{"version":3,"sources":["app.shared-out.js","src/app/shared/directives/brookson.form.inputs.ts","src/app/shared/app.shared.ts","src/app/shared/app.shared.state.ts","src/app/shared/app.shared.templates.ts","src/app/shared/directives/brookson.breakpoint.ts","src/app/shared/directives/brookson.form.input.datepicker.ts","src/app/shared/directives/brookson.form.inputs.dom.ts","src/app/shared/models/SubmitPersonSignificantControl.ts","src/app/shared/models/NavPersonalInformation.ts","src/app/shared/models/InvoicingAssignmentRate.ts","src/app/shared/models/EmployeeRate.ts","src/app/shared/models/NavBusinessInformation.ts","src/app/shared/models/NavContactInformation.ts","src/app/shared/models/AccountType.ts","src/app/shared/models/BankAccount.ts","src/app/shared/models/AAssignmentHeader.ts","src/app/shared/models/Review.ts","src/app/shared/models/Location.ts","src/app/shared/models/publicSectorAssignmentCheck/assignmentSelection.ts","src/app/shared/models/sdc/JobTitle.ts","src/app/shared/models/EnumObj.ts","src/app/shared/models/Assignment.ts","src/app/shared/models/Customer.ts","src/app/shared/models/Address.ts","src/app/shared/models/NamedAddress.ts","src/app/shared/enums/VatBusinessPostingGroup.ts","src/app/shared/enums/VatProdPostingGroup.ts","src/app/shared/models/InvoicingAssignment.ts","src/app/shared/models/NavCompanyInformation.ts","src/app/shared/models/Member.ts","src/app/shared/models/StatePensionAge.ts","src/app/shared/models/IR35AssessmentAnswers.ts","src/app/shared/services/brookson.services.member.ts","src/app/shared/models/NavNationality.ts","src/app/shared/services/brookson.services.account.ts","src/app/shared/directives/brookson.ui.backtop.ts","src/app/shared/directives/brookson.form.uiSelectRequired.ts","src/app/shared/directives/brookson.form.validation.ts","src/app/shared/directives/brookson.form.withinSameVatScheme.ts","src/app/shared/directives/brookson.format.number.ts","src/app/shared/directives/brookson.infinte.ts","src/app/shared/enums/SelfAssessmentSectionStatus.ts","src/app/shared/directives/brookson.ui.aside.ts","src/app/shared/directives/brookson.ui.images.ts","src/app/shared/directives/brookson.ui.os.ts","src/app/shared/directives/brookson.unsavedChanges.directive.ts","src/app/shared/enums/CommonValues.ts","src/app/shared/enums/DocumentDataSource.ts","src/app/shared/enums/ExpenseTypeRef.ts","src/app/shared/enums/ExpenseWarningCodeTypes.ts","src/app/shared/enums/FileView.ts","src/app/shared/enums/FuelType.ts","src/app/shared/enums/ImageSize.ts","src/app/shared/enums/IndustryList.ts","src/app/shared/enums/InvoiceCreationStatus.ts","src/app/shared/enums/SdcOutcomeType.ts","src/app/shared/enums/SelectedPackageEnum.ts","src/app/shared/enums/SubmitPersonSignificantControl.ts","src/app/shared/enums/TransactionTypes.ts","src/app/shared/enums/VatScheme.ts","src/app/shared/models/Transaction.ts","src/app/shared/modules/brookson.utilities.date.ts","src/app/shared/models/VatRateConfig.ts","src/app/shared/services/brookson.services.bank-link.ts","src/app/shared/models/ShareholderSplit.ts","src/app/shared/models/IncomeProfit.ts","src/app/shared/models/dividends/CompanyDividendSplit.ts","src/app/shared/models/dividends/CompanyDividendPayments.ts","src/app/shared/models/dividends/CompanyDividendPaymentSplit.ts","src/app/shared/models/dividends/TaxYear.ts","src/app/shared/models/dividends/TaxYearSelection.ts","src/app/shared/models/dividends/CompanyDividendPaymentGrouped.ts","src/app/shared/models/dividends/TaxYearMonthSummary.ts","src/app/shared/models/dividends/ProposedDividend.ts","src/app/shared/services/brookson.services.money-manager.ts","src/app/shared/modules/brookson.navigation.ts","src/app/shared/services/brookson.services.authentication.ts","src/app/shared/models/BusinessDetailSummary.ts","src/app/shared/services/brookson.services.service-line.ts","src/app/shared/models/SaveExpensesRequest.ts","src/app/shared/models/ExpenseHeader.ts","src/app/shared/models/SubmissionType.ts","src/app/shared/models/ExpenseType.ts","src/app/shared/models/ExpenseWarning.ts","src/app/shared/models/CoreExpenseItem.ts","src/app/shared/models/RegularExpense.ts","src/app/shared/models/AppliedRate.ts","src/app/shared/models/ExpenseMileageVehicle.ts","src/app/shared/models/MileageExpense.ts","src/app/shared/models/ExpenseDetails.ts","src/app/shared/models/ExpenseDataSource.ts","src/app/shared/models/ExpensesOverview.ts","src/app/shared/models/MileageExpenseRateLookup.ts","src/app/shared/models/ExpenseTotals.ts","src/app/shared/models/VatRate.ts","src/app/shared/modules/brookson.enums.ts","src/app/shared/services/brookson.services.receipts.ts","src/app/shared/services/brookson.services.expenses.ts","src/app/shared/models/ExpenseWarnings.ts","src/app/shared/services/brookson.services.expense-warnings.ts","src/app/shared/models/ExpenseWarningTypes.ts","src/app/shared/models/AppSettings.ts","src/app/shared/factories/brookson.factories.expenses.ts","src/app/shared/factories/brookson.factories.bankLink.ts","src/app/shared/models/MicroCalendlyBooking.ts","src/app/shared/services/brookson.services.calendly.ts","src/app/shared/factories/brookson.factories.calendly.ts","src/app/shared/factories/brookson.factories.feedback.ts","src/app/shared/models/ConnectIntro.ts","src/app/shared/services/brookson.services.intro.ts","src/app/shared/services/brookson.services.ir35modal.ts","src/app/shared/models/AssignmentRateCompact.ts","src/app/shared/models/AssignmentCompact.ts","src/app/shared/models/ClientRate.ts","src/app/shared/models/CustomerCompact.ts","src/app/shared/models/PaymentCode.ts","src/app/shared/models/PaymentFrequency.ts","src/app/shared/models/PayPersonBureau.ts","src/app/shared/models/TimesheetFrequencyDetails.ts","src/app/shared/services/brookson.services.assignment.ts","src/app/shared/factories/brookson.factories.intro.ts","src/app/shared/factories/brookson.factories.logger.ts","src/app/shared/factories/brookson.factories.privacy.ts","src/app/shared/models/sdc/SdcQuestionnaireAnswer.ts","src/app/shared/models/sdc/SdcQuestionnaireInput.ts","src/app/shared/models/sdc/AssignmentInfo.ts","src/app/shared/models/sdc/SdcQuestionnaireOutcome.ts","src/app/shared/models/sdc/SdcQuestionnaire.ts","src/app/shared/models/sdc/SdcQuestionnaireInputForm.ts","src/app/shared/models/sdc/AssignmentSdcOutcome.ts","src/app/shared/services/brookson.services.sdc.ts","src/app/shared/factories/brookson.factories.sdc.ts","src/app/shared/factories/brookson.factories.signalr.ts","src/app/shared/filters/brookson.filters.address.ts","src/app/shared/filters/brookson.filters.bank-account.ts","src/app/shared/filters/brookson.filters.bankAccountType.ts","src/app/shared/filters/brookson.filters.boolean.ts","src/app/shared/filters/brookson.filters.currency.ts","src/app/shared/filters/brookson.filters.date.ts","src/app/shared/filters/brookson.filters.displayLineBrakes.ts","src/app/shared/filters/brookson.filters.startFrom.ts","src/app/shared/filters/brookson.filters.units.ts","src/app/shared/models/ActionsToTakeSummary.ts","src/app/shared/models/agencyMarginCompact.ts","src/app/shared/models/Calendar.ts","src/app/shared/models/CompanyDetails.ts","src/app/shared/models/ConnectReceipt.ts","src/app/shared/models/CS01Confirmation.ts","src/app/shared/models/DaashboardWidget.ts","src/app/shared/models/DashboardUserWidget.ts","src/app/shared/models/DashboardUser.ts","src/app/shared/models/FixedTaxData.ts","src/app/shared/models/ForecastCalculations.ts","src/app/shared/models/Notification.ts","src/app/shared/models/GetNotificationsResponse.ts","src/app/shared/models/GLEntrySummary.ts","src/app/shared/models/HolidayRequest.ts","src/app/shared/models/IntroVideo.ts","src/app/shared/models/MemberCurrentStage.ts","src/app/shared/models/UserInputData.ts","src/app/shared/models/UmbrellaTaxData.ts","src/app/shared/models/PersonalTaxTrackerData.ts","src/app/shared/models/ProfitAndLossSummary.ts","src/app/shared/models/PscInformation.ts","src/app/shared/models/RemusRewardParameters.ts","src/app/shared/models/TaskAction.ts","src/app/shared/models/Task.ts","src/app/shared/models/UserFeedback.ts","src/app/shared/models/UtrNumber.ts","src/app/shared/models/WelcomeScreen.ts","src/app/shared/modules/brookson.document.preview.ts","src/app/shared/modules/brookson.file.download.ts","src/app/shared/modules/brookson.http.gritter.ts","src/app/shared/modules/brookson.http.interceptor.ts","src/app/shared/modules/brookson.modals.feedback.ts","src/app/shared/modules/brookson.modals.gl-entries.ts","src/app/shared/models/ir35DetailCapture/requiresCompletion.ts","src/app/shared/services/brookson.services.ir35DetailCapture.ts","src/app/shared/modules/brookson.modals.ir35DetailCapture.ts","src/app/shared/services/brookson.services.publicSectorAssignmentCheck.ts","src/app/shared/modules/brookson.modals.publicSectorAssignmentCheck.ts","src/app/shared/modules/brookson.modals.receipt-bank.ts","src/app/shared/modules/brookson.modals.receipt-preview.ts","src/app/shared/modules/brookson.modals.sdc.ts","src/app/shared/modules/brookson.modals.select.ts","src/app/shared/modules/brookson.modals.vehicle-details.ts","src/app/shared/services/brookson.services.notification.ts","src/app/shared/services/brookson.services.task-planner.ts","src/app/shared/modules/brookson.notifications.manager.ts","src/app/employmentStatus/models/AssignmentHeader.ts","src/app/shared/models/ir35DetailCapture/buttonPressed.ts","src/app/shared/modules/brookson.pdf.angular.ts","src/app/shared/modules/brookson.pdf.modal.ts","src/app/shared/modules/brookson.ui.image-preview.modal.ts","src/app/shared/modules/brookson.ui.popup.ts","src/app/shared/modules/brookson.ui.scroll-top.ts","src/app/shared/modules/brookson.utilities.compile.ts","src/app/shared/services/brookson.services.auth-interceptor.ts","src/app/shared/models/auto-allocation/AutoAllocationItem.ts","src/app/shared/services/brookson.services.auto-allocation.ts","src/app/shared/services/brookson.services.company-year-end.ts","src/app/shared/services/brookson.services.cs01-confirmation.ts","src/app/shared/services/brookson.services.dashboard.ts","src/app/shared/services/brookson.services.dialogue.ts","src/app/shared/models/document-storage/DocumentCompact.ts","src/app/shared/models/document-storage/FolderCompact.ts","src/app/shared/models/document-storage/DocumentStorageData.ts","src/app/shared/models/document-storage/DocumentStorageFolder.ts","src/app/shared/models/document-storage/FavouriteRequest.ts","src/app/shared/models/document-storage/GetFullSizedImageRequest.ts","src/app/shared/models/document-storage/SharedDrive.ts","src/app/shared/models/document-storage/SharedDrives.ts","src/app/shared/models/document-storage/SharedDriveFolder.ts","src/app/shared/services/brookson.services.document-storage.ts","src/app/shared/services/brookson.services.dropbox.ts","src/app/employmentStatus/models/ESAQuestionaireAnswer.ts","src/app/employmentStatus/models/ESAContractFile.ts","src/app/employmentStatus/models/IndustrySectors.ts","src/app/employmentStatus/models/ESAQuestionaire.ts","src/app/employmentStatus/models/ESAQuestionaireQuestions.ts","src/app/employmentStatus/models/ESAQuestionairreQuestions3.ts","src/app/employmentStatus/models/MemberAdvisedStatus.ts","src/app/shared/services/brookson.services.employment-status.ts","src/app/shared/services/brookson.services.financial-center.ts","src/app/shared/services/brookson.services.holidays.ts","src/app/shared/models/invoicing/InvoiceType.ts","src/app/shared/models/invoicing/TimesheetCompactUmbrella.ts","src/app/shared/models/invoicing/InvoiceCompactUmbrella.ts","src/app/shared/models/invoicing/PaymentUmbrella.ts","src/app/shared/models/invoicing/PayslipUmbrella.ts","src/app/shared/models/invoicing/invoicePreference.ts","src/app/shared/models/invoicing/FullInvoice.ts","src/app/shared/services/brookson.services.invoicing.ts","src/app/shared/services/brookson.services.logger.ts","src/app/shared/services/brookson.services.modals.umbrella-trust.ts","src/app/shared/models/open-bankiing-widget/WidgetAccount.ts","src/app/shared/services/brookson.services.openbanking-widget.ts","src/app/shared/models/advisory/UmbrellaTaxTracker.ts","src/app/shared/services/brookson.services.personal-tax-tracker.ts","src/app/shared/models/questionnaire/QuestionnaireFormitem.ts","src/app/shared/services/brookson.services.questionnaire.ts","src/app/shared/services/brookson.services.remus-rewards.ts","src/app/shared/services/brookson.services.sme-management.ts","src/app/shared/services/brookson.services.welcome-screen.ts","src/app/shared/services/brookson.shared.swap-user-service-line.ts","src/app/shared/components/bankLink/brookson.bankLink.allocation-confirmation.ts","src/app/shared/components/bankLink/brookson.bankLink.automatch.settings.ts","src/app/shared/components/bankLink/brookson.bankLink.bank-file-import.ts","src/app/shared/components/bankLink/brookson.bankLink.transactions.mobile.ts","src/app/shared/components/bankLink/brookson.bankLink.transactions.pagination.ts","src/app/shared/components/bankLink/brookson.bankLink.transactions.ts","src/app/shared/components/inputs/brookons.inputs.job-industry.ts","src/app/shared/components/inputs/brookson.input.select-assignment.ts","src/app/shared/components/inputs/brookson.inputs.expense-amount.ts","src/app/shared/components/inputs/brookson.inputs.expense-attach.ts","src/app/shared/components/inputs/brookson.inputs.job-title.ts","src/app/shared/components/payment/brookson.payment.create-payment.ts","src/app/shared/components/shared/brookson.shared.auth-code-comnponents.ts","src/app/shared/components/shared/brookson.shared.confirm-draft-accounts.ts","src/app/shared/components/shared/brookson.shared.confirm-self-assessment.ts","src/app/shared/components/shared/brookson.shared.confirm.financial-health-check.ts","src/app/shared/components/shared/brookson.shared.header.ts","src/app/shared/components/shared/brookson.shared.navigation.ts","src/app/shared/components/shared/brookson.shared.umbrellaflexform.ts","src/app/shared/components/shared/brookson.shared.utr-component.ts","src/app/shared/components/shared/brookson.shared.year-end-tile.ts","src/app/shared/components/ui/brookson.ui.accept-checkbox.ts","src/app/shared/components/ui/brookson.ui.accept-terms-and-conditions.ts","src/app/shared/components/ui/brookson.ui.account-details.contact-information.ts","src/app/shared/components/ui/brookson.ui.account-details.personal-details.ts","src/app/shared/components/ui/brookson.ui.attach-receipt.ts","src/app/shared/components/ui/brookson.ui.calendar-overlay.ts","src/app/shared/components/ui/brookson.ui.feedback.ts","src/app/shared/components/ui/brookson.ui.privacy.button.ts","src/app/shared/components/ui/brookson.ui.progress-bar.ts","src/app/shared/components/ui/brookson.ui.receipt-panel.ts","src/app/shared/components/ui/brookson.ui.valid-vat-receipt.ts","src/app/shared/components/widgets/brookson.widgets.actions.ts","src/app/shared/components/widgets/brookson.widgets.assignments.ts","src/app/shared/components/widgets/brookson.widgets.bank-link.ts","src/app/shared/components/widgets/brookson.widgets.document-storage.ts","src/app/shared/components/widgets/brookson.widgets.document-umbrella-storage.ts","src/app/shared/components/widgets/brookson.widgets.employment-record.ts","src/app/shared/components/widgets/brookson.widgets.expenses.ts","src/app/shared/components/widgets/brookson.widgets.invoicing.ts","src/app/shared/components/widgets/brookson.widgets.invoicing.umbrella.ts","src/app/shared/components/widgets/brookson.widgets.key-dates.ts","src/app/shared/components/widgets/brookson.widgets.money-manager.ts","src/app/shared/components/widgets/brookson.widgets.open-banking.ts","src/app/shared/components/widgets/brookson.widgets.receipt-bank.ts","src/app/shared/components/widgets/brookson.widgets.remus-rewards-button.ts","src/app/shared/components/widgets/brookson.widgets.remus-rewards.ts","src/app/shared/components/widgets/brookson.widgets.sme.actions-to-take.ts","src/app/shared/components/widgets/brookson.widgets.sme.employees-on-holiday.ts","src/app/shared/components/widgets/brookson.widgets.sme.last-payslip.ts","src/app/shared/components/widgets/brookson.widgets.sme.next-holiday.ts","src/app/shared/components/widgets/brookson.widgets.sme.profit-loss.ts","src/app/shared/components/widgets/brookson.widgets.task-planner.ts","src/app/shared/components/widgets/brookson.widgets.tax-tracker.ts","src/app/shared/components/widgets/brookson.widgets.umbrella-brookson-adverts.ts","src/app/shared/components/widgets/brookson.widgets.umbrella-brookson-financial-adverts.ts","src/app/shared/components/widgets/brookson.widgets.umbrella-whats-app.ts","src/app/shared/components/widgets/brookson.widgets.umbrella.faq.ts","src/app/shared/components/widgets/brookson.widgets.umbrella.payalerts.ts","src/app/shared/models/advisory/AccountsTable.ts","src/app/shared/models/advisory/AdviseTable.ts","src/app/shared/models/advisory/AdvisoryAdvice.ts","src/app/shared/models/advisory/AmountAvailableTable.ts","src/app/shared/models/advisory/BankTable.ts","src/app/shared/models/advisory/DividendsTable.ts","src/app/shared/models/advisory/ExpensesTable.ts","src/app/shared/models/advisory/ExpenseTableDetail.ts","src/app/shared/models/advisory/HRTThresholdTable.ts","src/app/shared/models/advisory/IntroductionSection.ts","src/app/shared/models/advisory/KeyInformation.ts","src/app/shared/models/advisory/PersonalTaxCalcTable.ts","src/app/shared/models/advisory/ProfitTable.ts","src/app/shared/models/advisory/PscPayeTable.ts","src/app/shared/models/advisory/SectionHeader.ts","src/app/shared/models/advisory/SectionMenuItem.ts","src/app/shared/models/advisory/UmbPayslipTable.ts","src/app/shared/models/advisory/UnconfirmedTable.ts","src/app/shared/models/assignments/Agency.ts","src/app/shared/models/assignments/SaveAssignmentRequest.ts","src/app/shared/models/assignments/SaveUmbrellaAssignmentRequest.ts","src/app/shared/models/invoicing/InvoiceLine.ts"],"names":["__extends","this","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","__spreadArray","to","from","pack","arguments","length","ar","i","l","slice","concat","_this","appSettings","window","angular","module","config","$httpProvider","$locationProvider","interceptors","push","html5Mode","enabled","requireBase","run","$rootScope","$state","Analytics","$templateCache","$on","evt","params","redirectTo","preventDefault","go","pageView","remove","put","value","baseApiUrl","location","protocol","hostname","port","authSettings","clientId","useRefreshToken","growlProvider","onlyUniqueMessages","globalReversedOrder","AnalyticsProvider","trackingCode","googleAnalyticsTrackingCode","setAccount","trackPages","trackUrlParams","setPageEvent","constant","factory","$injector","logger","exception","cause","environment","error","message","stack","$stateProvider","$urlRouterProvider","state","views","navigation","template","header","footer","templateUrl","main","url","","sticky","directive","ngIfDirective","screenSize","ngIf","transclude","priority","terminal","restrict","link","args","_i","show","is","brooksonBreakpoint","on","match","apply","appShared","$detection","require","scope","ngModel","ngReadonly","label","field","isRequired","placeholder","ngDisabled","minDate","maxDate","viewOnly","ngChange","maxCustomMessage","minCustomMessage","max","showDateHint","el","attrs","requires","form","format","useMobileInput","isiOS","isAndroid","isWindowsPhone","datepickerStatus","isOpen","openDatepicker","$event","dateUtils","element","ctrl","$observe","newValue","$modelValue","Date","$setViewValue","$validators","viewValue","$error","convertToJsDate","min","$formatters","unshift","modelValue","isValid","convertToViewString","$parsers","elem","attr","e","name","focusOn","focus","$timeout","$broadcast","Shared","SubmitPersonSignificantControl","NavPersonalInformation","jobTitle","title","firstName","middleName","surname","filingCode","homePhoneNo","mobilePhoneNo","workPhoneNo","eMail","smsAlertPreference","emailPayslipsPreference","preferredMethodOfContact","address","address2","city","county","postcode","password","confirmPassword","dob","niNumber","utrNumber","nationality","nationalityOption","doSubmitPSC","contactJoiningDate","contractFileName","tfaEnabled","tfaEnabledAmended","twoFactorDisabledExpiryDate","twoFactorOverrideDate","RatePeriods","InvoicingAssignmentRate","rateTypes","assignmentRateID","rate","description","currency","ratePeriod","rateType","paymentCode","startDate","endDate","chargableDays","chargableTotal","totalHoursWorked","Currencies","EmployeeRate","contractRateID","employeeID","rateDescription","staffID","staffIDM","createdDateTime","yearKey","isDayRate","NavBusinessInformation","companies","employeeRates","NavContactInformation","personalInformation","businessInformation","twoFactorAuthenticationEnabled","MoleAccountType","AccountType","BankAccount","bankAccountID","bankName","sortCode","accountNo","AssignmentHeader","agency","dateStarted","dateEnded","assignmentId","client","assignmentName","instructionText","overallStatusText","assignmentAddress","assignmentNotes","agencyReference","fullAssignmentName","Review","reviewId","contractReceived","resaReceived","legalReviewed","reviewCompleted","resaStatus","contractStatus","finalOutcome","resaDocument","attendanceNoteDocument","contractDocument","assignmentID","assignment","Location","expectedEndDate","lastDayOnSite","siteName","address1","address3","postCode","PublicSectorAssignmentCheckButtonPressed","JobTitle","EnumObj","id","_super","Assignment","memberId","hasIR35Questionnaire","iR35QuestionnaireComplete","company","memberAdvisedStatusOld","reviews","preferredEmailAddresses","locations","isAssignment24MonthRuleReclaimable","sdcStatus","publicSector","jobTitleOption","industry","iR35CapturedFromDate","iR35CapturedEffectiveDate","showExpensesPopup","Sectors","Customer","customerNumber","customerName","customerAddress","customerAddressObj","contactName","contactNumber","billingAddress","billingAddressObj","assignments","umbTimesheetDisabled","Address","addressLine1","addressLine2","addressLine3","town","country","NamedAddress","VatBusinessPostingGroup","VatProdPostingGroup","InvoicingAssignment","rates","customer","currencyCode","isSelfBilling","narrative","poNumber","deemed","remittanceAddress","companyNo","vatNo","isRaisedInError","vatRegStatus","defaultHours","invoiceDistributionEnabled","NavCompanyInformation","companyType","companyName","companyRegistrationNo","companyReference","directorsName","vatRegistrationNo","bankAccounts","corporationTaxRefNo","Member","memberID","altMemberID","firstname","lastname","email","groups","username","personalTaxActive","companyRef","userType","accountType","useSTStyleInvoicing","isActive","dateOfBirth","createdDate","businessType","role","connect2Enabled","StatePensionAge","IR35AssessmentAnswers","MemberModel","userName","token","refreshToken","isAdmin","isAuthenticated","hasUmbBusinessType","hasLtdBusinessType","hasMulipleLtdCompanies","umbCustomerReference","ltdCustomerReference","expires","refreshTokenExpires","navReferral","apiKeySource","MemberService","getHasAdvisoryKeyInformation","silentMode","cached","$http","get","cache","then","response","data","getHasAdvisoryKeyInformationUmbrella","showMemberMTD","insertAuthorsationCode","authorisationCode","post","$inject","localStorageService","analytics","isMiniConnectUser","member","serviceLines","line","_","filter","o","customerReference","isSecondShareholder","isEligible","setMember","assign","getMemberBusinessType","set","getMember","store","updateMember","clearMember","getMemberDetails","getPensionAge","service","NAVNationality","code","AccountService","memberSrv","getAccountDetailsForUser","find","each","bankAccount","toLowerCase","updateAccountDetailsForUser","getNationalities","getCommonPasswords","shared","brooksonInlineController","ngMinlength","ngMaxlength","ngPattern","ngPatternMessage","formCtrl","controller","$scope","inputType","commonPasswords","ngModelController","accountSrv","$watch","strength","toString","vm","hasTyped","indexOf","trim","$setValidity","strengthMessage","strengthClass","isWeakPassword","isCommonPassword","test","optionsData","optionsExpression","ngRepeat","defaultOption","additionalData","noDefault","showSpinner","viewOnlyProperty","ngModelIsAnObject","oldValue","isObject","typeaheadValue","showZero","isNaN","bind","blur","ngMin","step","wholeNumber","round","$apply","changeInternal","$filter","currencyEnums","isEditMode","defaultValue","isSelfAssessment","$onInit","ngChecked","buttons","multiselect","additionalStyling","changed","isArray","includes","item","isSelected","button","textboxStyle","hideRemainingCharacters","blockTypingBeyondLimit","isUndefined","regEx","isLimitedCompany","valueWatch","RegExp","uiMask","uiMaskplaceholder","transformedValue","$render","maxlength","addontext","validate","titleText","$eval","brooksonUiSelectRequired","inputEl","querySelector","inputNgElement","inputName","$invalid","$touched","addClass","removeClass","vatScheme_1","brooksonWithinSameVatScheme","every","brooksonAllExpenses","markedAsDelete","effectiveVatScheme","typeOf","parseFloat","brooksonInfiniteScroll","$window","handler","windowBottom","scrollBusy","height","scrollTop","offset","top","onScroll","unbind","SelfAssessmentSectionStatus","brooksonUiAside","$q","$templateRequest","$compile","$document","bindToController","brooksonAsideController","controllerAs","getSummary","options","when","isFunction","body","eq","menu","asideClass","comp","colorOverride","append","summaryForms","selfAssessmentFactory","selfAssessment","sectionStatusEnum","showAside","hideAside","brooksonScrollTop","replace","icon","speed","theme","yTrigger","text","parseInt","smoothScroll","addEventListener","scrollY","pageYOffset","$element","$attrs","$set","ngHide","ngShow","app","UnsavedWarningSharedService","$location","brooksonPopup","ignoreEvent","allFormsArray","messages","navigate","reload","removeFunctions","noop","routeEvent","allForms","allFormsClean","cleanFormCount","forEach","idx","$dirty","init","setup","removeForm","splice","tearDown","fn","onbeforeunload","confirmExit","eventsToWatchFor","aEvent","removeFn","event","next","current","showYesNoPopup","result","completeEvent","catch","er","path","unsavedWarningSharedService","formElement","$valid","$setPristine","CommonValues","pensionAge","DocumentDataSource","ExpenseTypeRef","ExpenseWarningCodeTypes","FileView","FuelType","ImageSize","IndustryList","getArray","aerospaceAndDefence","automotiveAndMotorsport","buildingConstructionInfrastructure","businessServices","energySectorOfficeBased","energySectorOffshoreSiteBased","financialService","informationTechnology","lifeSciences","marineAndShipbuilding","mediaAndCreative","medicalAndHealthcare","railAndTransportation","telecommunications","utilities","other","InvoiceCreationStatus","SdcOutcomeType","SdcOutcomeTypeParser","getDescription","NoChange","NotAssessed","Fail","AwaitingEndClient","FailedEndClient","Pass","SelectedPackageEnum","SubmitPersonalSignificantControl","TransactionTypes","VatScheme","none","flatRate","nonFlatRate","BankLink","Transaction","balance","bankId","bankKey","creditAmount","customerLedgerCategory","customerLedgerDescription","customerLedgerInvoice","debitAmount","isMobile","personalDiv1Amount","personalDiv2Amount","personalExpensesAmount","personalLoanAmount","personalSalaryAmount","receiptID","receiptable","serviceResponse","transactionCategory","transactionDate","transactionId","transactionReceiptStatus","transactionStatus","transactionType","unallocatedTransactionSource","flow","flowOptions","receiptThumbnail","category","relatedCategories","isVatReclaimable","hasValidVatReceipt","gross","vat","net","passes24MonthRule","accept24MonthRuleRisk","undefined","BrooksonUtilitiesDate","taxYearMonth","taxYearDay","getPreviousDayOfWeek","dayOfWeek","currentNumberOfWeeks","moment","weeks","previousWeekNumber","day","convertToMoment","date","isMoment","ISO_8601","stripOutTimezone","noTimezone","parseZone","convertToUtcMoment","utc","toDate","convertToViewMonthString","convertToServerString","convertDateToMidnightGmt","getFullYear","getMonth","getDate","dateDiff","date1","date2","diff","isSame","isBefore","isBeforeOrSame","isAfter","isAfterOrSame","taxYearStart","now","startDateString","year","add","taxYearEnd","currentTaxYear","previousTaxYear","previousTaxYearStart","previousTaxYearEnd","nextTaxYearStart","nextTaxYearEnd","nextTaxYear","ageFromDate","isMinDate","taxYearStartByOffset","taxYearEndByOffset","taxYearByOffset","isOverNMonthsAgo","numberOfMonths","nMonthsAgo","subtract","VatRateConfig","BankLinkSrv","getBankAccounts","getCategories","addYodleeAccount","editYodleeAccount","refreshYodleeAccount","isBankEnabled","isBankActionRequired","isCsvUploadRequired","cancelBankStatementBatch","clearBankStatementBatch","submitBankStatementBatch","reconciliationDate","updateBankStatementDate","getLastFiveBankTransaction","bankAccountKey","updateTransactions","transactions","getAllVatRatesConfig","map","expenseCode","vatRate","effectiveDate","ShareholderSplit","IncomeProfit","parameters","CompanyDividendSplit","CompanyDividendPayments","CompanyDividendPaymentSplit","TaxYear","TaxYearSelection","CompanyDividendPaymentGrouped","TaxYearMonthSummary","ProposedDividend","moneyManagerSrv","sharedConfig","moneyManagerSrvFactory","serviceBase","selectedWeeklyAccountSummary","startOfWeek","startOf","getTransactions","getMoneyManagerStatements","yearStart","yearEnd","requestData","getMoneyManagerStatementsByOffset","getMoneyAvailableStatement","getYearEndNotification","getPersonalTaxCalculations","mmShareholder","taxYear","request","shareholder","getMoneyManagerFinancialData","getWeeklyAccountSummary","getTransactionStatements","myMoneyAvailable","weeklyAccountSummary","tmp","weeklyAccountSummaryLogic","deferred","defer","getAccountScheduleLastUpdateDate","lastUpdateDateData","lastUpdateDate","weeklyAccountSummaryData","reverse","businessTotal","j","personalTotal","businessTransactions","amount","personalTransactions","resolve","reject","promise","moneyAvailablePanelLogic","getNewBusinessStatus","isNewSetup","aftStatementChildRows","rowCode","yearToDateValue","childMoneyManagerStatementRows","unpaidInvoices","moneyManagerFinancialData","lessUnpaidInvoices","totalMoneyAvailable","myMoneyAvailableAdjusted","getMoneyManagerData","getShareholderSplit","getIncomeProfitData","getCtUpdateData","updateCtTime","newTime","JSON","stringify","getCompanyDividendSplit","getCompanyDividendPayments","saveProposedCompanyDividendPayments","selectedTaxYear","monthlyTransactions","taxMonth","getProposedDividendPayments","brooksonNavigation","account","href","bankLink","dashboard","documentStorage","recentlyAdded","favourites","brooksonSharedDrive","sharedDriveId","folder","folderId","paySlipFolder","employmentStatus","returnUrl","returnText","ir35Assignment","expenses","business","expenseDetails","addExpense","addMileage","addReceipt","addAllowance","editExpense","editMileage","editReceipt","editAllowance","expenseReport","expensesReceiptBank","home","logout","summary","addAssignment","editAssignment","invoicing","raiseInvoice","createInvoice","newInvoice","knowledgeBase","login","superuser","serviceline","registration","passwordReset","forgottenPassword","moneyManager","profitLoss","balanceSheet","history","week","personalFinance","riskProfile","retirementPlanner","financialServices","personalTax","planner","tracker","hrmcersonalAccountBalance","selfAssessmentTAndCs","taskPlanner","calendar","calendarSelectedAction","actionID","camelCase","selectedAction","selectedActionTask","taskID","openBankingRedirect","holidays","sme","employeeZone","payslips","financialCenter","advisory","selectServiceLine","workFlex","umbrella","personalServiceCompany","AuthenticationService","$httpParamSerializer","_authentication","isAuth","useRefreshTokens","validateLoginRequest","err","console","log","twoFactorAuthRequest","contactAddressNumber","twoFactorAuthValidation","otp","getMemberMaskedContactDetails","getMemberContactDetails","saveTwoFactorAuthSetting","enableTfa","memberTwoFactorAuthStatus","loginData","grant_type","client_id","sessionId","headers","Content-Type","refresh_token","access_token","Number","is_admin","clientRefreshTokenExpires","updateAccessTokenServiceLine","serviceLine","member_id","company_ref","alt_member_id","altMemberId","business_type","service_line","set_service_line","activateMember","registrationId","requestPasswordReset","requestForgottenClientId","resetMemberPassword","verifyShareholderLogin","BusinessDetailSummary","getEffectiveVatSchemeOn","flatRateVatEffectiveDate","standardRateVatEffectiveDate","vatScheme","ServiceLineService","getBusinessDetailSummary","businessDetailSummary","getServiceLines","success","status","error_description","SaveExpenseRequest","ExpenseHeader","SubmissionType","ExpenseType","expenseTypeId","expenseTypeDescription","expenseSubmissionType","submissionTypeEnum","expenseReceiptAttachable","defaultExpenseRate","quantityLabel","isWholeNumber","offsite","isPublicSector","expenseGroup","sdcCheckApplicable","showWarning","warningHtml","ConfirmedExpenseWarning","ExpenseTabWarning","tabName","presentedWarnings","ExpenseTabWarnings","warningCount","tabWarnings","ExpenseWarning","showWarningHighRisk","showWarningAmount","showWarningMonthRule","warning","warningMessage","confirmed","dateConfirmed","warningMessageTwentyFour","confirmedTwentyFour","dateConfirmedTwentyFour","CoreExpenseItem","expenseWarning","RegularExpense","AppliedRate","ExpenseMileageVehicle","vehicleMake","vehicleModel","fuelType","engineCC","MileageExpense","ExpenseDetails","ExpenseDataSource","ExpensePlottingData","ExpensesOverview","MileageExpenseRateLookup","ExpenseTotals","VatRate","ContactEnums","Default","ContactInformation","CustomerServicesPhone","CustomerServicesEmail","InvoicingEnums","HOUR","DAY","WEEK","properties","0","adjective","1","2","OVERRIDE","SUCCESSFUL","EXCEPTION","InvoiceStatus","NONE","NEW","MODIFIED","DELETED","PUBLIC","PRIVATE","NOLONGERINUSE","NEITHER","3","TimesheetFrequency","WEEKLY","FORTNIGHTLY","MONTHLY","Ir35Captured","NOTASSESSED","OUTSIDEIR35","INSIDEIR35","CurrencyEnums","CurrencyCodes","GBP","EUR","USD","YEN","AUD","CAD","NOK","ZAR","SEK","CHF","AED","QAR","SGD","10","20","30","60","70","80","90","100","110","120","130","140","150","ExpensesEnums","PersonalOrCompany","PERSONAL","COMPANY","ExpenseTypeCategory","MILEAGE","HighRisk","Amount","TwentyFourMonthRule","ExpenseSubmissionType","UNKNOWN","RECEIPTATTACHED","RECEIPTPRINTED","MIRACLEMANUAL","4","ReceiptStatus","UNATTACHED","UNSUBMITTED","SUBMITTED","FuelTypes","PETROL","DIESEL","LPG","EngineSize","PETROL1_1400","PETROL1401_2000","PETROL2001_9999","LPG1_1400","LPG1401_2000","LPG2001_9999","DIESEL1_1600","DIESEL1601_2000","DIESEL2001_9999","40","50","ImageEnums","ORIGINAL","CUSTOM","ASPECTRATIO","DocumentStorageEnums","DETAILED","THUMBNAIL","SharedDriveLinkStatus","ERROR","DocumentCategory","FOLDER","RECENTLYADDED","FAVOURITES","SHAREDDRIVE","MEMBERWEBDOCUMENTS","QUEUESERVICE","MOLEDATA","DROPBOX","DialogueEnums","Dialogues","MILEAGE24MONTHRULE","EXPENSESNOTICE","PersonalTaxEnums","Timeframes","FORECAST","YEARTODATE","TaskPlannerEnums","TaskStatus","COMPLETED","CURRENT","FUTURE","OVERDUE","values","css","TaskResponsibility","ME","BROOKSON","LoggingEnums","LoggingLevel","DEBUG","INFO","WARN","FATAL","BankLinkEnums","BankAccountType","DEPOSIT","CREDIT_CARD","DEPOSIT_BOND","TransactionType","BUSINESS","UNALLOCATED","ALL","OUTGOINGS","TransactionStatuses","SAVED","PROCESSED","INTOUCHPROCESSED","BankLogos","BARCLAYS","CASHPLUS","HSBC","LLOYDS","RBS","SANTANDER","HALIFAX","BankIcons","BARC","NotificationEnums","NotificationSymbol","money","process","guide","video","document","book","information","NotificationColourLabel","red","blue","green","yellow","grey","HolidaysEnums","HolidayRequestStatus","PENDING","APPROVED","REJECTED","MemberEnums","ServiceLineRole","DIRECTOR","SHAREHOLDER","EMPLOYEE","NONPRINCIPALDIR","ServiceLineBusinessType","LTD","UMBRELLA","SME","IR35Enums","IR35Status","IR35Status_TaxedAsPAYE","IR35Status_TaxedAsSelfEmployed","IR35Status_Caution","IR35Status_ActionRequired","IR35Status_WithdrawnReview","IR35Status_AssessmentFormSubmit","IR35Status_AssessmentFormStarted","5","6","ReceiptsService","getReceipts","getReceiptImageData","size","width","deleteReceipts","receipts","cropReceipt","receiptId","imageData","ExpensesService","getMileageRates","getExpenses","pageSize","pageNo","getExpenseGuidancePaymentCodes","getPersonalMileageAndTotalExpenses","saveExpenses","hideGrowl","deleteExpense","expenseSubmissionId","delete","submitExpense","source","acceptMissingReceiptsExpenses","getExpenseDetails","dataSource","getExpenseOverView","getExpenseTypes","getExpenseWarnings","getExpenseWarningTypes","getPublicSectorExpenseTypes","getExpenseVehicles","getExpenseVehiclesLookup","saveExpenseVehicle","vehicle","getTotalMileageForCurrentTaxYear","getTotalMileageForPreviousTaxYear","removeWarningConfirmationsByExpenseId","ExpenseWarnings","expenseWarningId","codeValue","codeText","warningMessageText","timeLength","valueLimit","highRisk","twentyFourMthRuleApplicable","twentyFourMthTriggerOverride","ExpenseWarningsService","saveExpenseWarnings","expenseHeaderId","expenseWarnings","confirmedWarnings","getConfirmedExpenseWarnings","memberid","deleteExpenseWarningLogById","expenseWarningLogId","ExpenseWarningTypes","expenseWarningTypeId","expenseWarningCodeTypeId","expenseWarningText","AppSettings","ExpensesFactory","expensesSrv","receiptSrv","flowFactory","expensesEnums","expensesWarningsService","$uibModal","editMode","selectedAssignment","expenseLineCounter","expenseHeader","expenseTypes","expenseGuidancePaymentCodes","expenseWarningTypes","publicSectorExpenseTypes","mileageVehicles","mileageVehiclesLookup","regularExpenses","mileageExpenses","allowanceExpenses","totalMileageForCurrentTaxYear","totalMileageForPreviousTaxYear","restrictMileage","restrictMileageMaxDate","refreshRequired","isAutoSaving","expensesWaitingForIds","showMileageVatableExpenses","lastRegularExpenseVal","copyMode","copyModeValidateMileage","copyModeValidateRegular","copyModeValidateAllowance","getExpenseWarningText","n","getExpenseWarning","expense","receiptAttached","listener","deactivateAutoSave","receipt","resetReceiptStatus","expenseType","typeObject","deleteReceiptFromExpenseLine","isNil","prepareMileageExpense","expenseItem","isDeleted","workSite","type","vehicleObject","vehicleRegistration","expenseMileageVehicle","prepareAllowanceExpense","prepareRegularExpense","quantity","total","getAllVatRates","isDeemedAssignment","public","isNull","grossPaymentReceived","checkExpenseConfirmationLength","monthRule","warningType_1","getExpenseWarningType","confirmedExpenseWarning","expensesWarningsConfirmed","getLatestConfirmedExpense","datediff","diffMonths","dt1","dt2","showGuidance","sectionId","open","animation","windowClass","iframeUrl","showExpenseWarningModal","enableExpenseEnhancementModal","backdrop","keyboard","expenseGuidanceExists","buildPresentedExpenseWarnings","regularWarnings","expensesTab","expenseTabWarningCount","expensesTabWarningSummary","allowanceWarnings","obtainPresentedTabWarnings","allowanceTab","allowanceTabWarningCount","countExpenseTabWarnings","mileageWarnings","mileageTab","mileageTabWarningCount","tabExpenseWarningCount","tabWarning","confirmExpenseWarning","expenseLine","copy","confirmExpenseWarningTwentyFour","autoSaveExpenses","oldVal","newVal","hasChanges","completeExpenses","changedExpenses","equals","val","isSameRegularExpense","isCompleteRegularExpense","EXPENSE","prepareSaveExpense","ALLOWANCE","e1","e2","expenseTypeChanged","index","expenseList","presentedAlert","ex","monthDifference","previousConfirmedExpense","setExpenseWarningMessage","expenseLineVal","previousConfirmedExpenseTwentyFourMonth","twentyFourExpenseWarningType","updateWarningsAssignmentChange","removeConfirmationsBySelectedAssignment","clearConfirmedExpenseWarnings","addNewExpenseLineData","newId","generateGUID","tempID","mapRatesToMileageExpenseTypes","mileageExpenseTypes","eType","defered","mapExpenseDetails","postSaveExpenses","c","r","Math","random","mVehicles","refresh","statusOriginalValue","expenseID","getReceiptImageThumbnailData","oldReceipt","createReceiptFlowFactory","target","permanentErrors","__RequestVerificationToken","brookson","antiForgeryToken","Accept","testChunks","simultaneousUploads","chunkSize","mileageExpensesTotal","miles","regularExpensesTotal","allowanceExpensesTotal","receiptsTotal","mainSiteDateTime","endDateTime","mileageExpenseItems","expenseItems","allowanceItems","removeDeletedExpenses","removeExpensesThatHaveBeenAssignedTempIds","assignExpenseItemIds","savedExpenses","requestedExpenses","relatedExpense","re","newExpenses","expenseItemId","saveConfirmedExpenseWarning","addExpenseWarningMessage","expenseWarningType","removeExpenseWarnings","exp","removeConfirmedExpense","expenseConfirmation","populateConfirmedExpenseWarnings","deleteIndividualConfirmedExpenseLine","warningCodeValue","warnings","cWarning","expenseCodeValue","expenseId","warningCodeType","twentyFourMonthRuleApplied","sort","first","second","expenseWarningCodeTypes","expenseConfirmedMonth","expenseConfirmedHighRisk","expenseConfirmedAmount","tabExpenses","BankLinkFactory","bankLinkSrv","authenticationSrv","bankLinkEnums","fileDownloadSrv","brooksonModalReceiptBank","growl","serviceLineSrv","bankAccountsFlatList","categories","vatRatesConfig","transactionTypes","addYodleeFasklinkUrl","editYodleeFasklinkUrl","refreshYodleeFasklinkUrl","bankEnabled","csvUploadRequired","bankActionRequired","transactionsList","businessOnly","modifiedTransactions","paginationArray","currentPage","itemsPerPage","informationDetail","mandate","yodlee","noLink","relatedCategores","orderBy","reverseSort","refreshedYodleeAccounts","confirmedTransactions","warningTransactions","confirmedTransactionsTotal","acceptRisk","bankAccountsMandateLink","addBankLogoAndIconToBankAccount","bankAccountsYodleeLink","bankAccountsNoDataLink","displayString","accountNumber","bankAccountId","selectedBankAccount","addBankNameToTransactions","transaction","setRelatedTransationCategories","toUpperCase","logo","relatedBankAccount","transactionTypeLabel","creditOrDebitCategories","nonSoleTraderCategories","startsWith","creditCardApplicable","categoriesWithNoCcDiv","categoriesGroupedByDescription","groupBy","categoryGrouping","getTransactionTypes","selectedTransactionType","addBalanceToTransactions","transactionsOrderedByDate","groupedTransactionsByBankAccount","transactionGroup","key","endBalance","moneyManagerData","setOtherTransactionCategoryDescription","setTransactionsReceiptImageThumbnail","filterTransactions","selectedTransactionTypeChanged","selectedBankAccountChanged","filteredList","transacation","createPaginationArray","addModifiedTransaction","t","isVatable","check24MonthRuleApplicable","is24MonthRuleApplicable","getAllocationConfirmationModal","headerForm","saveTransactions","modifiedTransactionsCount","successfullyUpdatedTransactions","unsuccessfullyUpdatedTransactions","updateSuccessfulllyAllocatedTransaction","ttl","disableCountDown","transactionAllocationResult","relatedResult","downloadFile","downloadAndSave","selectBankAccountFromAsideMenu","localReceipt","receiptAttachedToAllocated","updateAllocatedTransaction","receiptDeleted","flowFileAdded","file","jpg","png","pdf","jpeg","gif","getExtension","fileTypeValidationError","fileSizeValidationError","files","flowFileSuccess","fromJson","imageDataEncoded","flowFilesSubmitted","opts","Authorization","upload","pages","ceil","filterTransactionType","isViewingPersonal","colSpanCount","isViewingAll","trans","MicroCalendlyBooking","EventType","CalendlyService","getCalendlyIntroductionBooking","getCalendlyAdvisoryBooking","getCalendlyFinancialHealthCheckBooking","BrooksonFactoriesCalendly","BrooksonUiFeedbackFactory","uaParser","userFeedback","UserFeedback","modalElementSelector","modalBackdropElementSelector","sendFeedbackElementSelector","isDrawing","onMouseDown","centerX","pageX","centerY","pageY","ctx","beginPath","redraw","onMouseMove","clearRect","addAlphaBackground","onMouseUp","highlight","fillStyle","strokeRect","fillRect","hideSendFeedback","showSendFeedback","openModal","modalSettings","isFeedbackMode","BrooksonModalFeedbackController","$uibModalInstance","closeModal","rendered","a","styleModal","modal","$","modalBackdrop","scrollHeight","documentElement","offsetHeight","clientHeight","hideModal","showModal","close","destroyCanvas","getUserFeedbackCategories","userFeedbackCategories","postUserFeedback","dismiss","getUserAgentInfo","browser","getBrowser","device","getDevice","cpu","getCPU","engine","getEngine","os","getOS","browserVersion","version","cpuArchitecture","architecture","deviceType","deviceModel","model","deviceVendor","vendor","engineName","engineVersion","osVersion","getState","stateParams","getUrl","absUrl","takeScreenshot","onrendered","canvas","isScreenshotMode","style","borderRadius","screenshotBase64","toDataURL","html2canvas","resetScreenshot","removeDocumentEvents","CANVAS_ID","FEEDBACK_HIGHLIGHT_CLASS","setupDocumentEvents","off","Error","createCanvas","canvasElement","getElementById","getContext","highlights","left","ConnectIntro","BrooksonServicesIntro","getConnectIntros","setFirstTimeLoginSeen","IR35ModalService","getListOfJobTitles","getListOfSectors","insertIR35Assessment","answers","showIR35AssessmentModal","AssignmentRateCompact","rateID","period","canBeDeleted","canBeEdited","AssignmentCompact","assignmentAddressObj","uniqueIdentifierNumber","sectorSelector","ir35AssignmentSelector","ClientRate","clientRateID","clientID","clientRateType","isDefault","CustomerCompact","customerEmail","contactEmail","selfBillingMethod","customerAddressAddressLine1","customerAddressAddressLine2","customerAddressAddressLine3","customerAddressTown","customerAddressCounty","customerAddressPostcode","customerAddressCountry","billingAddressAddressLine1","billingAddressAddressLine2","billingAddressAddressLine3","billingAddressTown","billingAddressCounty","billingAddressPostcode","billingAddressCountry","clientAddressId","billingAddressId","isDirectEngagement","PaymentCode","lineType","timeUnits","guidance","receiptRequired","isBanded","isPublic","isMileage","isOffSite","PaymentFrequency","PaymentFrequencyParser","weekly","fortnightly","monthly","getEnum","PayPersonBureau","TimesheetFrequencyDetails","payPersonBureauDescription","timesheetFrequencies","timesheetFrequencyDescription","timesheetFrequencyOptions","AssignmentSrv","invoicingEnums","publicOrPrivateAssignment","ir35CapturedAssignment","timesheetFrequency","getAssignment","assignmentRef","publicSectorFromDate","getAssignments","umbrellaExpenses","getAssignmentsForFullInvoice","getPaymentCodes","paymentCodes","getPaymentCodeValue","paymentCodeObj","paymentCodeIndex","getTimesheetFrequencyDetails","getAllAssignments","getAssignmentsForInvoiceCrediting","invoiceId","closeAssignment","reopenAssignment","BrooksonFactoriesIntro","assignmentSrv","ir35ModalService","getIntrosFromLocalStorage","connectIntros","setIntrosIntroLocalStorage","firstTimeLogin","startIntro","getLocalStorageKey","INTRO_LOCAL_STORAGE_KEY","$log","loggerSrv","loggingEnums","info","warn","BrooksonFactoryPrivacy","hotkeys","privacyModeEnabled","hotKeyToEnablePrivacyMode","togglePrivacy","toggleBlur","setPrivacyMode","blurArea","setupHotkeys","formatHotKey","combo","callback","isPrivacyModeEnabled","SdcQuestionnaireAnswer","SdcQuestionnaireInput","AssignmentInfo","SdcQuestionnaireOutcome","SdcQuestionnaire","SdcQuestionnaireInputForm","AssignmentSdcOutcome","SdcService","getLatestQuestionnaire","getOutcome","input","searchJobTitle","getAssignmentOutcomes","declineExpensesForAssignment","patch","SdcFactory","sdcService","sdcQuestionnaireInput","sdcQuestionnaireInputForm","sdcQuestionnaire","sdcOutcome","extraInfo","createSdcQuestionnaireInputForm","createSdcQuestionnaireInput","query","setRates","hasOutcomeSet","outcome","hasFailedOutcome","sdcWillIncurExpenses","getAnswerValue","SDC_QKEY_WILLINCUREXPENSES","sdcIntendMultipleAssignments","SDC_QKEY_INTENDMULTIPLEASSIGNMENTS","sdcDoesClientSupervise","SDC_QKEY_DOESCLIENTSUPERVISE","sdcDoesClientInstruct","SDC_QKEY_DOESCLIENTINSTRUCT","sdcCannotOverruleImplementation","SDC_QKEY_CANNOTOVERRULEIMPLEMENTATION","sdcCannotOverrulePlan","SDC_QKEY_CANNOTOVERRULEPLAN","sdcInPermanentTeam","SDC_QKEY_PERMANENTTEAMSAMEROLE","answer","questionKey","setAnswerValue","questionnaireAnswer","SDC_QKEY_RATEVALUEDAILY","findRateValue","PAYMENT_CODE_STANDARD_DAILY","PAYMENT_CODE_STANDARD_HOURLY","agencyNumber","assignmentIndustry","clientAddress","workSiteAddress","siteAddress","clientName","expectedLengthOfAssignmentMonths","dateStartedAtWorkSite","SDC_QKEY_RATEVALUEHOURLY","SDC_QKEY_ASSIGNMENTCURRENCY","brooksonSignalrFactory","rootScope","connect","openBankingSubscriptions","openBankingReconsentSubscriptions","fullInvoicePdfSubscriptions","ensureConnected","instance","openBankingHub","openBankingReconsentHub","fullInvoiceHub","connection","hub","start","connected","signalR","connectionState","disconnected","done","openBanking","subscribeToPage","server","unSubscribeFromPage","openBankingReconsent","fullInvoicegHub","fullInvoicePdfNotifications","notification","Action","FilterAddress","FilterBankAccount","substr","FilterBankAccountType","FilterBoolean","FilterCurrency","useValue","fractionSize","FilterBkShortDate","brooksonUtilitiesDate","convertToDate","m","FilterBkRelativeDate","DisplayLineBrakes","FilterStartFrom","FilterBytes","bytes","precision","displayUnit","isFinite","number","floor","pow","toFixed","ActionsToTakeSummary","expensesToAuthorize","holidaysToAuthorize","overtimeToAuthorize","Models","AgencyMarginCompact","Calendar","CompanyDetails","ConnectReceipt","CS01ConfirmationDetails","amendmentdetails","DashboardWidget","DashboardUserWidget","DashboardUser","FixedTaxData","taxFreeDividendAllowance","lowerRateDividendTaxRate","higherRateDividendTaxRate","additionalRateDividendTaxRate","personalAllowance","basicRateThreshold","higherRateThreshold","fullPersonalAllowanceUpperLimit","lowerRateIncomeTax","basicRateIncomeTax","higherRateTax","additionalRateTax","employmentIncomeStudentRepayThreshold","nonEmploymentIncomeStudentRepayThreshold","repaymentPercentage","childBenefitTaxChargeThreshold","percentageIncrements","ForecastCalculations","monthsYearToDate","monthsRemaining","weeksYearToDate","weeksRemaining","weeksYearToDateFromTaxStart","weeksRemainingFromTaxStart","pscEmployment","currentDirectorsFeeWeekly","shareholderSplit","confirmedAsDividends","unconfirmedTransactions","transactionsBeingProcessed","taxDeductedFromPSCIncome","isMonthlyBureau","Notification","companyContactNo","metaDescription","symbol","colour","showGuide","action","sortOrder","onClick","documentCategoryMappingId","GetNotificationsResponse","smartTileNotifications","alertNotifications","actionTileNotifications","bannersNotifications","GLEntrySummary","entryNo","glAccountNo","balAccountNo","description2","postingDate","documentDate","periodStart","periodEnd","HolidayRequest","IntroVideo","MemberCurrentStage","stage","step3","step4","completionDate","countOfAssignmentRequiringActions","isIr35Confirmed","isDraftsConfirmed","showConfirmationMessage","UserInputData","personalTaxTrackerDataId","otherEmploymentIncome","otherEmploymentIncomeYTD","pensionIncome","pensionIncomeYTD","interestIncome","interestIncomeYTD","taxableBenefitsInKind","taxableBenefitsInKindYTD","otherDividendIncome","otherDividendIncomeYTD","personalPensionPayments","personalPensionPaymentsYTD","childBenefitAmountReceived","childBenefitAmountReceivedYTD","studentLoanBalanceAtBeginningOfTaxYear","studentLoanBalanceAtBeginningOfTaxYearYTD","taxAlreadyPaid","paymentOnAccountPaidJanuary","paymentOnAccountPaidJuly","dividends","UmbrellaTaxData","grossSalaryFromUmbrella","taxDeductedUmbrellaEarnings","grossSalaryFromUmbrellaYTD","taxDeductedUmbrellaEarningsYTD","PersonalTaxTrackerData","fixedTaxData","forecastCalculations","userInputData","umbrellaTaxTracker","hasUmbrella","ProfitAndLossSummary","PscInformation","navPersonalInformation","RemusRewardParameters","TaskAction","actionId","action_Web_Task_no","actionTitle","actionDescription","extendedActionDescription","responsibility","dueDate","deadline","actionOrder","attachment","isInWarning","button1Text","button2Text","categoryId","categoryDesc","documents","closeable","closeMessage","taskCode","taskTitle","TaskObject","startsAt","endsAt","timestamp","events","highlightMonth","Task","completedDate","taskActions","userFeedbackId","userFeedbackCategoryId","screenshot","UtrNumber","utrReceived","WelcomeScreen","brooksonDocumentPreview","enums","documentStorageSrv","brooksonUiImagePreviewModal","FileSaver","brooksonPdfModal","previewDoc","getFullSizedImage","showImagePreviewModal","getSelectedPDF","documentId","blobObject","Blob","saveAs","lastOpened","download","fileName","expectedMediaType","openSaveAsDialog","filename","content","blob","responseType","extractMessages","parse","Severity","Title","Text","responseError","hide","numRequests","NProgress","showing","previousResponseErrors","previousError","method","submitButtonPressed","takeScreenshotButtonPressed","isBB10","$sce","payload","reportType","glEntriesOptions","cancel","reduce","sum","IR35DetailCaptureRequiresCompletion","IR35DetailCaptureService","getIR35DetailCaptureOutcome","ir35DetailCaptureRequiresCompletion","postIR35DetailCapture","sector","BrooksonIR35DetailCaptureModalService","BrooksonIR35DetailCaptureModalController","ir35DetailCaptureService","memberService","canBeCancelled","buttonPressed","validApiSource","isInternal","PublicSectorAssignmentCheckService","getPublicSectorAssignmentCheckOutcome","publicSectorAssignmentCheckRequiresCompletion","postPublicSectorAssignmentCheck","BrooksonPublicSectorAssignmentCheckModalService","BrooksonPublicSectorAssignmentCheckModalController","publicSectorAssignmentCheckService","submitAssignments","attachReceipt","attachReceiptModal","selectedReceipt","receiptSelected","receiptPreview","BrooksonSdcModalService","BrooksonSdcModalController","assignmentEndedRequestInProgress","noClaimOnAssignmentRequestInProgress","claimOnAssignmentButtonPressed","claimOnAssignment","noClaimOnAssignmentButtonPressed","noClaimOnAssignment","closeAssignmentButtonPressed","disableAssignmentEndedButton","some","disableAssignmentNoClainButton","handleGetAssignmentOutcomesResponse","assignmentOutcomes","x","$close","inProgress","removeAssignmentFromList","BrooksonModalSelect","showSelect","items","BrooksonModalSelectController","selectItems","ok","selected","ModalSelectItem","selectVehicle","vehicles","addVehicleModal","selectedVehicles","vehicleSelected","selectedVehicle","notificationSrv","getNotifications","closeNotification","TaskPlannerSrv","$stateParams","$cacheFactory","sectionTitle","selectedTask","buildMonthsArray","months","selectedMonth","viewDate","currentMonth","month","flattenActions","chain","task","taskAction","taskGroup","flatten","updateUTR","branchId","BranchId","buildMonths","closeTask","getAndParseTasks","updateCurrentTaskAndAction","updateAuthCode","authCode","AuthCode","tasks","cacheMode","getTasks","flatActions","getTasksComplete","parseTasks","sectionTitles","overdue","personal","taskDate","annualMonths","overrideCacheMode","getActionsByDay","getActionById","addMonth","subtractMonth","getTaskActions","getTasksToBeDisplayed","getFolderByID","folderID","get3MonthsRelatedDocs","getFolderByIDComplete","threeMonthsAgo","docs","future","docData","getYearEndStage","getYearEndMemberConfirmationStatus","exportCalendar","generateCalendarKey","getTaskCalendarSync","showTaskCompletionInput","webTaskNo","actionDetails","confirmAccountsStep","getYearEndStatus","updatePackStatus","getTaxPackStatus","getUtrNumber","previewDocument","view","previewCallback","actionWebTaskNo","getIsPayBeforeSubmit","saPersonalTax","paye","payroll","utr","NotificationsShown","Notifications","notifications","tiles","banners","BrooksonNotificationManager","LOCAL_STORAGE_KEY","TASK_PLANNER_NOTIFICATION_KEY","UNALLOCATED_TRANSACTIONS_KEY","UNALLOCATED_TRANSACTIONS_CLEAR_KEY","taskPlannerSrv","taskPlannerEnums","calendlyService","notificationsShown","taskPlannerNotifications","unallocatedTransactions","all","getTaskPlannerNotifications","getSmartNotifications","getUnallocatedTransactions","smartNotifications","unallocatedTransactionNotification","financialHealthCheckCalendlyBooking","minimumPreviousDate","setDate","f","overDueTaskActions","upcomingTaskActions","getNotificationKey","variables","goToTask","goToTaskPlanner","setNotificationKey","transactionsToAllocate","closeSmartTile","smartTile","pull","closeAlerts","alert","clearNotificationsShown","EmploymentStatus","PDFJS","setCanvasDimensions","w","h","ratio","devicePixelRatio","webkitBackingStorePixelRatio","mozBackingStorePixelRatio","msBackingStorePixelRatio","oBackingStorePixelRatio","backingStorePixelRatio","setTransform","renderTask","pdfLoaderTask","pdfId","pdfid","pdfpath","pdfUrl","pdfDoc","pageNum","page","scale","canvasid","windowEl","renderPDF","getDocument","onProgress","_pdfDoc","onLoad","renderPage","pageToDisplay","pageCount","numPages","onError","scroll","disableWorker","num","_internalRenderTask","getPage","viewport","pageHeightScale","renderContext","getViewport","pageWidthScale","clientWidth","canvasContext","render","onPageRender","goPrevious","goNext","zoomIn","zoomOut","changePage","rotate","getAttribute","setAttribute","destroy","documentID","documentPath","downloadPDF","confirmationOptions","$sanitize","showConfirmationPopup","acceptText","closeText","trustAsHtml","acceptButtonText","closeButtonText","userClickedCancelledButton","showTemplatedConfirmationPopup","messageTemplateUrl","popupSize","infoOptions","yesNoOptions","showInfoPopup","showTemplatedInfoPopup","showTemplatedHelpPopup","showErrorPopup","errorRef","errorOptions","showAcceptPopup","acceptOptions","showSaveAs","brooksonUiScrollTop","_currentYPosition","self","currentYPosition","setSpeed","startY","distance","scrollTo","leapY","timer","setTimeout","compile","html","removeAttr","authInterceptorSrv","authInterceptorServiceFactory","refreshingRequest","requestQueue","authData","rejection","retryCount","MatchingTransactions","count","AutoAllocation","AutoAllocationItem","AutoAllocationService","duplicateKeyword","newSetting","uniqueKeywordCheck","validationMessage","keyword","companyConfig","resetTransactionMatches","autoSetting","transactionMatches","searchTransactions","unescape","matchedTransactions","decorateKeyword","memberModel","getAutoAllocationSettings","saveNewAutoAllocationSetting","updateAutoAllocationSetting","internalNavUser","RequestedFromAllowedApiSource","getSettingsList","includeDisabled","list","populateNavCategories","autoAllocationSettings","navCategory","categoryList","categoryCode","createNewAllocationSetting","newAutoSetting","createdBy","matchedTransaction","escape","BrooksonServicesCompanyYearEnd","getCompanyYearEndTileDetails","setDraftAccountsConfirmed","reason","CS01ConfirmationService","GetNextIfOpen","GetCompanyDetails","SaveResponse","DashboardService","popup","selectModal","showMasonryItems","customiseOn","userDashboards","addWidget","widget","dashCopy","currentDashboard","widgets","removeWidget","widgetName","componentName","reloadMasonry","msnry","reloadItems","layout","getDashboardsForMember","sortBy","insertDashboardForMember","getDashboardWidgets","allWidgets","showGritterMessage","saveExisting","currentDash","replaceDashboard","saveAsNew","dashboardUserId","isBrookson","dashboardUserWidgetsId","showDelete","v","select","deleteDashboards","dashboards","makeDefault","promises","dash","resetCurrentDashboard","newDash","documentType","defineProperty","_currentDashboard","enumerable","configurable","differenceBy","getDateIsNull","dialogueSrv","dialogueSrvFactory","localStorageData","localStorageDashboardData","setData","getData","setDashboardData","getDashboardData","hasExpensesNoticeBeenDisplayed","expensesNotice","setExpensesNoticeDisplayed","hasFinancialReviewBannerHidden","hidemortgagereviewbanner","setFinancialReviewBannerHidden","setFinancialReviewBannerClosed","setRecommendAFriendTileClosed","recommendAFriendTile","hasRecommendAFriendTileHidden","setRecommendAFriendTileHidden","DocumentCompact","FolderCompact","DocumentStorageData","DocumentStorageFolder","FavouriteRequest","GetFullSizedImageRequest","SharedDrive","SharedDrives","SharedDriveFolder","DocumentStorageService","folders","recentDocuments","sharedDrives","dropboxSharedDrive","sharedDrivePath","sharedDriveFolder","orderByField","getFolder","subFolderID","getSharedDriveFolder","getNestedFolder","getPreviousFolder","folderPath","slicedFolderPath","splitFolderPath","split","join","isSharedDriveAttached","getFolderName","currentCategory","getFavourites","isFavourite","merge","getSharedDriveFavourites","fav","removeFavourite","setSharedDriveFavouriteValue","unfavouriteDocument","setFavourite","favouriteDocument","getSelected","findSelected","getSharedDriveSelected","selectedDocs","selectedDoc","downloadEmploymentFile","getThumbnail","getSelectedDocumentZip","getSharedDrives","getFolders","getDocumentStorageWidgetData","setupWatched","fileView","DropboxService","disconnect","createDropboxFileFactory","dropboxUploadPath","flowComplete","$flow","EsaQuestionaireAnswer","sectionNumber","ESAContractFile","esaContractFileId","esaQuestionaireId","contractFile","contractFileSize","IndustrySector","group","EsaQuestionaire","dateCreated","empStatusHelpConfirm","answersTrueConfirm","contactTime","saved","siteLocation","industrySector","dateSubmitted","esaQuestionaireAnswers","contractFileExists","esaContractFile","deleteContract","EsaQuestionaireQuestions","questionNumberID","questionNumber","question","EsaQuestionaireQuestions3","supplementalQuestion","MemberAdvisedStatus","memberAdvisedStatusId","ir35Status","GetQuestionnaireRequest","EmploymentStatusSrv","getQuestions","questions","getQuestionnaire","saveQuestionnaire","qnnaire","getQuestionByQuestionNumber","getQuestionByQuestionNumberAndGroup","FinalOutcome_Captured","FinalOutcome_NotCaptured","FinalOutcome_Inconclusive","FinalOutcome_UnderReview","removeContractData","esaQuestionnaireId","saveIR35Status","memberStatus","getIR35Status","CheckIR35AssessmentAllowed","FinancialCenterService","getProfitAndLossSummary","HolidaysSrv","submitHolidayRequest","employeeName","approveHolidayRequest","requestId","rejectHolidayRequest","holidayRequestId","getCompanyHolidays","getCompanyHolidayRequests","getUserHolidayRequests","getBankHolidays","region","getRemainingHolidayAllowance","getEmployeeHolidayAllowance","deleteHolidayRequest","employeeId","getStartOfHolidayYear","getNextHoliday","getCompanyActiveHolidayRequests","InvoiceType","Invoicing","TimesheetCompactUmbrella","InvoiceUmbrellaCompact","PaymentUmbrellaCompact","PayslipUmbrellaCompact","InvoicePreference","FullInvoiceLine","FullInvoiceAttachment","FullInvoice","BrooksonInvoicingService","getInvoicesByType","invoiceType","ledgerStatus","invoice","createInvoiceOverride","getInvoice","getInvoicingOverview","getTimesheetUmbreallaOverview","getInvoicingUmbrellaOverview","saveInvoice","updateDefaultHoursPerDay","getSavedInvoice","getSavedInvoiceForCrediting","deleteSavedInvoice","deleteSavedFullInvoice","calculateTotals","appliedRates","amountGross","amountNet","hidePublicSectorModal","creditInvoice","replacementInvoice","InvoiceId","ReplacementInvoice","saveInvoicePreferences","invoicePreferences","getCompanyInvoicePreferences","saveFullInvoice","fullinvoice","getFullInvoiceById","fullinvoiceId","getAttachmentsById","removeAttachmentById","fullInvoiceId","attachmentId","azureFilename","azureFileName","getInvoicePdfSharedAccessSignatureUrl","invoiceNumber","downloadInvoicePdf","getCurrentVatrate","vatBusPostingGroup","vatProdPostingGroup","determineVatStatusByPeriodEndDate","periodEndDate","umbrellaCheck","CompanyRef","regenerateFullInvoicePdf","level","loggingLevel","toJson","BrooksonUmbrellaTrustModalService","BrooksonUmbrellaTrustModalController","ConsentStatus","openbankingWidget","WidgetAccount","bankType","OpenbankingWidgetService","getOpenBankingWidgetData","getGetBankStatementData","disableWidgetButtons","disable","UmbrellaTaxTracker","PersonalTaxTrackerService","personalTaxEnums","isEditingDividends","debounceLength","detailedViewToggles","incomeSummary","liabilityDue","selectedTaxYearChanged","clearData","taxYearOffset","availableTaxYears","getPersonalTaxTrackerDataByOffset","umbrellaTaxData","roundedDecimal","resetEditingDividends","personalTaxData","payYear","sumGrossPay","sumPaye","grossPensionContribution","basicRateThresholdPension","basicRateThresholdDividends","higherRateThresholdPension","higherRateThresholdDividends","higherRateAllowanceDividends","higherRateDividendThreshold","forecastTotal","unconfirmedTransactionsWithShareholderSplit","transactionsBeingProcessedWithShareholderSplit","forecastPSCEmployment","feesRemainingForYear","forecastPSCDividendIncome","yearToDatePSCEmployment","yearToDatePSCDividendIncome","currentDirectorsFeeMonthly","incomeCalculations","pscEmploymentIncome","yearToDate","forecast","nonDividendIncome","pscDividendIncome","dividendIncome","grossTaxableIncome","taxCalculationWorkings","annualPersonalAllowance","fullPaUpperLimit","grossIncomeAboveUpperLimit","reductionInPA","paAfterSalaryAndDividendIncome","salaryWithinPA","salaryAtBR","salaryAtHR","k57","k63Sum","f20","v1","f19","f15","l51","salaryAtAR","salaryAtBRTax","salaryAtHRTax","salaryAtARTax","totalGrossSalary","incomeTaxDueOnSalary","dividendsWithinPA","k52","l52","l87","l57","dividendsWithinTFDA","f6","dividendsAtBR","v2","dividendsAtHR","f19k68","dividendsAtAR","totalDividends","dividendsAtBRTax","dividendsAtHRTax","dividendsAtARTax","additionalTaxDueOnDividends","totalTaxDueAtSelfAssessment","studentLoanRepayments","earnedIncome","nonEarnedIncome","employmentIncomeStudentRepay","nonEmploymentIncomeStudentRepay","studentPaymentAmount","k100K101","f29","f31","k49","l100","l101","l49","childBenefitTaxCharge","relativePercentageCharge","taxPayments","totalIncomeTaxPayable","studentLoanPaymentDue","totalPayableOnSelfAssessment","paymentOnAccount","totalTaxPayments","taxBandCapacity","dividendAllowance","basicRate7","incomeSummaryWidgetData","directorsFees","selectedTimeframe","totalIncome","taxTrackerWidgetData","basicRate","income","tax","higherRate","additionalRate","totalNonDividendIncome","taxableDividends","totalDividendIncome","incomeLeftInEachTaxBand","incomeAvailableBeforeHigherRateTax","taxLiabilityDueWidgetData","totalTaxPayable","taxBillForThisYear","taxDeductedFromDirectorsFees","paymentsOnAccountPaidforJan","paymentOnAccountPaidForJuly","paymentsMadeAgainstTaxBill","balancingPaymentDueJan","unpaidTaxForTaxYear","paymentOnAccountDueJan","paymentOnAccountDueJuly","totalPaymentDueJanThisYear","forecastCalculationsWidgetData","totalPSCDividendIncome","breakdownWidgetData","getPersonalTaxTrackerData","getConfirmedAsDividendsTransactions","getUnconfirmedTransactions","postUserInputData","getTaxYear","currentDate","QuestionnaireSubmission","AuditTrail","QuestionnaireMonthlySalaryPayments","questionnaire","QuestionaireFormItem","QuestionnaireService","getQuestionnaireForm","getDirectorFeesQuestionnaireForm","getMortgageQuestionnaireForm","getDirectorFeesMonthlySalaryPayments","saveQuestionnaireForm","saveQuestionnaireUpdateForm","hasCustomerSubmittedForm","showDirectorFeeFormBanner","hasCustomerSubmittedDirectorFeesForm","hasCustomerSubmittedMortgageForm","recordAuditTrail","auditTrail","RemusRewardSrv","selectedUmbrellaPackage","setPackageNavUmbrellaProtect","umbrellaPlusService","setSelectedPackageNav","selectedPackage","SelectedPackageRequestData","umbrellaProtect","getRemusRewardsUrlParameters","isUserUmbrellaPlus","setSelectedPackage","getAgencyMargin","getSelectedPackage","SmeManagementSrv","getActionsToTakeSummary","WelcomeScreenSrv","getWelcomeScreenMessageHtml","getWelcomeScreen","getWelcomeScreenEnabled","GetAccountantVideoId","getWelcomeVideos","setWelcomeScreenSeen","setHideWelcomeScreen","SwapUserServiceLineService","changeSelectedServiceLine","selectedCompanyRef","changeSelectedServiceLineLocation","AllocationConfirmationController","splitTransactionsAndTotalUp","runningTotal","BrooksonBankLinkAutoAllocationSettings","BrooksonBankLinkAutoAllocationSettingsController","autoAllocationService","bankLinkService","getAllowedCategories","businessSummary","loadAutoAllocationSettings","loading","showDisabledMatches","allowAddNewSetting","companyConfigList","showDisabled","autoAllocationFrm","addNew","saveNewAutoSetting","reclaimVat","cancelNewAutoSetting","pop","disableSaveButton","keywordChanged","originalValue","setting","hasChanged","finishedKeyword","settingChanged","cancelUpdate","updateAutoSetting","updatedBy","invokeBackButton","back","component","BrooksonBankFileImport","BrooksonBankFileImportController","fileDeletetedClicked","flowFileError","$file","$message","debug","uploadStatus","selectBankAccount","removeFile","selectedPendingStatement","hasPendingBankStatement","openNextStep","stepIndex","steps","openBackStep","fileUploaded","uploadMessage","progress","flowProgress","fileContent","toggleAll","bankStatementRows","selectAll","toggleRow","numberOfSelectedRows","totalAmountOfSelectedRows","newBalanceAmount","updatedTransactionDate","totalAmount","availableBalance","hasSelectedTransactions","totalCount","submittedRowCount","submittedTotalAmount","selectedTransactions","getTime","submittedDateRange","toLocaleDateString","cancelBatch","batchId","clearBatch","origin","openbankingWidgetService","navBankTransactions","todaysDate","bankAccountList","setupAccounts","currentFileId","uuid","submissionSuccess","BankAccountId","BankAccountKey","showTransactionDate","showTransactionDateFrm","hideTransactionDate","consentStatus","AccessTokenReceived","consentExpired","viewAccess","className","viewAccessDescription","submitTransactions","isSubmitError","submitMessage","submitTransactionDate","dateTransactionSuccess","singleFile","BrooksonBankLinkTransactionsMobile","BrooksonBankLinkTransactionsMobileController","bindings","orderByFilter","vatRateConfig","vatChanged","viewAutoAllocationSettings","viewBankFileUpload","clearVat","maxVat","maxVatMessage","getVatAmount","getApplicableVatRate","setMaxVat","vat20precent","grossChanged","hasValidVatReceiptChanged","applicableRateConfig","rateConfig","applicableRate","vatRates","blankAssignment","orderAssignmentsByDateStarted","BrooksonBankLinkTransactionsPagination","BrooksonBankLinkTransactionsPaginationController","BrooksonBankLinkTransactions","BrooksonBankLinkTransactionsController","BrooksonInputJobIndustry","BrooksonInputJobIndustryController","sdcFactory","industryList","BrooksonExpensesInputSelectAssignment","classes","BrooksonInputExpenseAmount","BrooksonInputExpenseAmountController","expensesFactory","checkForExpenseWarning","expenseDate","applicableRateAmount","BrooksonInputExpenseAttach","parentController","BrooksonInputExpenseAttachController","BrooksonInputJobTitle","BrooksonInputJobTitleController","listOfJobTitles","BrooksonPaymentCreatePayment","BrooksonPaymentCreatePaymentController","BrooksonAuthCodeInputController","authCodePattern","BrooksonConfirmAcccountsController","yearEndStatus","goToIR35","downloadDocuments","brooksonFileDownload","yearEndStage","confirmStep","BrooksonConfirmAccounts","BrooksonConfirmSelfAssessmentController","taxPackStatus","approved","payBeforeApproval","utrNumberUpdated","disableWorldPay","confirmTax","showUtrSection","taxPackFiled","showAwaitingUtrNumber","showInvalidUtrNumber","gotoSelfAssessment","gotoComfirmAndPay","BrooksonConfirmSelfAssessment","BrooksonConfirmFinancialHealthCheckController","openBookingScreen","showCalendarScreen","calendlySrv","welcomeSrv","financialCalendarUrl","welcomeScreenData","calendars","eventType","calendarUrl","financialHealthCheckUrl","trustAsResourceUrl","BrooksonConfirmFinancialHealthCheck","HeaderController","brooksonNotificationsManager","notificationEnums","sdcModalService","ir35DetailCaptureModalService","umbrellaTrustModalService","memberEnums","publicSectorAssignmentCheckModalService","calendlyFactory","swapServiceLineSrv","memberDetails","checkUmbrellaTrustOutcome","checkSdcModal","checkIR35DetailCapture","checkPublicSectorAssignmentCheck","checkWelcomeScreen","shouldDisplaySdcModal","displaySdcQuestionnaireCompletionPopup","pathname","ir35DetailCaptureModalEnabled","displayIR35DetailCapturePopup","displayIR35DetailCaptureModal","getWelcomeScreenDetails","welcomeScreen","showCalenderLink","hasWelcomeScreen","accountantName","accountantFirstName","accountantIntroductionCalendarUrl","accountantIntroductionUrl","microCalendlyBooking","advisoryDocCalendarUrl","advisoryDocUrl","advisoryDocumentCalendlyBooking","displayIntroductionCalenderScreen","showCalenderScreen","displaySourceUrl","displayFinancialHealthCheckScreen","displayAdvisoryDocScreen","hideCalenderScreen","handleRequiresCompletionResponse","requiresCompletion","isMemberCompanyRefUM1004U","isUmbrellaTrustModalConfigEnabled","displayUmbrellaTrustModal","getUmbrellaTrustModalOutcome","displayUmbrellaTrustOutcome","publicSectorAssignmentCheckModalEnabled","displayPublicSectorAssignmentCheckPopup","displayPublicSectorAssignmentCheckModal","handlePublicSectorAssignmentCheckCompletionResponse","goToAccountDetails","containsOverdueTasks","showConnect2Button","BrooksonSharedNavigation","BrooksonSharedNavigationController","dashboardService","privacyFactory","introFactory","umbrellaAssignmentSdcStatusChangeListener","pscOpen","pfOpen","ptOpen","managerZoneOpen","employeeZoneOpen","checkNavigationDropdowns","getMemberBusinessTypes","showHamburger","changeUserServiceLine","showDashboardButtons","setCustomiseOn","getCustomiseOn","deleteEnabled","checkNavigationDropdown","togglePSC","togglePF","togglePT","toggleManagerZone","toggleEmployeeZone","dropdown","dropdownLinks","angularLink","ignorePathsAttribute","attributes","ignorePaths","pathShouldBeIgnored","hideBreadcrumb","explicit","isActivePsc","memberBusinessType","memberSdcStatus","pscExpensesEnabledGlobally","SDCStatus","pscExpensesEnabled","hasAdvisorySection","hasAdvisorySectionUmb","BrooksonUmbrellaFlexFormController","BrooksonUmbrellaFlexForm","actionTile","BrooksonUtrInputController","utrPattern","branchPattern","BrooksonYearEndTileController","setAsConfirming","isConfirming","confirmationError","setAccountsConfirmed","yearEndTileDetails","currentYearEnd","draftAccountsConfirmed","BrooksonYearEndTile","AcceptCheckbox","AcceptCheckboxController","AcceptTermsAndConditions","headingText","AcceptTermsAndConditionsController","BrooksonUiAccountDetailsContactInformation","BrooksonUiAccountDetailsContactInformationController","BrooksonUiAccountDetailsPersonalInformation","BrooksonUiAccountDetailsPersonalInformationController","showNationalitySpinner","nationalities","findNationality","showTfa","enable2FAForAllMembers","tfaTemporaryDisabled","tfaPermanentlyDisabled","tfaNotYetEnabled","tfaEnabledChanged","brooksonUiAttachReceipt","brooksonModalReceiptPreview","brooksonUiPopup","$ctrl","openAttachReceiptModal","showAttachReceiptModal","previewReceipt","deleteReceipt","showReceiptBank","dropupClass","isReadonly","CalendarOverlayController","hideCalendarScreen","BrooksonCalendarOverlay","BrooksonUiFeedback","BrooksonUiFeedbackController","cancelScreenshotPressed","takeScreenshotPressed","BrooksonUiPrivacyButton","BrooksonUiPrivacyButtonController","brooksonUiReceiptPanel","checkable","hideCheckbox","checkboxSelected","receiptClick","BrooksonExpensesInputValidVatReceipt","showLabel","BrooksonExpensesInputValidVatReceiptController","BrooksonWidgetActions","onComplete","WidgetActionsCtrl","_dashboardService","bankLinkFactory","panelDisplayed","gotoTask","take","BrooksonWidgetsAssignment","BrooksonWidgetsAssignmentController","currentAssignmentPressed","goToAssignments","goToAssignmentDetails","goToAddAssignment","dateIsAfterToday","BrooksonWidgetsBankLink","BrooksonWidgetsBankLinkController","isBankLinkActionRequired","showNewSetupText","lastReconciledDate","xAxisPoints_1","groupedTransactionByBankAccount","accounts_1","chartData_1","countBy","transactionsGroupedByPeriod","periodGrouping","g","last","chart","c3","generate","bindto","point","columns","padding","right","axis","tick","fit","multiline","y","brooksonWidgetDocumentStorageRecentDocuments","brooksonWidgetDocumentStorageUmbrellaRecentDocuments","openContract","BrooksonWidgetEmploymentRecord","WidgetEmploymentRecordCtrl","brooksonWidgetExpensesOverview","xAxis","mileageValues","mileage","receiptedValues","receipted","allowances","types","Allowances","Receipted","Mileage","colors","names","position","tooltip","d3","transition","duration","chartData","keys","allowancesValues","load","noData","brooksonWidgetInvoicingOverview","invoicingSrv","latestInvoices","latestPayments","brooksonWidgetInvoicingUmbrella","latestTimesheets","latestPayslips","BrooksonWidgetsKeyDates","BrooksonWidgetsKeyDatesController","keyDatesWidgetPressed","tasksActions","brooksonWidgetMoneyManagerMoneyAvailable","showUnpaidInvoicesModal","getLastReconciledDate","BrooksonWidgetsOpenBanking","BrooksonWidgetsOpenBankingController","disableButtons","trueLayerPopupWindowEventChange","WidgetTokenExchangeResponse","hasCsvUpload","csvUploadEnabled","openTrueLayerBankPopup","authLink","dualScreenTop","newWindow","dualScreenLeft","screenLeft","screenTop","innerWidth","screen","innerHeight","setInterval","closed","clearInterval","openExendingConnection","bankaccount","Boolean","DisableButtons","State","OpenBankingStatus","pendingStatus","consentDateDue","ReConsentDate","consentReminder","hasAccessToken","AccessTokenError","AccessTokenPending","NotConsented","switchToOpenBanking","authorisedProvider","ConsentError","reconsentOpenBanking","maskedBankAccountNumber","showReconsentMessage","showTechIssueMessage","showAccessTokenErrorMessage","showNotConsentMessage","showAccessTokenPendingMessage","showReconsentDueMessage","downloadMandateForm","BrooksonWidgetsReceiptBank","BrooksonWidgetsReceiptBankController","goToReceiptBankPressed","numberOfReceipts","brooksonWidgetRemusRewardsButton","remusRewardSrv","cidValue","dataValue","isUmbrellaPlus","submitRemusRewardForm","submit","brooksonWidgetRemusRewards","BrooksonWidgetSmeActionsToTake","BrooksonWidgetsSmeActionsToTakeController","smeManagementSrv","actionsToTakeSummary","hasActionsToTake","BrooksonWidgetSmeEmployeesOnHoliday","BrooksonWidgetSmeEmployeesOnHolidayController","getActiveHolidayRequests","holidaySrv","holidayRequests","BrooksonWidgetsSmeLastPayslip","BrooksonWidgetsSmeLastPayslipController","BrooksonWidgetSmeNextHoliday","BrooksonWidgetsSmeNextHolidayController","goToHolidays","holidaysSrv","nextHoliday","stringData","days","hours","remainingHolidayAllowance","BrooksonWidgetsSmeProfitAndLoss","BrooksonWidgetsSmeProfitAndLossController","endOfCurrentPeriod","startOfCurrentPeriod","startOfPreviousPeriods","endOfPreviousPeriods","getPreviousMonthSummary","endOfPeriod","financialCenterSrv","getCurrentMonthSummary","previousMonth","BrooksonWidgetTaskPlanner","WidgetTaskPlannerCtrl","BrooksonWidgetsPersonalTaxTracker","BrooksonWidgetsPersonalTaxTrackerController","personalTaxSrv","brooksonWidgetUmbrellaBrooksonAdverts","_brooksonUiPopup","isUmbrellaPlusSelected","agencyMargin","selectUmbrellaProtect","brooksonWidgetUmbrellaFinancialAdverts","brooksonWidgetUmbrellaWhatsApp","brooksonWidgetUmbrellaFaq","brooksonWidgetUmbrellaPayalerts","AccountsTable","AdviceTable","AdvisoryAdvice","AmountAvailableTable","BankTable","DividendsTable","ExpensesTable","ExpenseTableDetail","HRTThresholdTable","IntroductionSection","KeyInformation","PersonalTaxCalcTable","ProfitTable","PscPayeTable","SectionHeader","SectionMenuItem","UmbPayslipTable","UnconfirmedTable","Agency","crmAgencyId","SaveAssignment","fromAssignmentCompact","uniqueId","ir35Capture","ir35AssignmentStatus","ir35AssessmentCaptured","timesheetFrequencySelector","SaveAssignmentRequest","SaveUmbrellaAssignmentRequest","InvoiceLine","IR35DetailCaptureButtonPressed"],"mappings":"AAAA,IAAIA,UAAaC,MAAQA,KAAKD,YAAc,KACxC,IAAIE,EAAgB,SAAUC,EAAGC,GAI7B,OAHAF,EAAgBG,OAAOC,iBAClB,CAAEC,UAAW,EAAA,YAAgBC,MAAS,SAAUL,EAAGC,GAAKD,EAAEI,UAAYH,CAAA,EACvE,SAAUD,EAAGC,GAAK,IAAK,IAAIK,KAAKL,EAAOC,OAAOK,UAAUC,eAAeC,KAAKR,EAAGK,CAAA,IAAIN,EAAEM,GAAKL,EAAEK,GAAA,IAC3EN,EAAGC,CAAA,C,EAE5B,OAAO,SAAUD,EAAGC,GAChB,GAAiB,YAAb,OAAOA,GAA0B,OAANA,EAC3B,MAAM,IAAIS,UAAU,uBAAyBC,OAAOV,CAAA,EAAK,+BAAA,EAE7D,SAASW,IAAOd,KAAKe,YAAcb,CAAA,CADnCD,EAAcC,EAAGC,CAAA,EAEjBD,EAAEO,UAAkB,OAANN,EAAaC,OAAOY,OAAOb,CAAA,GAAMW,EAAGL,UAAYN,EAAEM,UAAW,IAAIK,E,MAGnFG,cAAiBjB,MAAQA,KAAKiB,eAAkB,S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Ete,EAAK+Q,SAAW8F,EAAK9F,SACrB/Q,EAAKs7G,YAAczkG,EAAKykG,YACxBt7G,EAAKu7G,qBAAuB1kG,EAAK2kG,uBACjCx7G,EAAKy7G,2BAAyD,IAA5B5kG,EAAKo6C,mBAA2B,KAAOp6C,EAAKo6C,oBAEvEjxD,C,EA3CFiJ,EAAAyyG,sBAAb,aAOazyG,EAAAkyG,eAAcA,C,GARxBlyG,OAAAA,QAAM,EAAA,GCDNA,IACH,IAAAgH,EAAA,SAAA0rG,IrU8joBQ,OAAkB,OAAX1rG,GAAmBA,EAAO5K,MAAMjH,KAAMqB,SAAA,GAAcrB,I,CqU9joBnE6R,EAAmDhH,EAAAyyG,sBAAAv9G,UAAAw9G,EAAA1rG,CAAA,EAAtChH,EAAA0yG,8BAEbA,C,GAHG1yG,OAAAA,QAAM,EAAA,GCFNA,KACWA,EAAAs/E,YAAAt/E,EAAAs/E,UAAS,KACNqzB,YAAb,Y,GAFD3yG,OAAAA,QAAM,EAAA,GvIANA,KACS4yG,EAAA5yG,EAAA4yG,iCAAA5yG,EAAA4yG,+BAA8B,KACtCA,EAAA,OAAA,GAAA,SACAA,EAAAA,EAAA,QAAA,GAAA,UACAA,EAAAA,EAAA,KAAA,GAAA,M,GAJD5yG,OAAAA,QAAM,EAAA","file":"app-shared.min.7409b9b2.js","sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n/// \n/// \n(function () {\n \"use strict\";\n var appSettings = {};\n if (window) {\n // Object.assign(appSettings, window.appSettings);\n appSettings = window.appSettings;\n }\n angular.module(\"app.shared\", [\n // Angular modules\n \"ui.router\",\n 'ui.bootstrap',\n 'ngSanitize',\n 'ngMessages',\n 'ngAnimate',\n 'angular.filter',\n // Custom modules\n // 3rd Party Modules\n \"LocalStorageModule\",\n 'ngFileSaver',\n 'flow',\n 'matchMedia',\n 'ngFileSaver',\n 'angular-growl',\n 'angular-google-analytics',\n 'adaptive.detection',\n 'ngUaParser',\n 'cfp.hotkeys',\n 'ui.select'\n ])\n .config([\n \"$httpProvider\", \"$locationProvider\", function ($httpProvider, $locationProvider) {\n $httpProvider.interceptors.push(\"authInterceptorSrv\");\n $locationProvider.html5Mode({\n enabled: true,\n requireBase: true\n });\n }\n ])\n .run([\n \"$rootScope\", \"$state\", \"Analytics\", \"$templateCache\",\n function ($rootScope, $state, Analytics, $templateCache) {\n $rootScope.$on(\"$stateChangeStart\", function (evt, to, params) {\n if (to.redirectTo) {\n evt.preventDefault();\n $state.go(to.redirectTo, params);\n }\n });\n Analytics.pageView();\n $templateCache.remove('templates/growl/growl.html');\n $templateCache.put('templates/growl/growl.html', '
' +\n '
' +\n '' +\n '' +\n '

' +\n '
' +\n '
' +\n '
');\n }\n ])\n .value(\"shared.config\", {\n baseApiUrl: location.protocol + \"//\" + location.hostname + (location.port && \":\" + location.port) + '/',\n authSettings: { clientId: 'ngConnect3', useRefreshToken: true }\n })\n .config(['growlProvider', function (growlProvider) {\n growlProvider.onlyUniqueMessages(false);\n growlProvider.globalReversedOrder(true);\n }])\n .config(['AnalyticsProvider', function (AnalyticsProvider) {\n if (window.appSettings) {\n var trackingCode = window.appSettings.googleAnalyticsTrackingCode;\n AnalyticsProvider.setAccount(trackingCode)\n .trackPages(true)\n .trackUrlParams(true)\n .setPageEvent(\"$stateChangeSuccess\");\n }\n }])\n .constant('appSettings', appSettings)\n .factory('$exceptionHandler', ['$injector', 'brookson.logger', 'appSettings', function ($injector, logger, appSettings) { return function (exception, cause) {\n if (appSettings && appSettings.environment) {\n logger.error(\"Uncaught Exception - \" + exception.message, exception.stack, cause);\n }\n }; }]);\n})();\n/// \n(function () {\n \"use strict\";\n var app = angular.module(\"app.shared\");\n // Collect the routes\n app.config([\n \"$stateProvider\", \"$urlRouterProvider\", function ($stateProvider, $urlRouterProvider) {\n $stateProvider\n .state(\"brookson\", {\n views: {\n 'navigation': {\n template: \"\"\n },\n 'header': {\n template: \"\"\n },\n 'footer': {\n templateUrl: \"src/app/shared/views/footer.html\"\n },\n 'main': {\n template: \"
\"\n }\n }\n });\n $stateProvider.state(\"brookson.banklink-auto-allocation-settings\", {\n url: \"/banklink/auto-allocation/settings\",\n views: {\n '': {\n template: \"\"\n }\n },\n sticky: false\n });\n $stateProvider.state(\"brookson.bank-file-upload\", {\n url: \"/banklink/bank-file/upload\",\n views: {\n '': {\n template: \"\"\n }\n },\n sticky: false\n });\n }\n ]);\n})();\nangular.module('app.shared').run(['$templateCache', function ($templateCache) {\n $templateCache.put('src/app/shared/views/footer.html', '\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n
\\r\\n');\n $templateCache.put('src/app/shared/views/header.html', '
\\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n

{{$ctrl.memberSrv.companyName()}} \\r\\n
1\" ng-click=\"$ctrl.brooksonNavigation.login.serviceline()\">

\\r\\n\\r\\n
\\r\\n
    \\r\\n
  • \\r\\n \\r\\n
  • \\r\\n\\r\\n
  • \\r\\n \\r\\n Book an appointment \\r\\n \\r\\n \\r\\n
      \\r\\n
    • \\r\\n

      \\r\\n Reschedule Introduction Appointment\\r\\n

      \\r\\n
    • \\r\\n
    • \\r\\n

      \\r\\n Accountant Introduction Appointment\\r\\n

      \\r\\n
    • \\r\\n
    • \\r\\n

      \\r\\n Advisory Document Appointment\\r\\n

      \\r\\n
    • \\r\\n
    • \\r\\n

      \\r\\n Reschedule Advisory Appointment\\r\\n

      \\r\\n
    • \\r\\n
    • \\r\\n

      \\r\\n Financial Health Check Appointment\\r\\n

      \\r\\n
    • \\r\\n
    • \\r\\n

      \\r\\n Reschedule Health Check Appointment\\r\\n

      \\r\\n
    • \\r\\n
    \\r\\n
  • \\r\\n \\r\\n
  • \\r\\n Book a call \\r\\n
  • \\r\\n
  • \\r\\n Book a call \\r\\n
  • \\r\\n
  • \\r\\n Refer a Friend \\r\\n Refer a Friend \\r\\n
  • \\r\\n\\r\\n\\r\\n
  • \\r\\n \\r\\n \\r\\n \\r\\n
      \\r\\n
    • \\r\\n
      \\r\\n \\r\\n
      \\r\\n
    • \\r\\n\\r\\n
    • \\r\\n
      1\">\\r\\n \\r\\n
      \\r\\n
    • \\r\\n
    \\r\\n
  • \\r\\n\\r\\n
  • \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n {{$ctrl.brooksonNotificationsManager.notifications.notifications.length}}\\r\\n\\r\\n
      \\r\\n
    • \\r\\n

      \\r\\n You have no new alerts.\\r\\n

      \\r\\n
    • \\r\\n\\r\\n
    • \\r\\n

      \\r\\n \\t\\t\\t\\t\\t\\t\\t{{notification.metaDescription}}\\r\\n \\r\\n \\r\\n {{notification.title}}\\r\\n \\r\\n \\r\\n

      \\r\\n
    • \\r\\n\\r\\n
    • 0\">\\r\\n
      \\r\\n \\r\\n
      \\r\\n
    • \\r\\n
    \\r\\n
  • \\r\\n\\r\\n
  • \\r\\n \\r\\n \\r\\n {{$ctrl.brooksonNotificationsManager.notifications.planner.length}}\\r\\n \\r\\n\\r\\n
      \\r\\n
    • \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n {{task.actionTitle}}\\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n {{task.dueDate | bkShortDate: \\'DD/MM/YYYY\\'}}\\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n
    • \\r\\n
    \\r\\n\\r\\n
      \\r\\n
    • \\r\\n

      \\r\\n \\r\\n

      \\r\\n

      Looks like you are all caught up! Have a coffee.

      \\r\\n
    • \\r\\n
    \\r\\n
  • \\r\\n\\r\\n
  • \\r\\n
    \\r\\n
    \\r\\n \\r\\n {{$ctrl.memberDetails.firstname}}\\r\\n {{$ctrl.memberDetails.lastname}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n\\r\\n
      \\r\\n
    • \\r\\n
      \\r\\n {{$ctrl.member.memberId}}\\r\\n {{$ctrl.member.companyRef}}\\r\\n
      \\r\\n
    • \\r\\n
    • \\r\\n

      Account Settings

      \\r\\n
    • \\r\\n
    • \\r\\n

      \\r\\n Logout\\r\\n

      \\r\\n
    • \\r\\n
    \\r\\n
  • \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n ×\\r\\n
\\r\\n
 
brooksonone.co.uk
\\r\\n

\\r\\n Welcome to Brookson One\\r\\n

\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
');\n $templateCache.put('src/app/shared/views/navigation.html', '
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
Your account has been suspended due to outstanding fees. Please contact us on 01925 232526 to discuss this further and bring your account up to date to reinstate your access.
');\n $templateCache.put('src/app/shared/views/bank/brookson.banklink.auto.allocation.settings.html', '
\\r\\n \\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n

Auto Allocation Rules

\\r\\n
\\r\\n\\r\\n\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n

If you have transactions that occur on a regular basis (eg monthly phone contract), an Auto Allocation Keyword can be set up to identify, and allocate, the transactions accordingly.

\\r\\n

Any transactions which contain your Keyword will be allocated to the selected Category at the end of each day. Please ensure the keyword is specific enough to recognise the transactions.

\\r\\n

Transactions will be processed in your accounts gross (without VAT), if you operate under the Standard Rate VAT scheme and would like to reclaim VAT, please allocate the transaction and reclaim VAT as normal.

\\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n

\\r\\n \\r\\n
\\r\\n Loading ....\\r\\n

\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n 0\" ng-repeat=\"autoMatchConfig in $ctrl.companyConfigList\">\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
KeywordCategoryEnabled
There are currently no enabled Auto Allocation Rules.
\\r\\n \\r\\n
{{autoMatchConfig.validationMessage}}
\\r\\n
0\">\\r\\n
Unallocated & allocated business paid transactions containing text: \\'{{autoMatchConfig.keyword.toUpperCase()}}\\'
\\r\\n
10\">\\r\\n {{autoMatchConfig.transactionMatches.count}} results, showing latest 10 transactions\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
DescriptionDateAmount
{{wordMatch.transactionDate | date: \"dd/MMM/yyyy\"}}{{wordMatch.debitAmount | currency:\"\\xA3\"}}
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n\\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
');\n $templateCache.put('src/app/shared/views/bank/brookson.banklink.bankfilupload.html', '
\\r\\n \\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n Cancel\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n

Upload Bank Statement File

\\r\\n

Update Bank Transaction Date

\\r\\n
\\r\\n\\r\\n
\\r\\n Need some help? Click here for our FAQ\\'s\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n 1{{$ctrl.steps[0].title}}\\r\\n \\r\\n
\\r\\n

\\r\\n Choose the relevant bank account for the statement you intend to upload or update the bank statement date.\\r\\n

\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n Last 5 transactions \\r\\n

Account number: {{$ctrl.selectedBankAccount.accountNumber}} Sort Code: {{$ctrl.selectedBankAccount.sortCode}}

\\r\\n

{{$ctrl.selectedBankAccount.bankName}}

\\r\\n Balance date {{$ctrl.selectedBankAccount.reconciliationDate | date: \\'dd MMM yyyy\\'}}\\r\\n\\r\\n\\r\\n
\\r\\n
\\r\\n
0\">\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
DateDescriptionIn (£)Out (£)Balance (£)
{{line.transactionDate | date:\\'dd/MM/yyyy\\'}}{{line.transactionCategory.description}}
{{line.description}}
{{line.creditAmount == 0 ? \\' \\' : (line.creditAmount | number:2)}}{{line.debitAmount == 0 ? \\' \\' : (line.debitAmount | number:2)}}{{line.balance | number:2}}
No reconcilled results for this period
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n 2{{$ctrl.steps[1].title}}\\r\\n \\r\\n
\\r\\n

\\r\\n Upload statements as CSV files (2MB maximum). For assistance with file format, click here to refer to our FAQs.\\r\\n

\\r\\n

You should upload bank statement transactions dated between {{$ctrl.selectedBankAccount.reconciliationDate | date: \\'dd MMM yyyy\\'}} and today

\\r\\n
\\r\\n\\r\\n \\r\\n
\\r\\n \\r\\n {{successfullMessage}}\\r\\n
\\r\\n\\r\\n \\r\\n
\\r\\n \\r\\n Warning! We were unable to upload files:\\r\\n
\\r\\n {{file.name}}\\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n\\r\\n \\r\\n

\\r\\n {{uploadMessage}}\\r\\n \\r\\n \\r\\n or if transactions\\r\\n \\r\\n Update Statement date\\r\\n \\r\\n

\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n Warning! We were unable to upload files:\\r\\n
\\r\\n {{file.name}}\\r\\n
\\r\\n
\\r\\n\\r\\n\\r\\n \\r\\n
\\r\\n\\r\\n
\\r\\n
\\r\\n \\r\\n 3{{$ctrl.steps[2].title}}\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n We were unable to upload file due to issues in the file\\r\\n
\\r\\n {{file.name}}\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
SelectedDateDescriptionAmountBalance
\\r\\n Skipped\\r\\n \\r\\n {{transaction.date | bkShortDate:\\'DD, MMMM, YYYY\\'}}{{ transaction.dateError }}{{transaction.description}}{{transaction.amount | currency : \\'\\'}}{{transaction.balance | currency : \\'\\'}}
\\r\\n
\\r\\n

Note: No transactions found for submission. Please ensure the file format is correct and has not been uploaded previously.

\\r\\n
\\r\\n
\\r\\n

Note: All transactions are in before Balance Date {{$ctrl.selectedBankAccount.reconciliationDate | date: \\'dd MMM yyyy\\'}}

\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n 4{{$ctrl.steps[3].title}}\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
DateDescriptionAmount InAmount OutBalance
{{transaction.date | bkShortDate:\\'DD/MM/YYYY\\'}}{{ transaction.dateError }}{{transaction.description}}{{transaction.paidIn | currency : \\'\\'}}{{transaction.paidOut | currency : \\'\\'}}{{transaction.balance | currency : \\'\\'}}
\\r\\n
0\">\\r\\n

Note: The uploaded statement is missing a balance column, or we were unable to find a valid column header. Please ensure that the calculated balance corresponds with your bank statement before proceeding.

\\r\\n

Calculated Balace: {{$ctrl.newBalanceAmount() | currency : \\'\\'}}

\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n \\r\\n\\r\\n
\\r\\n
An error occurred submitting Bank Statement Transactions.
We were unable to submit your transactions contact us for more guidance.
\\r\\n
\\r\\n Cancel\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n Transaction Date\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n {{transaction.date | bkShortDate:\\'DD/MM/YYYY\\'}}\\r\\n {{$ctrl.selectedBankAccount.reconciliationDate | bkShortDate:\\'DD/MM/YYYY\\'}}\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n

Statement date successfully submitted!

\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n Bank statement submitted\\r\\n
\\r\\n
\\r\\n
\\r\\n

\\r\\n Thank you, your bank statement has been validated and balances.\\r\\n

\\r\\n

Transactions successfully submitted!

\\r\\n
    \\r\\n

    Transactions amount: {{$ctrl.summary.summary.totalAmount | currency : \\'\\'}}

    \\r\\n

    Number of transactions: {{$ctrl.summary.summary.totalCount}}

    \\r\\n

    New balance: {{$ctrl.newBalanceAmount() | currency : \\'\\'}}

    \\r\\n

    Statement date: {{$ctrl.updatedTransactionDate | date: \\'dd MMM yyyy\\'}}

    \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
An error occurred submitting Bank Statement File.
\\r\\n
\\r\\n
\\r\\n
');\n $templateCache.put('src/app/shared/views/bank/brookson.bankLink.transactions.html', '
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n\\t\\t\\r\\n\\t\\t\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n\\t\\r\\n\\t\\t\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n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transactionDate|bkShortDate:\"DD/MM/YYYY\"}}{{::transaction.transactionCategory.description}}\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{::transaction.debitAmount + transaction.creditAmount | currency:\"\\xA3\"}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{transaction.net | currency:\"\\xA3\"}}\\r\\n\\t\\t\\t\\t\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n\\t\\t\\t\\t\\t{{::transaction.debitAmount + transaction.creditAmount | currency:\"\\xA3\"}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{::transaction.personalSalaryAmount | currency:\"\\xA3\"}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{::transaction.personalExpensesAmount | currency:\"\\xA3\"}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{::transaction.personalDiv1Amount | currency:\"\\xA3\"}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{::transaction.personalDiv2Amount | currency:\"\\xA3\"}}\\r\\n\\t\\t\\t\\t{{::transaction.balance | currency:\"\\xA3\"}}
\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
No transactions recorded yet
\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
\\r\\n
');\n $templateCache.put('src/app/shared/views/bank/brookson.bankLink.transactions.mobile.html', '
\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n\\r\\n

{{$ctrl.data.selectedBankAccount.bankName}}

\\r\\n
\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n\\r\\n {{::transaction.transactionDate|bkShortDate:\"DD/MM/YYYY\"}}\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n {{::transaction.debitAmount + transaction.creditAmount | currency:\"\\xA3\"}}\\r\\n
\\r\\n\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n {{::transaction.transactionCategory.description}}\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n Valid VAT receipt: \\r\\n \\r\\n \\r\\n \\r\\n Total: {{::transaction.debitAmount + transaction.creditAmount | currency:\"\\xA3\"}}\\r\\n \\r\\n \\r\\n VAT: \\r\\n \\r\\n \\r\\n Net: {{transaction.net | currency:\"\\xA3\"}}\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n\\r\\n \\r\\n
');\n $templateCache.put('src/app/shared/views/bank/brookson.bankLink.transactions.pagination.html', '
\\r\\n \\r\\n
');\n $templateCache.put('src/app/shared/views/inputs/brookson.input.boolean.html', '
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
{{label}} is required
\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n {{ngModel | boolean}}\\r\\n
\\r\\n\\r\\n
\\r\\n {{ngModel | boolean}}\\r\\n
\\r\\n\\r\\n\\r\\n\\r\\n');\n $templateCache.put('src/app/shared/views/inputs/brookson.input.check-buttons.html', '
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
{{label}} is required
\\r\\n
\\r\\n
\\r\\n
\\r\\n {{viewValue()}}\\r\\n
\\r\\n\\r\\n\\r\\n\\r\\n');\n $templateCache.put('src/app/shared/views/inputs/brookson.input.checkbox.html', '
\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n
{{label}} is required
\\r\\n
\\r\\n
\\r\\n\\r\\n
\\r\\n \\r\\n
\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n');\n $templateCache.put('src/app/shared/views/inputs/brookson.input.datepicker.html', '
\\r\\n\\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n\\r\\n \\r\\n
\\r\\n
\\r\\n
{{ label }} is required
\\r\\n
{{ label }} is not a date
\\r\\n \\r\\n
{{ minCustomMessage }}
\\r\\n
{{ maxCustomMessage }}
\\r\\n
\\r\\n\\r\\n between {{minDate | bkShortDate: \\'DD/MM/YYYY\\' }} and {{maxDate | bkShortDate: \\'DD/MM/YYYY\\' }}\\r\\n\\r\\n before {{maxDate | bkShortDate: \\'DD/MM/YYYY\\' }}\\r\\n\\r\\n after {{maxDate | bkShortDate: \\'DD/MM/YYYY\\' }}\\r\\n
\\r\\n {{ngModel | bkShortDate: \\'DD/MM/YYYY\\' }}\\r\\n
\\r\\n\\r\\n\\r\\n');\n $templateCache.put('src/app/shared/views/inputs/brookson.input.expense-amount.html', '
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
\\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n
\\r\\n
');\n $templateCache.put('src/app/shared/views/inputs/brookson.input.expense-attach.html', '
\\r\\n
\\r\\n \\r\\n
\\r\\n \\r\\n \\r\\n
\\r\\n \\r\\n
\\r\\n
\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/inputs/brookson.input.inline-edit.date.html', '\\r\\n\\r\\n\\r\\n\\r\\n');\n $templateCache.put('src/app/shared/views/inputs/brookson.input.inline-edit.input.html', '
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    {{label}} is required
    \\r\\n
    Max length is {{ngMaxlength}}
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/inputs/brookson.input.inline-edit.textarea.html', '
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n Cancel\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    {{label}} is required
    \\r\\n
    Max length is {{ngMaxlength}}
    \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/inputs/brookson.input.job-industry.html', '');\n $templateCache.put('src/app/shared/views/inputs/brookson.input.job-title.html', '
    \\r\\n \\r\\n {{$ctrl.ngModel.titleText}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    {{$ctrl.label}} is required
    \\r\\n
    {{$ctrl.label}} is required
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n {{$ctrl.ngModel}}\\r\\n
    \\r\\n\\r\\n\\r\\n');\n $templateCache.put('src/app/shared/views/inputs/brookson.input.mask.html', '
    \\r\\n \\r\\n
    \\r\\n
    {{label}} is required
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n {{ngModel}}\\r\\n
    \\r\\n\\r\\n\\r\\n');\n $templateCache.put('src/app/shared/views/inputs/brookson.input.number.html', '
    \\r\\n\\r\\n
    {{ currencyEnums.CurrencyCodes.properties[currencyCode].code || \\'£\\' }}
    \\r\\n\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    {{label}} is required
    \\r\\n
    {{ minCustomMessage || (label + \\' must be greater than or equal to \\' + ngMin) }}
    \\r\\n
    {{label}} must be a whole number
    \\r\\n
    {{ maxCustomMessage || (label + \\' must be less than or equal to \\' + max) }}
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n {{ngModel}}\\r\\n {{ngModel | brooksonCurrency: currencyCode}}\\r\\n
    \\r\\n\\r\\n\\r\\n\\r\\n\\r\\n');\n $templateCache.put('src/app/shared/views/inputs/brookson.input.percentage.html', '
    \\r\\n\\r\\n \\r\\n
    %
    \\r\\n
    \\r\\n
    \\r\\n
    {{label}} is required
    \\r\\n
    {{label}} must be greater than 0
    \\r\\n
    {{label}} must be a whole number
    \\r\\n
    {{label}} must be less than or equal to {{max}}
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n {{ngModel}}\\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/inputs/brookson.input.select-search.html', '
    \\r\\n \\r\\n\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    {{label}} is required
    \\r\\n
    Please choose a {{label}} from the list provided
    \\r\\n
    \\r\\n\\r\\n\\r\\n\\r\\n
    \\r\\n {{ngModel[viewOnlyProperty]}}\\r\\n {{ngModel}}\\r\\n
    \\r\\n\\r\\n\\r\\n\\r\\n');\n $templateCache.put('src/app/shared/views/inputs/brookson.input.select.html', '
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    {{label}} is required
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n {{ngModel[viewOnlyProperty]}}\\r\\n {{ngModel}}\\r\\n
    \\r\\n\\r\\n\\r\\n \\r\\n');\n $templateCache.put('src/app/shared/views/inputs/brookson.input.text-addon.html', '
    \\r\\n
    \\r\\n {{addontext}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    {{label}} is required
    \\r\\n
    Max length is {{ngMaxlength}}
    \\r\\n
    Min length is {{ngMinlength}}
    \\r\\n
    {{ngPatternMessage}}
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n {{ngModel}}\\r\\n
    \\r\\n\\r\\n\\r\\n \\r\\n');\n $templateCache.put('src/app/shared/views/inputs/brookson.input.text.html', '
    \\r\\n \\r\\n
    \\r\\n
    {{label}} is required
    \\r\\n
    Max length is {{ngMaxlength}}
    \\r\\n
    Min length is {{ngMinlength}}
    \\r\\n
    Not a valid email address
    \\r\\n
    {{ngPatternMessage}}
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n {{ngModel}}\\r\\n
    \\r\\n\\r\\n\\r\\n\\r\\n');\n $templateCache.put('src/app/shared/views/inputs/brookson.input.text.password.html', '\\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    {{label}} is required
    \\r\\n
    Password is too long, should be less than {{ngMinlength}} characters long
    \\r\\n
    Password must be at least {{ngMinlength}} characters long
    \\r\\n
    Not a valid email address
    \\r\\n
    {{ngPatternMessage}}
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n {{ngModel}}\\r\\n
    \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n

    \\r\\n Password must contain a combination of letters, numbers, and/or symbols\\r\\n

    \\r\\n

    \\r\\n The password is too common or easy to guess. Please choose a stronger one\\r\\n

    \\r\\n
    \\r\\n

    Why is this a problem?

    \\r\\n

    This password is one of the most commonly used passwords, which makes it easy for hackers to guess.

    \\r\\n

    What to do:

    \\r\\n
      \\r\\n
    • Use a combination of uppercase, lowercase letters, numbers, and symbols.
    • \\r\\n
    • Avoid using dictionary words or names.
    • \\r\\n
    • Make your password at least 12 characters long.
    • \\r\\n
    \\r\\n
    \\r\\n\\r\\n');\n $templateCache.put('src/app/shared/views/inputs/brookson.input.text.restrict.html', '
    \\r\\n \\r\\n
    \\r\\n
    {{label}} is required
    \\r\\n
    Max length is {{ngMaxlength}}
    \\r\\n
    Min length is {{ngMinlength}}
    \\r\\n
    Not a valid email address
    \\r\\n
    {{ngPatternMessage}}
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n {{ngModel}}\\r\\n
    \\r\\n\\r\\n\\r\\n\\r\\n');\n $templateCache.put('src/app/shared/views/inputs/brookson.input.textarea.html', '
    \\n\\n \\n\\n Remaining characters: {{ngMaxlength - ngModel.length}}\\n\\n
    \\n
    {{label}} is required
    \\n
    Max length is {{ngMaxlength}}
    \\n
    \\n
    \\n\\n
    \\n {{ngModel}}\\n
    \\n\\n\\n\\n\\n');\n $templateCache.put('src/app/shared/views/inputs/expenses.input.select-assignment.html', '\\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/inputs/expenses.input.valid-vat-receipt.html', '
    \\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n');\n $templateCache.put('src/app/shared/views/modals/brookson.modals.feedback.html', '
    \\r\\n
    \\r\\n

    Feedback

    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n {{category.note}}\\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/modals/brookson.modals.gl-entries.html', '
    \\r\\n

    General Ledger Entries

    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n

    {{title}} Breakdown

    \\r\\n
    \\r\\n
    \\r\\n

    {{reportType === \"BS\" ? \\'Balance\\' : \\'Total\\'}}: {{ total | brooksonCurrency }}

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    Posting DateDocument DateDescription\\xA3 Debit\\xA3 Credit{{reportType === \"BS\" ? \\'Balance\\' : \\'Total\\'}}
    {{ entry.postingDate | date:\\'dd/MM/yyyy\\' }}{{ entry.documentDate | date:\\'dd/MM/yyyy\\' }}{{ entry.description }}{{ entry.amount > 0 ? (entry.amount | number:2) : \\' \\' }}{{ entry.amount < 0 ? (entry.amount | number:2) : \\' \\' }}{{ reportType == \"BS\" ? (entry.balance | number:2) : (entry.amount | number:2) }}
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/modals/brookson.modals.gl-entries.mobile.html', '
    \\r\\n

    GL Entries

    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    Posting Date
    {{entry.postingDate | date:\\'dd/MM/yyyy\\'}}
    \\r\\n
    Doc Date
    {{entry.documentDate | date:\\'dd/MM/yyyy\\'}}
    \\r\\n
    Total
    {{entry.amount | number:2}} {{ entry.amount > 0 ? \\'CR\\' : \\'DR\\'}}
    \\r\\n
    Description
    {{entry.description}}
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/modals/brookson.modals.ir35DetailCapture.html', '
    \\r\\n
    \\r\\n

    IR35 Detail Capture

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n

    As you may be aware, the IR35 rules for contractors working on an assignment for the public sector are changing from 6 April 2017 (there will be no changes if you work for a private sector end client). Please let us know by using the buttons below whether your current assignment(s) is for a public sector or private sector end client.

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n

    More information on the changes can be found here: http://www.brookson.co.uk/blog/ir35-reform/

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/modals/brookson.modals.pdf-modal.html', '
    \\r\\n

    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/modals/brookson.modals.publicSectorAssignmentCheck.html', '
    \\r\\n
    \\r\\n

    Public Sector Assignments

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n

    As you are aware, the IR35 rules for contractors working on assignments in the public sector changed from 6th April 2017- please note, however, there are currently no changes if you work for a private sector end client. Please indicate, using the buttons below, which sector is appropriate to your current assignment(s):

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n

    {{assignment.fullAssignmentName}}

    \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n
      \\r\\n
    • \\r\\n \\r\\n Public\\r\\n
    • \\r\\n
    • \\r\\n \\r\\n Private\\r\\n
    • \\r\\n
    • \\r\\n \\r\\n No longer in use\\r\\n
    • \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
      \\r\\n
    • \\r\\n \\r\\n Yes\\r\\n
    • \\r\\n
    • \\r\\n \\r\\n No\\r\\n
    • \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n

    As a director it is important that you review the IR35 status of your contract(s) on a regular basis, to help you with this we are delighted to offer in partnership with Brookson Legal Services, unlimited reviews as part of our all-inclusive service. To take advantage of this service please go to \\'My Company / IR35 Employment Status\\' and complete the required forms.

    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n

    More information on the changes can be found here: http://www.brookson.co.uk/blog/ir35-reform/\\r\\n

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/modals/brookson.modals.receipt-bank.attach-receipt.html', '
    \\r\\n

    Attach Receipt

    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/modals/brookson.modals.receipt-preview.html', '
    \\r\\n

    Preview Receipt

    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n\\r\\n \\r\\n View Receipt Image\\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/modals/brookson.modals.sdc.html', '
    \\r\\n
    \\r\\n

    Unassessed Assignments

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n

    You have an assignment that has not been reviewed for eligibility to claim expenses.

    \\r\\n

    Do you intend to claim expenses on the assignments listed below?

    \\r\\n

    You are not able to navigate around Connect until an SDC questionnaire has been completed for the following assignments.

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n

    {{assignment.agencyName}} | {{assignment.clientName}}

    \\r\\n
    {{assignment.dateStarted | bkShortDate: \"DD/MM/YYYY\"}}
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/modals/brookson.modals.select.html', '
    \\r\\n

    {{title}}

    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    ');\n $templateCache.put('src/app/shared/views/modals/brookson.modals.unpaidInvoices.html', '
    \\r\\n

    Less: Unpaid Invoices

    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n

    The value of unpaid invoices is the amount of the invoice that could be taken out as a dividend. This is the \\r\\n unpaid invoice amount (trade debtors) x 100/120 (if VAT registered) x 81/100 (to take out Corporation tax).

    \\r\\n

    This is a prudent approach and is most appropriate for customers with businesses in their first few months of trading.

    \\r\\n

    If you are an established business it may be better for you to consider including the value of unpaid invoices. This \\r\\n will advise you to take out the additional value of unpaid invoices before they are paid. This can be the right option \\r\\n for certain circumstances so please call us on 0345 058 1200 to discuss this option.

    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    ');\n $templateCache.put('src/app/shared/views/payment/brookson.payment.payment-view.html', '
    \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n

    Auto Allocation Rules

    \\r\\n
    \\r\\n\\r\\n\\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n\\r\\n\\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.accept-checkbox.html', '
    \\r\\n \\r\\n \\r\\n
    ');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.accept-terms-and-conditions.html', '
    \\r\\n
    \\r\\n
    \\r\\n

    {{$ctrl.headingText}}

    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.account-details.contact-information.html', '
    \\r\\n

    \\r\\n Contact Details\\r\\n

    \\r\\n\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.account-details.personal-information.html', '
    \\r\\n

    \\r\\n Personal Details\\r\\n

    \\r\\n\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n

    Two Factor Authentication is currently disabled

    \\r\\n

    Two Factor Authentication Enabled. If you disable this then it will be re-enabled in 24 hours time.

    \\r\\n

    Two Factor Authentication has been disabled until {{$ctrl.twoFactorDisabledExpiryDate()}}

    \\r\\n

    Two Factor Authentication was permanently disabled on {{$ctrl.twoFactorOverrideDate()}}

    \\r\\n
    \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.attach-receipt.html', '
    \\r\\n 0\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" id=\"attachReceiptDropup\" aria-haspopup=\"true\"\\r\\n aria-expanded=\"false\">\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      \\r\\n
    • 0\">\\r\\n Preview\\r\\n
    • \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.auth-code.input.html', '
    \\r\\n
    \\r\\n

    Please enter your HMRC Authorisation code below

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.back-top.html', '');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.calendar-overlay.html', '
    \\r\\n\\t
    \\r\\n\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t\\t\\t×\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t
     
    brooksonone.co.uk
    \\r\\n\\t\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t\\t\\tWelcome to Brookson One\\r\\n\\t\\t\\t\\t\\t

    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t
    \\r\\n\\t\\t
    \\r\\n\\t
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.confirm.accounts.html', '
    \\r\\n \\r\\n Done\\r\\n Current\\r\\n Future\\r\\n Overdue {{$ctrl.action.dueDate | bkShortDate:\"DD/MM/YYYY\"}}\\r\\n \\r\\n

    {{$ctrl.action.actionTitle}}

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n

    \\r\\n Draft accounts have been confirmed.\\r\\n

    \\r\\n\\r\\n
    \\r\\n

    \\r\\n Please review the draft accounts we have published. If you are happy with the content then please confirm the accounts\\r\\n below.\\r\\n

    \\r\\n
    Step 1
    \\r\\n

    \\r\\n Please review and confirm that any assignment caught by IR35(disguised employment) is correctly showing on the assignment\\r\\n page and that there are no other assignments which you believe should be subject to PAYE.\\r\\n

    \\r\\n

    \\r\\n \\r\\n \\r\\n

    \\r\\n
    \\r\\n
    \\r\\n
    Step 2
    \\r\\n

    \\r\\n We need you to review the approved draft acounts and representation letter. Once you have reviewed the documents please confirm your approval of the\\r\\n draft accounts and representation letter by clicking the confirm button below. Please be aware that we cannot issue your formal year end accounts pack\\r\\n until you have approved your draft accounts.\\r\\n

    \\r\\n
    Related documents
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    No docs
    {{doc.name}}View Document
    Download All
    \\r\\n

    \\r\\n

    \\r\\n

    If you have any queries relating to you accounts then please contact the customer services team for further assistance on 0345 058 1200 or 01925 232526

    \\r\\n
    \\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.confirm.financial-health-check.html', '
    \\r\\n

    Our team of experts are here to help you make the most of your money. Book your appointment today.

    \\r\\n Book Appointment\\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.confirm.self.assessment.html', '
    \\r\\n
    \\r\\n

    Your Self Assessment Tax Pack is now available to complete.

    \\r\\n Tax Pack\\r\\n
    \\r\\n\\r\\n
    \\r\\n

    Thank you for completing your Tax Pack.

    \\r\\n Tax Pack\\r\\n
    \\r\\n\\r\\n
    \\r\\n

    Your tax return has been filed at the HMRC.

    \\r\\n
    \\r\\n\\r\\n
    Thank you for approving your Tax Return. We will submit this to HMRC in due course and send you a notification once submitted.
    \\r\\n\\r\\n

    Your Personal Tax Return will show here when it has been prepared ready to be reviewed.

    \\r\\n\\r\\n
    \\r\\n \\r\\n

    Your Tax Return is ready to be reviewed and approved by you.

    \\r\\n\\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    We are busy preparing your Tax Return
    {{doc.name}}View Document
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n

    I confirm that I am in agreement with the content of my Tax Return

    \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n

    I confirm that I am in agreement with the content of my Tax Return

    \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n

    Thank you for completing your Tax Pack.

    \\r\\n Tax Pack\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n

    We do not have your UTR number (Unique Taxpayer Reference) issued to you by HMRC.
    Enter this on your Tax Pack and Add UTR.\\r\\n

    \\r\\n

    The UTR number we have on record is not in the correct format.
    Update this on your Tax Pack and click Update UTR.\\r\\n

    \\r\\n
    \\r\\n\\r\\n
    ');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.confirm.year.end.html', '
    \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n
    \\r\\n

    Your draft Year End Accounts have been produced for you to view and confirm. When confirmed we will start the process of submitting the Year End Accounts to Companies House and HMRC.

    \\r\\n
    \\r\\n
    There was an issue updating your Year End status, please try again later.
    \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n I confirm that I am happy with the content of the {{$ctrl.yearEndTileDetails.currentYearEndName}} Year End Accounts.\\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n\\r\\n \\r\\n
    \\r\\n

    Thank you for confirming your Year End Accounts, we will now arrange for these to be submitted to Companies House and HMRC.

    \\r\\n
    \\r\\n \\r\\n View Accounts\\r\\n \\r\\n
    \\r\\n Confirmed\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n\\r\\n \\r\\n
    \\r\\n

    Your Company Year End Accounts have been submitted to Companies House and HMRC.

    \\r\\n
    \\r\\n \\r\\n View Accounts\\r\\n \\r\\n
    \\r\\n Confirmed\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.feedback.html', '\\uFEFF\\r\\n
    \\r\\n How are we doing?\\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n Options\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.flex.form.html', '
    \\r\\n

    You have provided the required information to join Brookson\\u2019s umbrella solution. We will be in contact with further information.

    \\r\\n
    \\r\\n

    \\r\\n Introducing Flex! The IR35 Solution for Contractors to easily switch between Limited and Umbrella working as and when needed.\\r\\n

    \\r\\n

    \\r\\n Want to know more about Flex, click here\\r\\n

    \\r\\n

    \\r\\n Join Brookson Umbrella\\r\\n

    \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.image-not-found.html', '
    \\r\\n

    \\r\\n\\r\\n

    Image not found

    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.image-preview.modal.html', '
    \\r\\n

    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.pdf-view.html', '
    \\r\\n\\t
    \\r\\n\\t\\t\\r\\n\\t
    \\r\\n
    \\r\\n\\r\\n\\r\\n');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.popup.html', '
    \\r\\n

    {{title}}

    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.popup.input.html', '
    \\r\\n

    {{title}}

    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    ');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.privacy.button.html', '
    \\r\\n \\r\\n
    \\r\\n Use {{$ctrl.privacyFactory.hotKeyToEnablePrivacyMode}} to enable/disable\\r\\n
    ');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.progress-bar.html', '
    \\r\\n
    \\r\\n Uploaded {{$ctrl.file.sizeUploaded() | bytes }} of {{ $ctrl.file.size | bytes }} | {{ $ctrl.file.sizeUploaded() / $ctrl.file.size * 100 | number:0 }} %\\r\\n\\r\\n
    \\n \\n Pending...\\n \\n
    ');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.receipt-panel.html', '
    \\r\\n \\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.templated-confirmation-popup.html', '
    \\r\\n

    {{title}}

    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    ');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.templated-help-popup.html', '
    \\r\\n

    {{title}}

    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    ');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.templated-info-popup.html', '
    \\n

    {{title}}

    \\r\\n \\r\\n \\r\\n \\n
    \\n
    \\n \\n
    ');\n $templateCache.put('src/app/shared/views/ui/brookson.ui.utr.input.html', '
    \\r\\n
    \\r\\n

    Please enter your UTR and Branch ID Number below

    \\r\\n
    \\r\\n\\r\\n
    \\r\\n The Unique Taxpayer Reference (UTR) is issued by HMRC when you have registered for Self Assessment. It is made up of 10 numbers\\r\\n and can be found on documentation issued by HMRC such as the Tax Return (SA100), a \\'Notice to complete a Tax Return\\'\\r\\n (SA316) or a Statement of Account.\\r\\n
    The Branch ID is the digit branch code found on documentation issued by HMRC.\\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n /\\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.actions.html', '
    \\r\\n
    \\r\\n
    \\r\\n Actions\\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    TypeDescriptionStatusDue Date
    {{::task.taskGroup}}{{::task.actionTitle}}{{::$ctrl.enums.TaskStatus.properties[task.status].description}}{{::task.dueDate|date:\\'dd/MM/yyyy\\'}}
    \\r\\n No tasks to be displayed.\\r\\n
    \\r\\n
    \\r\\n You have {{::$ctrl.transactionsToAllocate}} transactions to allocate\\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    There was a problem loading your data.
    \\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.assignments.html', '
    \\r\\n
    \\r\\n
    \\r\\n Assignments\\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n {{$ctrl.assignments[0].assignmentName}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    Rate(s)
    \\r\\n\\r\\n
    \\r\\n \\r\\n {{rate.amount}} {{rate.currency}} per {{rate.period | lowercase}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n\\r\\n \\r\\n
    \\r\\n Start Date\\r\\n
    \\r\\n \\r\\n {{assignment.dateStarted | bkShortDate: \\'DD/MM/YYYY\\' : \\'No Start Date Specified\\'}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n\\r\\n \\r\\n
    \\r\\n Expected End Date\\r\\n
    \\r\\n \\r\\n {{assignment.dateEnded | bkShortDate: \\'DD/MM/YYYY\\' : \\'No End Date Specified\\'}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n\\r\\n \\r\\n
    \\r\\n IR35 Status\\r\\n
    \\r\\n \\r\\n Take Assessment\\r\\n \\r\\n {{assignment.overallStatusText}}\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n

    You currently have no assignments

    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    There was a problem loading your data.
    \\r\\n
    \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.bank-link.html', '
    \\r\\n
    \\r\\n
    \\r\\n Bank\\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n Balance Trends\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Your Bank Status:\\r\\n
    \\r\\n Action required\\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n\\r\\n
    \\r\\n Transactions to confirm: {{$ctrl.transactionsToAllocate}}\\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    There was a problem loading your data.
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n This feature is automatically activated when view access is enabled on your business bank account and will display a list of transactions, which you will need to categorise and allocate. If the transaction is a business expense, you will need to attach a receipt.\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.document-storage.recent-documents.html', '
    \\r\\n
    \\r\\n
    \\r\\n Document Storage\\r\\n
    \\r\\n \\r\\n\\r\\n \\r\\n Recent Documents\\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n

    \\r\\n {{document.name}} View Document\\r\\n

    \\r\\n
    \\r\\n
    \\r\\n No recently added documents.\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    There was a problem loading your data.
    \\r\\n
    \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.document-storage.umbrella-recent-documents.html', '
    \\r\\n
    \\r\\n
    \\r\\n Documents\\r\\n
    \\r\\n \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n

    4}\">\\r\\n {{document.name}} View Document\\r\\n

    \\r\\n
    \\r\\n
    \\r\\n No recently added documents.\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    There was a problem loading your data.
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    A/CDateDescriptionAmount
    {{::transaction.bankName}}{{::transaction.transactionDate | bkShortDate:\"DD/MM/YYYY\"}}{{::transaction.debitAmount + transaction.creditAmount | currency:\"\\xA3\"}}
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    Important documents
    \\r\\n Contract of Employment\\r\\n \\r\\n Download\\r\\n
    \\r\\n Employee Handbook\\r\\n \\r\\n Download\\r\\n
    \\r\\n Health Safety Assessment\\r\\n \\r\\n Download\\r\\n
    \\r\\n Health Safety Assessment Guidelines\\r\\n \\r\\n Download\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.employment-record.html', '
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Employment Record\\r\\n
    \\r\\n \\r\\n\\r\\n \\r\\n Overview\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    Personal Details
    \\r\\n First name\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.firstName !== \\'\\' ? $ctrl.accountSrv.personalInformation.firstName : \\'--\\'}}\\r\\n
    \\r\\n Middle name\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.middleName !== \\'\\' ? $ctrl.accountSrv.personalInformation.middleName : \\'--\\'}}\\r\\n
    \\r\\n Last name\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.surname !== \\'\\' ? $ctrl.accountSrv.personalInformation.surname : \\'--\\'}}\\r\\n\\r\\n
    \\r\\n Nationality\\r\\n \\r\\n {{($ctrl.nationalities | filter: {code: $ctrl.accountSrv.personalInformation.nationality })[0].nationality }}\\r\\n
    \\r\\n NI Number\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.niNumber !== \\'\\' ? $ctrl.accountSrv.personalInformation.niNumber : \\'--\\'}}\\r\\n
    \\r\\n Address 1\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.address !== \\'\\' ? $ctrl.accountSrv.personalInformation.address : \\'--\\'}}\\r\\n
    \\r\\n Address 2\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.address2 !== \\'\\' ? $ctrl.accountSrv.personalInformation.address2 : \\'--\\'}}\\r\\n
    \\r\\n Town\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.city !== \\'\\' ? $ctrl.accountSrv.personalInformation.city : \\'--\\'}}\\r\\n
    \\r\\n County\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.county !== \\'\\' ? $ctrl.accountSrv.personalInformation.county : \\'--\\'}}\\r\\n
    \\r\\n Postcode\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.postcode !== \\'\\' ? $ctrl.accountSrv.personalInformation.postcode : \\'--\\'}}\\r\\n
    \\r\\n UTR number\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.utrNumber !== \\'\\' ? $ctrl.accountSrv.personalInformation.utrNumber : \\'--\\'}}\\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    Contact Details
    \\r\\n Home number\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.mobilePhoneNo !== \\'\\' ? $ctrl.accountSrv.personalInformation.mobilePhoneNo : \\'--\\'}}\\r\\n
    \\r\\n Work number\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.workPhoneNo !== \\'\\' ? $ctrl.accountSrv.personalInformation.workPhoneNo : \\'--\\'}}\\r\\n
    \\r\\n Email\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.eMail !== \\'\\' ? $ctrl.accountSrv.personalInformation.eMail : \\'--\\'}}\\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    Documents
    \\r\\n Contract of Employment\\r\\n \\r\\n Download Document\\r\\n
    \\r\\n Employee Handbook\\r\\n \\r\\n Download Document\\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    There was a problem loading your data.
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n Any invoices raised or remittances submitted will be displayed, along with any payments against them. The default view displays all unmatched invoices and payments, giving you an overview of what is outstanding. To raise an invoice, click the \\u2018Raise Invoice\\u2019 button.\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.expenses.overview.html', '
    \\r\\n
    \\r\\n
    \\r\\n Personally Paid Expenses & Mileage\\r\\n
    \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n Monthly Analysis\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n You have no expenses to display\\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    There was a problem loading your data.
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.invoicing.overview.html', '
    \\r\\n
    \\r\\n
    \\r\\n {{$ctrl.appSettings.invoiceTitle}}\\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n Overview\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    Latest {{$ctrl.appSettings.invoiceTitle}}
    \\r\\n {{latestInvoice.date | bkShortDate:\"DD/MM/YYYY\"}}\\r\\n \\r\\n \\r\\n {{latestInvoice.description}}\\r\\n \\r\\n \\r\\n {{latestInvoice.status}}\\r\\n \\r\\n {{latestInvoice.gross | currency: \"\"}}\\r\\n
    \\r\\n No latest invoices.\\r\\n
    \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n Latest Payments\\r\\n
    \\r\\n {{latestPayment.date | bkShortDate:\"DD/MM/YYYY\"}}\\r\\n \\r\\n \\r\\n {{latestPayment.description}}\\r\\n \\r\\n \\r\\n {{latestPayment.gross | currency: \"\"}}\\r\\n
    \\r\\n No latest payments.\\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    There was a problem loading your data.
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n Any invoices raised or remittances submitted will be displayed, along with any payments against them. The default view displays all unmatched invoices and payments, giving you an overview of what is outstanding. To raise an invoice, click the \\u2018Raise Invoice\\u2019 button.\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.invoicing.umb.detail.html', '
    \\r\\n\\r\\n
    \\r\\n View Payslips\\r\\n Raise Timesheet \\r\\n
    \\r\\n Pay tracker\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    Timesheet IDWeek EndingAgencyTotalPayslip Period
    \\r\\n {{latestTimesheet.timesheetID}}\\r\\n \\r\\n {{latestTimesheet.timesheetEndDate | bkShortDate:\"DD MMM YYYY\"}}\\r\\n \\r\\n \\r\\n {{latestTimesheet.agencyName}}\\r\\n \\r\\n \\r\\n {{latestTimesheet.timesheetValue | currency: \"\"}}\\r\\n \\r\\n {{latestTimesheet.payYear}}-{{latestTimesheet.payPeriod}}\\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n No latest Timesheets.\\r\\n
    \\r\\n \\r\\n You currently have no Timesheets Raise Timesheet\\r\\n\\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    There was a problem loading your data.
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n Any invoices raised or remittances submitted will be displayed, along with any payments against them. The default view displays all unmatched invoices and payments, giving you an overview of what is outstanding. To raise an invoice, click the \\u2018Raise Invoice\\u2019 button.\\r\\n
    \\r\\n
    \\r\\n\\r\\n\\r\\n');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.key-dates.html', '
    \\r\\n
    \\r\\n
    \\r\\n Key Dates\\r\\n
    \\r\\n \\r\\n \\r\\n Key Dates\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
      \\r\\n
    • \\r\\n
      \\r\\n {{taskAction.deadline | bkShortDate: \\'DD/MM/YYYY\\'}}\\r\\n
      {{taskAction.taskTitle}}
      \\r\\n

      {{taskAction.actionTitle}}

      \\r\\n
      \\r\\n
    • \\r\\n
    • \\r\\n No key dates to be displayed\\r\\n
    • \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    There was a problem loading your data.
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.money-manager.money-available.html', '
    \\r\\n
    \\r\\n
    \\r\\n Money Available\\r\\n
    \\r\\n \\r\\n \\r\\n {{::$ctrl.data.getLastReconciledDate | date:\\'dd/MM/yyyy\\'}}\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    Available funds balance statement£ Balance
    Money in Bank{{($ctrl.data.moneyManagerFinancialData.moneyInBank | number:2) || \\'0\\'}}
    Unpaid Invoices / Unmatched cash{{($ctrl.data.moneyManagerFinancialData.unpaidInvoicesCashUnmatched | number:2) || \\'0\\'}}
    PAYE / NICs{{($ctrl.data.moneyManagerFinancialData.paye | number:2) || \\'0\\'}}
    Corporation Tax Previous Year{{($ctrl.data.moneyManagerFinancialData.corporationTaxPreviousYear | number:2) || \\'0\\'}}
    Corporation Tax Current Year{{($ctrl.data.moneyManagerFinancialData.corporationTax | number:2) || \\'0\\'}}
    VAT{{($ctrl.data.moneyManagerFinancialData.vat | number:2) || \\'0\\'}}
    Other Total {{($ctrl.data.moneyManagerFinancialData.otherBreakdownTotal | number:2) || \\'0\\'}}
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    Funds Including Unpaid Invoices{{($ctrl.data.moneyManagerFinancialData.fundsIncludingUnpaidInvoices | number:2) || \\'0\\'}}
    Less: unpaid invoices\\r\\n \\r\\n {{($ctrl.data.moneyManagerFinancialData.lessUnpaidInvoices | number:2) || \\'0\\'}}\\r\\n \\r\\n
    Total Money Available{{($ctrl.data.moneyManagerFinancialData.totalMoneyAvailable | currency:\"\\xA3\":2) || \\'0\\'}}
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    Other Breakdown£
    Employee Wages{{($ctrl.data.moneyManagerFinancialData.employeeWages | number:2) || \\'0\\'}}
    Bank Loans & Finance{{($ctrl.data.moneyManagerFinancialData.bankLoansFinance | number:2) || \\'0\\'}}
    Pension Provider{{($ctrl.data.moneyManagerFinancialData.pensionProvider | number:2) || \\'0\\'}}
    Accountancy Fees{{($ctrl.data.moneyManagerFinancialData.accountancyFees | number:2) || \\'0\\'}}
    CIS Provision{{($ctrl.data.moneyManagerFinancialData.cisProvision | number:2) || \\'0\\'}}
    Other Amounts{{($ctrl.data.moneyManagerFinancialData.otherAmounts | number:2) || \\'0\\'}}
    Other Breakdown Total{{($ctrl.data.moneyManagerFinancialData.otherBreakdownTotal | currency:\"\\xA3\":2) ||\\r\\n \\'0\\'}}
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    There was a problem loading your data.
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.open-banking.html', '
    \\r\\n
    \\r\\n
    \\r\\n Banking\\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n Bank Accounts\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Help\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \"{{::bank}}\"\\r\\n\\r\\n \\r\\n
    {{::accounts[0].bankName}}
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n {{::bankAccount.accountType}} {{::bankAccount.type}} Account - {{$ctrl.maskedBankAccountNumber(bankAccount)}}\\r\\n
    \\r\\n
    \\r\\n {{::bankAccount.availableBalance | currency : \\'\\xA3\\'}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Amount as of {{::bankAccount.reconciliationDate | date: \\'dd MMM yyyy\\'}}\\r\\n
    \\r\\n
    \\r\\n \\r\\n {{bankAccount.viewAccessDescription}}\\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Bank Statement Pending\\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n Your access has expired, use the link below to complete the validation process\\r\\n
    \\r\\n\\r\\n
    \\r\\n Due to a technical issue, your authorisation will need to be completed. Please access using the link below\\r\\n
    \\r\\n\\r\\n
    \\r\\n Registration for Open Banking has not been successful on this occasion. Please try again & if you continue to experience this issue, email our Business Advisory Team on businessadvisors@brookson.co.uk\\r\\n
    \\r\\n\\r\\n
    \\r\\n To ensure your authorisation remains up to date you will be required to re-authenticate your details every 90 days\\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n Pending Update\\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n Re-Consent Due : {{::bankAccount.consentDateDue | date: \\'dd MMM yyyy\\'}}\\r\\n
    \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n

    You currently have no Bank Accounts

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    There was a problem retrieving your bank accounts.
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.personal-tax.tracker.html', '
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Personal Tax Tracker\\r\\n
    \\r\\n \\r\\n \\r\\n Forecast\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    Total income{{$ctrl.personalTaxSrv.incomeSummaryWidgetData.totalIncome() | number : 0}}
    Payment due 31st January {{$ctrl.personalTaxSrv.brooksonUtilitiesDate.taxYearEndByOffset($ctrl.personalTaxSrv.taxYearOffset + 1).year()}}{{$ctrl.personalTaxSrv.taxLiabilityDueWidgetData.paymentOnAccountDueJan() | number: 0}}
    Payment due 31st July {{$ctrl.personalTaxSrv.brooksonUtilitiesDate.taxYearEndByOffset($ctrl.personalTaxSrv.taxYearOffset + 1).year()}}{{$ctrl.personalTaxSrv.taxLiabilityDueWidgetData.paymentOnAccountDueJuly() | number: 0}}
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n We were unable to gather your personal tax data.\\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    There was a problem loading your data.
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n This features is automatically activated when sufficient information exists within Money Manager and will display an estimate of your persona tax bill, as personal tax is payable on dividends that you withdraw from your business.\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.receipt-bank.html', '
    \\r\\n
    \\r\\n
    \\r\\n Receipt Bank\\r\\n
    \\r\\n \\r\\n \\r\\n Unassigned\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n You have {{$ctrl.numberOfReceipts}} unassigned receipts\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    There was a problem loading your data.
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.remus-rewards-button.html', '\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n Brookson Rewards\\r\\n
    \\r\\n
    \\r\\n Error loading Brookson Rewards.\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    There was a problem loading your data.
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.remus-rewards.html', '\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n Explore Brookson Rewards\\r\\n
    \\r\\n
    \\r\\n Error loading Brookson Rewards.\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    There was a problem loading your data.
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.sme.actions-to-take.html', '
    \\r\\n
    \\r\\n
    \\r\\n Manager Zone\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    Overtime to authorize
    Holidays to authorize
    Expenses to authorize
    \\r\\n
    \\r\\n You have no actions to take.\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    There was a problem loading your data.
    \\r\\n
    \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.sme.employees-on-holiday.html', '
    \\r\\n
    \\r\\n
    \\r\\n Employees on Holiday\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    {{holidayRequest.employeeName}}{{holidayRequest.startDate | date: \\'dd-MM-yyyy\\'}}{{holidayRequest.endDate | date: \\'dd-MM-yyyy\\'}}
    \\r\\n\\r\\n
    \\r\\n You have no employees on holiday.\\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    There was a problem loading your data.
    \\r\\n
    \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.sme.last-payslip.html', '
    \\r\\n
    \\r\\n
    \\r\\n Last Payslip\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\xA36,000.00
    \\r\\n
    \\xA33,785.99
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n You haven\\'t received a payslip yet.\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    There was a problem loading your data.
    \\r\\n
    \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.sme.next-holiday.html', '
    \\r\\n
    \\r\\n
    \\r\\n Holidays\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    Remaining holiday allowance: {{$ctrl.remainingHolidayAllowance}}
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    Next Holiday
    Start Date
    End Date
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    Remaining holiday allowance: {{$ctrl.remainingHolidayAllowance}}
    \\r\\n
    \\r\\n You have no holidays coming up.\\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    There was a problem loading your data.
    \\r\\n
    \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.sme.profit-loss.html', '
    \\r\\n
    \\r\\n
    \\r\\n Profit and Loss\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    Description{{$ctrl.startOfPreviousPeriods}} ... {{$ctrl.endOfPreviousPeriods}}{{$ctrl.startOfCurrentPeriod}} ... {{$ctrl.endOfPeriod}}
    TotalRevenue{{$ctrl.previousMonth.totalRevenue | currency: \\'\\xA3\\'}}{{$ctrl.currentMonth.totalRevenue | currency: \\'\\xA3\\'}}
    Total Cost{{$ctrl.previousMonth.totalCost | currency: \\'\\xA3\\'}}{{$ctrl.currentMonth.totalCost | currency: \\'\\xA3\\'}}
    Gross Margin{{$ctrl.previousMonth.grossMargin | currency: \\'\\xA3\\'}}{{$ctrl.currentMonth.grossMargin | currency: \\'\\xA3\\'}}
    Gross Margin %{{$ctrl.previousMonth.grossMarginPercentage | number: 2}}{{$ctrl.currentMonth.grossMarginPercentage | number: 2}}
    Operating Expenses{{$ctrl.previousMonth.operatingExpenses | currency: \\'\\xA3\\'}}{{$ctrl.currentMonth.operatingExpenses | currency: \\'\\xA3\\'}}
    Operating Margin{{$ctrl.previousMonth.operatingExpensesMargin | currency: \\'\\xA3\\'}}{{$ctrl.currentMonth.operatingExpensesMargin | currency: \\'\\xA3\\'}}
    Operating Margin %{{$ctrl.previousMonth.operatingExpensesMarginPercentage | number: 2}}{{$ctrl.currentMonth.operatingExpensesMarginPercentage | number: 2}}
    Other Expenses{{$ctrl.previousMonth.otherExpenses | currency: \\'\\xA3\\'}}{{$ctrl.currentMonth.otherExpenses | currency: \\'\\xA3\\'}}
    Income before Interest and VAT{{$ctrl.previousMonth.incomeBeforeInterestAndVat | currency: \\'\\xA3\\'}}{{$ctrl.currentMonth.incomeBeforeInterestAndVat | currency: \\'\\xA3\\'}}
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    There was a problem loading your data.
    \\r\\n
    \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.task-planner.html', '
    \\r\\n
    \\r\\n
    \\r\\n Planner\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    TypeDescriptionStatusDue Date
    {{::task.taskGroup}}{{::task.actionTitle}}{{::$ctrl.enums.TaskStatus.properties[task.status].description}}{{::task.dueDate|date:\\'dd/MM/yyyy\\'}}
    \\r\\n No tasks to be displayed.\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    There was a problem loading your data.
    \\r\\n
    \\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.umbrella-brookson-adverts.html', '
    \\r\\n
    \\r\\n
    \\r\\n Upgrade\\r\\n Seleted  \\r\\n
    \\r\\n Upgrade to Umbrella Protect Selected\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    £{{ $ctrl.agencyMargin.umbrellaPlusMargin }}pw all these employee benefits:
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \"\"\\r\\n

    Financial Benefits

    \\r\\n

    \\r\\n

      \\r\\n
    • Unlimited financial well being reviews
    • \\r\\n
    • Access to Brookson Financial for initial discussions concerning Mortgages, Investments, Pensions &\\r\\n Insurance.
    • \\r\\n
    \\r\\n

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \"\"\\r\\n

    Benefits Platform

    \\r\\n

    Full access to our benefits platform includes: \\r\\n

      \\r\\n
    • Discounted holidays,
    • \\r\\n
    • Discounted entertainment & activities,
    • \\r\\n
    • Discounted gym and online personal trainer,
    • \\r\\n
    • Cash back on fuel, plus so much more!
    • \\r\\n
    \\r\\n

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \"\"\\r\\n

    Physical Benefits

    \\r\\n

    \\r\\n

      \\r\\n
    • Eye tests & prescriptions
    • \\r\\n
    • Access to private medical care via AXA
    • \\r\\n
    \\r\\n

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \"\"\\r\\n

    Psychological Benefits

    \\r\\n

    \\r\\n

      \\r\\n
    • Employee Assistance Programme
    • \\r\\n
    • Adult / Menopause / Teenage
    • \\r\\n
    • Mental Health Support
    • \\r\\n
    \\r\\n

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n\\r\\n\\r\\n \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.umbrella-financial-adverts.html', '
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \"\"\"\"\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n

    Get Access to a World of Financial Benefits!

    Brookson Financial offers a full range of bespoke financial services for umbrella\\r\\n employees, including\\r\\n mortgages, pensions, and protection. Find out more or book a free initial call.\\r\\n

    \\r\\n

    Learn More   \\r\\n

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n\\r\\n\\r\\n \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.umbrella-whats-app.html', '
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \"\"\\r\\n
    \\r\\n \"\"\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n

    Brookson WhatsApp Service

    \\r\\n

    Pay updates and help at your fingertips

    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n

    Get information on your payments and access our FAQ\\'s quickly with our WhatsApp service, just\\r\\n say\\r\\n \"Hi\" to 01202 835 514\\r\\n

    \\r\\n

    Add to Contacts\\r\\n

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n\\r\\n\\r\\n \\r\\n
    \\r\\n
    ');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.umbrella.faq.html', '
    \\r\\n
    \\r\\n
    \\r\\n Frequently Asked Questions\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n \\r\\n

    How has my payslip been calaculted?

    \\r\\n
    \\r\\n
    \\r\\n \\r\\n

    When will I get paid?

    \\r\\n
    \\r\\n
    \\r\\n \\r\\n

    Why have I not been paid?

    \\r\\n
    \\r\\n
    \\r\\n \\r\\n

    What is pension auto enrolement?

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/widgets/brookson.widgets.umbrella.payalerts.html', '
    \\r\\n
    \\r\\n

    Alerts, updates on pay and requesting a call back

    \\r\\n
    \\r\\n

    We have an automated service whereby you can request updates on your pay, request call backs and submit your timesheet details \\u2013 available through SMS or WhatsApp

    \\r\\n

    Simply reply \\'Hello\\' to +441202835514 by SMS or through WhatsApp to Access the service.

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n');\n $templateCache.put('src/app/shared/views/bank/modals/brookson.bankLink.modals.allocationConfirmation.html', '
    \\r\\n
    \\r\\n

    Confirm your transaction allocations

    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    A/CDateDescriptionCategoryReceiptTotalVATNet
    {{::transaction.transactionDate|bkShortDate:\"DD/MM/YYYY\"}}\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    {{::transaction.debitAmount === undefined ? \\'0\\' : transaction.debitAmount | currency:\"\\xA3\"}}{{::transaction.vat === undefined ? \\'0\\' : transaction.vat | currency:\"\\xA3\"}}{{::transaction.net === undefined ? \\'0\\' : (transaction.net*-1) | currency:\"\\xA3\"}}
    Total Expenses{{::$ctrl.data.confirmedTransactionsTotal | currency:\"\\xA3\"}}
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n

    Warning

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    A/CDateDescriptionCategoryReceiptTotalVATNet
    {{::transaction.transactionDate|bkShortDate:\"DD/MM/YYYY\"}}\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    {{::transaction.debitAmount === undefined ? \\'0\\' : transaction.debitAmount | currency:\"\\xA3\"}}{{::transaction.vat === undefined ? \\'0\\' : transaction.vat | currency:\"\\xA3\"}}{{::transaction.net === undefined ? \\'0\\' : (transaction.net*-1) | currency:\"\\xA3\"}}
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n

    According to our records you have been working at your main worksite for over 24 months therefore you are no longer entitled to claim main site travel expenses. This will also apply for any other associated main site costs you incur such as meals and accommodation. Any such expenses paid for from your business account should now be marked as personal withdrawals on money manager when allocating your payments. You should also not continue to claim for any personally paid expenses that relate to attending your main worksite.

    \\r\\n

    If you do not believe that the 24-month rule applies to this work site because you spend less than 40% of your time there and your attendance is not regular, you can confirm the transactions as expenses. If the expenses are relating to your main worksite, you should confirm the transactions as personal withdrawals going forwards. Please select the relevant option below so we can account for the above transactions accordingly for you.

    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    ');\n }]);\n/// \n(function () {\n 'use strict';\n var appShared = angular.module(\"app.shared\");\n appShared.directive('brooksonBreakpoint', ['ngIfDirective', 'screenSize', function (ngIfDirective, screenSize) {\n /*\n xs - phones\n sm - tables\n md - desktops\n lg - large desktops\n */\n var ngIf = ngIfDirective[0];\n return {\n transclude: ngIf.transclude,\n priority: ngIf.priority,\n terminal: ngIf.terminal,\n restrict: 'A',\n link: function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var show = screenSize.is(args[2].brooksonBreakpoint);\n screenSize.on(args[2].brooksonBreakpoint, function (match) {\n show = match;\n });\n args[2].ngIf = function () {\n return show;\n };\n ngIf.link.apply(ngIf, args);\n }\n };\n }]);\n})();\n(function () {\n 'use strict';\n var appShared = angular.module(\"app.shared\");\n appShared.directive('brooksonInputDatepicker', ['$detection', function ($detection) {\n return {\n restrict: 'AE',\n require: ['^form', '^ngModel'],\n templateUrl: 'src/app/shared/views/inputs/brookson.input.datepicker.html',\n scope: {\n ngModel: '=',\n ngReadonly: '=',\n label: '@',\n field: '@',\n isRequired: '=',\n placeholder: '@',\n ngDisabled: '=',\n minDate: '=',\n maxDate: '=',\n viewOnly: '=',\n ngChange: '=',\n maxCustomMessage: '@?',\n minCustomMessage: '@?',\n max: '=',\n showDateHint: '='\n },\n link: function (scope, el, attrs, requires) {\n scope.form = requires[0];\n scope.format = \"dd/MM/yyyy\";\n scope.useMobileInput = ($detection.isiOS() || $detection.isAndroid() || $detection.isWindowsPhone());\n scope.datepickerStatus = {\n isOpen: false\n };\n scope.openDatepicker = function ($event) {\n scope.datepickerStatus.isOpen = !scope.datepickerStatus.isOpen;\n $event.preventDefault();\n };\n }\n };\n }]);\n appShared.directive('brooksonDatepickerAttr', ['brookson.utilities.date', '$detection', function (dateUtils, $detection) {\n return {\n require: '^ngModel',\n link: function (scope, element, attrs, ctrl) {\n scope.format = \"dd/MM/yyyy\";\n scope.useMobileInput = ($detection.isiOS() || $detection.isAndroid() || $detection.isWindowsPhone());\n attrs.$observe('brooksonDatepickerAttr', function (newValue) {\n if (scope.format === newValue || !ctrl.$modelValue) {\n return;\n }\n scope.format = \"dd/MM/yyyy\";\n ctrl.$modelValue = new Date(ctrl.$setViewValue);\n });\n if (scope.max) {\n ctrl.$validators.max = function (viewValue) {\n if (viewValue > scope.max) {\n scope.form[scope.field].$error.max = scope.maxCustomMessage;\n return false;\n }\n return dateUtils.convertToJsDate(viewValue);\n };\n }\n if (scope.min) {\n ctrl.$validators.min = function (viewValue) {\n if (viewValue > scope.min) {\n scope.form[scope.field].$error.min = scope.minCustomMessage;\n return false;\n }\n return dateUtils.convertToJsDate(viewValue);\n };\n }\n ctrl.$formatters.unshift(function (modelValue) {\n if (!modelValue || modelValue === '' || !dateUtils.isValid(modelValue)) {\n return '';\n }\n return scope.useMobileInput ? dateUtils.convertToJsDate(modelValue) : dateUtils.convertToViewString(modelValue);\n });\n ctrl.$parsers.unshift(function (viewValue) {\n if (!viewValue || viewValue === '' || !dateUtils.isValid(viewValue)) {\n return '';\n }\n return dateUtils.convertToJsDate(viewValue);\n });\n }\n };\n }]);\n})();\n/// \n(function () {\n 'use strict';\n var appShared = angular.module('app.shared');\n appShared.directive('focusOn', function () {\n return function (scope, elem, attr) {\n return scope.$on('focusOn', function (e, name) {\n if (name === attr.focusOn) {\n return elem[0].focus();\n }\n });\n };\n });\n appShared.factory('focus', [\n '$rootScope', '$timeout', (function ($rootScope, $timeout) {\n return function (name) {\n return $timeout(function () {\n return $rootScope.$broadcast('focusOn', name);\n });\n };\n })\n ]);\n})();\nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var SubmitPersonSignificantControl;\n (function (SubmitPersonSignificantControl) {\n SubmitPersonSignificantControl[SubmitPersonSignificantControl[\"NoResponse\"] = 0] = \"NoResponse\";\n SubmitPersonSignificantControl[SubmitPersonSignificantControl[\"Yes\"] = 1] = \"Yes\";\n SubmitPersonSignificantControl[SubmitPersonSignificantControl[\"No\"] = 2] = \"No\";\n })(SubmitPersonSignificantControl = Shared.SubmitPersonSignificantControl || (Shared.SubmitPersonSignificantControl = {}));\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var NavPersonalInformation = /** @class */ (function () {\n function NavPersonalInformation() {\n // JOBTITLE\n this.jobTitle = null;\n // TITLE\n this.title = null;\n // FIRSTNAME\n this.firstName = null;\n // MIDDLENAME\n this.middleName = null;\n // SURNAME\n this.surname = null;\n // FILINGCODE\n this.filingCode = null;\n // HOMEPHONENO\n this.homePhoneNo = null;\n // MOBILEPHONENO\n this.mobilePhoneNo = null;\n // WORKPHONENO\n this.workPhoneNo = null;\n // EMAIL\n this.eMail = null;\n // SMSALERTPREFERENCE\n this.smsAlertPreference = 0;\n // EMAILPAYSLIPSPREFERENCE\n this.emailPayslipsPreference = 0;\n // PREFERREDMETHODOFCONTACT\n this.preferredMethodOfContact = null;\n // ADDRESS\n this.address = null;\n // ADDRESS2\n this.address2 = null;\n // CITY\n this.city = null;\n // COUNTY\n this.county = null;\n // POSTCODE\n this.postcode = null;\n // PASSWORD\n this.password = null;\n // CONFIRMPASSWORD\n this.confirmPassword = null;\n // DOB\n this.dob = null;\n // NINUMBER\n this.niNumber = null;\n // UTRNUMBER\n this.utrNumber = null;\n // NATIONALITY\n this.nationality = null;\n // NATIONALITYOPTION\n this.nationalityOption = null;\n //DOSUBMITPSC\n this.doSubmitPSC = null;\n // Contact Joining Date\n this.contactJoiningDate = null;\n // Contract File Name\n this.contractFileName = null;\n this.tfaEnabled = false;\n this.tfaEnabledAmended = false;\n this.twoFactorDisabledExpiryDate = null;\n this.twoFactorOverrideDate = null;\n }\n return NavPersonalInformation;\n }());\n Shared.NavPersonalInformation = NavPersonalInformation;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var InvoicingAssignmentRate = /** @class */ (function () {\n function InvoicingAssignmentRate() {\n // RATETYPES\n this.rateTypes = [];\n // ASSIGNMENTRATEID\n this.assignmentRateID = 0;\n // RATE\n this.rate = 0;\n // DESCRIPTION\n this.description = null;\n // CURRENCY\n this.currency = null;\n // RATEPERIOD\n this.ratePeriod = null;\n // RATETYPE\n this.rateType = null;\n // PAYMENTCODE\n this.paymentCode = null;\n // STARTDATE\n this.startDate = null;\n // ENDDATE\n this.endDate = null;\n this.chargableDays = 0;\n this.chargableTotal = 0;\n this.totalHoursWorked = 0;\n }\n return InvoicingAssignmentRate;\n }());\n Shared.InvoicingAssignmentRate = InvoicingAssignmentRate;\n var Currencies;\n (function (Currencies) {\n Currencies[Currencies[\"GBP\"] = 10] = \"GBP\";\n Currencies[Currencies[\"EUR\"] = 20] = \"EUR\";\n Currencies[Currencies[\"USD\"] = 30] = \"USD\";\n Currencies[Currencies[\"YEN\"] = 60] = \"YEN\";\n Currencies[Currencies[\"AUD\"] = 70] = \"AUD\";\n Currencies[Currencies[\"CAD\"] = 80] = \"CAD\";\n Currencies[Currencies[\"NOK\"] = 90] = \"NOK\";\n Currencies[Currencies[\"ZAR\"] = 100] = \"ZAR\";\n Currencies[Currencies[\"SEK\"] = 110] = \"SEK\";\n Currencies[Currencies[\"CHF\"] = 120] = \"CHF\";\n Currencies[Currencies[\"AED\"] = 130] = \"AED\";\n })(Currencies = Shared.Currencies || (Shared.Currencies = {}));\n var RatePeriods;\n (function (RatePeriods) {\n RatePeriods[RatePeriods[\"Hour\"] = 0] = \"Hour\";\n RatePeriods[RatePeriods[\"Day\"] = 1] = \"Day\";\n RatePeriods[RatePeriods[\"Week\"] = 2] = \"Week\";\n })(RatePeriods = Shared.RatePeriods || (Shared.RatePeriods = {}));\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var EmployeeRate = /** @class */ (function () {\n function EmployeeRate() {\n // CONTRACTRATEID\n this.contractRateID = 0;\n // EMPLOYEEID\n this.employeeID = 0;\n // RATEDESCRIPTION\n this.rateDescription = null;\n // RATE\n this.rate = 0;\n // STAFFID\n this.staffID = null;\n // STAFFIDM\n this.staffIDM = null;\n // CREATEDDATETIME\n this.createdDateTime = null;\n // YEARKEY\n this.yearKey = 0;\n // ISDAYRATE\n this.isDayRate = false;\n // PAYMENTCODE\n this.paymentCode = null;\n // RATEPERIOD\n this.ratePeriod = null;\n // STARTDATE\n this.startDate = null;\n // ENDDATE\n this.endDate = null;\n // CURRENCY\n this.currency = null;\n }\n return EmployeeRate;\n }());\n Shared.EmployeeRate = EmployeeRate;\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var NavBusinessInformation = /** @class */ (function () {\n function NavBusinessInformation() {\n // COMPANIES\n this.companies = [];\n // EMPLOYEERATES\n this.employeeRates = [];\n }\n return NavBusinessInformation;\n }());\n Shared.NavBusinessInformation = NavBusinessInformation;\n})(Shared || (Shared = {}));\n/// \n/// \nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var NavContactInformation = /** @class */ (function () {\n function NavContactInformation() {\n // PERSONALINFORMATION\n this.personalInformation = null;\n // BUSINESSINFORMATION\n this.businessInformation = null;\n this.twoFactorAuthenticationEnabled = false;\n }\n return NavContactInformation;\n }());\n Shared.NavContactInformation = NavContactInformation;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var AccountType;\n (function (AccountType) {\n AccountType[AccountType[\"unknown\"] = 0] = \"unknown\";\n AccountType[AccountType[\"limitedCompany\"] = 1] = \"limitedCompany\";\n AccountType[AccountType[\"deemed\"] = 99] = \"deemed\";\n AccountType[AccountType[\"soleTrader\"] = 5] = \"soleTrader\";\n AccountType[AccountType[\"umbrella\"] = 3] = \"umbrella\";\n })(AccountType = Shared.AccountType || (Shared.AccountType = {}));\n var MoleAccountType;\n (function (MoleAccountType) {\n MoleAccountType[MoleAccountType[\"unknown\"] = 0] = \"unknown\";\n MoleAccountType[MoleAccountType[\"limitedCompany\"] = 1] = \"limitedCompany\";\n MoleAccountType[MoleAccountType[\"limitedCompany2\"] = 2] = \"limitedCompany2\";\n MoleAccountType[MoleAccountType[\"umbrella\"] = 3] = \"umbrella\";\n MoleAccountType[MoleAccountType[\"cis\"] = 4] = \"cis\";\n MoleAccountType[MoleAccountType[\"soleTrader\"] = 5] = \"soleTrader\";\n })(MoleAccountType = Shared.MoleAccountType || (Shared.MoleAccountType = {}));\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var BankAccount = /** @class */ (function () {\n function BankAccount() {\n // BANKACCOUNTID\n this.bankAccountID = null;\n // BANKNAME\n this.bankName = null;\n // SORTCODE\n this.sortCode = null;\n // ACCOUNTNO\n this.accountNo = null;\n }\n return BankAccount;\n }());\n Shared.BankAccount = BankAccount;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var AssignmentHeader = /** @class */ (function () {\n function AssignmentHeader() {\n // AGENCY\n this.agency = null;\n // DATESTARTED\n this.dateStarted = null;\n // DATEENDED\n this.dateEnded = null;\n // ASSIGNMENTID\n this.assignmentId = null;\n // CLIENT\n this.client = null;\n // ASSIGNMENTNAME\n this.assignmentName = null;\n // INSTRUCTIONTEXT\n this.instructionText = null;\n // OVERALLSTATUSTEXT\n this.overallStatusText = null;\n // ASSIGNMENTADDRESS\n this.assignmentAddress = null;\n // ASSIGNMENTNOTES\n this.assignmentNotes = null;\n // AGENCYREFERENCE\n this.agencyReference = null;\n this.fullAssignmentName = null;\n }\n return AssignmentHeader;\n }());\n Shared.AssignmentHeader = AssignmentHeader;\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var Review = /** @class */ (function () {\n function Review() {\n // REVIEWID\n this.reviewId = 0;\n // CONTRACTRECEIVED\n this.contractReceived = null;\n // RESARECEIVED\n this.resaReceived = null;\n // LEGALREVIEWED\n this.legalReviewed = null;\n // REVIEWCOMPLETED\n this.reviewCompleted = null;\n // RESASTATUS\n this.resaStatus = null;\n // CONTRACTSTATUS\n this.contractStatus = null;\n // FINALOUTCOME\n this.finalOutcome = null;\n // RESADOCUMENT\n this.resaDocument = null;\n // ATTENDANCENOTEDOCUMENT\n this.attendanceNoteDocument = null;\n // CONTRACTDOCUMENT\n this.contractDocument = null;\n // ASSIGNMENTID\n this.assignmentID = null;\n // ASSIGNMENT\n this.assignment = null;\n }\n return Review;\n }());\n Shared.Review = Review;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var Location = /** @class */ (function () {\n function Location() {\n // STARTDATE\n this.startDate = null;\n // EXPECTEDENDDATE\n this.expectedEndDate = null;\n // LASTDAYONSITE\n this.lastDayOnSite = null;\n // SITENAME\n this.siteName = null;\n // ADDRESS1\n this.address1 = null;\n // ADDRESS2\n this.address2 = null;\n // ADDRESS3\n this.address3 = null;\n // CITY\n this.city = null;\n // COUNTY\n this.county = null;\n // POSTCODE\n this.postCode = null;\n }\n return Location;\n }());\n Shared.Location = Location;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var PublicSectorAssignmentCheckButtonPressed;\n (function (PublicSectorAssignmentCheckButtonPressed) {\n PublicSectorAssignmentCheckButtonPressed[PublicSectorAssignmentCheckButtonPressed[\"public\"] = 0] = \"public\";\n PublicSectorAssignmentCheckButtonPressed[PublicSectorAssignmentCheckButtonPressed[\"private\"] = 1] = \"private\";\n PublicSectorAssignmentCheckButtonPressed[PublicSectorAssignmentCheckButtonPressed[\"notrequired\"] = 2] = \"notrequired\";\n })(PublicSectorAssignmentCheckButtonPressed = Shared.PublicSectorAssignmentCheckButtonPressed || (Shared.PublicSectorAssignmentCheckButtonPressed = {}));\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var JobTitle = /** @class */ (function () {\n function JobTitle() {\n }\n return JobTitle;\n }());\n Shared.JobTitle = JobTitle;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var EnumObj = /** @class */ (function () {\n function EnumObj(name, id) {\n this.name = name;\n this.id = id;\n }\n return EnumObj;\n }());\n Shared.EnumObj = EnumObj;\n})(Shared || (Shared = {}));\n/// \n/// \n/// \n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var Assignment = /** @class */ (function (_super) {\n __extends(Assignment, _super);\n function Assignment() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n // RATETYPES\n _this.rateTypes = [];\n // MEMBERID\n _this.memberId = 0;\n // HASIR35QUESTIONNAIRE\n _this.hasIR35Questionnaire = false;\n // IR35QUESTIONNAIRECOMPLETE\n _this.iR35QuestionnaireComplete = false;\n // COMPANY\n _this.company = null;\n // MEMBERADVISEDSTATUSOLD\n _this.memberAdvisedStatusOld = null;\n // REVIEWS\n _this.reviews = [];\n // PREFERREDEMAILADDRESSES\n _this.preferredEmailAddresses = [];\n // LOCATIONS\n _this.locations = [];\n _this.isAssignment24MonthRuleReclaimable = false;\n _this.sdcStatus = 0;\n _this.publicSector = null;\n _this.jobTitleOption = null;\n _this.jobTitle = null;\n _this.industry = null;\n _this.iR35CapturedFromDate = null;\n _this.iR35CapturedEffectiveDate = null;\n _this.showExpensesPopup = false;\n return _this;\n }\n return Assignment;\n }(Shared.AssignmentHeader));\n Shared.Assignment = Assignment;\n var Sectors;\n (function (Sectors) {\n Sectors[Sectors[\"public\"] = 0] = \"public\";\n Sectors[Sectors[\"private\"] = 1] = \"private\";\n Sectors[Sectors[\"nolongerinuse\"] = 2] = \"nolongerinuse\";\n })(Sectors = Shared.Sectors || (Shared.Sectors = {}));\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var Customer = /** @class */ (function () {\n function Customer() {\n // CUSTOMERNUMBER\n this.customerNumber = null;\n // CUSTOMERNAME\n this.customerName = null;\n // CUSTOMERADDRESS\n this.customerAddress = null;\n // CUSTOMERADDRESSOBJ\n this.customerAddressObj = null;\n // CONTACTNAME\n this.contactName = null;\n // CONTACTNUMBER\n this.contactNumber = null;\n // BILLINGADDRESS\n this.billingAddress = null;\n // BILLINGADDRESSOBJ\n this.billingAddressObj = null;\n // ASSIGNMENTS\n this.assignments = [];\n this.umbTimesheetDisabled = 0;\n }\n return Customer;\n }());\n Shared.Customer = Customer;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var Address = /** @class */ (function () {\n function Address() {\n this.name = null;\n // ADDRESSLINE1\n this.addressLine1 = null;\n // ADDRESSLINE2\n this.addressLine2 = null;\n // ADDRESSLINE3\n this.addressLine3 = null;\n // TOWN\n this.town = null;\n // COUNTY\n this.county = null;\n // POSTCODE\n this.postcode = null;\n // COUNTRY\n this.country = null;\n }\n return Address;\n }());\n Shared.Address = Address;\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var NamedAddress = /** @class */ (function (_super) {\n __extends(NamedAddress, _super);\n function NamedAddress() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n // NAME\n _this.name = null;\n return _this;\n }\n return NamedAddress;\n }(Shared.Address));\n Shared.NamedAddress = NamedAddress;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var VatBusinessPostingGroup;\n (function (VatBusinessPostingGroup) {\n // \"\"\n VatBusinessPostingGroup[VatBusinessPostingGroup[\"Blank\"] = 0] = \"Blank\";\n // \"EU\"\n VatBusinessPostingGroup[VatBusinessPostingGroup[\"EU\"] = 1] = \"EU\";\n // \"EXEMPT\"\n VatBusinessPostingGroup[VatBusinessPostingGroup[\"EXEMPT\"] = 2] = \"EXEMPT\";\n // \"UK\"\n VatBusinessPostingGroup[VatBusinessPostingGroup[\"UK\"] = 3] = \"UK\";\n // \"NON EU\"\n VatBusinessPostingGroup[VatBusinessPostingGroup[\"NONEU\"] = 4] = \"NONEU\";\n })(VatBusinessPostingGroup = Shared.VatBusinessPostingGroup || (Shared.VatBusinessPostingGroup = {}));\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var VatProdPostingGroup;\n (function (VatProdPostingGroup) {\n // \"\"\n VatProdPostingGroup[VatProdPostingGroup[\"Blank\"] = 0] = \"Blank\";\n // \"EXEMPT\"\n VatProdPostingGroup[VatProdPostingGroup[\"EXEMPT\"] = 1] = \"EXEMPT\";\n // \"VAT10\"\n VatProdPostingGroup[VatProdPostingGroup[\"VAT10\"] = 2] = \"VAT10\";\n // \"VAT17\"\n VatProdPostingGroup[VatProdPostingGroup[\"VAT17\"] = 3] = \"VAT17\";\n // \"VAT5\"\n VatProdPostingGroup[VatProdPostingGroup[\"VAT5\"] = 4] = \"VAT5\";\n // \"ZERO\"\n VatProdPostingGroup[VatProdPostingGroup[\"ZERO\"] = 5] = \"ZERO\";\n })(VatProdPostingGroup = Shared.VatProdPostingGroup || (Shared.VatProdPostingGroup = {}));\n})(Shared || (Shared = {}));\n/// \n/// \n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var InvoicingAssignment = /** @class */ (function (_super) {\n __extends(InvoicingAssignment, _super);\n function InvoicingAssignment() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n // RATES\n _this.rates = [];\n // CUSTOMER\n _this.customer = null;\n // CURRENCYCODE\n _this.currencyCode = 0;\n // ISSELFBILLING\n _this.isSelfBilling = false;\n // NARRATIVE\n _this.narrative = null;\n // PONUMBER\n _this.poNumber = null;\n // DEEMED\n _this.deemed = false;\n // REMITTANCEADDRESS\n _this.remittanceAddress = null;\n // COMPANYNO\n _this.companyNo = null;\n // VATNO\n _this.vatNo = null;\n // ISRAISEDINERROR\n _this.isRaisedInError = false;\n // VATREGSTATUS\n _this.vatRegStatus = 0;\n _this.defaultHours = 0;\n _this.invoiceDistributionEnabled = false;\n return _this;\n }\n return InvoicingAssignment;\n }(Shared.Assignment));\n Shared.InvoicingAssignment = InvoicingAssignment;\n})(Shared || (Shared = {}));\n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var NavCompanyInformation = /** @class */ (function () {\n function NavCompanyInformation() {\n // COMPANYTYPE\n this.companyType = null;\n // COMPANYNAME\n this.companyName = null;\n // COMPANYREGISTRATIONNO\n this.companyRegistrationNo = null;\n // COMPANYREFERENCE\n this.companyReference = null;\n // DIRECTORSNAME\n this.directorsName = null;\n // VATREGISTRATIONNO\n this.vatRegistrationNo = null;\n // BANKACCOUNTS\n this.bankAccounts = [];\n // ASSIGNMENTS\n this.assignments = [];\n //CORPORATIONTAXREFNO\n this.corporationTaxRefNo = null;\n }\n return NavCompanyInformation;\n }());\n Shared.NavCompanyInformation = NavCompanyInformation;\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var Member = /** @class */ (function () {\n function Member() {\n // MEMBERID\n this.memberID = 0;\n // ALTMEMBERID\n this.altMemberID = 0;\n // FIRSTNAME\n this.firstname = null;\n // LASTNAME\n this.lastname = null;\n // EMAIL\n this.email = null;\n // GROUPS\n this.groups = null;\n // USERNAME\n this.username = null;\n // PERSONALTAXACTIVE\n this.personalTaxActive = false;\n // COMPANYREF\n this.companyRef = null;\n // USERTYPE\n this.userType = 0;\n // ACCOUNTTYPE\n this.accountType = null;\n // USESTSTYLEINVOICING\n this.useSTStyleInvoicing = false;\n // ISACTIVE\n this.isActive = false;\n // DATEOFBIRTH\n this.dateOfBirth = null;\n // CREATEDDATE\n this.createdDate = null;\n this.businessType = null;\n this.role = null;\n this.connect2Enabled = false;\n this.companyName = null;\n }\n return Member;\n }());\n Shared.Member = Member;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var StatePensionAge = /** @class */ (function () {\n function StatePensionAge() {\n }\n return StatePensionAge;\n }());\n Shared.StatePensionAge = StatePensionAge;\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n var IR35AssessmentAnswers = /** @class */ (function () {\n function IR35AssessmentAnswers() {\n }\n return IR35AssessmentAnswers;\n }());\n Shared.IR35AssessmentAnswers = IR35AssessmentAnswers;\n})(Shared || (Shared = {}));\n/// \n/// \n/// \n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var MemberModel = /** @class */ (function () {\n function MemberModel() {\n this.userName = \"\";\n this.token = \"\";\n this.refreshToken = \"\";\n this.isAdmin = false;\n this.isAuthenticated = false;\n this.memberId = \"\";\n this.useRefreshToken = false;\n this.hasUmbBusinessType = false;\n this.hasLtdBusinessType = false;\n this.hasMulipleLtdCompanies = false;\n this.umbCustomerReference = \"\";\n this.ltdCustomerReference = \"\";\n this.companyRef = \"\";\n this.businessType = \"\";\n this.role = \"\";\n this.expires = \"\";\n this.refreshTokenExpires = \"\";\n this.navReferral = \"\";\n this.companyName = \"\";\n this.apiKeySource = \"\";\n }\n return MemberModel;\n }());\n Shared.MemberModel = MemberModel;\n var MemberService = /** @class */ (function () {\n function MemberService($injector, localStorageService, analytics) {\n var _this = this;\n this.$injector = $injector;\n this.localStorageService = localStorageService;\n this.analytics = analytics;\n this.isMiniConnectUser = function () {\n if (_this.member.serviceLines) {\n var line = _.filter(_this.member.serviceLines, function (o) { return o.customerReference === _this.member.companyRef; });\n if (line.length > 0) {\n if ((line[0].isSecondShareholder === true) || ((line[0].isEligible === true) && (line[0].isActive === false))) {\n return true;\n }\n }\n }\n return false;\n };\n this.companyName = function () {\n if (_this.member.serviceLines) {\n var line = _.filter(_this.member.serviceLines, function (o) { return o.customerReference === _this.member.companyRef; });\n if (line[0]) {\n return line[0].companyName;\n }\n if (_this.member.companyName) {\n return _this.member.companyName;\n }\n }\n };\n this.setMember = function (data) {\n //set in memory values\n _this.member = _.assign(_this.member, data);\n _this.member.businessType = _this.getMemberBusinessType();\n //persist changes\n _this.localStorageService.set(\"brookson.member\", _this.member);\n _this.analytics.set(\"dimension1\", _this.member.memberId);\n _this.analytics.set(\"dimension2\", _this.member.businessType);\n _this.analytics.set(\"dimension3\", _this.member.companyRef);\n _this.analytics.set(\"dimension4\", _this.member.isAdmin ? \"Y\" : \"N\");\n return _this.member;\n };\n this.getMember = function () {\n if (!_this.member || !_this.member.userName) {\n var store = _this.localStorageService.get(\"brookson.member\");\n if (store) {\n _this.member = store;\n }\n }\n return _this.member;\n };\n this.getMemberBusinessType = function () {\n var member = _this.member;\n // If there's service lines, return the one matching business type from here\n if (member.serviceLines) {\n var line = _.filter(member.serviceLines, function (o) { return o.customerReference === member.companyRef; });\n if (line[0]) {\n return line[0].businessType;\n }\n else {\n return member.businessType;\n }\n }\n else {\n return member.businessType;\n }\n };\n this.updateMember = function (data) {\n return _this.setMember(data);\n };\n this.clearMember = function () {\n _this.member = null;\n _this.localStorageService.set(\"brookson.member\", {});\n _this.localStorageService.set(\"brookson.dashboard\", {});\n };\n this.getMemberDetails = function (silentMode, cached) {\n _this.$http = _this.$http || _this.$injector.get('$http');\n return _this.$http.get('api/Member/GetMemberDetails', {\n silentMode: silentMode ? silentMode : silentMode,\n cache: cached ? cached : false\n }).then(function (response) {\n return response.data;\n });\n };\n this.getPensionAge = function (silentMode, cached) {\n var config = {\n silentMode: silentMode ? silentMode : false,\n cache: cached ? cached : false\n };\n return _this.$http.get('api/Member/PensionAge', config).then(function (response) {\n return response.data;\n });\n };\n this.member = new MemberModel();\n }\n MemberService.prototype.getHasAdvisoryKeyInformation = function (silentMode, cached) {\n var config = {\n silentMode: silentMode ? silentMode : false,\n cache: cached ? cached : false\n };\n var hasAdvisor = this.$http.get('api/Advisory/HasAdvisoryKeyInformation', config).then(function (response) {\n return response.data;\n });\n return hasAdvisor;\n };\n MemberService.prototype.getHasAdvisoryKeyInformationUmbrella = function (silentMode, cached) {\n var config = {\n silentMode: silentMode ? silentMode : false,\n cache: cached ? cached : false\n };\n var hasAdvisor = this.$http.get('api/Advisory/HasAdvisoryKeyInformationUmbrella', config).then(function (response) {\n return response.data;\n });\n return hasAdvisor;\n };\n MemberService.prototype.showMemberMTD = function () {\n return this.$http.get('api/Member/ShowMemberMTD').then(function (response) {\n return response.data;\n });\n };\n MemberService.prototype.insertAuthorsationCode = function (authorisationCode) {\n var requestData = {\n authorisationCode: authorisationCode\n };\n return this.$http.post('api/Member/InsertMTDAuthorisationCode', requestData)\n .then(function (response) {\n return response.data;\n });\n };\n MemberService.$inject = ['$injector', \"localStorageService\", 'Analytics'];\n return MemberService;\n }());\n Shared.MemberService = MemberService;\n})(Shared || (Shared = {}));\nangular.module('app.shared').service('memberSrv', Shared.MemberService);\nvar Shared;\n(function (Shared) {\n var NAVNationality = /** @class */ (function () {\n function NAVNationality() {\n this.code = null;\n this.nationality = null;\n }\n return NAVNationality;\n }());\n Shared.NAVNationality = NAVNationality;\n})(Shared || (Shared = {}));\n/// \n/// \n/// \n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var AccountService = /** @class */ (function () {\n function AccountService($http, memberSrv) {\n var _this = this;\n this.$http = $http;\n this.memberSrv = memberSrv;\n this.getAccountDetailsForUser = function () {\n return _this.$http.get('api/Account/GetAccountDetailsForUser').then(function (response) {\n if (response.data) {\n _this.personalInformation = response.data.personalInformation;\n _this.businessInformation = response.data.businessInformation;\n _this.company = _.find(response.data.businessInformation.companies, function (company) {\n return company.companyReference === _this.member.companyRef;\n });\n _.each(_this.company.bankAccounts, function (bankAccount) {\n bankAccount.bankName = bankAccount.bankName.toLowerCase();\n });\n }\n return response.data;\n });\n };\n this.updateAccountDetailsForUser = function (personalInformation, password) {\n return _this.$http.post('api/Account/UpdateAccountDetailsForUser', {\n personalInformation: personalInformation,\n password: password\n }).then(function (response) {\n return response.data;\n });\n };\n this.getNationalities = function (silentMode) {\n return _this.$http.get('api/Account/GetNationalities', {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n };\n this.getCommonPasswords = function (silentMode) {\n return _this.$http.get('api/Account/common-passwords', {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n };\n this.member = memberSrv.getMember();\n }\n AccountService.$inject = ['$http', 'memberSrv'];\n return AccountService;\n }());\n Shared.AccountService = AccountService;\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .service('accountSrv', Shared.AccountService);\n/// \n/// \nvar _this = this;\n(function () {\n 'use strict';\n var appShared = angular.module(\"app.shared\");\n appShared.directive('brooksonInputText', function () {\n return {\n restrict: 'AE',\n require: '^form',\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text.html',\n scope: {\n ngModel: '=',\n label: '@',\n field: '@',\n isRequired: '@',\n ngReadonly: '=',\n ngChange: '=',\n ngMinlength: '=',\n ngMaxlength: '=',\n ngDisabled: '=',\n placeholder: '@',\n ngPattern: '=',\n ngPatternMessage: '@',\n viewOnly: '='\n },\n link: function (scope, el, attrs, formCtrl) {\n scope.form = formCtrl;\n },\n controller: [\n \"$scope\", function ($scope) {\n $scope.inputType = 'text';\n // $scope.expression = /^\\d{2}$/;\n // $scope.expression = $scope.ngPattern;\n }\n ]\n };\n });\n appShared.directive('brooksonInputEmail', function () {\n return {\n restrict: 'AE',\n require: '^form',\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text.html',\n scope: {\n ngModel: '=',\n label: '@',\n field: '@',\n isRequired: '@',\n ngReadonly: '=',\n ngChange: '=',\n ngDisabled: '=',\n ngMinlength: '=',\n placeholder: '@',\n viewOnly: '='\n },\n link: function (scope, el, attrs, formCtrl) {\n scope.form = formCtrl;\n },\n controller: [\n \"$scope\", function ($scope) {\n $scope.inputType = 'email';\n }\n ]\n };\n });\n appShared.directive('brooksonInputPasswords', function () {\n return {\n restrict: 'AE',\n require: '^form',\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text.html',\n scope: {\n ngModel: '=',\n label: '@',\n field: '@',\n isRequired: '@',\n ngReadonly: '=',\n ngChange: '=',\n ngDisabled: '=',\n placeholder: '@',\n viewOnly: '='\n },\n link: function (scope, el, attrs, formCtrl) {\n scope.form = formCtrl;\n },\n controller: [\n \"$scope\", function ($scope) {\n $scope.inputType = 'password';\n $scope.ngMinlength = 8;\n }\n ]\n };\n });\n appShared.directive('brooksonInputPasswordStrength', function () {\n return {\n restrict: 'AE',\n require: '^form',\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text.password.html',\n scope: {\n ngModel: '=',\n label: '@',\n field: '@',\n isRequired: '@',\n ngReadonly: '=',\n ngChange: '=',\n ngDisabled: '=',\n placeholder: '@',\n viewOnly: '='\n },\n link: function (scope, el, attrs, formCtrl) {\n scope.form = formCtrl;\n var commonPasswords = [];\n scope.accountSrv.getCommonPasswords(true).then(function (data) {\n commonPasswords = data;\n });\n var ngModelController = el.controller('ngModel');\n // Watch the password input field\n scope.$watch('ngModel', function (password) {\n password = password ? password.toString() : '';\n // Reset validity and messages for empty password\n if (!password) {\n scope.vm.strengthMessage = '';\n scope.vm.strengthClass = '';\n scope.vm.isWeakPassword = true;\n scope.vm.hasTyped = false;\n scope.vm.isCommonPassword = false;\n ngModelController.$setValidity('brooksonInputPasswordStrength', true); // Reset to valid\n return;\n }\n scope.vm.hasTyped = true;\n var strength = 0;\n // Check if the password is common\n if (commonPasswords.indexOf(password.trim()) !== -1) {\n ngModelController.$setValidity('brooksonInputPasswordStrength', false);\n scope.vm.strengthMessage = 'Weak (Common Password)';\n scope.vm.strengthClass = 'strength-weak';\n scope.vm.isWeakPassword = true;\n return;\n }\n scope.vm.isCommonPassword = false;\n // Check password strength criteria\n if (password.length >= 8)\n strength++;\n if (/[A-Z]/.test(password))\n strength++;\n if (/[a-z]/.test(password))\n strength++;\n if (/[0-9]/.test(password))\n strength++;\n if (/[\\W]/.test(password))\n strength++;\n // Set validity and strength messages based on criteria\n if (strength <= 2) {\n ngModelController.$setValidity('brooksonInputPasswordStrength', false);\n scope.vm.strengthMessage = 'Weak';\n scope.vm.strengthClass = 'strength-weak';\n scope.vm.isWeakPassword = true;\n }\n else if (strength === 3) {\n ngModelController.$setValidity('brooksonInputPasswordStrength', true);\n scope.vm.strengthMessage = 'Medium';\n scope.vm.strengthClass = 'strength-medium';\n scope.vm.isWeakPassword = false;\n }\n else if (strength > 3) {\n ngModelController.$setValidity('brooksonInputPasswordStrength', true);\n scope.vm.strengthMessage = 'Strong';\n scope.vm.strengthClass = 'strength-strong';\n scope.vm.isWeakPassword = false;\n }\n });\n },\n controller: [\n \"$scope\", \"accountSrv\", function ($scope, accountSrv) {\n $scope.vm = {\n strengthMessage: '',\n strengthClass: '',\n isWeakPassword: true,\n hasTyped: false,\n isCommonPassword: false\n };\n $scope.inputType = 'password';\n $scope.ngMinlength = 8;\n $scope.accountSrv = accountSrv;\n }\n ]\n };\n });\n appShared.directive('brooksonInputPasswordStrength2', function () {\n return {\n restrict: 'AE',\n require: '^form',\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text.password.html', // Assuming you have a template for the password strength indicator\n scope: {\n ngModel: '=',\n label: '@',\n field: '@',\n isRequired: '@',\n ngReadonly: '=',\n ngChange: '=',\n ngDisabled: '=',\n placeholder: '@',\n viewOnly: '='\n },\n link: function (scope, el, attrs, formCtrl) {\n scope.form = formCtrl;\n var commonPasswords = [];\n scope.accountSrv.getCommonPasswords(true).then(function (data) {\n commonPasswords = data;\n });\n var ngModelController = el.controller('ngModel');\n // Watch the password input field\n scope.$watch('ngModel', function (password) {\n password = password ? password.toString() : '';\n if (!password) {\n scope.vm.strengthMessage = '';\n scope.vm.strengthClass = '';\n scope.vm.isWeakPassword = true;\n scope.vm.hasTyped = false;\n scope.vm.isCommonPassword = false;\n return;\n }\n scope.vm.hasTyped = true;\n var strength = 0;\n if (commonPasswords.indexOf(password.trim()) !== -1) {\n //ngModelController.$setValidity('brooksonInputPasswordStrength', false);\n scope.form.$setValidity('brooksonInputPasswordStrength', false);\n scope.vm.strengthMessage = 'Very Weak (Common Password)';\n scope.vm.strengthClass = 'strength-weak';\n scope.vm.isWeakPassword = true;\n scope.vm.isCommonPassword = true;\n return;\n }\n scope.vm.isCommonPassword = false;\n if (password.length >= 8)\n strength++;\n if (/[A-Z]/.test(password))\n strength++;\n if (/[a-z]/.test(password))\n strength++;\n if (/[0-9]/.test(password))\n strength++;\n if (/[\\W]/.test(password))\n strength++;\n if (strength <= 2) {\n ngModelController.$setValidity('brooksonInputPasswordStrength', false);\n //scope.form.$setValidity('brooksonInputPasswordStrength', false);\n scope.vm.strengthMessage = 'Weak';\n scope.vm.strengthClass = 'strength-weak';\n scope.vm.isWeakPassword = true;\n }\n else if (strength === 3) {\n ngModelController.$setValidity('brooksonInputPasswordStrength', true);\n scope.vm.strengthMessage = 'Medium';\n scope.vm.strengthClass = 'strength-medium';\n scope.vm.isWeakPassword = false;\n }\n else if (strength > 3) {\n ngModelController.$setValidity('brooksonInputPasswordStrength', true);\n scope.vm.strengthMessage = 'Strong';\n scope.vm.strengthClass = 'strength-strong';\n scope.vm.isWeakPassword = false;\n }\n });\n ngModelController.$parsers.push(ngModelController);\n },\n controller: [\n \"$scope\", \"accountSrv\", function ($scope, accountSrv) {\n $scope.vm = {\n strengthMessage: '',\n strengthClass: '',\n isWeakPassword: true,\n hasTyped: false,\n isCommonPassword: false\n };\n $scope.inputType = 'password';\n $scope.ngMinlength = 8;\n $scope.accountSrv = accountSrv;\n }\n ]\n };\n });\n appShared.directive('brooksonInputPassword', function () {\n return {\n restrict: 'AE',\n require: '^form',\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text.password.html',\n scope: {\n ngModel: '=',\n label: '@',\n field: '@',\n isRequired: '@',\n ngReadonly: '=',\n ngChange: '=',\n ngDisabled: '=',\n placeholder: '@',\n viewOnly: '='\n },\n link: function (scope, el, attrs, formCtrl) {\n scope.form = formCtrl;\n },\n controller: [\n \"$scope\", function ($scope) {\n $scope.inputType = 'password';\n $scope.ngMinlength = 8;\n }\n ]\n };\n });\n appShared.directive('brooksonInputSelect', function () {\n return {\n restrict: 'AE',\n require: '^form',\n templateUrl: 'src/app/shared/views/inputs/brookson.input.select.html',\n scope: {\n ngModel: '=',\n ngChange: '=',\n ngDisabled: '=',\n optionsData: '=',\n optionsExpression: '@',\n field: '@',\n isRequired: '@',\n label: '@',\n ngRepeat: '@',\n defaultOption: '@',\n additionalData: '=',\n noDefault: '=',\n showSpinner: '=',\n viewOnly: '=',\n viewOnlyProperty: '@'\n },\n link: function (scope, el, attrs, formCtrl) {\n scope.form = formCtrl;\n scope.ngModelIsAnObject = false;\n if (!scope.defaultOption) {\n scope.defaultOption = \"-- Please Select --\";\n }\n scope.$watch(\"ngModel\", function (newValue, oldValue) {\n if (scope.viewOnly) {\n scope.ngModelIsAnObject = _.isObject(newValue);\n }\n });\n }\n };\n });\n appShared.directive('brooksonInputSelectSearch', function () {\n return {\n restrict: 'AE',\n require: '^form',\n templateUrl: 'src/app/shared/views/inputs/brookson.input.select-search.html',\n scope: {\n ngModel: '=',\n ngChange: '=',\n ngDisabled: '=',\n optionsData: '=',\n optionsExpression: '@',\n field: '@',\n isRequired: '@',\n label: '@',\n ngRepeat: '@',\n defaultOption: '@',\n additionalData: '=',\n noDefault: '=',\n showSpinner: '=',\n viewOnly: '=',\n viewOnlyProperty: '@',\n typeaheadValue: '@'\n },\n link: function (scope, el, attrs, formCtrl) {\n scope.form = formCtrl;\n }\n };\n });\n appShared.directive('brooksonNumber', function () {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function (scope, element, attrs, ngModel) {\n //format text going to user (model to view)\n ngModel.$formatters.push(function (value) {\n if (value === 0) {\n if (attrs.showZero) {\n return 0;\n }\n return null;\n }\n if (!value || isNaN(value))\n return value;\n //return _.round(value, 2);\n return value;\n });\n //format text from the user (view to model)\n ngModel.$parsers.push(function (value) {\n if (!value || isNaN(value))\n return value;\n //return _.round(value, 2);\n return value;\n });\n element.bind('mousewheel', function () {\n element.blur();\n });\n }\n };\n });\n appShared.directive('brooksonInputNumber', ['$timeout', function ($timeout) {\n return {\n restrict: 'AE',\n require: ['^form', '^ngModel'],\n templateUrl: 'src/app/shared/views/inputs/brookson.input.number.html',\n scope: {\n ngModel: '=',\n label: '@',\n currencyCode: '=',\n field: '@',\n isRequired: '=',\n ngReadonly: '=',\n ngChange: '&',\n ngMin: '=',\n ngDisabled: '=',\n placeholder: '@',\n step: '=?',\n wholeNumber: '=',\n showZero: '=',\n max: '=',\n viewOnly: '=',\n minCustomMessage: '@?',\n maxCustomMessage: '@?'\n },\n link: function (scope, el, attrs, require) {\n scope.form = require[0];\n el.bind('change', function () {\n scope.ngModel = _.round(scope.ngModel, 2);\n $timeout(function () {\n scope.$apply();\n });\n });\n var changeInternal = function () {\n if (scope.ngChange) {\n $timeout(function () {\n scope.ngChange();\n });\n }\n };\n scope.changeInternal = changeInternal;\n },\n controller: [\n \"$scope\", '$filter', \"currency.enums\", function ($scope, $filter, currencyEnums) {\n $scope.currencyEnums = currencyEnums;\n $scope.step = $scope.step ? $scope.step : 0.01;\n activate();\n function activate() {\n $scope.$watch('wholeNumber', function () {\n $scope.ngPattern = $scope.wholeNumber ? /^[0-9]{1,7}$/ : '';\n }, true);\n }\n }\n ]\n };\n }]);\n var brooksonInlineController = [\"$scope\", function ($scope) {\n $scope.isEditMode = false;\n $scope.defaultValue = null;\n $scope.$watch(\"isEditMode\", function (newValue, oldValue) {\n if (newValue === false) {\n $scope.ngModel = $scope.defaultValue;\n }\n });\n $scope.$watch(\"ngModel\", function (newValue, oldValue) {\n if ((oldValue === \"\" || oldValue === null) && $scope.defaultValue === null) {\n $scope.defaultValue = newValue;\n }\n else if ($scope.defaultValue === null) {\n $scope.defaultValue = \"\";\n }\n });\n }];\n appShared.directive('brooksonInlineEdit', function () {\n return {\n restrict: 'AE',\n require: '^form',\n templateUrl: 'src/app/shared/views/inputs/brookson.input.inline-edit.input.html',\n scope: {\n ngModel: '=',\n ngMaxlength: '=',\n field: '@',\n isRequired: '@',\n ngReadonly: '=',\n ngDisabled: '=',\n placeholder: '@',\n viewOnly: '='\n },\n link: function (scope, el, attrs, formCtrl) {\n scope.form = formCtrl;\n },\n controller: brooksonInlineController\n };\n });\n appShared.directive('brooksonInlineEditTextarea', function () {\n return {\n restrict: 'AE',\n require: '^form',\n templateUrl: 'src/app/shared/views/inputs/brookson.input.inline-edit.textarea.html',\n scope: {\n ngModel: '=',\n field: '@',\n isRequired: '@',\n ngReadonly: '=',\n ngDisabled: '=',\n placeholder: '@',\n ngMaxlength: '=',\n viewOnly: '='\n },\n link: function (scope, el, attrs, formCtrl) {\n scope.form = formCtrl;\n },\n controller: brooksonInlineController\n };\n });\n appShared.directive('brooksonInputBoolean', function () {\n return {\n restrict: 'AE',\n require: '^form',\n templateUrl: 'src/app/shared/views/inputs/brookson.input.boolean.html',\n scope: {\n ngModel: '=',\n label: '@',\n field: '@',\n isRequired: '@',\n ngReadonly: '=',\n ngChange: '=',\n ngDisabled: '=',\n viewOnly: '=',\n isSelfAssessment: '='\n },\n link: function (scope, el, attrs, formCtrl) {\n scope.form = formCtrl;\n },\n controller: [\n \"$scope\", function ($scope) {\n _this.$onInit = function () { };\n }\n ]\n };\n });\n appShared.directive('brooksonInputCheckbox', function () {\n return {\n restrict: 'AE',\n require: '^form',\n templateUrl: 'src/app/shared/views/inputs/brookson.input.checkbox.html',\n scope: {\n ngModel: '=',\n label: '@',\n field: '@',\n isRequired: '@',\n ngReadonly: '=',\n ngChange: '=',\n ngDisabled: '=',\n viewOnly: '=',\n ngChecked: '='\n },\n link: function (scope, el, attrs, formCtrl) {\n scope.form = formCtrl;\n },\n controller: [\n \"$scope\", function ($scope) {\n _this.$onInit = function () { };\n }\n ]\n };\n });\n appShared.directive('brooksonInputCheckButtons', function () {\n return {\n restrict: 'AE',\n require: '^form',\n templateUrl: 'src/app/shared/views/inputs/brookson.input.check-buttons.html',\n scope: {\n buttons: '=',\n ngModel: '=',\n label: '@',\n field: '@',\n isRequired: '@',\n ngReadonly: '=',\n ngChange: '=',\n ngMinlength: '=',\n ngMaxlength: '=',\n ngDisabled: '=',\n placeholder: '@',\n multiselect: '=',\n viewOnly: '=',\n additionalStyling: '@',\n isSelfAssessment: '='\n },\n link: function (scope, el, attrs, formCtrl) {\n scope.form = formCtrl;\n },\n controller: [\n \"$scope\", function ($scope) {\n _this.$onInit = function () { };\n $scope.changed = function (value) {\n if ($scope.multiselect) {\n if (!$scope.ngModel || !Array.isArray($scope.ngModel))\n $scope.ngModel = [];\n if (_.includes($scope.ngModel, value)) {\n _.remove($scope.ngModel, function (item) {\n return item === value;\n });\n }\n else {\n $scope.ngModel.push(value);\n }\n }\n else {\n $scope.ngModel = value;\n }\n };\n $scope.isSelected = function (value) {\n if ($scope.multiselect) {\n return _.includes($scope.ngModel, value);\n }\n else {\n return $scope.ngModel === value;\n }\n };\n $scope.viewValue = function () {\n var button = _.find($scope.buttons, function (button) {\n return button.id === $scope.ngModel;\n });\n return button ? button.name : '';\n };\n }\n ]\n };\n });\n appShared.directive('brooksonInputPercentage', ['$timeout', function ($timeout) {\n return {\n restrict: 'AE',\n require: ['^form', '^ngModel'],\n templateUrl: 'src/app/shared/views/inputs/brookson.input.percentage.html',\n scope: {\n ngModel: '=',\n label: '@',\n field: '@',\n isRequired: '@',\n ngReadonly: '=',\n ngChange: '=',\n ngMin: '=',\n ngDisabled: '=',\n placeholder: '@',\n step: '=?',\n wholeNumber: '=',\n showZero: '=',\n viewOnly: '=',\n max: '='\n },\n link: function (scope, el, attrs, require) {\n scope.form = require[0];\n el.bind('change', function () {\n scope.ngModel = _.round(scope.ngModel, 2);\n $timeout(function () {\n scope.$apply();\n });\n });\n },\n controller: [\n \"$scope\", '$filter', function ($scope, $filter) {\n $scope.step = $scope.step ? $scope.step : 0.01;\n $scope.ngPattern = $scope.wholeNumber ? /^[0-9]{1,7}$/ : '';\n }\n ]\n };\n }]);\n appShared.directive('brooksonInputTextarea', function () {\n return {\n restrict: 'AE',\n require: '^form',\n templateUrl: 'src/app/shared/views/inputs/brookson.input.textarea.html',\n scope: {\n ngModel: '=',\n field: '@',\n label: '@',\n isRequired: '@',\n ngReadonly: '=',\n ngDisabled: '=',\n placeholder: '@',\n ngMaxlength: '=',\n textboxStyle: '=',\n hideRemainingCharacters: '=',\n viewOnly: '=',\n blockTypingBeyondLimit: '@',\n ngChange: '='\n },\n link: function (scope, el, attrs, formCtrl) {\n scope.form = formCtrl;\n },\n controller: [\n \"$scope\", function ($scope) {\n if ($scope.blockTypingBeyondLimit === \"true\") {\n $scope.$watch(\"ngModel\", function (newValue, oldValue) {\n if (_.isUndefined(newValue) && oldValue) {\n $scope.ngModel = oldValue;\n }\n });\n }\n }\n ]\n };\n });\n appShared.directive('brooksonInputPhone', function () {\n return {\n restrict: 'AE',\n require: '^form',\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text.html',\n scope: {\n ngModel: '=',\n label: '@',\n field: '@',\n isRequired: '@',\n ngReadonly: '=',\n ngChange: '=',\n ngDisabled: '=',\n placeholder: '@',\n viewOnly: '='\n },\n link: function (scope, el, attrs, formCtrl) {\n scope.form = formCtrl;\n },\n controller: [\n \"$scope\", function ($scope) {\n $scope.ngPattern = /^(?:(?:\\(?(?:0(?:0|11)\\)?[\\s-]?\\(?|\\+)44\\)?[\\s-]?(?:\\(?0\\)?[\\s-]?)?)|(?:\\(?0))(?:(?:\\d{5}\\)?[\\s-]?\\d{4,5})|(?:\\d{4}\\)?[\\s-]?(?:\\d{5}|\\d{3}[\\s-]?\\d{3}))|(?:\\d{3}\\)?[\\s-]?\\d{3}[\\s-]?\\d{3,4})|(?:\\d{2}\\)?[\\s-]?\\d{4}[\\s-]?\\d{4}))(?:[\\s-]?(?:x|ext\\.?|\\#)\\d{3,4})?$/;\n $scope.ngPatternMessage = \"Not a valid phone number\";\n }\n ]\n };\n });\n appShared.directive('brooksonInputTradingName', function () {\n return {\n restrict: 'AE',\n require: '^form',\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text.html',\n scope: {\n ngModel: '=',\n label: '@',\n field: '@',\n isRequired: '@',\n ngReadonly: '=',\n ngChange: '=',\n ngDisabled: '=',\n placeholder: '@',\n viewOnly: '='\n },\n link: function (scope, el, attrs, formCtrl) {\n scope.form = formCtrl;\n },\n controller: [\n \"$scope\", function ($scope) {\n $scope.isLimitedCompany = (function () {\n var regEx = /\\w*(limited|ltd)\\b/i;\n return {\n test: function (value) {\n return !regEx.test(value);\n }\n };\n })();\n $scope.ngPattern = $scope.isLimitedCompany;\n $scope.ngPatternMessage = \"Limited company income should not be input in self employment section\";\n }\n ]\n };\n });\n appShared.directive('brooksonInputBankName', function () {\n return {\n restrict: 'AE',\n require: '^form',\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text.html',\n scope: {\n ngModel: '=',\n label: '@',\n field: '@',\n isRequired: '@',\n ngReadonly: '=',\n ngChange: '=',\n ngDisabled: '=',\n placeholder: '@',\n viewOnly: '='\n },\n link: function (scope, el, attrs, formCtrl) {\n scope.form = formCtrl;\n },\n controller: [\n \"$scope\", function ($scope) {\n $scope.isLimitedCompany = (function () {\n var regEx = /\\w*(limited|ltd)\\b/i;\n return {\n test: function (value) {\n return !regEx.test(value);\n }\n };\n })();\n $scope.ngPattern = $scope.isLimitedCompany;\n $scope.ngPatternMessage = \"You appear to have entered ‘Limited’ or ‘Ltd’ in the Account Name please ensure this is your personal bank account not your company’s.\";\n }\n ]\n };\n });\n appShared.directive('brooksonInputUtrNumber', function () {\n return {\n restrict: 'AE',\n require: '^form',\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text.html',\n scope: {\n ngModel: '=',\n label: '@',\n field: '@',\n isRequired: '@',\n ngChange: '=',\n ngDisabled: '=',\n placeholder: '@',\n viewOnly: '='\n },\n link: function (scope, el, attrs, formCtrl) {\n scope.form = formCtrl;\n var valueWatch = scope.$watch(\"form.\".concat(scope.field, \".$viewValue\"), function (newValue, oldValue) {\n if (oldValue)\n valueWatch();\n setNgReadonly();\n }, true);\n function setNgReadonly() {\n scope.ngReadonly = new RegExp(scope.ngPattern).test(scope.ngModel);\n }\n },\n controller: [\n \"$scope\", function ($scope) {\n $scope.ngPattern = /^[0-9]{10}$/;\n $scope.ngPatternMessage = \"Not a valid UTR number\";\n }\n ]\n };\n });\n appShared.directive('brooksonMaskedInput', function () {\n return {\n restrict: 'AE',\n require: '^form',\n templateUrl: 'src/app/shared/views/inputs/brookson.input.mask.html',\n scope: {\n ngModel: '=',\n label: '@',\n field: '@',\n isRequired: '@',\n ngReadonly: '=',\n ngChange: '=',\n ngMinlength: '=',\n ngMaxlength: '=',\n ngDisabled: '=',\n placeholder: '@',\n ngPattern: '=',\n ngPatternMessage: '@',\n viewOnly: '=',\n uiMask: '@',\n uiMaskplaceholder: '@'\n },\n link: function (scope, el, attrs, formCtrl) {\n scope.form = formCtrl;\n },\n controller: [\n \"$scope\", function ($scope) {\n $scope.inputType = 'text';\n }\n ]\n };\n });\n appShared.directive('brooksonInputTextOnly', function () {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function (scope, elem, attrs, ngModel) {\n ngModel.$parsers.push(function (viewValue) {\n var reg = /^[ a-zA-Z0-9]*$/;\n // if view values matches regexp, update model value\n if (viewValue.match(reg)) {\n return viewValue;\n }\n // keep the model value as it is\n var transformedValue = ngModel.$modelValue;\n ngModel.$setViewValue(transformedValue);\n ngModel.$render();\n return transformedValue;\n });\n }\n };\n });\n appShared.directive('brooksonInputTextRestrict', function () {\n return {\n restrict: 'AE',\n require: '^form',\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text.restrict.html',\n scope: {\n ngModel: '=',\n label: '@',\n field: '@',\n isRequired: '@',\n ngReadonly: '=',\n ngChange: '=',\n ngMinlength: '=',\n ngMaxlength: '=',\n ngDisabled: '=',\n placeholder: '@',\n ngPattern: '=',\n ngPatternMessage: '@',\n viewOnly: '='\n },\n link: function (scope, el, attrs, formCtrl) {\n scope.form = formCtrl;\n },\n controller: [\n \"$scope\", function ($scope) {\n $scope.inputType = 'text';\n // $scope.expression = /^\\d{2}$/;\n // $scope.expression = $scope.ngPattern;\n }\n ]\n };\n });\n appShared.directive('brooksonInputTextAddon', function () {\n return {\n restrict: 'AE',\n require: '^form',\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text-addon.html',\n scope: {\n ngModel: '=',\n label: '@',\n field: '@',\n isRequired: '@',\n ngReadonly: '=',\n ngChange: '=',\n ngMinlength: '=',\n maxlength: '=',\n ngMaxlength: '=',\n ngDisabled: '=',\n placeholder: '@',\n ngPattern: '=',\n ngPatternMessage: '@',\n viewOnly: '=',\n uiMask: '@',\n uiMaskplaceholder: '@',\n addontext: '@',\n inputType: '@'\n },\n link: function (scope, el, attrs, formCtrl) {\n scope.form = formCtrl;\n },\n controller: [\n \"$scope\", function ($scope) {\n $scope.inputType = 'text';\n }\n ]\n };\n });\n})();\n/// \n(function () {\n 'use strict';\n var appShared = angular.module(\"app.shared\");\n appShared.directive('brooksonUiSelectRequired', [function () {\n return {\n restrict: 'A',\n require: '^ngModel',\n link: function (scope, el, attrs, ngModel) {\n var validate = function (value) {\n ngModel.$setValidity('brooksonUiSelectRequired', value !== null && value !== undefined && value !== \"\" && value.titleText !== \"\");\n };\n if (scope.$eval(attrs.brooksonUiSelectRequired)) {\n ngModel.$parsers.unshift(function (value) {\n validate(value);\n return value;\n });\n ngModel.$formatters.unshift(function (value) {\n validate(value);\n return value;\n });\n }\n }\n };\n }]);\n})();\n/// \n(function () {\n 'use strict';\n var appShared = angular.module(\"app.shared\");\n appShared.directive('brooksonValidateHighlight', function () {\n return {\n restrict: 'A',\n require: '^form',\n link: function (scope, el, attrs, formCtrl) {\n // find the text box element, which has the 'name' attribute\n var inputEl = el[0].querySelector(\"[name]\");\n // convert the native text box element to an angular element\n var inputNgElement = angular.element(inputEl);\n // get the name on the text box so we know the property to check\n // on the form controller\n inputNgElement.bind('keyup blur change focus input', function () {\n var inputName = inputNgElement.attr('name');\n if (!inputName) {\n return;\n }\n if (formCtrl[inputName] && formCtrl[inputName].$invalid && formCtrl[inputName].$touched) {\n el.addClass(\"has-error\");\n }\n else {\n el.removeClass(\"has-error\");\n }\n });\n }\n };\n });\n})();\n/// \n(function () {\n \"use strict\";\n var appShared = angular.module(\"app.shared\");\n appShared.directive(\"brooksonWithinSameVatScheme\", [function () {\n return {\n restrict: \"A\",\n require: \"^ngModel\",\n link: function (scope, el, attrs, ngModel) {\n var validate = function (value) {\n var isValid = value === null || value === undefined || value === \"\";\n if (!isValid) {\n var vatScheme_1 = scope.$eval(attrs.brooksonWithinSameVatScheme);\n isValid = _.every(scope.$eval(attrs.brooksonAllExpenses), function (e) {\n var expense = e;\n return expense.markedAsDelete || expense.effectiveVatScheme === vatScheme_1;\n });\n }\n ngModel.$setValidity(\"brooksonWithinSameVatScheme\", isValid);\n };\n ngModel.$parsers.unshift(function (value) {\n validate(value);\n return value;\n });\n ngModel.$formatters.unshift(function (value) {\n validate(value);\n return value;\n });\n }\n };\n }]);\n})();\n/// \n(function () {\n angular.module('app.shared')\n .run(['$rootScope', function ($rootScope) {\n $rootScope.typeOf = function (value) {\n return typeof value;\n };\n }])\n .directive('stringToNumber', function () {\n return {\n require: 'ngModel',\n link: function (scope, element, attrs, ngModel) {\n ngModel.$parsers.push(function (value) {\n return '' + value;\n });\n ngModel.$formatters.push(function (value) {\n return parseFloat(value);\n });\n }\n };\n });\n})();\n/// \n(function () {\n 'use strict';\n angular\n .module('app.shared')\n .directive('brooksonInfiniteScroll', brooksonInfiniteScroll);\n brooksonInfiniteScroll.$inject = ['$window'];\n function brooksonInfiniteScroll($window) {\n // Usage:\n //\n // Creates:\n //\n var directive = {\n link: link,\n restrict: 'A',\n scope: {\n onScroll: \"&\",\n scrollBusy: \"=\"\n }\n };\n return directive;\n function link(scope, elem, attrs) {\n $window = angular.element($window);\n var scrollDistance = 0;\n angular.element($window).bind('scroll', handler);\n scope.$on('$destroy', function () {\n return $window.unbind('scroll', handler);\n });\n function handler() {\n if (!scope.scrollBusy) {\n var elementBottom, remaining, shouldScroll, windowBottom;\n windowBottom = $window.height() + $window.scrollTop();\n elementBottom = elem.offset().top + elem.height();\n remaining = elementBottom - windowBottom;\n shouldScroll = remaining <= $window.height() * scrollDistance;\n if (shouldScroll) {\n scope.$apply(scope.onScroll);\n }\n }\n }\n }\n }\n})();\n// $Classes/Enums/Interfaces(filter)[template][separator]\n// filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n// template: The template to repeat for each matched item\n// separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n// More info: http://frhagn.github.io/Typewriter/\nvar Shared;\n(function (Shared) {\n var SelfAssessmentSectionStatus;\n (function (SelfAssessmentSectionStatus) {\n SelfAssessmentSectionStatus[SelfAssessmentSectionStatus[\"notStarted\"] = 0] = \"notStarted\";\n SelfAssessmentSectionStatus[SelfAssessmentSectionStatus[\"notRequired\"] = 1] = \"notRequired\";\n SelfAssessmentSectionStatus[SelfAssessmentSectionStatus[\"inProgress\"] = 2] = \"inProgress\";\n SelfAssessmentSectionStatus[SelfAssessmentSectionStatus[\"completed\"] = 3] = \"completed\";\n SelfAssessmentSectionStatus[SelfAssessmentSectionStatus[\"submitted\"] = 4] = \"submitted\";\n })(SelfAssessmentSectionStatus = Shared.SelfAssessmentSectionStatus || (Shared.SelfAssessmentSectionStatus = {}));\n})(Shared || (Shared = {}));\n/// \n/// \n(function () {\n 'use strict';\n angular\n .module('app.shared')\n .directive('brooksonUiAside', brooksonUiAside);\n brooksonUiAside.$inject = ['$q', '$templateRequest', '$compile', '$document', '$injector'];\n function brooksonUiAside($q, $templateRequest, $compile, $document, $injector) {\n // Usage:\n //\n // Creates:\n //\n var directive = {\n bindToController: true,\n controller: ['$scope', '$rootScope', '$document', '$injector', brooksonAsideController],\n controllerAs: 'vm',\n link: link,\n restrict: 'E',\n scope: {\n template: '=',\n show: '=',\n templateUrl: '=',\n asideClass: '=',\n appSettings: '=',\n summaryForms: '=',\n colorOverride: '=',\n isSelfAssessment: '='\n }\n };\n return directive;\n function link(scope, element, attrs) {\n if (scope.vm.isSelfAssessment) {\n var selfAssessmentFactory = $injector.get('selfAssessmentFactory');\n selfAssessmentFactory.getSummary();\n }\n var opts = {\n template: attrs.template,\n templateUrl: attrs.templateUrl,\n };\n getTemplatePromise(opts).then(function (template) {\n var body = $document.find('body').eq(0);\n var menu = '
    ' + template + '
    ';\n if (scope.vm.colorOverride) {\n menu = '
    ' + template + '
    ';\n }\n var comp = $compile(menu)(scope);\n body.append(comp);\n });\n }\n function getTemplatePromise(options) {\n return options.template ? $q.when(options.template) :\n $templateRequest(angular.isFunction(options.templateUrl) ? (options.templateUrl)() : options.templateUrl);\n }\n }\n /* @ngInject */\n function brooksonAsideController($scope, $rootScope, $document, $injector) {\n var vm = this;\n if (vm.isSelfAssessment) {\n var selfAssessmentFactory = $injector.get('selfAssessmentFactory');\n vm.selfAssessment = selfAssessmentFactory;\n }\n vm.sectionStatusEnum = Shared.SelfAssessmentSectionStatus;\n $scope.$watch('vm.show', function (newValue, oldValue) {\n if (newValue === true) {\n vm.showAside();\n }\n else {\n vm.hideAside();\n }\n });\n // this will listen for route changes and call the callback\n $rootScope.$on('$stateChangeStart', function () {\n vm.show = false;\n });\n vm.showAside = function () {\n $document.find('.aside-container').addClass('in');\n $document.find('.aside-container').removeClass('out');\n };\n vm.hideAside = function () {\n $document.find('.aside-container').addClass('out');\n $document.find('.aside-container').removeClass('in');\n };\n }\n})();\n/// \nvar shared = angular.module('app.shared');\nshared.directive('brooksonBackTop', function () {\n return {\n restrict: 'AE',\n templateUrl: 'src/app/shared/views/ui/brookson.ui.back-top.html'\n };\n});\nshared.directive('backTop', ['$window', 'brookson.ui.scroll-top', function ($window, brooksonScrollTop) {\n return {\n restrict: 'E',\n transclude: true,\n replace: true,\n template: '
    ',\n scope: {\n icon: \"@buttonIcon\",\n speed: \"@scrollSpeed\",\n theme: \"@buttonTheme\",\n yTrigger: \"@yTrigger\"\n },\n link: function (scope, element) {\n scope.text = scope.text || 'Scroll top';\n scope.speed = parseInt(scope.speed, 10) || 300;\n scope.theme = scope.theme || 'light';\n scope.button = element.find('button');\n scope.button.on('click', function () {\n brooksonScrollTop.smoothScroll(scope.speed);\n element.removeClass('show');\n });\n $window.addEventListener('scroll', function () {\n var top = ($window.scrollY || $window.pageYOffset);\n if (top >= (scope.yTrigger)) {\n element.addClass('show');\n }\n else {\n element.removeClass('show');\n }\n });\n }\n };\n }]);\n/// \nvar shared = angular.module('app.shared');\nshared.directive('brooksonImageNotFound', function () {\n return {\n restrict: 'AE',\n templateUrl: 'src/app/shared/views/ui/brookson.ui.image-not-found.html'\n };\n});\n/// \n(function () {\n 'use strict';\n var appShared = angular.module('app.shared');\n appShared.directive('hideMobile', ['$compile', '$detection', hideMobileController]);\n function hideMobileController($compile, $detection) {\n var directive = {\n controller: ['$scope', '$element', '$attrs', '$compile', controller],\n restrict: 'A'\n };\n return directive;\n function controller($scope, $element, $attrs) {\n if (!$attrs.ngIf && ($detection.isiOS() || $detection.isAndroid() || $detection.isWindowsPhone())) {\n $attrs.$set('ng-if', false);\n $compile($element)($scope);\n }\n else if (!$attrs.ngIf) {\n $attrs.$set('ng-if', true);\n $compile($element)($scope);\n }\n }\n }\n appShared.directive('showMobile', ['$compile', '$detection', showMobileController]);\n function showMobileController($compile, $detection) {\n var directive = {\n controller: ['$scope', '$element', '$attrs', '$compile', controller],\n restrict: 'A'\n };\n return directive;\n function controller($scope, $element, $attrs) {\n if (!$attrs.ngIf && ($detection.isiOS() || $detection.isAndroid() || $detection.isWindowsPhone())) {\n $attrs.$set('ng-if', true);\n $compile($element)($scope);\n }\n else if (!$attrs.ngIf) {\n $attrs.$set('ng-if', false);\n $compile($element)($scope);\n }\n }\n }\n appShared.directive('hideIos', ['$compile', '$detection', hideIosController]);\n function hideIosController($compile, $detection) {\n var directive = {\n controller: ['$scope', '$element', '$attrs', '$compile', controller],\n restrict: 'A'\n };\n return directive;\n function controller($scope, $element, $attrs) {\n if (!$attrs.ngHide && $detection.isiOS()) {\n $attrs.$set('ng-hide', true);\n $compile($element)($scope);\n }\n }\n }\n appShared.directive('showIos', ['$compile', '$detection', showIosController]);\n function showIosController($compile, $detection) {\n var directive = {\n controller: ['$scope', '$element', '$attrs', '$compile', controller],\n restrict: 'A'\n };\n return directive;\n function controller($scope, $element, $attrs) {\n if (!$attrs.ngShow && $detection.isiOS()) {\n $attrs.$set('ng-show', true);\n $compile($element)($scope);\n }\n }\n }\n appShared.directive('hideAndroid', ['$compile', '$detection', hideAndroidController]);\n function hideAndroidController($compile, $detection) {\n var directive = {\n controller: ['$scope', '$element', '$attrs', '$compile', controller],\n restrict: 'A'\n };\n return directive;\n function controller($scope, $element, $attrs) {\n if (!$attrs.ngHide && $detection.isAndroid()) {\n $attrs.$set('ng-hide', true);\n $compile($element)($scope);\n }\n }\n }\n appShared.directive('showAndroid', ['$compile', '$detection', showAndroidController]);\n function showAndroidController($compile, $detection) {\n var directive = {\n controller: ['$scope', '$element', '$attrs', '$compile', controller],\n restrict: 'A'\n };\n return directive;\n function controller($scope, $element, $attrs) {\n if (!$attrs.ngShow && $detection.isAndroid()) {\n $attrs.$set('ng-show', true);\n $compile($element)($scope);\n }\n }\n }\n appShared.directive('hideWindowsPhone', ['$compile', '$detection', hideWindowsPhoneController]);\n function hideWindowsPhoneController($compile, $detection) {\n var directive = {\n controller: ['$scope', '$element', '$attrs', '$compile', controller],\n restrict: 'A'\n };\n return directive;\n function controller($scope, $element, $attrs) {\n if (!$attrs.ngHide && $detection.isWindowsPhone()) {\n $attrs.$set('ng-hide', true);\n $compile($element)($scope);\n }\n }\n }\n appShared.directive('showWindowsIos', ['$compile', '$detection', showWindowsPhoneController]);\n function showWindowsPhoneController($compile, $detection) {\n var directive = {\n controller: ['$scope', '$element', '$attrs', '$compile', controller],\n restrict: 'A'\n };\n return directive;\n function controller($scope, $element, $attrs) {\n if (!$attrs.ngShow && $detection.isWindowsPhone()) {\n $attrs.$set('ng-show', true);\n $compile($element)($scope);\n }\n }\n }\n /**\n * IF\n *\n */\n appShared.directive('ifDesktop', ['$compile', '$detection', ifNotMobileController]);\n function ifNotMobileController($compile, $detection) {\n var directive = {\n controller: ['$scope', '$element', '$attrs', '$compile', controller],\n restrict: 'A'\n };\n return directive;\n function controller($scope, $element, $attrs) {\n if (!$attrs.ngIf && ($detection.isiOS() || $detection.isAndroid() || $detection.isWindowsPhone())) {\n $attrs.$set('ng-if', false);\n $compile($element)($scope);\n }\n else if (!$attrs.ngIf) {\n $attrs.$set('ng-if', true);\n $compile($element)($scope);\n }\n }\n }\n appShared.directive('ifMobile', ['$compile', '$detection', ifMobileController]);\n function ifMobileController($compile, $detection) {\n var directive = {\n controller: ['$scope', '$element', '$attrs', '$compile', controller],\n restrict: 'A'\n };\n return directive;\n function controller($scope, $element, $attrs) {\n if (!$attrs.ngIf && ($detection.isiOS() || $detection.isAndroid() || $detection.isWindowsPhone())) {\n $attrs.$set('ng-if', true);\n $compile($element)($scope);\n }\n else if (!$attrs.ngIf) {\n $attrs.$set('ng-if', false);\n $compile($element)($scope);\n }\n }\n }\n})();\nvar app;\n(function (app) {\n var shared;\n (function (shared) {\n 'use strict';\n var UnsavedWarningSharedService = /** @class */ (function () {\n function UnsavedWarningSharedService($rootScope, $injector, $location, $state, brooksonPopup) {\n var _this = this;\n this.$rootScope = $rootScope;\n this.$injector = $injector;\n this.$location = $location;\n this.$state = $state;\n this.brooksonPopup = brooksonPopup;\n this.ignoreEvent = false;\n this.allFormsArray = [];\n this.messages = {\n navigate: 'You will lose unsaved changes if you leave this page',\n reload: 'You will lose unsaved changes if you reload this page'\n };\n this.removeFunctions = [angular.noop];\n this.routeEvent = ['$locationChangeStart', '$stateChangeStart'];\n this.allForms = function () {\n return _this.allFormsArray;\n };\n this.allFormsClean = function () {\n var cleanFormCount = 0;\n angular.forEach(_this.allFormsArray, function (item, idx) {\n if (item.$dirty) {\n cleanFormCount++;\n }\n });\n return cleanFormCount === 0; // no dirty forms were found\n };\n this.init = function (form) {\n if (_this.allFormsArray.length === 0)\n _this.setup();\n _this.allFormsArray.push(form);\n };\n this.removeForm = function (form) {\n var idx = _this.allFormsArray.indexOf(form);\n if (idx === -1)\n return;\n _this.allFormsArray.splice(idx, 1);\n if (_this.allFormsArray.length === 0)\n _this.tearDown();\n };\n this.tearDown = function () {\n angular.forEach(_this.removeFunctions, function (fn) {\n fn();\n });\n window.onbeforeunload = null;\n _this.ignoreEvent = false;\n };\n this.confirmExit = function () {\n if (!_this.allFormsClean())\n return _this.messages.reload;\n };\n this.setup = function () {\n window.onbeforeunload = _this.confirmExit;\n var eventsToWatchFor = _this.routeEvent;\n angular.forEach(eventsToWatchFor, function (aEvent) {\n // calling this function later will unbind this, acting as $off()\n var removeFn = _this.$rootScope.$on(aEvent, function (event, next, current) {\n if (!_this.allFormsClean() && !_this.ignoreEvent) {\n _this.ignoreEvent = true;\n event.preventDefault();\n _this.brooksonPopup.showYesNoPopup(\"Unsaved Changes\", _this.messages.navigate).then(function (result) {\n _this.completeEvent(event, next);\n }).catch(function (er) {\n _this.ignoreEvent = false;\n });\n }\n else {\n }\n });\n _this.removeFunctions.push(removeFn);\n });\n };\n this.completeEvent = function (event, next) {\n switch (event.name) {\n case '$locationChangeStart':\n _this.$location.path(next);\n break;\n case '$stateChangeStart':\n _this.$state.go(next);\n break;\n default:\n break;\n }\n };\n }\n UnsavedWarningSharedService.$inject = ['$rootScope', '$injector', '$location', '$state', 'brookson.ui.popup'];\n return UnsavedWarningSharedService;\n }());\n shared.UnsavedWarningSharedService = UnsavedWarningSharedService;\n angular\n .module('app.shared')\n .service('unsavedWarningSharedService', UnsavedWarningSharedService);\n })(shared = app.shared || (app.shared = {}));\n})(app || (app = {}));\n(function () {\n 'use strict';\n angular.module(\"app.shared\").directive('confirmOnExit', ['unsavedWarningSharedService', function (unsavedWarningSharedService) {\n return {\n require: 'form',\n link: function (scope, formElement, attrs, formCtrl) {\n // register this form\n unsavedWarningSharedService.init(formCtrl);\n // bind to form submit, this makes the typical submit button work\n // in addition to the ability to bind to a seperate button which clears warning\n formElement.bind('submit', function (event) {\n if (formCtrl.$valid) {\n formCtrl.$setPristine();\n }\n });\n // @todo check destroy on clear button too? \n scope.$on('$destroy', function () {\n unsavedWarningSharedService.removeForm(formCtrl);\n });\n }\n };\n }]);\n})();\nvar Shared;\n(function (Shared) {\n var CommonValues = /** @class */ (function () {\n function CommonValues() {\n }\n CommonValues.pensionAge = 65;\n return CommonValues;\n }());\n Shared.CommonValues = CommonValues;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var DocumentDataSource;\n (function (DocumentDataSource) {\n DocumentDataSource[DocumentDataSource[\"MemberWebDocuments\"] = 0] = \"MemberWebDocuments\";\n DocumentDataSource[DocumentDataSource[\"QueueService\"] = 1] = \"QueueService\";\n DocumentDataSource[DocumentDataSource[\"MoleData\"] = 2] = \"MoleData\";\n DocumentDataSource[DocumentDataSource[\"Dropbox\"] = 3] = \"Dropbox\";\n })(DocumentDataSource = Shared.DocumentDataSource || (Shared.DocumentDataSource = {}));\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var ExpenseTypeRef;\n (function (ExpenseTypeRef) {\n ExpenseTypeRef[ExpenseTypeRef[\"EXPENSE\"] = 0] = \"EXPENSE\";\n ExpenseTypeRef[ExpenseTypeRef[\"MILEAGE\"] = 1] = \"MILEAGE\";\n ExpenseTypeRef[ExpenseTypeRef[\"ALLOWANCE\"] = 2] = \"ALLOWANCE\";\n })(ExpenseTypeRef = Shared.ExpenseTypeRef || (Shared.ExpenseTypeRef = {}));\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var ExpenseWarningCodeTypes;\n (function (ExpenseWarningCodeTypes) {\n ExpenseWarningCodeTypes[ExpenseWarningCodeTypes[\"HighRisk\"] = 1] = \"HighRisk\";\n ExpenseWarningCodeTypes[ExpenseWarningCodeTypes[\"Amount\"] = 2] = \"Amount\";\n ExpenseWarningCodeTypes[ExpenseWarningCodeTypes[\"TwentyFourMonthRule\"] = 3] = \"TwentyFourMonthRule\";\n })(ExpenseWarningCodeTypes = Shared.ExpenseWarningCodeTypes || (Shared.ExpenseWarningCodeTypes = {}));\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var FileView;\n (function (FileView) {\n FileView[FileView[\"DETAILED\"] = 0] = \"DETAILED\";\n FileView[FileView[\"THUMBNAIL\"] = 1] = \"THUMBNAIL\";\n })(FileView = Shared.FileView || (Shared.FileView = {}));\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var FuelType;\n (function (FuelType) {\n FuelType[FuelType[\"notKnown\"] = 0] = \"notKnown\";\n FuelType[FuelType[\"petrol\"] = 1] = \"petrol\";\n FuelType[FuelType[\"diesel\"] = 2] = \"diesel\";\n FuelType[FuelType[\"lpg\"] = 3] = \"lpg\";\n })(FuelType = Shared.FuelType || (Shared.FuelType = {}));\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var ImageSize;\n (function (ImageSize) {\n ImageSize[ImageSize[\"ORIGINAL\"] = 0] = \"ORIGINAL\";\n ImageSize[ImageSize[\"CUSTOM\"] = 1] = \"CUSTOM\";\n ImageSize[ImageSize[\"ASPECTRATIO\"] = 2] = \"ASPECTRATIO\";\n })(ImageSize = Shared.ImageSize || (Shared.ImageSize = {}));\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var IndustryList = /** @class */ (function () {\n function IndustryList() {\n }\n IndustryList.getArray = function () {\n return [IndustryList.aerospaceAndDefence,\n IndustryList.automotiveAndMotorsport,\n IndustryList.buildingConstructionInfrastructure,\n IndustryList.businessServices,\n IndustryList.energySectorOfficeBased,\n IndustryList.energySectorOffshoreSiteBased,\n IndustryList.financialService,\n IndustryList.informationTechnology,\n IndustryList.lifeSciences,\n IndustryList.marineAndShipbuilding,\n IndustryList.mediaAndCreative,\n IndustryList.medicalAndHealthcare,\n IndustryList.railAndTransportation,\n IndustryList.telecommunications,\n IndustryList.utilities,\n IndustryList.other];\n };\n IndustryList.aerospaceAndDefence = \"Aerospace and Defence\";\n IndustryList.automotiveAndMotorsport = \"Automotive and Motorsport\";\n IndustryList.buildingConstructionInfrastructure = \"Building, Construction and Infrastructure\";\n IndustryList.businessServices = \"Business Services\";\n IndustryList.energySectorOfficeBased = \"Energy sector (office based)\";\n IndustryList.energySectorOffshoreSiteBased = \"Energy sector (offshore/sitebased)\";\n IndustryList.financialService = \"Financial Services\";\n IndustryList.informationTechnology = \"Information Technology\";\n IndustryList.lifeSciences = \"Life Sciences\";\n IndustryList.marineAndShipbuilding = \"Marine and Shipbuilding\";\n IndustryList.mediaAndCreative = \"Media and Creative\";\n IndustryList.medicalAndHealthcare = \"Medical and Healthcare\";\n IndustryList.railAndTransportation = \"Rail and Transportation\";\n IndustryList.telecommunications = \"Telecommunications\";\n IndustryList.utilities = \"Utilities\";\n IndustryList.other = \"Other\";\n return IndustryList;\n }());\n Shared.IndustryList = IndustryList;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var InvoiceCreationStatus;\n (function (InvoiceCreationStatus) {\n InvoiceCreationStatus[InvoiceCreationStatus[\"Override\"] = 0] = \"Override\";\n InvoiceCreationStatus[InvoiceCreationStatus[\"Successful\"] = 1] = \"Successful\";\n InvoiceCreationStatus[InvoiceCreationStatus[\"Exception\"] = 2] = \"Exception\";\n })(InvoiceCreationStatus = Shared.InvoiceCreationStatus || (Shared.InvoiceCreationStatus = {}));\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var SdcOutcomeType;\n (function (SdcOutcomeType) {\n SdcOutcomeType[SdcOutcomeType[\"NoChange\"] = -1] = \"NoChange\";\n SdcOutcomeType[SdcOutcomeType[\"NotAssessed\"] = 0] = \"NotAssessed\";\n SdcOutcomeType[SdcOutcomeType[\"Fail\"] = 1] = \"Fail\";\n SdcOutcomeType[SdcOutcomeType[\"AwaitingEndClient\"] = 2] = \"AwaitingEndClient\";\n SdcOutcomeType[SdcOutcomeType[\"FailedEndClient\"] = 3] = \"FailedEndClient\";\n SdcOutcomeType[SdcOutcomeType[\"Pass\"] = 4] = \"Pass\";\n })(SdcOutcomeType = Shared.SdcOutcomeType || (Shared.SdcOutcomeType = {}));\n var SdcOutcomeTypeParser = /** @class */ (function () {\n function SdcOutcomeTypeParser() {\n }\n SdcOutcomeTypeParser.getDescription = function (value) {\n switch (value) {\n case Shared.SdcOutcomeType.NoChange:\n return 'No Changes';\n case Shared.SdcOutcomeType.NotAssessed:\n return 'Not Assessed';\n case Shared.SdcOutcomeType.Fail:\n return 'Failed';\n case Shared.SdcOutcomeType.AwaitingEndClient:\n return 'Awaiting End Client';\n case Shared.SdcOutcomeType.FailedEndClient:\n return 'Failed End Client';\n case Shared.SdcOutcomeType.Pass:\n return 'Passed';\n default:\n return '';\n }\n };\n return SdcOutcomeTypeParser;\n }());\n Shared.SdcOutcomeTypeParser = SdcOutcomeTypeParser;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var SelectedPackageEnum;\n (function (SelectedPackageEnum) {\n SelectedPackageEnum[SelectedPackageEnum[\"umbrella\"] = 0] = \"umbrella\";\n SelectedPackageEnum[SelectedPackageEnum[\"umbrellaProtect\"] = 1] = \"umbrellaProtect\";\n })(SelectedPackageEnum = Shared.SelectedPackageEnum || (Shared.SelectedPackageEnum = {}));\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var SubmitPersonalSignificantControl;\n (function (SubmitPersonalSignificantControl) {\n SubmitPersonalSignificantControl[SubmitPersonalSignificantControl[\"noResponse\"] = 0] = \"noResponse\";\n SubmitPersonalSignificantControl[SubmitPersonalSignificantControl[\"yes\"] = 1] = \"yes\";\n SubmitPersonalSignificantControl[SubmitPersonalSignificantControl[\"no\"] = 2] = \"no\";\n })(SubmitPersonalSignificantControl = Shared.SubmitPersonalSignificantControl || (Shared.SubmitPersonalSignificantControl = {}));\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var TransactionTypes;\n (function (TransactionTypes) {\n TransactionTypes[TransactionTypes[\"Business\"] = 0] = \"Business\";\n TransactionTypes[TransactionTypes[\"Personal\"] = 1] = \"Personal\";\n TransactionTypes[TransactionTypes[\"Unallocated\"] = 2] = \"Unallocated\";\n TransactionTypes[TransactionTypes[\"All\"] = 3] = \"All\";\n })(TransactionTypes = Shared.TransactionTypes || (Shared.TransactionTypes = {}));\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var VatScheme = /** @class */ (function () {\n function VatScheme() {\n }\n VatScheme.none = \"_blank_\";\n VatScheme.flatRate = \"FRV\";\n VatScheme.nonFlatRate = \"Non_FRV\";\n return VatScheme;\n }());\n Shared.VatScheme = VatScheme;\n})(Shared || (Shared = {}));\nvar BankLink;\n(function (BankLink) {\n var Transaction = /** @class */ (function () {\n function Transaction() {\n this.balance = null;\n this.bankId = null;\n this.bankKey = null;\n this.creditAmount = null;\n this.customerLedgerCategory = null;\n this.customerLedgerDescription = null;\n this.customerLedgerInvoice = null;\n this.debitAmount = null;\n this.description = null;\n this.isMobile = null;\n this.personalDiv1Amount = null;\n this.personalDiv2Amount = null;\n this.personalExpensesAmount = null;\n this.personalLoanAmount = null;\n this.personalSalaryAmount = null;\n this.receiptID = null;\n this.receiptable = null;\n this.serviceResponse = null;\n this.transactionCategory = null;\n this.transactionDate = null;\n this.transactionId = null;\n this.transactionReceiptStatus = null;\n this.transactionStatus = null;\n this.transactionType = null;\n this.unallocatedTransactionSource = null;\n this.flow = null;\n this.flowOptions = null;\n this.receiptThumbnail = null;\n this.category = null;\n this.relatedCategories = null;\n this.isVatReclaimable = false;\n this.hasValidVatReceipt = false;\n this.gross = 0;\n this.vat = 0;\n this.net = 0;\n this.passes24MonthRule = false;\n this.accept24MonthRuleRisk = undefined;\n }\n return Transaction;\n }());\n BankLink.Transaction = Transaction;\n})(BankLink || (BankLink = {}));\n/// \n// Please note that most methods can take \"any\" as input parameters because they all get converted to Moment which can convert from any type (string, number, Date, moment.Moment).\nvar Shared;\n(function (Shared) {\n var BrooksonUtilitiesDate = /** @class */ (function () {\n function BrooksonUtilitiesDate() {\n var _this = this;\n this.taxYearMonth = 4;\n this.taxYearDay = 5;\n this.getPreviousDayOfWeek = function (dayOfWeek) {\n // Get the current week number of the year\n var currentNumberOfWeeks = moment().weeks();\n // Minus 1 off the above number\n var previousWeekNumber = --currentNumberOfWeeks;\n // Given the above number, find the monday based on that week\n var previousWeekOfDay = moment().weeks(previousWeekNumber).day(dayOfWeek);\n return previousWeekOfDay;\n };\n this.convertToMoment = function (date) {\n if (moment.isMoment(date)) {\n return date;\n }\n if ((date instanceof Date)) {\n return moment(date);\n }\n return moment(date, [moment.ISO_8601, \"YYYY-MM-DD\", \"DD-MM-YYYY\", \"YYYY/MM/DD\", \"DD/MM/YYYY\", 'dddd', 'YYYY-MM-DDThh:mm:ss', \"ddd MMM DD YYYY hh:mm:ss GMTzzz\"], true);\n };\n this.stripOutTimezone = function (date) {\n if (!moment.isMoment(date)) {\n date = moment(date);\n }\n var noTimezone = date.format(\"ddd MMM DD YYYY\").toString();\n return moment.parseZone(noTimezone + \" 00:00:00 GMT+0000\");\n };\n this.convertToUtcMoment = function (date) {\n return moment.utc(date);\n };\n this.convertToJsDate = function (date) {\n if ((date instanceof Date)) {\n return date;\n }\n return _this.convertToMoment(date).toDate();\n };\n this.convertToViewString = function (date) {\n return _this.convertToMoment(date).format(\"DD/MM/YYYY\");\n };\n this.convertToViewMonthString = function (date) {\n return _this.convertToMoment(date).format(\"DD/MMM/YYYY\");\n };\n this.convertToServerString = function (date) {\n return _this.convertToMoment(date).format(\"YYYY-MM-DD\");\n };\n this.convertDateToMidnightGmt = function (date) {\n if (!date) {\n return date;\n }\n return moment.utc([date.getFullYear(), date.getMonth(), date.getDate()]).toDate();\n };\n this.dateDiff = function (date1, date2) {\n return _this.convertToMoment(date1).diff(_this.convertToMoment(date2));\n };\n this.isValid = function (date) {\n return _this.convertToMoment(date).isValid();\n };\n this.isSame = function (date1, date2) {\n if (date1 === date2) {\n return true;\n }\n return _this.dateDiff(_this.convertToMoment(date1), _this.convertToMoment(date2)) === 0;\n };\n this.isBefore = function (date1, date2) {\n return (_this.dateDiff(_this.convertToMoment(date1), _this.convertToMoment(date2)) < 0);\n };\n this.isBeforeOrSame = function (date1, date2) {\n return (_this.dateDiff(_this.convertToMoment(date1), _this.convertToMoment(date2)) <= 0);\n };\n this.isAfter = function (date1, date2) {\n return (_this.dateDiff(_this.convertToMoment(date1), _this.convertToMoment(date2)) > 0);\n };\n this.isAfterOrSame = function (date1, date2) {\n return (_this.dateDiff(_this.convertToMoment(date1), _this.convertToMoment(date2)) >= 0);\n };\n this.taxYearStart = function () {\n var now = moment();\n var startDateString = _this.taxYearDay + \"/\" + _this.taxYearMonth + \"/\" + now.year();\n var startDate = moment(startDateString, 'DD/MM/YYYY').add(1, 'days');\n if (startDate > now) {\n startDate.add(-1, 'years');\n }\n return startDate;\n };\n this.taxYearEnd = function () {\n return _this.taxYearStart().add(1, 'years').add(-1, 'days');\n };\n this.currentTaxYear = function () {\n return _this.taxYearStart().year() + \"/\" + _this.taxYearEnd().year();\n };\n this.previousTaxYear = function () {\n return _this.previousTaxYearStart().year() + \"/\" + _this.previousTaxYearEnd().year();\n };\n this.previousTaxYearStart = function () {\n return _this.taxYearStart().add(-1, 'years');\n };\n this.previousTaxYearEnd = function () {\n return _this.taxYearEnd().add(-1, 'years');\n };\n this.nextTaxYearStart = function () {\n return _this.taxYearStart().add(1, 'years');\n };\n this.nextTaxYearEnd = function () {\n return _this.taxYearEnd().add(1, 'years');\n };\n this.nextTaxYear = function () {\n return _this.nextTaxYearStart().year() + \"/\" + _this.nextTaxYearEnd().year();\n };\n this.ageFromDate = function (date) {\n return _this.convertToMoment(date).diff(moment(), 'years');\n };\n /**\n * Returns whether the date passed in is the C# default date\n * ('0001-01-01T00:00:00')\n *\n * @param {string} date\n * @returns {boolean}\n */\n this.isMinDate = function (date) {\n return date === \"0001-01-01T00:00:00\";\n };\n this.taxYearStartByOffset = function (offset) {\n return _this.taxYearStart().add(offset, 'years');\n };\n this.taxYearEndByOffset = function (offset) {\n return _this.taxYearEnd().add(offset, 'years');\n };\n this.taxYearByOffset = function (offset) {\n return _this.taxYearStartByOffset(offset).year() + \"/\" + _this.taxYearEndByOffset(offset).year();\n };\n }\n BrooksonUtilitiesDate.prototype.isOverNMonthsAgo = function (date, numberOfMonths) {\n var nMonthsAgo = moment().subtract(numberOfMonths, 'months');\n return moment(date).isBefore(nMonthsAgo);\n };\n return BrooksonUtilitiesDate;\n }());\n Shared.BrooksonUtilitiesDate = BrooksonUtilitiesDate;\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .service('brookson.utilities.date', Shared.BrooksonUtilitiesDate);\nvar Shared;\n(function (Shared) {\n var VatRateConfig = /** @class */ (function () {\n function VatRateConfig() {\n }\n return VatRateConfig;\n }());\n Shared.VatRateConfig = VatRateConfig;\n})(Shared || (Shared = {}));\n/// \n/// \nvar Shared;\n(function (Shared) {\n var BankLinkSrv = /** @class */ (function () {\n function BankLinkSrv($http) {\n var _this = this;\n this.$http = $http;\n this.getBankAccounts = function (silentMode) {\n return _this.$http.get(\"api/BankLink/GetBankAccounts\", {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) { return response.data; });\n };\n this.getCategories = function (silentMode, transactionType) {\n var url = \"api/BankLink/GetCategories\";\n if (!_.isUndefined(transactionType)) {\n url = \"\".concat(url, \"?transactionType=\").concat(transactionType);\n }\n return _this.$http.get(url, {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) { return response.data; });\n };\n this.addYodleeAccount = function (silentMode) {\n return _this.$http.get('api/BankLink/AddYodleeAccount', {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) { return response.data; });\n };\n this.editYodleeAccount = function (id, silentMode) {\n return _this.$http.get('api/BankLink/EditYodleeAccount?id=' + id, {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) { return response.data; });\n };\n this.refreshYodleeAccount = function (id, silentMode) {\n return _this.$http.get('api/BankLink/RefreshYodleeAccount?id=' + id, {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) { return response.data; });\n };\n this.isBankEnabled = function (silentMode) {\n return _this.$http.get('api/BankLink/IsBankLinkEnabled', {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) { return response.data; });\n };\n this.isBankActionRequired = function (silentMode) {\n return _this.$http.get('api/BankLink/IsBankLinkActionRequired', {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) { return response.data; });\n };\n this.isCsvUploadRequired = function (silentMode) {\n return _this.$http.get('api/BankLink/IsCsvUploadRequired', {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) { return response.data; });\n };\n this.cancelBankStatementBatch = function (id, silentMode) {\n return _this.$http.get('api/BankLink/CancelBankStatementBatch?id=' + id, {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) { return response.data; });\n };\n this.clearBankStatementBatch = function (id, silentMode) {\n return _this.$http.get('api/BankLink/ClearBankStatementBatch?id=' + id, {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) { return response.data; });\n };\n this.submitBankStatementBatch = function (id, bankId, reconciliationDate) {\n var url = \"api/BankLink/SubmitBankStatementBatch\";\n var requestData = {\n id: id !== undefined ? id : \"\",\n bankId: bankId !== undefined ? bankId : \"\",\n reconciliationDate: reconciliationDate !== undefined ? reconciliationDate : \"\",\n };\n return _this.$http.get(url, {\n cache: true,\n params: requestData,\n }).then(function (response) {\n return response.data;\n });\n };\n this.updateBankStatementDate = function (bankId, reconciliationDate) {\n var url = \"api/BankLink/UpdateBankStatementDate\";\n var requestData = {\n bankId: bankId !== undefined ? bankId : \"\",\n reconciliationDate: reconciliationDate !== undefined ? reconciliationDate : \"\",\n };\n return _this.$http.get(url, {\n cache: true,\n params: requestData,\n }).then(function (response) {\n return response.data;\n });\n };\n this.getLastFiveBankTransaction = function (bankAccountKey, silentMode) {\n var url = \"api/BankLink/GetLastFiveBankTransaction\";\n var requestData = {\n bankAccountKey: bankAccountKey !== undefined ? bankAccountKey : \"\"\n };\n return _this.$http.get(url, {\n cache: true,\n params: requestData,\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n };\n this.updateTransactions = function (transactions, silentMode) {\n var config = {\n silentMode: silentMode ? silentMode : false\n };\n return _this.$http.post('api/MoneyManager/UpdateTransactions', transactions, config)\n .then(function (response) {\n return response.data;\n });\n };\n this.getAllVatRatesConfig = function (silentMode) {\n var url = \"api/Expenses/GetExpenseVatConfig\";\n return _this.$http.get(url, {\n cache: \"true\",\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return _.map(response.data, function (item) {\n var rate = new Shared.VatRateConfig();\n rate.expenseCode = item.expenseCode;\n rate.vatRate = item.vatRate;\n rate.effectiveDate = new Date(item.effectiveDate);\n rate.endDate = new Date(item.endDate);\n return rate;\n });\n });\n };\n }\n BankLinkSrv.$inject = ['$http'];\n return BankLinkSrv;\n }());\n Shared.BankLinkSrv = BankLinkSrv;\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .service('bankLinkSrv', Shared.BankLinkSrv);\nvar Shared;\n(function (Shared) {\n var ShareholderSplit = /** @class */ (function () {\n function ShareholderSplit() {\n }\n return ShareholderSplit;\n }());\n Shared.ShareholderSplit = ShareholderSplit;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n /**\n * IncomeProfit\n */\n var IncomeProfit = /** @class */ (function () {\n function IncomeProfit(parameters) {\n }\n return IncomeProfit;\n }());\n Shared.IncomeProfit = IncomeProfit;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var CompanyDividendSplit = /** @class */ (function () {\n function CompanyDividendSplit() {\n }\n return CompanyDividendSplit;\n }());\n Shared.CompanyDividendSplit = CompanyDividendSplit;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var CompanyDividendPayments = /** @class */ (function () {\n function CompanyDividendPayments() {\n }\n return CompanyDividendPayments;\n }());\n Shared.CompanyDividendPayments = CompanyDividendPayments;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var CompanyDividendPaymentSplit = /** @class */ (function () {\n function CompanyDividendPaymentSplit() {\n }\n return CompanyDividendPaymentSplit;\n }());\n Shared.CompanyDividendPaymentSplit = CompanyDividendPaymentSplit;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var TaxYear = /** @class */ (function () {\n function TaxYear() {\n }\n return TaxYear;\n }());\n Shared.TaxYear = TaxYear;\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n var TaxYearSelection = /** @class */ (function () {\n function TaxYearSelection() {\n }\n return TaxYearSelection;\n }());\n Shared.TaxYearSelection = TaxYearSelection;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var CompanyDividendPaymentGrouped = /** @class */ (function () {\n function CompanyDividendPaymentGrouped() {\n }\n return CompanyDividendPaymentGrouped;\n }());\n Shared.CompanyDividendPaymentGrouped = CompanyDividendPaymentGrouped;\n})(Shared || (Shared = {}));\n/// \n/// \nvar Shared;\n(function (Shared) {\n var TaxYearMonthSummary = /** @class */ (function () {\n function TaxYearMonthSummary() {\n }\n return TaxYearMonthSummary;\n }());\n Shared.TaxYearMonthSummary = TaxYearMonthSummary;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var ProposedDividend = /** @class */ (function () {\n function ProposedDividend() {\n }\n return ProposedDividend;\n }());\n Shared.ProposedDividend = ProposedDividend;\n})(Shared || (Shared = {}));\n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n(function () {\n \"use strict\";\n angular\n .module(\"app.shared\")\n .service(\"moneyManagerSrv\", moneyManagerSrv);\n moneyManagerSrv.$inject = [\"$http\", \"$q\", \"shared.config\", \"brookson.utilities.date\"];\n function moneyManagerSrv($http, $q, sharedConfig, dateUtils) {\n var moneyManagerSrvFactory = {};\n var serviceBase = sharedConfig.baseApiUrl;\n // Data\n var myMoneyAvailable = {};\n var weeklyAccountSummary = [];\n var selectedWeeklyAccountSummary = {};\n var startOfWeek = moment().startOf(\"week\").toDate();\n var tmp;\n // var newBusinessStatus:boolean;\n var isNewSetup = false;\n // Requests\n function getTransactions(bankId, silentMode) {\n var url = serviceBase + \"api/MoneyManager/GetTransactions\";\n var requestData = {\n bankId: bankId !== undefined ? bankId : \"\"\n };\n return $http.get(url, {\n cache: true,\n params: requestData,\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n }\n function getMoneyManagerStatements(yearStart, yearEnd, silentMode) {\n var url = serviceBase + \"api/MoneyManager/GetMoneyManagerStatements\";\n var requestData = {\n yearStart: yearStart.toDate(),\n yearEnd: yearEnd.toDate()\n };\n return $http.get(url, {\n params: requestData,\n cache: \"true\",\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n }\n function getMoneyManagerStatementsByOffset(offset, silentMode) {\n var url = serviceBase + \"api/MoneyManager/GetMoneyManagerStatementsByOffset\";\n var requestData = {\n offset: offset\n };\n return $http.get(url, {\n params: requestData,\n cache: \"false\",\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n }\n function getMoneyManagerFinancialData(silentMode) {\n var url = serviceBase + \"api/MoneyManager/GetMoneyManagerFinancialData\";\n return $http.get(url, {\n cache: \"true\",\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n }\n function getMoneyAvailableStatement(silentMode) {\n var url = serviceBase + \"api/MoneyManager/GetMoneyAvailableStatement\";\n return $http.get(url, {\n cache: \"true\",\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n }\n function getYearEndNotification(silentMode) {\n var url = serviceBase + \"api/MoneyManager/GetYearEndNotification\";\n return $http.get(url, {\n cache: \"true\",\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n }\n function getPersonalTaxCalculations(mmShareholder, taxYear, silentMode) {\n var url = serviceBase + \"api/MoneyManager/GetPersonalTaxCalculations\";\n var requestData = {\n request: {\n shareholder: mmShareholder,\n taxYear: taxYear\n }\n };\n return $http.post(url, {\n params: requestData,\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n }\n function getWeeklyAccountSummary(startDate, endDate, silentMode) {\n var url = serviceBase + \"api/MoneyManager/GetWeeklyAccountSummary\";\n var requestData = {\n startDate: startDate.toDate(),\n endDate: endDate.toDate()\n };\n return $http.get(url, {\n params: requestData,\n cache: \"true\",\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n }\n function getTransactionStatements(startDate, endDate, silentMode) {\n var url = serviceBase + \"api/MoneyManager/GetTransactionStatements\";\n var requestData = {\n startDate: startDate.toDate(),\n endDate: endDate.toDate(),\n };\n return $http.get(url, {\n params: requestData,\n cache: \"true\",\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n }\n function getAccountScheduleLastUpdateDate(silentMode) {\n return $http.get(serviceBase + \"api/MoneyManager/GetAccountScheduleLastUpdateDate\", {\n cache: \"true\",\n silentMode: silentMode ? silentMode : false\n })\n .then(function (response) {\n return response.data;\n });\n }\n function getMoneyManagerData(silentMode) {\n return $http.get(serviceBase + \"api/MoneyManager/GetMoneyManagerData\", {\n cache: \"true\",\n silentMode: silentMode ? silentMode : false\n })\n .then(function (response) {\n return response.data;\n });\n }\n function getNewBusinessStatus(silentMode) {\n return $http.get(serviceBase + \"api/MoneyManager/GetNewBusinessStatus\", {\n cache: \"true\",\n silentMode: silentMode ? silentMode : false\n })\n .then(function (response) {\n return response.data;\n });\n }\n function getIncomeProfitData(silentMode) {\n return $http.get(serviceBase + \"api/MoneyManager/GetIncomeProfitChart\", {\n cache: \"true\",\n silentMode: silentMode ? silentMode : false\n })\n .then(function (response) {\n return response.data;\n });\n }\n // Parse Data\n function weeklyAccountSummaryLogic() {\n var deferred = $q.defer();\n moneyManagerSrvFactory.getAccountScheduleLastUpdateDate().then(function (lastUpdateDateData) {\n var startDate = moment().subtract(3, \"month\").startOf(\"day\");\n var endDate = moment().startOf(\"day\");\n var lastUpdateDate = dateUtils.convertToMoment(lastUpdateDateData);\n if (lastUpdateDate.isBefore(endDate)) {\n endDate = lastUpdateDate;\n }\n moneyManagerSrvFactory.getWeeklyAccountSummary(startDate, endDate).then(function (weeklyAccountSummaryData) {\n var weeklyAccountSummary = weeklyAccountSummaryData;\n weeklyAccountSummary.reverse();\n for (var i = 0; i < weeklyAccountSummary.length; i++) {\n weeklyAccountSummary[i].businessTotal = 0;\n weeklyAccountSummary[i].personalTotal = 0;\n for (var j = 0; j < weeklyAccountSummary[i].businessTransactions.length; j++) {\n weeklyAccountSummary[i].businessTotal += weeklyAccountSummary[i].businessTransactions[j].amount;\n }\n for (j = 0; j < weeklyAccountSummary[i].personalTransactions.length; j++) {\n weeklyAccountSummary[i].personalTotal += weeklyAccountSummary[i].personalTransactions[j].amount;\n }\n }\n selectedWeeklyAccountSummary = weeklyAccountSummary[0];\n moneyManagerSrvFactory.weeklyAccountSummary = weeklyAccountSummary;\n moneyManagerSrvFactory.selectedWeeklyAccountSummary = selectedWeeklyAccountSummary;\n deferred.resolve(weeklyAccountSummary);\n }, function (er) {\n deferred.reject(er);\n });\n }, function (er) {\n deferred.reject(er);\n });\n return deferred.promise;\n }\n function moneyAvailablePanelLogic(silentMode) {\n return this.getNewBusinessStatus(silentMode).then(function (result) {\n moneyManagerSrvFactory.isNewSetup = false;\n moneyManagerSrvFactory.tmp = _.filter(moneyManagerSrvFactory.myMoneyAvailable.aftStatementChildRows, { rowCode: \"AF1\" });\n if (moneyManagerSrvFactory.tmp.length && moneyManagerSrvFactory.tmp[0].yearToDateValue) {\n moneyManagerSrvFactory.myMoneyAvailable.bankAccounts = moneyManagerSrvFactory.tmp[0].childMoneyManagerStatementRows;\n }\n moneyManagerSrvFactory.myMoneyAvailable.unpaidInvoices = moneyManagerSrvFactory.moneyManagerFinancialData.lessUnpaidInvoices;\n moneyManagerSrvFactory.myMoneyAvailable.myMoneyAvailable = moneyManagerSrvFactory.moneyManagerFinancialData.totalMoneyAvailable;\n moneyManagerSrvFactory.myMoneyAvailable.myMoneyAvailableAdjusted =\n moneyManagerSrvFactory.myMoneyAvailable.myMoneyAvailable +\n moneyManagerSrvFactory.myMoneyAvailable.unpaidInvoices;\n });\n }\n function getShareholderSplit(silentMode) {\n var url = serviceBase + \"api/MoneyManager/GetShareholderSplit\";\n return $http.get(url, {\n cache: \"true\",\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n }\n function getCtUpdateData(silentMode) {\n var url = serviceBase + \"api/MoneyManager/GetCtUpdateData\";\n return $http.get(url, {\n cache: \"true\",\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n }\n function updateCtTime(newTime) {\n return $http.post(serviceBase + 'api/MoneyManager/UpdateCtTime', JSON.stringify(newTime))\n .then(function (response) { return response.data; });\n }\n function getCompanyDividendSplit(silentMode) {\n var url = serviceBase + \"api/MoneyManager/getCompanyDividendSplit\";\n return $http.get(url, {\n cache: \"true\",\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n }\n function getCompanyDividendPayments(silentMode) {\n var url = serviceBase + \"api/MoneyManager/getCompanyDividendPayments\";\n return $http.get(url, {\n cache: \"true\",\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n }\n function saveProposedCompanyDividendPayments(selectedTaxYear, monthlyTransactions) {\n var requestData = {\n selectedTaxYear: selectedTaxYear,\n taxMonth: monthlyTransactions\n };\n return $http.post(serviceBase + 'api/MoneyManager/SaveProposedCompanyDividendPayments', requestData)\n .then(function (response) { return response.data; });\n }\n function getProposedDividendPayments(silentMode) {\n var url = serviceBase + \"api/MoneyManager/GetProposedDividendShareholderPayments\";\n return $http.get(url, {\n cache: \"true\",\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n }\n moneyManagerSrvFactory.getTransactions = getTransactions;\n moneyManagerSrvFactory.getMoneyManagerStatements = getMoneyManagerStatements;\n moneyManagerSrvFactory.getMoneyManagerStatementsByOffset = getMoneyManagerStatementsByOffset;\n moneyManagerSrvFactory.getMoneyAvailableStatement = getMoneyAvailableStatement;\n moneyManagerSrvFactory.getYearEndNotification = getYearEndNotification;\n moneyManagerSrvFactory.getPersonalTaxCalculations = getPersonalTaxCalculations;\n moneyManagerSrvFactory.getMoneyManagerFinancialData = getMoneyManagerFinancialData;\n moneyManagerSrvFactory.getWeeklyAccountSummary = getWeeklyAccountSummary;\n moneyManagerSrvFactory.getTransactionStatements = getTransactionStatements;\n moneyManagerSrvFactory.myMoneyAvailable = myMoneyAvailable;\n moneyManagerSrvFactory.weeklyAccountSummary = weeklyAccountSummary;\n moneyManagerSrvFactory.selectedWeeklyAccountSummary = selectedWeeklyAccountSummary;\n moneyManagerSrvFactory.startOfWeek = startOfWeek;\n moneyManagerSrvFactory.tmp = tmp;\n moneyManagerSrvFactory.weeklyAccountSummaryLogic = weeklyAccountSummaryLogic;\n moneyManagerSrvFactory.moneyAvailablePanelLogic = moneyAvailablePanelLogic;\n moneyManagerSrvFactory.getAccountScheduleLastUpdateDate = getAccountScheduleLastUpdateDate;\n moneyManagerSrvFactory.getMoneyManagerData = getMoneyManagerData;\n moneyManagerSrvFactory.getNewBusinessStatus = getNewBusinessStatus;\n moneyManagerSrvFactory.isNewSetup = isNewSetup;\n moneyManagerSrvFactory.getShareholderSplit = getShareholderSplit;\n moneyManagerSrvFactory.getIncomeProfitData = getIncomeProfitData;\n moneyManagerSrvFactory.getCtUpdateData = getCtUpdateData;\n moneyManagerSrvFactory.updateCtTime = updateCtTime;\n moneyManagerSrvFactory.getCompanyDividendSplit = getCompanyDividendSplit;\n moneyManagerSrvFactory.getCompanyDividendPayments = getCompanyDividendPayments;\n moneyManagerSrvFactory.saveProposedCompanyDividendPayments = saveProposedCompanyDividendPayments;\n moneyManagerSrvFactory.getProposedDividendPayments = getProposedDividendPayments;\n return moneyManagerSrvFactory;\n }\n})();\n/// \n(function () {\n 'use strict';\n angular\n .module('app.shared')\n .factory('brookson.navigation', brooksonNavigation);\n brooksonNavigation.$inject = ['$window'];\n function brooksonNavigation($window) {\n var account = {\n main: function () {\n $window.location.href = \"/Account\";\n }\n };\n var bankLink = {\n main: function () {\n $window.location.href = \"/BankLink\";\n }\n };\n var advisory = {\n main: function () {\n $window.location.href = \"/Advisory\";\n }\n };\n var selectServiceLine = {\n main: function () {\n $window.location.href = \"/SelectServiceLine\";\n }\n };\n //var jobsBoard = {\n // main: () => {\n // $window.location.href = \"/JobsBoard\";\n // }\n //};\n var workFlex = {\n main: function () {\n $window.location.href = \"/WorkFlex\";\n },\n umbrella: function () {\n $window.location.href = \"/WorkFlex/Umbrella\";\n },\n personalServiceCompany: function () {\n $window.location.href = \"/WorkFlex/PersonalServiceCompany\";\n }\n };\n var dashboard = {\n main: function () {\n $window.location.href = \"/Dashboard\";\n }\n };\n var documentStorage = {\n main: function () {\n $window.location.href = \"/DocumentStorage\";\n },\n recentlyAdded: function () {\n $window.location.href = \"/DocumentStorage/RecentlyAdded\";\n },\n favourites: function () {\n $window.location.href = \"/DocumentStorage/Favourites\";\n },\n brooksonSharedDrive: function (sharedDriveId) {\n $window.location.href = \"/DocumentStorage/BrooksonSharedDrive\" + sharedDriveId;\n },\n folder: function (folderId) {\n $window.location.href = \"DocumentStorage/\" + folderId;\n },\n paySlipFolder: function () {\n $window.location.href = \"DocumentStorage/2/\";\n }\n };\n var employeeZone = {\n holidays: function () {\n $window.location.href = \"/EmployeeZone/EmployeeHolidays\";\n },\n payslips: function () {\n $window.location.href = \"/EmployeeZone/Payslips\";\n }\n };\n var employmentStatus = {\n main: function (returnUrl, returnText) {\n if (!returnUrl && !returnText)\n $window.location.href = \"/EmploymentStatus\";\n $window.location.href = \"/EmploymentStatus?returnUrl=\".concat(returnUrl, \"&returnText=\").concat(returnText);\n },\n ir35Assignment: function (assignmentId) {\n $window.location.href = \"/EmploymentStatus/\" + assignmentId;\n }\n };\n var expenses = {\n main: function () {\n $window.location.href = \"/Expenses/Personal\";\n },\n business: function () {\n $window.location.href = \"/Expenses/Business\";\n },\n expenseDetails: function () {\n $window.location.href = \"/Expenses/ExpenseDetails\";\n },\n addExpense: function () {\n $window.location.href = \"/AddExpense\";\n },\n addMileage: function () {\n $window.location.href = \"/AddMileage\";\n },\n addReceipt: function () {\n $window.location.href = \"/AddReceipt\";\n },\n addAllowance: function () {\n $window.location.href = \"/AddAllowance\";\n },\n editExpense: function () {\n $window.location.href = \"/EditExpense\";\n },\n editMileage: function () {\n $window.location.href = \"/EditMileage\";\n },\n editReceipt: function () {\n $window.location.href = \"/EditReceipt\";\n },\n editAllowance: function () {\n $window.location.href = \"/EditAllowance\";\n },\n expenseReport: function (id) {\n $window.location.href = \"/Expenses/ExpenseReport/\" + id;\n },\n expensesReceiptBank: function () {\n $window.location.href = \"/Expenses/ReceiptBank\";\n }\n };\n var financialCenter = {\n main: function () {\n $window.location.href = \"/FinancialCenter\";\n }\n };\n var home = {\n logout: function () {\n $window.location.href = \"/Home/LogOut\";\n }\n };\n var assignments = {\n main: function () {\n $window.location.href = \"/Assignments\";\n },\n summary: function (assignmentId) {\n var url = \"/Assignments/Summary\";\n url += assignmentId ? '/' + assignmentId : '';\n $window.location.href = url;\n },\n addAssignment: function () {\n $window.location.href = \"/Assignments/Add-Assignment\";\n },\n editAssignment: function (assignmentId) {\n var url = \"/Assignments/Edit-Assignment\";\n url += assignmentId ? '/' + assignmentId : '';\n $window.location.href = url;\n }\n };\n var invoicing = {\n main: function () {\n $window.location.href = \"/Invoicing\";\n },\n raiseInvoice: function (id) {\n var url = \"/Invoicing/Raise-Invoice\";\n url += id ? '/' + id : '';\n $window.location.href = url;\n },\n createInvoice: function (id) {\n var url = \"/Invoicing/create-invoice\";\n url += id ? '/' + id : '';\n $window.location.href = url;\n },\n newInvoice: function () {\n var url = \"/Invoicing/Raise-Invoice/\";\n $window.location.href = url;\n },\n };\n var knowledgeBase = {\n main: function () {\n $window.location.href = \"/Dashboard/KnowledgeBase\";\n }\n };\n var login = {\n main: function () {\n $window.location.href = \"/Login\";\n },\n superuser: function () {\n $window.location.href = \"/Login/Super\";\n },\n serviceline: function () {\n $window.location.href = \"/Login/ServiceLine\";\n },\n registration: function () {\n $window.location.href = \"/Login/Registration\";\n },\n passwordReset: function (id) {\n $window.location.href = \"/Login/PasswordReset/\" + id;\n },\n forgottenPassword: function () {\n $window.location.href = \"/Login/ForgottenPassword\";\n },\n shareholder: function () {\n $window.location.href = \"/login/shareholder\";\n }\n };\n var moneyManager = {\n main: function () {\n $window.location.href = \"/MoneyManager\";\n },\n profitLoss: function () {\n $window.location.href = \"/MoneyManager/ProfitLoss\";\n },\n balanceSheet: function () {\n $window.location.href = \"/MoneyManager/BalanceSheet\";\n },\n history: function (week) {\n $window.location.href = \"/MoneyManager/History/\" + week;\n },\n transactions: function () {\n $window.location.href = \"/MoneyManager/Transactions\";\n }\n };\n var personalFinance = {\n main: function () {\n $window.location.href = \"/PersonalFinance\";\n },\n riskProfile: function () {\n $window.location.href = \"/PersonalFinance/RiskProfile\";\n },\n retirementPlanner: function () {\n $window.location.href = \"/PersonalFinance/RetirementPlanner\";\n }\n };\n var financialServices = {\n main: function () {\n $window.location.href = \"/FinancialServices\";\n }\n };\n var personalTax = {\n main: function () {\n $window.location.href = \"/PersonalTax\";\n },\n planner: function () {\n $window.location.href = \"/TaskPlanner/saPersonalTax\";\n },\n tracker: function () {\n $window.location.href = \"/PersonalTax/Tracker\";\n },\n hrmcersonalAccountBalance: function () {\n $window.location.href = \"/PersonalTax/HMRCPersonalAccountBalance\";\n },\n selfAssessment: function () {\n $window.location.href = \"/PersonalTax/SelfAssessment\";\n },\n selfAssessmentTAndCs: function () {\n $window.location.href = \"/PersonalTax/SelfAssessment/TermsAndConditions\";\n }\n };\n var taskPlanner = {\n main: function () {\n $window.location.href = \"/TaskPlanner\";\n },\n calendar: function () {\n $window.location.href = \"/Calendar/calendar\";\n },\n calendarSelectedAction: function (actionID) {\n $window.location.href = \"/Calendar/calendar/\" + _.camelCase(actionID);\n },\n selectedAction: function (actionID) {\n $window.location.href = \"/TaskPlanner/\" + _.camelCase(actionID);\n },\n selectedActionTask: function (actionID, taskID) {\n $window.location.href = \"/TaskPlanner/\" + _.camelCase(actionID) + \"/\" + taskID;\n }\n };\n var sme = {\n holidays: function () {\n $window.location.href = \"/Sme/Holidays\";\n }\n };\n var openBankingRedirect = {\n holidays: function () {\n $window.location.href = \"/OpenBankingRedirect\";\n }\n };\n var service = {\n account: account,\n bankLink: bankLink,\n dashboard: dashboard,\n documentStorage: documentStorage,\n employmentStatus: employmentStatus,\n expenses: expenses,\n home: home,\n assignments: assignments,\n invoicing: invoicing,\n knowledgeBase: knowledgeBase,\n login: login,\n moneyManager: moneyManager,\n personalFinance: personalFinance,\n financialServices: financialServices,\n personalTax: personalTax,\n taskPlanner: taskPlanner,\n openBankingRedirect: openBankingRedirect,\n sme: sme,\n employeeZone: employeeZone,\n financialCenter: financialCenter,\n advisory: advisory,\n selectServiceLine: selectServiceLine,\n /* jobsBoard: jobsBoard,*/\n workFlex: workFlex\n };\n return service;\n }\n})();\n/// \n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var AuthenticationService = /** @class */ (function () {\n function AuthenticationService($injector, $httpParamSerializer, $q, sharedConfig, memberSrv, brooksonNavigation, localStorageService) {\n var _this = this;\n this.$injector = $injector;\n this.$httpParamSerializer = $httpParamSerializer;\n this.$q = $q;\n this.sharedConfig = sharedConfig;\n this.memberSrv = memberSrv;\n this.brooksonNavigation = brooksonNavigation;\n this.localStorageService = localStorageService;\n this._authentication = {\n isAuth: false,\n userName: \"\",\n useRefreshTokens: false\n };\n this.validateLoginRequest = function (memberId, password) {\n _this.$http = _this.$http || _this.$injector.get(\"$http\");\n var url = _this.serviceBase + \"api/TwoFactorAuth/ValidateLoginRequest\";\n var request = {\n memberId: memberId,\n password: password\n };\n return _this.$http.post(url, request)\n .then(function (response) {\n return response.data;\n }, function (err) {\n console.log(err.data);\n })\n .catch(function (err) {\n console.log(err.data);\n });\n };\n this.twoFactorAuthRequest = function (contactAddressNumber, memberId) {\n _this.$http = _this.$http || _this.$injector.get(\"$http\");\n var url = _this.serviceBase + \"api/TwoFactorAuth/TwoFactorAuthRequest\";\n var request = {\n contactAddressNumber: contactAddressNumber,\n memberId: memberId\n };\n return _this.$http.post(url, request)\n .then(function (response) {\n return response.data;\n });\n };\n this.twoFactorAuthValidation = function (otp, memberId) {\n _this.$http = _this.$http || _this.$injector.get(\"$http\");\n var url = _this.serviceBase + \"api/TwoFactorAuth/TwoFactorAuthValidation\";\n var request = {\n otp: otp,\n memberId: memberId\n };\n return _this.$http.post(url, request)\n .then(function (response) {\n return response.data;\n });\n };\n this.getMemberMaskedContactDetails = function (memberId) {\n _this.$http = _this.$http || _this.$injector.get(\"$http\");\n var url = _this.serviceBase + \"api/TwoFactorAuth/GetMaskedMemberContactDetails\";\n var request = {\n memberId: memberId\n };\n return _this.$http.post(url, request)\n .then(function (response) {\n return response.data;\n });\n };\n this.getMemberContactDetails = function (memberId) {\n _this.$http = _this.$http || _this.$injector.get(\"$http\");\n var url = _this.serviceBase + \"api/TwoFactorAuth/GetMemberContactDetails\";\n var request = {\n memberId: memberId\n };\n return _this.$http.post(url, request)\n .then(function (response) {\n return response.data;\n });\n };\n this.saveTwoFactorAuthSetting = function (memberId, enableTfa) {\n _this.$http = _this.$http || _this.$injector.get(\"$http\");\n var url = _this.serviceBase + \"api/TwoFactorAuth/SaveTwoFactorAuthSetting\";\n var request = {\n memberId: memberId,\n enableTfa: enableTfa\n };\n return _this.$http.post(url, request)\n .then(function (response) {\n return response.data;\n });\n };\n this.memberTwoFactorAuthStatus = function (memberId) {\n _this.$http = _this.$http || _this.$injector.get(\"$http\");\n var url = _this.serviceBase + \"api/TwoFactorAuth/MemberTwoFactorAuthStatus\";\n var request = {\n memberId: memberId\n };\n return _this.$http.post(url, request)\n .then(function (response) {\n return response.data;\n });\n };\n this.login = function (loginData) {\n var deferred = _this.$q.defer();\n var data = {\n grant_type: \"password\",\n username: loginData.userName,\n password: loginData.password,\n client_id: \"\",\n scope: [loginData.sessionId, loginData.apiKeySource],\n };\n if (_this.authSettings.useRefreshToken) {\n data.client_id = _this.authSettings.clientId;\n }\n _this.$http = _this.$http || _this.$injector.get(\"$http\");\n _this.$http.post(_this.serviceBase + \"token\", _this.$httpParamSerializer(data), {\n headers: {\n 'Content-Type': \"application/x-www-form-urlencoded\"\n }\n })\n .then(function (response) {\n var refreshToken = \"\";\n if (_this.authSettings.useRefreshToken) {\n refreshToken = response.data.refresh_token;\n }\n if (response.data.access_token) {\n _this.localStorageService.set(\"brookson.showcs01confirmation\", true);\n var result = {\n token: response.data.access_token,\n memberId: Number(response.data.userName),\n userName: Number(response.data.userName),\n isAuthenticated: true,\n refreshToken: refreshToken,\n useRefreshToken: _this.authSettings.useRefreshToken,\n isAdmin: response.data.is_admin === 'true' ? true : false,\n expires: response.data['.expires'],\n refreshTokenExpires: response.data.clientRefreshTokenExpires,\n apiKeySource: response.data.apiKeySource\n };\n deferred.resolve(result);\n }\n else {\n deferred.reject(response.data);\n }\n }, function (err) {\n deferred.reject(err.data);\n });\n return deferred.promise;\n };\n this.updateAccessTokenServiceLine = function (id, serviceLine, refreshToken, apiKeySource) {\n var deferred = _this.$q.defer();\n var data = {\n member_id: id,\n company_ref: serviceLine.customerReference,\n alt_member_id: serviceLine.altMemberId,\n business_type: serviceLine.businessType,\n role: serviceLine.role,\n navReferral: serviceLine.navReferral,\n apiKeySource: apiKeySource\n };\n _this.refreshToken(data)\n .then(function (response) {\n if (response.access_token) {\n deferred.resolve(response);\n }\n else {\n deferred.reject(response);\n }\n })\n .catch(function (err) {\n deferred.reject(err);\n });\n return deferred.promise;\n };\n this.refreshToken = function (service_line) {\n var deferred = _this.$q.defer();\n var member = _this.memberSrv.getMember();\n if (member && member.useRefreshToken) {\n var data = {\n grant_type: \"refresh_token\",\n refresh_token: member.refreshToken,\n client_id: _this.authSettings.clientId,\n set_service_line: false,\n member_id: \"\",\n alt_member_id: \"\",\n company_ref: \"\",\n business_type: \"\",\n role: \"\",\n navReferral: \"\",\n apiKeySource: \"\"\n };\n if (service_line) {\n data.set_service_line = true;\n data.member_id = service_line.member_id;\n data.alt_member_id = service_line.alt_member_id;\n data.company_ref = service_line.company_ref;\n data.business_type = service_line.business_type;\n data.role = service_line.role;\n data.navReferral = service_line.navReferral;\n data.apiKeySource = service_line.apiKeySource;\n }\n _this.$http = _this.$http || _this.$injector.get(\"$http\");\n console.log('refresh request start');\n _this.$http.post(_this.serviceBase + \"token\", _this.$httpParamSerializer(data), { headers: { 'Content-Type': \"application/x-www-form-urlencoded\" } })\n .then(function (response) {\n var data = response.data;\n var result = {\n token: data.access_token,\n userName: data.userName,\n isAuthenticated: true,\n refreshToken: data.refresh_token,\n useRefreshToken: true,\n expires: data['.expires'],\n refreshTokenExpires: data.clientRefreshTokenExpires,\n apiKeySource: service_line === undefined ? data.apiKeySource : service_line.apiKeySource\n };\n _this.memberSrv.updateMember(result);\n console.log('refresh request complete');\n deferred.resolve(data);\n }).catch(function (err) { return deferred.reject(err); });\n }\n else {\n deferred.reject();\n }\n return deferred.promise;\n };\n this.logout = function () {\n _this.localStorageService.remove(\"brookson.showcs01confirmation\");\n _this.memberSrv.clearMember();\n _this.brooksonNavigation.home.logout();\n };\n this.activateMember = function (memberId, registrationId, password) {\n _this.$http = _this.$http || _this.$injector.get(\"$http\");\n var url = _this.serviceBase + \"api/Member/ActivateMember\";\n var request = {\n memberId: memberId,\n registrationId: registrationId,\n password: password\n };\n return _this.$http.post(url, request)\n .then(function (response) {\n return response.data;\n });\n };\n this.requestPasswordReset = function (memberId) {\n _this.$http = _this.$http || _this.$injector.get(\"$http\");\n var url = _this.serviceBase + \"api/Member/RequestPasswordResetSms/\" + memberId;\n return _this.$http.get(url)\n .then(function (response) {\n return response.data;\n });\n };\n this.requestForgottenClientId = function (firstName, surname, email, dateOfBirth) {\n _this.$http = _this.$http || _this.$injector.get(\"$http\");\n var url = _this.serviceBase + \"api/Member/RequestForgottenClientId\";\n var request = {\n firstName: firstName,\n surname: surname,\n email: email,\n dateOfBirth: dateOfBirth\n };\n return _this.$http.post(url, request)\n .then(function (response) {\n return response.data;\n });\n };\n this.resetMemberPassword = function (id, memberId, password) {\n _this.$http = _this.$http || _this.$injector.get(\"$http\");\n var url = _this.serviceBase + \"api/Member/resetMemberPassword\";\n var request = {\n id: id,\n memberId: memberId,\n password: password\n };\n return _this.$http.post(url, request)\n .then(function (response) {\n return response.data;\n });\n };\n this.verifyShareholderLogin = function (userName, registrationId, password) {\n _this.$http = _this.$http || _this.$injector.get(\"$http\");\n var url = _this.serviceBase + \"api/Member/verifyShareholderLogin\";\n var request = {\n username: userName,\n registrationId: registrationId,\n password: password\n };\n return _this.$http.post(url, request)\n .then(function (response) {\n return response.data;\n });\n };\n this.serviceBase = sharedConfig.baseApiUrl;\n this.authSettings = sharedConfig.authSettings;\n }\n AuthenticationService.$inject = [\"$injector\", \"$httpParamSerializer\", \"$q\", \"shared.config\", \"memberSrv\", \"brookson.navigation\", 'localStorageService'];\n return AuthenticationService;\n }());\n Shared.AuthenticationService = AuthenticationService;\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .service('authenticationSrv', Shared.AuthenticationService);\n/// \nvar Shared;\n(function (Shared) {\n var BusinessDetailSummary = /** @class */ (function () {\n function BusinessDetailSummary() {\n var _this = this;\n this.getEffectiveVatSchemeOn = function (date) {\n if (!date || (!_this.flatRateVatEffectiveDate && !_this.standardRateVatEffectiveDate)) {\n return _this.vatScheme;\n }\n switch (_this.vatScheme) {\n case Shared.VatScheme.nonFlatRate:\n if (_this.standardRateVatEffectiveDate) {\n return date < _this.standardRateVatEffectiveDate ? Shared.VatScheme.flatRate : Shared.VatScheme.nonFlatRate;\n }\n return date < _this.flatRateVatEffectiveDate ? Shared.VatScheme.nonFlatRate : Shared.VatScheme.flatRate;\n case Shared.VatScheme.flatRate:\n if (_this.flatRateVatEffectiveDate) {\n return date < _this.flatRateVatEffectiveDate ? Shared.VatScheme.nonFlatRate : Shared.VatScheme.flatRate;\n }\n return date < _this.standardRateVatEffectiveDate ? Shared.VatScheme.flatRate : Shared.VatScheme.nonFlatRate;\n default:\n if (_this.standardRateVatEffectiveDate) {\n return date < _this.standardRateVatEffectiveDate ? Shared.VatScheme.none : Shared.VatScheme.nonFlatRate;\n }\n return date < _this.flatRateVatEffectiveDate ? Shared.VatScheme.none : Shared.VatScheme.flatRate;\n }\n };\n }\n return BusinessDetailSummary;\n }());\n Shared.BusinessDetailSummary = BusinessDetailSummary;\n})(Shared || (Shared = {}));\n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var ServiceLineService = /** @class */ (function () {\n function ServiceLineService($http, $q, sharedConfig, memberSrv) {\n var _this = this;\n this.$http = $http;\n this.$q = $q;\n this.sharedConfig = sharedConfig;\n this.memberSrv = memberSrv;\n this.serviceLines = [];\n this.getBusinessDetailSummary = function () {\n return _this.$http.get(_this.serviceBase + 'api/Member/GetBusinessDetailSummary', {\n cache: true\n })\n .then(function (response) {\n var businessDetailSummary = new Shared.BusinessDetailSummary();\n businessDetailSummary.companyName = response.data.companyName;\n businessDetailSummary.companyRegistrationNo = response.data.companyRegistrationNo;\n businessDetailSummary.vatNo = response.data.vatNo;\n businessDetailSummary.vatScheme = response.data.vatScheme;\n if (response.data.flatRateVatEffectiveDate) {\n businessDetailSummary.flatRateVatEffectiveDate = new Date(response.data.flatRateVatEffectiveDate);\n }\n if (response.data.standardRateVatEffectiveDate) {\n businessDetailSummary.standardRateVatEffectiveDate = new Date(response.data.standardRateVatEffectiveDate);\n }\n _this.businessDetailSummary = businessDetailSummary;\n return _this.businessDetailSummary;\n });\n };\n this.getServiceLines = function (member) {\n var deferred = _this.$q.defer();\n if (member.memberId) {\n if (_this.serviceLines.length > 0) {\n deferred.resolve(_this.serviceLines);\n }\n else {\n _this.$http.get(_this.serviceBase + 'api/Member/GetServiceLinesDistinct/' + member.memberId)\n .success(function (data) {\n //save in the service;\n _this.serviceLines = data;\n deferred.resolve(data);\n }).error(function (err, status) {\n deferred.reject(err);\n });\n }\n }\n else {\n deferred.reject({ error_description: 'Invalid Member Id.' });\n }\n return deferred.promise;\n };\n this.serviceBase = sharedConfig.baseApiUrl;\n }\n ServiceLineService.$inject = ['$http', '$q', 'shared.config', 'memberSrv'];\n return ServiceLineService;\n }());\n Shared.ServiceLineService = ServiceLineService;\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .service('serviceLineSrv', Shared.ServiceLineService);\nvar Shared;\n(function (Shared) {\n var SaveExpenseRequest = /** @class */ (function () {\n function SaveExpenseRequest() {\n }\n return SaveExpenseRequest;\n }());\n Shared.SaveExpenseRequest = SaveExpenseRequest;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var ExpenseHeader = /** @class */ (function () {\n function ExpenseHeader() {\n }\n return ExpenseHeader;\n }());\n Shared.ExpenseHeader = ExpenseHeader;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var SubmissionType;\n (function (SubmissionType) {\n SubmissionType[SubmissionType[\"unknown\"] = 0] = \"unknown\";\n SubmissionType[SubmissionType[\"mileage\"] = 1] = \"mileage\";\n SubmissionType[SubmissionType[\"receiptAttached\"] = 2] = \"receiptAttached\";\n SubmissionType[SubmissionType[\"receiptPrinted\"] = 3] = \"receiptPrinted\";\n SubmissionType[SubmissionType[\"miracleManual\"] = 4] = \"miracleManual\";\n })(SubmissionType = Shared.SubmissionType || (Shared.SubmissionType = {}));\n})(Shared || (Shared = {}));\n/// \n/// \nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var ExpenseType = /** @class */ (function () {\n function ExpenseType() {\n // EXPENSETYPEID\n this.expenseTypeId = null;\n // EXPENSETYPEDESCRIPTION\n this.expenseTypeDescription = null;\n // EXPENSESUBMISSIONTYPE\n this.expenseSubmissionType = 0;\n // SUBMISSIONTYPEENUM\n this.submissionTypeEnum = null;\n // EXPENSERECEIPTATTACHABLE\n this.expenseReceiptAttachable = false;\n // PAYMENTCODE\n this.paymentCode = null;\n // CATEGORY\n this.category = null;\n // ACCOUNTTYPE\n this.accountType = null;\n // DEFAULTEXPENSERATE\n this.defaultExpenseRate = 0;\n // RATES\n this.rates = null;\n this.quantityLabel = null;\n this.isWholeNumber = false;\n this.offsite = false;\n this.deemed = false;\n this.isPublicSector = false;\n this.expenseGroup = null;\n this.sdcCheckApplicable = false;\n this.showWarning = false;\n this.warningHtml = null;\n }\n return ExpenseType;\n }());\n Shared.ExpenseType = ExpenseType;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var ExpenseWarning = /** @class */ (function () {\n function ExpenseWarning() {\n this.showWarningHighRisk = false;\n this.showWarningAmount = false;\n this.showWarningMonthRule = false;\n this.warning = null;\n this.warningMessage = null;\n this.confirmed = false;\n this.dateConfirmed = null;\n this.warningMessageTwentyFour = null;\n this.confirmedTwentyFour = false;\n this.dateConfirmedTwentyFour = null;\n }\n return ExpenseWarning;\n }());\n Shared.ExpenseWarning = ExpenseWarning;\n var ConfirmedExpenseWarning = /** @class */ (function () {\n function ConfirmedExpenseWarning() {\n }\n return ConfirmedExpenseWarning;\n }());\n Shared.ConfirmedExpenseWarning = ConfirmedExpenseWarning;\n var ExpenseTabWarning = /** @class */ (function () {\n function ExpenseTabWarning(tabName) {\n this.name = null;\n this.presentedWarnings = 0;\n this.name = tabName;\n }\n return ExpenseTabWarning;\n }());\n Shared.ExpenseTabWarning = ExpenseTabWarning;\n var ExpenseTabWarnings = /** @class */ (function () {\n function ExpenseTabWarnings() {\n this.warningCount = 0;\n this.tabWarnings = new Array();\n }\n return ExpenseTabWarnings;\n }());\n Shared.ExpenseTabWarnings = ExpenseTabWarnings;\n})(Shared || (Shared = {}));\n/// \n/// \nvar Shared;\n(function (Shared) {\n var CoreExpenseItem = /** @class */ (function () {\n function CoreExpenseItem() {\n this.expenseWarning = new Shared.ExpenseWarning();\n }\n return CoreExpenseItem;\n }());\n Shared.CoreExpenseItem = CoreExpenseItem;\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n var RegularExpense = /** @class */ (function (_super) {\n __extends(RegularExpense, _super);\n function RegularExpense() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return RegularExpense;\n }(Shared.CoreExpenseItem));\n Shared.RegularExpense = RegularExpense;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var AppliedRate = /** @class */ (function () {\n function AppliedRate() {\n }\n return AppliedRate;\n }());\n Shared.AppliedRate = AppliedRate;\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var ExpenseMileageVehicle = /** @class */ (function () {\n function ExpenseMileageVehicle() {\n // VEHICLEMAKE\n this.vehicleMake = null;\n // VEHICLEMODEL\n this.vehicleModel = null;\n // FUELTYPE\n this.fuelType = null;\n // ENGINECC\n this.engineCC = null;\n // REGISTRATION\n this.registration = null;\n // STARTDATE\n this.startDate = null;\n // ENDDATE\n this.endDate = null;\n }\n return ExpenseMileageVehicle;\n }());\n Shared.ExpenseMileageVehicle = ExpenseMileageVehicle;\n})(Shared || (Shared = {}));\n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var MileageExpense = /** @class */ (function (_super) {\n __extends(MileageExpense, _super);\n function MileageExpense() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return MileageExpense;\n }(Shared.CoreExpenseItem));\n Shared.MileageExpense = MileageExpense;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var ExpenseDetails = /** @class */ (function () {\n function ExpenseDetails() {\n }\n return ExpenseDetails;\n }());\n Shared.ExpenseDetails = ExpenseDetails;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var ExpenseDataSource;\n (function (ExpenseDataSource) {\n ExpenseDataSource[ExpenseDataSource[\"OldExpenses\"] = 0] = \"OldExpenses\";\n ExpenseDataSource[ExpenseDataSource[\"Expenses\"] = 1] = \"Expenses\";\n ExpenseDataSource[ExpenseDataSource[\"MiracleExpenses\"] = 2] = \"MiracleExpenses\";\n })(ExpenseDataSource = Shared.ExpenseDataSource || (Shared.ExpenseDataSource = {}));\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var ExpensesOverview = /** @class */ (function () {\n function ExpensesOverview() {\n }\n return ExpensesOverview;\n }());\n Shared.ExpensesOverview = ExpensesOverview;\n var ExpensePlottingData = /** @class */ (function () {\n function ExpensePlottingData() {\n }\n return ExpensePlottingData;\n }());\n Shared.ExpensePlottingData = ExpensePlottingData;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var MileageExpenseRateLookup = /** @class */ (function () {\n function MileageExpenseRateLookup() {\n }\n return MileageExpenseRateLookup;\n }());\n Shared.MileageExpenseRateLookup = MileageExpenseRateLookup;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var ExpenseTotals = /** @class */ (function () {\n function ExpenseTotals() {\n }\n return ExpenseTotals;\n }());\n Shared.ExpenseTotals = ExpenseTotals;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var VatRate = /** @class */ (function () {\n function VatRate() {\n }\n return VatRate;\n }());\n Shared.VatRate = VatRate;\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n var ContactEnums = /** @class */ (function () {\n function ContactEnums() {\n this.ContactInformation = {\n CustomerServicesPhone: '0345 058 1200 or 01925 232 526',\n CustomerServicesEmail: 'businessadvisors@brookson.co.uk'\n };\n }\n ContactEnums.Default = function () { return new ContactEnums(); };\n return ContactEnums;\n }());\n Shared.ContactEnums = ContactEnums;\n var InvoicingEnums = /** @class */ (function () {\n function InvoicingEnums() {\n this.RatePeriods = {\n HOUR: 0,\n DAY: 1,\n WEEK: 2,\n properties: {\n 0: { value: \"Hour\", adjective: \"Hourly\" },\n 1: { value: \"Day\", adjective: \"Daily\" },\n 2: { value: \"Week\", adjective: \"Weekly\" }\n }\n };\n this.InvoiceCreationStatus = {\n OVERRIDE: 0,\n SUCCESSFUL: 1,\n EXCEPTION: 2\n };\n this.InvoiceStatus = {\n NONE: 0,\n NEW: 1,\n MODIFIED: 2,\n DELETED: 3\n };\n this.Sectors = {\n PUBLIC: 0,\n PRIVATE: 1,\n NOLONGERINUSE: 2,\n NEITHER: 3,\n properties: {\n 0: { description: 'Public', id: 0 },\n 1: { description: 'Private', id: 1 },\n 2: { description: 'NoLongerInUse', id: 2 },\n 3: { description: 'Neither', id: 3 }\n }\n };\n this.TimesheetFrequency = {\n WEEKLY: 0,\n FORTNIGHTLY: 2,\n MONTHLY: 3,\n properties: {\n 0: { description: 'Weekly', id: 0 },\n 1: { description: 'Fortnightly', id: 2 },\n 2: { description: 'Monthly', id: 3 },\n }\n };\n this.Ir35Captured = {\n NOTASSESSED: 0,\n OUTSIDEIR35: 1,\n INSIDEIR35: 2,\n properties: {\n 0: { description: 'Status not assessed yet', id: 0 },\n 1: { description: 'Outside IR35', id: 1 },\n 2: { description: 'Inside IR35', id: 2 },\n }\n };\n }\n InvoicingEnums.Default = function () { return new InvoicingEnums(); };\n return InvoicingEnums;\n }());\n Shared.InvoicingEnums = InvoicingEnums;\n var CurrencyEnums = /** @class */ (function () {\n function CurrencyEnums() {\n this.CurrencyCodes = {\n GBP: 10,\n EUR: 20,\n USD: 30,\n YEN: 60,\n AUD: 70,\n CAD: 80,\n NOK: 90,\n ZAR: 100,\n SEK: 110,\n CHF: 120,\n AED: 130,\n QAR: 140,\n SGD: 150,\n properties: {\n 10: { value: \"GBP\", code: \"£\" },\n 20: { value: \"EUR\", code: \"€\" },\n 30: { value: \"USD\", code: \"$\" },\n 60: { value: \"YEN\", code: \"¥\" },\n 70: { value: \"AUD\", code: \"$\" },\n 80: { value: \"CAD\", code: \"$\" },\n 90: { value: \"NOK\", code: \"kr\" },\n 100: { value: \"ZAR\", code: \"R\" },\n 110: { value: \"SEK\", code: \"kr\" },\n 120: { value: \"CHF\", code: \"chf\" },\n 130: { value: \"AED\", code: \"aed\" },\n 140: { value: \"QAR\", code: \"qar\" },\n 150: { value: \"SGD\", code: \"S$\" }\n }\n };\n }\n CurrencyEnums.Default = function () { return new CurrencyEnums(); };\n return CurrencyEnums;\n }());\n Shared.CurrencyEnums = CurrencyEnums;\n var ExpensesEnums = /** @class */ (function () {\n function ExpensesEnums() {\n this.PersonalOrCompany = {\n PERSONAL: 0,\n COMPANY: 1,\n properties: {\n 0: { description: 'Personal' },\n 1: { description: 'Company' }\n }\n };\n this.ExpenseTypeCategory = {\n MILEAGE: 'MILEAGE'\n };\n this.ExpenseWarningCodeTypes = {\n HighRisk: 1,\n Amount: 2,\n TwentyFourMonthRule: 3,\n };\n this.ExpenseSubmissionType = {\n UNKNOWN: 0,\n MILEAGE: 1,\n RECEIPTATTACHED: 2,\n RECEIPTPRINTED: 3,\n MIRACLEMANUAL: 4,\n properties: {\n 0: { description: 'Unknown' },\n 1: { description: 'Mileage' },\n 2: { description: 'Receipt Attached' },\n 3: { description: 'Receipt Printed' },\n 4: { description: 'Manual' }\n }\n };\n this.ReceiptStatus = {\n UNKNOWN: 0,\n UNATTACHED: 1,\n UNSUBMITTED: 2,\n SUBMITTED: 3\n };\n this.FuelTypes = {\n PETROL: 1,\n DIESEL: 2,\n LPG: 3,\n properties: {\n 1: { description: 'Petrol' },\n 2: { description: 'Diesel' },\n 3: { description: 'LPG' }\n }\n };\n this.EngineSize = {\n PETROL1_1400: 10,\n PETROL1401_2000: 20,\n PETROL2001_9999: 30,\n LPG1_1400: 40,\n LPG1401_2000: 50,\n LPG2001_9999: 60,\n DIESEL1_1600: 70,\n DIESEL1601_2000: 80,\n DIESEL2001_9999: 90,\n properties: {\n 10: { description: \"1-1400cc\", code: \"1400\" },\n 20: { description: \"1401-2000cc\", code: \"2000\" },\n 30: { description: \"2001-9999cc\", code: \"9999\" },\n 40: { description: \"1-1400cc\", code: \"1400\" },\n 50: { description: \"1401-2000cc\", code: \"2000\" },\n 60: { description: \"2001-9999cc\", code: \"9999\" },\n 70: { description: \"1-1600cc\", code: \"1600\" },\n 80: { description: \"1601-2000cc\", code: \"2000\" },\n 90: { description: \"2001-9999cc\", code: \"9999\" },\n }\n };\n }\n ExpensesEnums.Default = function () { return new ExpensesEnums(); };\n return ExpensesEnums;\n }());\n Shared.ExpensesEnums = ExpensesEnums;\n var ImageEnums = /** @class */ (function () {\n function ImageEnums() {\n this.ImageSize = {\n ORIGINAL: 0,\n CUSTOM: 1,\n ASPECTRATIO: 2\n };\n }\n ImageEnums.Default = function () { return new ImageEnums(); };\n return ImageEnums;\n }());\n Shared.ImageEnums = ImageEnums;\n var DocumentStorageEnums = /** @class */ (function () {\n function DocumentStorageEnums() {\n this.FileView = {\n DETAILED: 0,\n THUMBNAIL: 1\n };\n this.SharedDriveLinkStatus = {\n NONE: 0,\n SUCCESSFUL: 1,\n ERROR: 2\n };\n this.DocumentCategory = {\n FOLDER: \"\",\n RECENTLYADDED: \"Recently Added\",\n FAVOURITES: \"Favourites\",\n SHAREDDRIVE: \"Brookson Shared Drive\"\n };\n this.DocumentDataSource = {\n MEMBERWEBDOCUMENTS: 0,\n QUEUESERVICE: 1,\n MOLEDATA: 2,\n DROPBOX: 3\n };\n }\n DocumentStorageEnums.Default = function () { return new DocumentStorageEnums(); };\n return DocumentStorageEnums;\n }());\n Shared.DocumentStorageEnums = DocumentStorageEnums;\n var DialogueEnums = /** @class */ (function () {\n function DialogueEnums() {\n this.Dialogues = {\n MILEAGE24MONTHRULE: \"MILEAGE24MONTHRULE\",\n EXPENSESNOTICE: \"EXPENSESNOTICE\"\n };\n }\n DialogueEnums.Default = function () { return new DialogueEnums(); };\n return DialogueEnums;\n }());\n Shared.DialogueEnums = DialogueEnums;\n var PersonalTaxEnums = /** @class */ (function () {\n function PersonalTaxEnums() {\n this.Timeframes = {\n FORECAST: \"FORECAST\",\n YEARTODATE: \"YEARTODATE\",\n properties: {\n \"FORECAST\": { value: \"FORECAST\", description: \"Forecast\" },\n \"YEARTODATE\": { value: \"YEARTODATE\", description: \"Year To Date\" }\n }\n };\n }\n PersonalTaxEnums.Default = function () { return new PersonalTaxEnums(); };\n return PersonalTaxEnums;\n }());\n Shared.PersonalTaxEnums = PersonalTaxEnums;\n var TaskPlannerEnums = /** @class */ (function () {\n function TaskPlannerEnums() {\n this.TaskStatus = {\n COMPLETED: 0,\n CURRENT: 1,\n FUTURE: 2,\n OVERDUE: 3,\n properties: {\n 0: { values: 0, description: \"Completed\", css: \"task-completed\" },\n 1: { values: 1, description: \"Current\", css: \"task-current\" },\n 2: { values: 2, description: \"Future\", css: \"task-future\" },\n 3: { values: 3, description: \"Overdue\", css: \"task-overdue\" },\n }\n };\n this.TaskResponsibility = {\n ME: 'Me',\n BROOKSON: 'Brookson'\n };\n }\n TaskPlannerEnums.Default = function () { return new TaskPlannerEnums(); };\n return TaskPlannerEnums;\n }());\n Shared.TaskPlannerEnums = TaskPlannerEnums;\n var LoggingEnums = /** @class */ (function () {\n function LoggingEnums() {\n this.LoggingLevel = {\n DEBUG: 0,\n INFO: 1,\n WARN: 2,\n ERROR: 3,\n FATAL: 4\n };\n }\n LoggingEnums.Default = function () { return new LoggingEnums(); };\n return LoggingEnums;\n }());\n Shared.LoggingEnums = LoggingEnums;\n var BankLinkEnums = /** @class */ (function () {\n function BankLinkEnums() {\n this.BankAccountType = {\n CURRENT: 0,\n DEPOSIT: 1,\n CREDIT_CARD: 2,\n DEPOSIT_BOND: 3\n };\n this.TransactionType = {\n BUSINESS: 0,\n PERSONAL: 1,\n UNALLOCATED: 2,\n ALL: 3,\n OUTGOINGS: 4,\n properties: {\n 0: { description: 'Business' },\n 1: { description: 'Personal' },\n 2: { description: 'Unallocated' },\n 3: { description: 'All Types' },\n 4: { description: 'Outgoings & Balances' }\n }\n };\n this.TransactionStatuses = {\n NONE: 0,\n SAVED: 1,\n SUBMITTED: 2,\n PROCESSED: 3,\n INTOUCHPROCESSED: 4,\n };\n this.BankLogos = {\n BARCLAYS: '/Content/img/logos/banklogos/svg/logo_barclays.svg',\n CASHPLUS: '/Content/img/logos/banklogos/svg/logo_cashplus.svg',\n HSBC: '/Content/img/logos/banklogos/svg/logo_hsbc.svg',\n LLOYDS: '/Content/img/logos/banklogos/svg/logo_lloyds.svg',\n RBS: '/Content/img/logos/banklogos/svg/logo_rbs.svg',\n SANTANDER: '/Content/img/logos/banklogos/svg/logo_santander.png',\n HALIFAX: '/Content/img/logos/banklogos/svg/halifax.svg'\n };\n this.BankIcons = {\n BARC: '/Content/img/logos/banklogos/svg/icon_barclays.svg',\n CASHPLUS: '/Content/img/logos/banklogos/svg/icon_cashplus.svg',\n HSBC: '/Content/img/logos/banklogos/svg/icon_hsbc.svg',\n LLOYDS: '/Content/img/logos/banklogos/svg/icon_lloydsbank.svg',\n RBS: '/Content/img/logos/banklogos/svg/icon_rbs.svg',\n SANTANDER: '/Content/img/logos/banklogos/svg/icon_santander.svg',\n HALIFAX: '/Content/img/logos/banklogos/svg/halifax.svg'\n };\n }\n BankLinkEnums.Default = function () { return new BankLinkEnums(); };\n return BankLinkEnums;\n }());\n Shared.BankLinkEnums = BankLinkEnums;\n var NotificationEnums = /** @class */ (function () {\n function NotificationEnums() {\n this.NotificationSymbol = {\n \"money\": 'fa-gbp',\n \"process\": 'fa-cog',\n \"guide\": 'fa-question-circle',\n \"video\": 'fa-play',\n \"document\": 'fa-file',\n \"book\": 'fa-calendar',\n \"information\": 'fa-info-circle'\n };\n this.NotificationColourLabel = {\n \"red\": 'label-danger',\n \"blue\": 'label-primary',\n \"green\": 'label-success',\n \"yellow\": 'label-warning',\n \"grey\": 'label-default'\n };\n }\n NotificationEnums.Default = function () { return new NotificationEnums(); };\n return NotificationEnums;\n }());\n Shared.NotificationEnums = NotificationEnums;\n var HolidaysEnums = /** @class */ (function () {\n function HolidaysEnums() {\n this.HolidayRequestStatus = {\n ALL: 0,\n PENDING: 1,\n APPROVED: 2,\n REJECTED: 3,\n properties: {\n 0: { description: \"All\" },\n 1: { description: \"Pending\" },\n 2: { description: \"Approved\" },\n 3: { description: \"Rejected\" }\n }\n };\n }\n HolidaysEnums.Default = function () { return new HolidaysEnums(); };\n return HolidaysEnums;\n }());\n Shared.HolidaysEnums = HolidaysEnums;\n var MemberEnums = /** @class */ (function () {\n function MemberEnums() {\n this.ServiceLineRole = {\n UNKNOWN: 'UNKNOWN',\n DIRECTOR: 'DIRECTOR',\n SHAREHOLDER: 'SHAREHOLDER',\n EMPLOYEE: 'EMPLOYEE',\n NONPRINCIPALDIR: 'NON PRINCIPAL DIR'\n };\n this.ServiceLineBusinessType = {\n UNKNOWN: 'UNKNOWN',\n LTD: 'LTD',\n UMBRELLA: 'UMBRELLA',\n SME: 'SME'\n };\n }\n MemberEnums.Default = function () { return new MemberEnums(); };\n return MemberEnums;\n }());\n Shared.MemberEnums = MemberEnums;\n var IR35Enums = /** @class */ (function () {\n function IR35Enums() {\n this.IR35Status = {\n IR35Status_TaxedAsPAYE: 0,\n IR35Status_TaxedAsSelfEmployed: 1,\n IR35Status_Caution: 2,\n IR35Status_ActionRequired: 3,\n IR35Status_WithdrawnReview: 4,\n IR35Status_AssessmentFormSubmit: 5,\n IR35Status_AssessmentFormStarted: 6,\n properties: {\n 0: { description: \"Taxed as PAYE\" },\n 1: { description: \"Taxed as Self Employed\" },\n 2: { description: \"Caution\" },\n 3: { description: \"Action Required\" },\n 4: { description: \"Review Incomplete\" },\n 5: { description: \"Assessment Form Submitted\" },\n 6: { description: \"Assessment Form Incomplete\" }\n }\n };\n }\n IR35Enums.Default = function () { return new IR35Enums(); };\n return IR35Enums;\n }());\n Shared.IR35Enums = IR35Enums;\n angular.module(\"app.shared\")\n .constant(\"contact.enums\", ContactEnums.Default())\n .constant(\"invoicing.enums\", InvoicingEnums.Default())\n .constant(\"currency.enums\", CurrencyEnums.Default())\n .constant(\"expenses.enums\", ExpensesEnums.Default())\n .constant(\"image.enums\", ImageEnums.Default())\n .constant(\"documentStorage.enums\", DocumentStorageEnums.Default())\n .constant('dialogue.enums', DialogueEnums.Default())\n .constant('personalTax.enums', PersonalTaxEnums.Default())\n .constant('taskPlanner.enums', TaskPlannerEnums.Default())\n .constant('logging.enums', LoggingEnums.Default())\n .constant('bankLink.enums', BankLinkEnums.Default())\n .constant('notification.enums', NotificationEnums.Default())\n .constant('holidays.enums', HolidaysEnums.Default())\n .constant('member.enums', MemberEnums.Default())\n .constant('ir35.enums', IR35Enums.Default());\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var ReceiptsService = /** @class */ (function () {\n function ReceiptsService($http) {\n this.$http = $http;\n }\n ReceiptsService.prototype.getReceipts = function (silentMode) {\n return this.$http.get(\"api/Receipts/GetReceipts\", {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n };\n ReceiptsService.prototype.getReceiptImageData = function (id, size, width, height, silentMode) {\n var requestData = {\n size: size,\n width: width,\n height: height\n };\n return this.$http.get(\"api/Receipts/GetReceiptImageData/\".concat(id), {\n params: requestData,\n silentMode: silentMode ? silentMode : false\n }).then(function (response) { return response.data; });\n };\n ReceiptsService.prototype.deleteReceipts = function (receipts) {\n return this.$http.post(\"api/Receipts/DeleteReceipts\", receipts)\n .then(function (response) { return response.data; });\n };\n ReceiptsService.prototype.cropReceipt = function (receiptId, imageData) {\n var requestData = {\n receiptId: receiptId,\n imageData: imageData\n };\n return this.$http.post(\"api/Receipts/CropReceipt\", requestData)\n .then(function (response) { return response.data; });\n };\n ReceiptsService.$inject = ['$http'];\n return ReceiptsService;\n }());\n Shared.ReceiptsService = ReceiptsService;\n})(Shared || (Shared = {}));\nangular\n .module(\"app.shared\")\n .service(\"receiptSrv\", Shared.ReceiptsService);\n/// \n/// \nvar Shared;\n(function (Shared) {\n var ExpensesService = /** @class */ (function () {\n function ExpensesService($http) {\n this.$http = $http;\n }\n ExpensesService.prototype.getMileageRates = function (silentMode) {\n var requestData = {\n effectiveDate: new Date()\n };\n return this.$http.get(\"api/Expenses/GetMileageRateLookup\", {\n params: requestData,\n silentMode: silentMode ? silentMode : false\n }).then(function (response) { return response.data; });\n };\n ExpensesService.prototype.getExpenses = function (pageSize, pageNo) {\n var requestData = {\n pageSize: pageSize,\n pageNo: pageNo\n };\n return this.$http.get(\"api/Expenses/GetExpenses\", {\n params: requestData\n }).then(function (response) { return response.data; });\n };\n ExpensesService.prototype.getExpenseGuidancePaymentCodes = function () {\n return this.$http.get(\"api/Expenses/GetExpenseGuidancePaymentCodes\")\n .then(function (response) { return response.data; });\n };\n ExpensesService.prototype.getPersonalMileageAndTotalExpenses = function () {\n return this.$http.get(\"api/Expenses/GetPersonalMileageAndTotalExpenses\")\n .then(function (response) { return response.data; });\n };\n ExpensesService.prototype.saveExpenses = function (expenses, silentMode, hideGrowl) {\n expenses.hideGrowl = hideGrowl;\n return this.$http.post(\"api/Expenses/SaveExpenses\", expenses, {\n silentMode: silentMode\n }).then(function (response) { return response.data; });\n };\n ExpensesService.prototype.deleteExpense = function (expenseSubmissionId) {\n return this.$http.delete(\"api/Expenses/DeleteExpense/\".concat(expenseSubmissionId))\n .then(function (response) { return response.data; });\n };\n ExpensesService.prototype.submitExpense = function (id, source, acceptMissingReceiptsExpenses) {\n var request = {\n id: id,\n source: source,\n acceptMissingReceiptsExpenses: acceptMissingReceiptsExpenses\n };\n return this.$http.post(\"api/Expenses/SubmitExpenses\", request)\n .then(function (response) { return response.data; });\n };\n ExpensesService.prototype.getExpenseDetails = function (expenseSubmissionId, dataSource) {\n var requestData = {\n id: expenseSubmissionId,\n source: dataSource\n };\n return this.$http.get(\"api/Expenses/GetExpenseDetails\", {\n params: requestData\n }).then(function (response) { return response.data; });\n };\n ExpensesService.prototype.expenseReport = function (id, source) {\n var requestData = {\n id: id,\n source: source\n };\n return this.$http.get(\"api/Expenses/GetExpenseReport\", {\n params: requestData\n }).then(function (response) { return response.data; });\n };\n ExpensesService.prototype.getExpenseOverView = function (silentMode) {\n return this.$http.get(\"api/Expenses/GetExpenseOverview\", {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) { return response.data; });\n };\n ExpensesService.prototype.getExpenseTypes = function (silentMode) {\n return this.$http.get(\"api/Expenses/GetExpenseTypes/\")\n .then(function (response) { return response.data; });\n };\n ExpensesService.prototype.getExpenseWarnings = function (silentMode) {\n return this.$http.get('api/Expenses/GetExpenseWarnings/')\n .then(function (response) { return response.data; });\n };\n ExpensesService.prototype.getExpenseWarningTypes = function (silentMode) {\n return this.$http.get('api/Expenses/GetExpenseWarningTypes/')\n .then(function (response) { return response.data; });\n };\n ExpensesService.prototype.getPublicSectorExpenseTypes = function (silentMode) {\n return this.$http.get(\"api/Expenses/GetPublicSectorExpenseTypes/\")\n .then(function (response) { return response.data; });\n };\n ExpensesService.prototype.getExpenseVehicles = function (silentMode) {\n return this.$http.get(\"api/Expenses/GetExpenseVehicles/\")\n .then(function (response) { return response.data; });\n };\n ExpensesService.prototype.getExpenseVehiclesLookup = function (silentMode) {\n return this.$http.get(\"api/Expenses/GetExpenseVehiclesLookup/\")\n .then(function (response) { return response.data; });\n };\n ExpensesService.prototype.saveExpenseVehicle = function (vehicle) {\n return this.$http.post(\"api/Expenses/SaveExpenseVehicle\", vehicle).then(function (response) { return response.data; });\n };\n ExpensesService.prototype.getTotalMileageForCurrentTaxYear = function (silentMode) {\n var requestData = {\n effectiveDate: new Date()\n };\n return this.$http.get(\"api/Expenses/GetMileageTotal\", {\n params: requestData,\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n };\n ExpensesService.prototype.getTotalMileageForPreviousTaxYear = function (silentMode) {\n var requestData = {\n effectiveDate: moment(new Date()).add(-1, 'year').toDate()\n };\n return this.$http.get(\"api/Expenses/GetMileageTotal\", {\n params: requestData,\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n };\n ExpensesService.prototype.removeWarningConfirmationsByExpenseId = function (expenseSubmissionId) {\n return this.$http.delete(\"api/Expenses/DeleteWarningConfirmation/\".concat(expenseSubmissionId))\n .then(function (response) { return response.data; });\n };\n ExpensesService.$inject = ['$http'];\n return ExpensesService;\n }());\n Shared.ExpensesService = ExpensesService;\n})(Shared || (Shared = {}));\nangular\n .module(\"app.shared\")\n .service(\"expensesSrv\", Shared.ExpensesService);\nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var ExpenseWarnings = /** @class */ (function () {\n function ExpenseWarnings() {\n // EXPENSEWARNINGID\n this.expenseWarningId = 0;\n // CODEVALUE\n this.codeValue = null;\n // CODETEXT\n this.codeText = null;\n // CATEGORY\n this.category = null;\n // WARNINGMESSAGETEXT\n this.warningMessageText = null;\n // TIMELENGTH\n this.timeLength = 0;\n // VALUELIMIT\n this.valueLimit = 0;\n // HIGHRISK\n this.highRisk = false;\n // 24MTHRULEAPPLICABLE\n this.twentyFourMthRuleApplicable = false;\n // 24MTHTRIGGEROVERRIDE\n this.twentyFourMthTriggerOverride = 0;\n // ENABLED\n this.enabled = false;\n }\n return ExpenseWarnings;\n }());\n Shared.ExpenseWarnings = ExpenseWarnings;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var ExpenseWarningsService = /** @class */ (function () {\n function ExpenseWarningsService($http) {\n this.$http = $http;\n }\n ExpenseWarningsService.prototype.saveExpenseWarnings = function (assignmentId, memberId, expenseHeaderId, expenseWarnings) {\n var expenseConfirmationModel = {\n memberId: memberId,\n assignmentId: assignmentId,\n expenseHeaderId: expenseHeaderId,\n confirmedWarnings: expenseWarnings\n };\n return this.$http.post(\"/api/expenses/saveExpenseWarnings\", expenseConfirmationModel)\n .then(function (response) { return response.data; });\n };\n ExpenseWarningsService.prototype.getConfirmedExpenseWarnings = function (memberid, assignmentId) {\n var requestData = {\n memberId: memberid,\n assignmentId: assignmentId\n };\n return this.$http.get(\"/api/expenses/getExpenseWarningConfirmations\", { params: requestData })\n .then(function (response) { return response.data; });\n };\n ExpenseWarningsService.prototype.deleteExpenseWarningLogById = function (expenseWarningLogId) {\n return this.$http.delete(\"api/Expenses/DeleteExpenseWarningLogById/\".concat(expenseWarningLogId))\n .then(function (response) { return response.data; });\n };\n ExpenseWarningsService.$inject = ['$http'];\n return ExpenseWarningsService;\n }());\n Shared.ExpenseWarningsService = ExpenseWarningsService;\n})(Shared || (Shared = {}));\nangular\n .module(\"app.shared\")\n .service(\"expensesWarningsService\", Shared.ExpenseWarningsService);\nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var ExpenseWarningTypes = /** @class */ (function () {\n function ExpenseWarningTypes() {\n // EXPENSETYPEWARNINGTYPEID\n this.expenseWarningTypeId = 0;\n // EXPENSEWARNINGID\n this.expenseWarningId = 0;\n // EXPENSEWARNINGCODETYPEID\n this.expenseWarningCodeTypeId = 0;\n // EXPENSEWARNINGTEXT\n this.expenseWarningText = null;\n }\n return ExpenseWarningTypes;\n }());\n Shared.ExpenseWarningTypes = ExpenseWarningTypes;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var AppSettings = /** @class */ (function () {\n function AppSettings() {\n }\n return AppSettings;\n }());\n Shared.AppSettings = AppSettings;\n})(Shared || (Shared = {}));\n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var ExpensesFactory = /** @class */ (function () {\n function ExpensesFactory($http, $q, $window, expensesSrv, receiptSrv, memberSrv, flowFactory, expensesEnums, dateUtils, currencyEnums, sharedConfig, expensesWarningsService, $uibModal, localStorageService, appSettings) {\n var _this = this;\n this.$http = $http;\n this.$q = $q;\n this.$window = $window;\n this.expensesSrv = expensesSrv;\n this.receiptSrv = receiptSrv;\n this.memberSrv = memberSrv;\n this.flowFactory = flowFactory;\n this.expensesEnums = expensesEnums;\n this.dateUtils = dateUtils;\n this.currencyEnums = currencyEnums;\n this.sharedConfig = sharedConfig;\n this.expensesWarningsService = expensesWarningsService;\n this.$uibModal = $uibModal;\n this.localStorageService = localStorageService;\n this.appSettings = appSettings;\n this.editMode = false;\n this.selectedAssignment = null;\n this.assignments = [];\n this.expenseLineCounter = 0;\n this.expenseHeader = new Shared.ExpenseHeader();\n this.expenseTypes = [];\n this.expenseGuidancePaymentCodes = [];\n this.expenseWarnings = [];\n this.expenseWarningTypes = [];\n this.publicSectorExpenseTypes = [];\n this.mileageVehicles = [];\n this.mileageVehiclesLookup = [];\n this.regularExpenses = [];\n this.mileageExpenses = [];\n this.allowanceExpenses = [];\n this.receipts = [];\n this.totalMileageForCurrentTaxYear = 0;\n this.totalMileageForPreviousTaxYear = 0;\n this.restrictMileage = false;\n this.restrictMileageMaxDate = null;\n this.maxDate = moment().add(7, \"days\");\n this.refreshRequired = false;\n this.isAutoSaving = false;\n this.expensesWaitingForIds = [];\n this.showMileageVatableExpenses = false;\n this.lastRegularExpenseVal = [];\n /**\n * Property to store whether the user is cloning an expense form\n *\n * @type {boolean}\n * @memberOf ExpensesFactory\n */\n this.copyMode = false;\n /**\n * These validation properties are used as the validation looks for whether\n * the form is dirty and invalid, however if the user is cloning an expense,\n * the form is prepopulated. The form may not have been rendered so the validation\n * has nothing to check against.\n * */\n this.copyModeValidateMileage = false;\n this.copyModeValidateRegular = false;\n this.copyModeValidateAllowance = false;\n this.getExpenseWarningText = function (expenseWarningId, expenseWarningCodeTypeId) {\n var expenseType = _.find(_this.expenseWarningTypes, function (n) {\n return n.expenseWarningId === expenseWarningId && n.expenseWarningCodeTypeId === expenseWarningCodeTypeId;\n });\n return expenseType;\n };\n this.getExpenseWarning = function (expense) {\n if (expense) {\n var expenseType = _.filter(_this.expenseWarnings, function (n) {\n return n.codeValue.trim().toString() === expense.paymentCode.trim().toString();\n });\n return expenseType[0];\n }\n return null;\n };\n this.receiptAttached = function (expense, listener) {\n _this.deactivateAutoSave(listener);\n return function (receipt) {\n // If the expense already has an assigned receiptId, set the status of the receipt to unattached\n if (expense.receiptId) {\n _this.resetReceiptStatus(expense.receiptId);\n }\n receipt.status = _this.expensesEnums.ReceiptStatus.UNSUBMITTED;\n receipt.isSelected = false;\n expense.expenseType = expense.typeObject;\n receipt.expense = expense;\n expense.receiptId = receipt.receiptId;\n expense.receiptThumbnail = receipt.imageData;\n };\n };\n /**\n * Deletes an attached receipt from the expense line\n *\n * @param {Shared.RegularExpense} expense\n *\n * @memberOf BrooksonExpensesAddExpenseController\n */\n this.deleteReceiptFromExpenseLine = function (expense) {\n var receipt = _.find(_this.receipts, function (n) { return (n.receiptId === expense.receiptId); });\n receipt.status = _this.expensesEnums.ReceiptStatus.UNATTACHED;\n expense.receiptId = 0;\n };\n /**\n * Deactive the wtacher for auto save\n *\n *\n * @memberOf BrooksonExpensesAddExpenseController\n */\n this.deactivateAutoSave = function (listener) {\n if (!_.isNil(listener)) {\n listener();\n }\n };\n this.prepareMileageExpense = function (expenseItem) {\n expenseItem.isDeleted = expenseItem.markedAsDelete;\n if (expenseItem.typeObject) {\n expenseItem.workSite = expenseItem.typeObject.offsite ? 'Off Site' : 'Main Site';\n expenseItem.type = expenseItem.typeObject.expenseTypeId;\n expenseItem.net = expenseItem.gross;\n expenseItem.vat = 0;\n expenseItem.date = _this.dateUtils.convertToServerString(expenseItem.date);\n if (expenseItem.vehicleObject !== undefined && expenseItem.vehicleObject !== null) {\n expenseItem.vehicleRegistration = expenseItem.vehicleObject.registration;\n expenseItem.expenseMileageVehicle = expenseItem.vehicleObject;\n }\n }\n };\n this.prepareAllowanceExpense = function (expenseItem) {\n if (expenseItem.typeObject) {\n expenseItem.type = expenseItem.typeObject.expenseTypeId;\n expenseItem.net = expenseItem.gross;\n expenseItem.date = _this.dateUtils.convertToServerString(expenseItem.date);\n }\n delete expenseItem.flow;\n delete expenseItem.flowOptions;\n };\n this.prepareRegularExpense = function (expenseItem) {\n if (expenseItem && expenseItem.typeObject) {\n if (!expenseItem.typeObject.expenseReceiptAttachable) {\n expenseItem.receiptId = 0;\n expenseItem.receiptThumbnail = \"\";\n }\n if (expenseItem.typeObject.defaultExpenseRate > 0) {\n expenseItem.quantity = expenseItem.total / expenseItem.typeObject.defaultExpenseRate;\n }\n expenseItem.type = expenseItem.typeObject.expenseTypeId;\n expenseItem.net = expenseItem.gross - (expenseItem.vat ? expenseItem.vat : 0);\n expenseItem.date = _this.dateUtils.convertToServerString(expenseItem.date);\n delete expenseItem.flow;\n delete expenseItem.flowOptions;\n }\n };\n this.getAllVatRates = function (silentMode) {\n var url = _this.sharedConfig.baseApiUrl + \"api/Expenses/GetAllVatRates\";\n return _this.$http.get(url, {\n cache: \"true\",\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return _.map(response.data, function (item) {\n var rate = new Shared.VatRate();\n rate.amount = item.amount;\n rate.startDate = new Date(item.startDate);\n return rate;\n });\n });\n };\n this.getAllVatRatesConfig = function (silentMode) {\n var url = _this.sharedConfig.baseApiUrl + \"api/Expenses/GetExpenseVatConfig\";\n return _this.$http.get(url, {\n cache: \"true\",\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return _.map(response.data, function (item) {\n var rate = new Shared.VatRateConfig();\n rate.expenseCode = item.expenseCode;\n rate.vatRate = item.vatRate;\n rate.effectiveDate = new Date(item.effectiveDate);\n rate.endDate = new Date(item.endDate);\n return rate;\n });\n });\n };\n this.isDeemedAssignment = function (assignment) {\n if (assignment.publicSector !== Shared.Sectors.public && !_.isNull(assignment.iR35CapturedFromDate)) {\n return true;\n }\n return false;\n };\n this.grossPaymentReceived = function (assignment) {\n if (assignment.publicSector === Shared.Sectors.public\n && _.isNull(assignment.iR35CapturedFromDate)\n && _.isNull(assignment.iR35CapturedEffectiveDate)) {\n return true;\n }\n return false;\n };\n this.checkExpenseConfirmationLength = function (expense, monthRule) {\n if (expense) {\n var warningType_1;\n if (expense.typeObject)\n warningType_1 = _this.getExpenseWarningType(expense.typeObject);\n if (!warningType_1)\n return false;\n if (_this.confirmedExpenseWarning.length === 0 && _this.expensesWarningsConfirmed.length === 0)\n return false;\n if (_this.confirmedExpenseWarning.length > 0) {\n var confirmedExpenses = _.find(_this.confirmedExpenseWarning, function (n) {\n return n.warning.codeValue.trim().toString() === warningType_1.codeValue.trim().toString() &&\n ((n.confirmedTwentyFour && monthRule) || (n.confirmed && !monthRule));\n });\n if (confirmedExpenses) {\n return true;\n }\n }\n if (_this.expensesWarningsConfirmed.length > 0) {\n var expenseWarning = _this.getLatestConfirmedExpense(warningType_1, monthRule ? Shared.ExpenseWarningCodeTypes.TwentyFourMonthRule : Shared.ExpenseWarningCodeTypes.Amount);\n if (expenseWarning) {\n var datediff = _this.diffMonths(new Date(), expenseWarning.dateConfirmed);\n if (monthRule) {\n if (expense.expenseWarning && expenseWarning.dateConfirmed)\n return !(datediff >= warningType_1.timeLength);\n }\n else {\n if (expense.expenseWarning && expenseWarning.dateConfirmed) {\n if (datediff >= warningType_1.timeLength) {\n if (warningType_1.highRisk) {\n return false;\n }\n if (expense.gross >= warningType_1.valueLimit) {\n return false;\n }\n }\n }\n }\n }\n return false;\n }\n }\n return false;\n };\n this.diffMonths = function (dt1, dt2) {\n return moment(dt1).diff(moment(dt2), \"months\", false);\n };\n this.getExpenseWarningType = function (expense) {\n var expenseType = _.filter(_this.expenseWarnings, function (n) {\n return n.codeValue.trim().toString() === expense.paymentCode.trim().toString();\n });\n return expenseType[0];\n };\n this.showGuidance = function (paymentCode) {\n var sectionId = _.includes(paymentCode, 'MILEAGE') ? 'MILEAGE' :\n _.includes(paymentCode, 'OVERNIGHT') ? 'OVERNIGHT' :\n paymentCode;\n var modalSettings = {\n animation: true,\n templateUrl: \"src/app/expenses/views/modals/brookson.modals.view-guidance.html\",\n windowClass: \"viewGuidanceModalWindow\",\n controller: \"viewGuidanceCtrl as $ctrl\",\n size: \"lg\",\n resolve: {\n iframeUrl: function () { return \"https://www.brooksonfaq.co.uk/article-tags/\" + sectionId.replace(/\\s/g, '').replace('&', '').toLowerCase() + \"/\"; }\n }\n };\n var modalInstance = _this.$uibModal.open(modalSettings);\n return modalInstance.result;\n };\n this.showExpenseWarningModal = function () {\n if (_this.appSettings.enableExpenseEnhancementModal) {\n var modalSettings = {\n animation: true,\n templateUrl: \"src/app/expenses/views/modals/brookson.modals.expensewarnings.html\",\n windowClass: \"expenseWarningsModalWindow\",\n controller: \"expenseWarningsCtrl as $ctrl\",\n size: \"lg\",\n backdrop: 'static',\n keyboard: false,\n };\n var cookieVal = _this.localStorageService.get(\"expenseWarningPopup\");\n if (!cookieVal) {\n var modalInstance = _this.$uibModal.open(modalSettings);\n return modalInstance.result;\n }\n }\n return null;\n };\n this.expenseGuidanceExists = function (expenseType) {\n if (_.includes(_this.expenseGuidancePaymentCodes, expenseType.paymentCode)) {\n return true;\n }\n return false;\n };\n this.buildPresentedExpenseWarnings = function () {\n _this.expensesTabWarningSummary = new Shared.ExpenseTabWarnings();\n if (_this.allowanceExpenses && _this.allowanceExpenses.length > 0) {\n var allowanceWarnings = _this.obtainPresentedTabWarnings(_this.allowanceExpenses);\n var allowanceTab = new Shared.ExpenseTabWarning(\"Allowances\");\n var allowanceTabWarningCount = 0;\n if (allowanceWarnings.length > 0) {\n allowanceTabWarningCount = _this.countExpenseTabWarnings(allowanceWarnings, allowanceTabWarningCount);\n }\n allowanceTab.presentedWarnings = allowanceTabWarningCount;\n _this.expensesTabWarningSummary.tabWarnings.push(allowanceTab);\n _this.expensesTabWarningSummary.warningCount += allowanceTab.presentedWarnings;\n }\n if (_this.mileageExpenses && _this.mileageExpenses.length > 0) {\n var mileageWarnings = _this.obtainPresentedTabWarnings(_this.mileageExpenses);\n var mileageTab = new Shared.ExpenseTabWarning(\"Mileage\");\n var mileageTabWarningCount = 0;\n if (mileageWarnings.length > 0) {\n mileageTabWarningCount = _this.countExpenseTabWarnings(mileageWarnings, mileageTabWarningCount);\n }\n mileageTab.presentedWarnings = mileageTabWarningCount;\n _this.expensesTabWarningSummary.tabWarnings.push(mileageTab);\n _this.expensesTabWarningSummary.warningCount += mileageTab.presentedWarnings;\n }\n if (_this.regularExpenses && _this.regularExpenses.length > 0) {\n var regularWarnings = _this.obtainPresentedTabWarnings(_this.regularExpenses);\n var expensesTab = new Shared.ExpenseTabWarning(\"Expenses\");\n var expenseTabWarningCount = 0;\n if (regularWarnings.length > 0) {\n expenseTabWarningCount = _this.countExpenseTabWarnings(regularWarnings, expenseTabWarningCount);\n }\n expensesTab.presentedWarnings = expenseTabWarningCount;\n _this.expensesTabWarningSummary.tabWarnings.push(expensesTab);\n _this.expensesTabWarningSummary.warningCount += expensesTab.presentedWarnings;\n }\n };\n this.tabExpenseWarningCount = function (tabName) {\n if (!_this.expensesTabWarningSummary || _this.expensesTabWarningSummary.tabWarnings.length === 0)\n return 0;\n var tabWarnings = _.find(_this.expensesTabWarningSummary.tabWarnings, function (tabWarning) {\n return tabWarning.name === tabName;\n });\n if (tabWarnings)\n return tabWarnings.presentedWarnings;\n return 0;\n };\n this.confirmExpenseWarning = function (expenseLine) {\n expenseLine.expenseWarning.confirmed = true;\n expenseLine.expenseWarning.dateConfirmed = new Date();\n expenseLine.expenseWarning.showWarningMonthRule = false;\n _this.confirmedExpenseWarning.push(angular.copy(expenseLine.expenseWarning));\n _this.buildPresentedExpenseWarnings();\n };\n this.confirmExpenseWarningTwentyFour = function (expenseLine) {\n expenseLine.expenseWarning.confirmedTwentyFour = true;\n expenseLine.expenseWarning.dateConfirmedTwentyFour = new Date();\n _this.confirmedExpenseWarning.push(angular.copy(expenseLine.expenseWarning));\n _this.buildPresentedExpenseWarnings();\n };\n this.autoSaveExpenses = function (oldVal, newVal, expenseType) {\n if (_this.isAutoSaving || !_this.selectedAssignment || !_this.expenseHeader.description || _.isNil(newVal) || !newVal.length || angular.equals(newVal, _this.lastRegularExpenseVal)) {\n return;\n }\n var hasChanges = false;\n _.forEach(newVal, function (val) {\n hasChanges = hasChanges ||\n (!_this.isSameRegularExpense(val, _this.lastRegularExpenseVal[newVal.indexOf(val)]) &&\n !_.isNil(_this.lastRegularExpenseVal[newVal.indexOf(val)]) &&\n _this.isCompleteRegularExpense(val));\n });\n var completeExpenses = _.filter(newVal, function (e) { return _this.isCompleteRegularExpense(e); });\n _this.lastRegularExpenseVal = angular.copy(newVal);\n if (!hasChanges || !completeExpenses.length) {\n return;\n }\n var changedExpenses = angular.copy(completeExpenses);\n var requestData;\n _.forEach(changedExpenses, function (expenseItem) {\n switch (expenseType) {\n case Shared.ExpenseTypeRef.EXPENSE:\n _this.prepareRegularExpense(expenseItem);\n requestData = _this.prepareSaveExpense([], changedExpenses);\n break;\n case Shared.ExpenseTypeRef.MILEAGE:\n _this.prepareMileageExpense(expenseItem);\n requestData = _this.prepareSaveExpense(changedExpenses);\n break;\n case Shared.ExpenseTypeRef.ALLOWANCE:\n _this.prepareAllowanceExpense(expenseItem);\n requestData = _this.prepareSaveExpense([], [], changedExpenses);\n break;\n default:\n _this.prepareRegularExpense(expenseItem);\n requestData = _this.prepareSaveExpense([], changedExpenses);\n }\n });\n _this.saveExpenses(requestData, true, true);\n };\n this.isSameRegularExpense = function (e1, e2) {\n if (_.isNil(e1) || _.isNil(e2)) {\n return false;\n }\n return e1.description === e2.description &&\n _this.dateUtils.isSame(e1.date, e2.date) &&\n angular.equals(e1.typeObject, e2.typeObject) &&\n e1.gross === e2.gross &&\n e1.markedAsDelete === e2.markedAsDelete &&\n (_.isNil(e1.receiptId) ? 0 : e1.receiptId) === (_.isNil(e2.receiptId) ? 0 : e2.receiptId);\n };\n this.isCompleteRegularExpense = function (expense) {\n return !_.isNil(expense.date) &&\n !_.isNil(expense.description) &&\n !_.isNil(expense.gross) && expense.gross > 0 &&\n !_.isNil(expense.typeObject);\n };\n this.expenseTypeChanged = function (expense, index, expenseList) {\n var expenseLine = expenseList[index];\n expenseLine.expenseWarning = new Shared.ExpenseWarning();\n if (!expense || !expenseList || !_this.selectedAssignment) {\n _this.buildPresentedExpenseWarnings();\n return;\n }\n var expenseWarning = _this.getExpenseWarningType(expense);\n if (!expenseWarning || !expenseWarning.enabled)\n return;\n var presentedAlert = _.find(expenseList, function (ex) { return ex.expenseWarning && ex.expenseWarning.warning && ex.expenseWarning.warning.codeValue === expenseWarning.codeValue && ex.expenseWarning.warningMessage; });\n if (presentedAlert) {\n return;\n }\n expenseLine.expenseWarning.assignment = _this.selectedAssignment;\n expenseLine.expenseWarning.warning = expenseWarning;\n var previousConfirmedExpense = _this.getLatestConfirmedExpense(expenseWarning, Shared.ExpenseWarningCodeTypes.HighRisk);\n expenseLine.expenseWarning.showWarningHighRisk = expenseWarning.highRisk && !previousConfirmedExpense;\n if (expenseLine.expenseWarning.showWarningHighRisk) {\n _this.setExpenseWarningMessage(expenseLine, expenseWarning, _this.expensesEnums.ExpenseWarningCodeTypes.HighRisk);\n }\n else {\n if (expenseLine.net || expenseLine.gross) {\n previousConfirmedExpense = _this.getLatestConfirmedExpense(expenseWarning, Shared.ExpenseWarningCodeTypes.Amount);\n var expenseLineVal = expenseLine.gross;\n if (previousConfirmedExpense) {\n var monthDifference = _this.diffMonths(new Date(), previousConfirmedExpense.dateConfirmed);\n expenseLine.expenseWarning.showWarningAmount = expenseLineVal >= expenseWarning.valueLimit && monthDifference >= expenseWarning.timeLength;\n }\n else {\n expenseLine.expenseWarning.showWarningAmount = expenseLineVal >= expenseWarning.valueLimit;\n }\n if (expenseLine.expenseWarning.showWarningAmount) {\n _this.setExpenseWarningMessage(expenseLine, expenseWarning, _this.expensesEnums.ExpenseWarningCodeTypes.Amount);\n }\n else {\n var exp = _.find(expenseList, function (e) { return e.expenseWarning && !e.expenseWarning.warning && e.typeObject && e.typeObject.paymentCode === expenseLine.typeObject.paymentCode; });\n if (exp) {\n _this.setExpenseWarningMessage(expenseLine, expenseWarning, _this.expensesEnums.ExpenseWarningCodeTypes.Amount);\n }\n }\n }\n }\n if (expenseLine.date) {\n var presentedAlert_1 = _.find(expenseList, function (ex) { return ex.expenseWarning && ex.expenseWarning.warning && ex.expenseWarning.warning.codeValue === expenseWarning.codeValue && ex.expenseWarning.warningMessageTwentyFour; });\n if (presentedAlert_1) {\n return;\n }\n if (expenseWarning && expenseWarning.twentyFourMthRuleApplicable) {\n var previousConfirmedExpenseTwentyFourMonth = _this.getLatestConfirmedExpense(expenseWarning, Shared.ExpenseWarningCodeTypes.TwentyFourMonthRule);\n if (previousConfirmedExpenseTwentyFourMonth) {\n var monthDifference = _this.diffMonths(new Date(), previousConfirmedExpenseTwentyFourMonth.dateConfirmed);\n expenseLine.expenseWarning.showWarningMonthRule = monthDifference >= expenseWarning.timeLength;\n }\n else {\n var monthDifference = _this.diffMonths(expenseLine.date, _this.selectedAssignment.dateStarted);\n expenseLine.expenseWarning.showWarningMonthRule = monthDifference >= expenseWarning.twentyFourMthTriggerOverride;\n }\n if (expenseLine.expenseWarning.showWarningMonthRule && expenseLine.expenseWarning.warning) {\n var twentyFourExpenseWarningType = _this.getExpenseWarningText(expenseWarning.expenseWarningId, _this.expensesEnums.ExpenseWarningCodeTypes.TwentyFourMonthRule);\n if (twentyFourExpenseWarningType) {\n expenseLine.expenseWarning.warningMessageTwentyFour = twentyFourExpenseWarningType.expenseWarningText.replace('(i)', '');\n }\n else {\n expenseLine.expenseWarning.showWarningMonthRule = false;\n }\n }\n }\n }\n _this.buildPresentedExpenseWarnings();\n };\n this.updateWarningsAssignmentChange = function (expenses) {\n _this.removeConfirmationsBySelectedAssignment();\n if (expenses.length > 0) {\n _.forEach(expenses, function (expense) {\n if (expense.expenseWarning) {\n expense.expenseWarning.showWarningMonthRule = false;\n expense.expenseWarning.showWarningAmount = false;\n expense.expenseWarning.showWarningHighRisk = false;\n _this.expenseTypeChanged(expense.typeObject, expenses.indexOf(expense), expenses);\n }\n });\n _this.buildPresentedExpenseWarnings();\n }\n };\n this.removeConfirmationsBySelectedAssignment = function () {\n if (!_this.selectedAssignment)\n return;\n for (var i = _this.confirmedExpenseWarning.length - 1; i >= 0; i--) {\n if (_this.confirmedExpenseWarning[i].assignment.assignmentId !== _this.selectedAssignment.assignmentId) {\n _this.confirmedExpenseWarning.splice(i, 1);\n }\n }\n };\n if (!this.confirmedExpenseWarning)\n this.clearConfirmedExpenseWarnings();\n this.expensesWarningsConfirmed = new Array();\n this.getExpenseWarnings().then(function (data) {\n _this.expenseWarnings = data;\n });\n this.getExpenseWarningTypes().then(function (data) {\n _this.expenseWarningTypes = data;\n });\n this.getExpenseGuidancePaymentCodes().then(function (data) {\n _this.expenseGuidancePaymentCodes = data;\n });\n }\n ExpensesFactory.prototype.getExpenses = function (pageSize, pageNo) {\n return this.expensesSrv.getExpenses(pageSize, pageNo);\n };\n ExpensesFactory.prototype.getPersonalMileageAndTotalExpenses = function () {\n return this.expensesSrv.getPersonalMileageAndTotalExpenses();\n };\n ExpensesFactory.prototype.addNewExpenseLineData = function (data) {\n var newId = this.generateGUID();\n data.push({\n markedAsDelete: false,\n tempID: newId\n });\n };\n ExpensesFactory.prototype.mapRatesToMileageExpenseTypes = function (rates) {\n var _this = this;\n var mileageExpenseTypes = _.filter(this.expenseTypes, function (eType) { return (eType.category === _this.expensesEnums.ExpenseTypeCategory.MILEAGE); });\n _.forEach(mileageExpenseTypes, function (eType) {\n eType.rates = _.filter(rates, function (rate) { return (rate.paymentCode === eType.paymentCode); });\n });\n };\n ExpensesFactory.prototype.getExpenseTypes = function () {\n var _this = this;\n var deferred = this.$q.defer();\n if (this.expenseTypes.length === 0) {\n return this.expensesSrv.getExpenseTypes().then(function (data) {\n _this.expenseTypes = data;\n return _this.expensesSrv.getMileageRates();\n }).then(function (data) {\n _this.mapRatesToMileageExpenseTypes(data);\n return _this.expenseTypes;\n });\n }\n else {\n deferred.resolve(this.expenseTypes);\n }\n return deferred.promise;\n };\n ExpensesFactory.prototype.getExpenseWarnings = function () {\n var _this = this;\n var deferred = this.$q.defer();\n if (this.expenseWarnings.length === 0) {\n return this.expensesSrv.getExpenseWarnings()\n .then(function (data) {\n _this.expenseWarnings = data;\n return _this.expenseWarnings;\n }).then(function (data) {\n _this.expenseWarnings = data;\n return _this.expenseWarnings;\n });\n }\n else {\n deferred.resolve(this.expenseWarnings);\n }\n return deferred.promise;\n };\n ExpensesFactory.prototype.getExpenseWarningTypes = function () {\n var _this = this;\n var deferred = this.$q.defer();\n if (this.expenseWarningTypes.length === 0) {\n return this.expensesSrv.getExpenseWarningTypes()\n .then(function (data) {\n _this.expenseWarningTypes = data;\n return _this.expenseWarningTypes;\n }).then(function (data) {\n _this.expenseWarningTypes = data;\n return _this.expenseWarningTypes;\n });\n }\n else {\n deferred.resolve(this.expenseWarningTypes);\n }\n return deferred.promise;\n };\n ExpensesFactory.prototype.getPublicSectorExpenseTypes = function () {\n var _this = this;\n var deferred = this.$q.defer();\n if (this.publicSectorExpenseTypes.length === 0) {\n return this.expensesSrv.getPublicSectorExpenseTypes().then(function (data) {\n _this.publicSectorExpenseTypes = data;\n return _this.publicSectorExpenseTypes;\n });\n }\n else {\n deferred.resolve(this.publicSectorExpenseTypes);\n }\n this.getExpenseVehicles();\n return deferred.promise;\n };\n ExpensesFactory.prototype.getExpenseVehicles = function () {\n var _this = this;\n return this.expensesSrv.getExpenseVehicles().then(function (data) {\n _this.mileageVehicles = data;\n return data;\n });\n };\n ExpensesFactory.prototype.getExpenseGuidancePaymentCodes = function () {\n var _this = this;\n return this.expensesSrv.getExpenseGuidancePaymentCodes().then(function (data) {\n _this.expenseGuidancePaymentCodes = data;\n return data;\n });\n };\n ExpensesFactory.prototype.getExpenseVehiclesLookup = function () {\n var _this = this;\n return this.expensesSrv.getExpenseVehiclesLookup().then(function (data) {\n _this.mileageVehiclesLookup = data;\n return data;\n });\n };\n ExpensesFactory.prototype.saveExpenseVehicle = function (request) {\n return this.expensesSrv.saveExpenseVehicle(request);\n };\n ExpensesFactory.prototype.saveExpenses = function (request, silentMode, hideGrowl) {\n var _this = this;\n if (this.isAutoSaving) {\n var defered = this.$q.defer();\n defered.resolve(undefined);\n return defered.promise;\n }\n this.isAutoSaving = true;\n this.buildPresentedExpenseWarnings();\n return this.expensesSrv.saveExpenses(request, silentMode, hideGrowl).then(function (data) {\n var updatedExpenseDetails = _this.mapExpenseDetails(data);\n return updatedExpenseDetails;\n }).then(function (data) { return _this.postSaveExpenses(request, data); });\n };\n ExpensesFactory.prototype.deleteExpense = function (expenseSubmissionId) {\n return this.expensesSrv.deleteExpense(expenseSubmissionId);\n };\n ExpensesFactory.prototype.submitExpense = function (id, source, acceptMissingReceiptsExpenses) {\n return this.expensesSrv.submitExpense(id, source, acceptMissingReceiptsExpenses);\n };\n ExpensesFactory.prototype.generateGUID = function () {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n };\n ExpensesFactory.prototype.mapExpenseDetails = function (data) {\n var _this = this;\n if (!_.isNil(data)) {\n this.expenseHeader = data.expenseHeader;\n _.map(data.regularExpenses, function (expense) {\n expense.markedAsDelete = expense.isDeleted;\n var expenseType = _.find(_this.expenseTypes, function (eType) { return (eType.expenseTypeId === expense.expenseTypeId); });\n expense.typeObject = expenseType;\n expense.date = _this.dateUtils.convertToJsDate(expense.date);\n });\n _.map(data.mileageExpenses, function (expense) {\n expense.markedAsDelete = expense.isDeleted;\n var expenseType = _.find(_this.expenseTypes, function (eType) { return (eType.expenseTypeId === expense.expenseTypeId); });\n var expenseMileageVehicle = _.find(_this.mileageVehicles, function (mVehicles) { return (mVehicles.registration === expense.vehicleRegistration); });\n if (_this.mileageVehicles.length === 1) {\n expenseMileageVehicle = _this.mileageVehicles[0];\n }\n expense.typeObject = expenseType;\n expense.vehicleObject = expenseMileageVehicle;\n expense.date = _this.dateUtils.convertToJsDate(expense.date);\n // If the expense is an older one from Connect2, it won't have a tempID set, so we make one so that it won't duplicate the expenseItemIDs later in the code [and then the backend ignores the dupes bar 1]\n if (expense.tempID === \"00000000-0000-0000-0000-000000000000\") {\n expense.tempID = _this.generateGUID();\n }\n });\n _.map(data.allowanceExpenses, function (expense) {\n expense.markedAsDelete = expense.isDeleted;\n var expenseType = _.find(_this.expenseTypes, function (eType) { return (eType.expenseTypeId === expense.expenseTypeId); });\n expense.typeObject = expenseType;\n expense.date = _this.dateUtils.convertToJsDate(expense.date);\n });\n }\n return data;\n };\n ExpensesFactory.prototype.removeWarningConfirmationsByExpenseId = function (expenseSubmissionId) {\n return this.expensesSrv.removeWarningConfirmationsByExpenseId(expenseSubmissionId);\n };\n ExpensesFactory.prototype.getExpenseDetails = function (expenseSubmissionId, dataSource) {\n var _this = this;\n return this.expensesSrv.getExpenseDetails(expenseSubmissionId, dataSource).then(function (data) {\n if (data) {\n _this.mapExpenseDetails(data);\n _this.expenseHeader = data.expenseHeader;\n if (data.mileageExpenses.length > 0) {\n _this.mileageExpenses = data.mileageExpenses;\n }\n if (data.allowanceExpenses.length > 0) {\n _this.allowanceExpenses = data.allowanceExpenses;\n }\n if (data.regularExpenses.length > 0) {\n _this.regularExpenses = data.regularExpenses;\n }\n }\n return data;\n });\n };\n ExpensesFactory.prototype.getTotalMileageForCurrentTaxYear = function (refresh) {\n if (!this.totalMileageForCurrentTaxYear || (refresh === true) || this.refreshRequired) {\n return this.expensesSrv.getTotalMileageForCurrentTaxYear();\n }\n else {\n var defered = this.$q.defer();\n defered.resolve(this.totalMileageForCurrentTaxYear);\n return defered.promise;\n }\n };\n ExpensesFactory.prototype.getTotalMileageForPreviousTaxYear = function (refresh) {\n if (!this.totalMileageForPreviousTaxYear || (refresh === true) || this.refreshRequired) {\n return this.expensesSrv.getTotalMileageForPreviousTaxYear();\n }\n else {\n var defered = this.$q.defer();\n defered.resolve(this.totalMileageForPreviousTaxYear);\n return defered.promise;\n }\n };\n ExpensesFactory.prototype.getReceipts = function (silentMode) {\n var _this = this;\n return this.receiptSrv.getReceipts(silentMode).then(function (data) {\n _this.receipts = data;\n _.forEach(_this.receipts, function (receipt) {\n // The status value of the receipt may change through the application so we\n // need to keep a record of the orignal value\n receipt.statusOriginalValue = receipt.status;\n // If the user has added an expense before getReceipts is called, they may have regular expenses with a receipt attached,\n // we need to go through and check whether the receiptId has been assigned to an expense.\n var isAttachedToUnsavedExpense = _.filter(_this.regularExpenses, function (expense) { return (expense.receiptId === receipt.receiptId && !expense.expenseID); }).length > 0;\n if (isAttachedToUnsavedExpense) {\n receipt.status = _this.expensesEnums.ReceiptStatus.UNSUBMITTED;\n }\n });\n return data;\n });\n };\n ExpensesFactory.prototype.getReceiptImageData = function (id, size, width, height, silentMode) {\n return this.receiptSrv.getReceiptImageData(id, size, width, height, silentMode);\n };\n ExpensesFactory.prototype.getReceiptImageThumbnailData = function (receiptId) {\n return this.getReceiptImageData(receiptId, Shared.ImageSize.CUSTOM, 50, 50).then(function (data) { return data; });\n };\n ExpensesFactory.prototype.deleteReceipts = function (receipts) {\n return this.receiptSrv.deleteReceipts(receipts);\n };\n ExpensesFactory.prototype.cropReceipt = function (receiptId, imageData) {\n return this.receiptSrv.cropReceipt(receiptId, imageData);\n };\n ExpensesFactory.prototype.resetReceiptStatus = function (receiptId) {\n var oldReceipt = _.find(this.receipts, function (receipt) { return (receipt.receiptId === receiptId); });\n if (oldReceipt) {\n oldReceipt.status = this.expensesEnums.ReceiptStatus.UNATTACHED;\n }\n };\n ExpensesFactory.prototype.expenseReport = function (id, source) {\n return this.expensesSrv.expenseReport(id, source);\n };\n ExpensesFactory.prototype.createReceiptFlowFactory = function () {\n return this.flowFactory.create({\n target: \"/api/Receipts/Upload\",\n permanentErrors: [404, 500, 501],\n headers: {\n \"__RequestVerificationToken\": this.$window.brookson.antiForgeryToken,\n \"Accept\": \"application/json\"\n },\n testChunks: false,\n simultaneousUploads: 1,\n chunkSize: 9007199254740992\n });\n };\n ExpensesFactory.prototype.getExpenseOverView = function (silentMode) {\n return this.expensesSrv.getExpenseOverView(silentMode);\n };\n ExpensesFactory.prototype.mileageExpensesTotal = function () {\n return _.filter(this.mileageExpenses, function (expense) { return (expense.markedAsDelete !== true && expense.description && expense.date && expense.gross && expense.miles && expense.rate && expense.typeObject); }).length;\n };\n ExpensesFactory.prototype.regularExpensesTotal = function () {\n return _.filter(this.regularExpenses, function (expense) { return (expense.markedAsDelete !== true && expense.date && expense.description && expense.gross && expense.typeObject); }).length;\n };\n ExpensesFactory.prototype.allowanceExpensesTotal = function () {\n return _.filter(this.allowanceExpenses, function (expense) { return (expense.markedAsDelete !== true && expense.date && expense.description && expense.gross && expense.typeObject); }).length;\n };\n ExpensesFactory.prototype.receiptsTotal = function () {\n var _this = this;\n return _.filter(this.receipts, function (receipt) { return (receipt.status === _this.expensesEnums.ReceiptStatus.UNATTACHED); }).length;\n };\n ExpensesFactory.prototype.prepareSaveExpense = function (mileageExpenses, regularExpenses, allowanceExpenses) {\n if (mileageExpenses === void 0) { mileageExpenses = []; }\n if (regularExpenses === void 0) { regularExpenses = []; }\n if (allowanceExpenses === void 0) { allowanceExpenses = []; }\n var request = new Shared.SaveExpenseRequest();\n request.expenseSubmissionId = this.expenseHeader ? this.expenseHeader.id : 0;\n request.description = this.expenseHeader ? this.expenseHeader.description : this.selectedAssignment\n ? this.selectedAssignment.assignmentName\n : this.expenseHeader.assignment;\n request.assignmentId = this.selectedAssignment\n ? this.selectedAssignment.assignmentId\n : this.expenseHeader.assignmentId;\n request.assignmentName = this.selectedAssignment\n ? this.selectedAssignment.assignmentName\n : this.expenseHeader.assignment;\n request.mainSiteDateTime = this.selectedAssignment\n ? this.dateUtils.convertToServerString(this.selectedAssignment.dateStarted)\n : this.expenseHeader.startDate;\n request.endDateTime = this.selectedAssignment\n ? this.dateUtils.convertToServerString(this.selectedAssignment.dateEnded)\n : null;\n request.mileageExpenseItems = mileageExpenses;\n request.expenseItems = regularExpenses;\n request.allowanceItems = allowanceExpenses;\n request.dataSource = 1;\n request.isDeleted = false;\n return request;\n };\n ExpensesFactory.prototype.postSaveExpenses = function (request, response) {\n if (_.isNil(response)) {\n this.isAutoSaving = false;\n return;\n }\n this.removeDeletedExpenses(this.mileageExpenses, request.mileageExpenseItems);\n this.removeDeletedExpenses(this.regularExpenses, request.expenseItems);\n this.removeDeletedExpenses(this.allowanceExpenses, request.allowanceItems);\n this.removeExpensesThatHaveBeenAssignedTempIds();\n this.assignExpenseItemIds(response);\n this.isAutoSaving = false;\n return response;\n };\n /**\n * Removes any expenses that were marked as deleted and have been deleted from the database.\n * It checks the requested expenses that were sent up to the API to make sure that the expense has been\n * deleted.\n *\n * @private\n * @param {Array} savedExpenses\n * @param {Array} requestedExpenses\n *\n * @memberOf ExpensesFactory\n */\n ExpensesFactory.prototype.removeDeletedExpenses = function (savedExpenses, requestedExpenses) {\n _.remove(savedExpenses, function (ex) {\n return ex.markedAsDelete && (_.find(requestedExpenses, function (e) { return e.tempID === ex.tempID; }));\n });\n };\n /**\n * Removes expenses in the expenses waiting for ids array that have been assigned a tempID\n *\n * @private\n *\n * @memberOf ExpensesFactory\n */\n ExpensesFactory.prototype.removeExpensesThatHaveBeenAssignedTempIds = function () {\n var _this = this;\n _.remove(this.expensesWaitingForIds, function (e) {\n var expenses = __spreadArray(__spreadArray(__spreadArray([], _this.mileageExpenses, true), _this.regularExpenses, true), _this.allowanceExpenses, true);\n var relatedExpense = _.find(expenses, function (re) {\n return e.tempID === re.tempID;\n });\n return !_.isNil(relatedExpense);\n });\n };\n /**\n * Assign the generated expense item ids to the associated expense items based on the tempID\n *\n * @private\n * @param {Shared.ExpenseDetails} response\n *\n * @memberOf ExpensesFactory\n */\n ExpensesFactory.prototype.assignExpenseItemIds = function (response) {\n var newExpenses = _.filter(__spreadArray(__spreadArray(__spreadArray([], this.mileageExpenses, true), this.regularExpenses, true), this.allowanceExpenses, true), function (expense) { return !expense.expenseItemId; });\n var savedExpenses = __spreadArray(__spreadArray(__spreadArray([], response.mileageExpenses, true), response.regularExpenses, true), response.allowanceExpenses, true);\n _.forEach(newExpenses, function (expense) {\n var relatedExpense = _.find(savedExpenses, function (e) { return e.tempID === expense.tempID; });\n if (relatedExpense) {\n expense.expenseItemId = relatedExpense.expenseItemId;\n }\n });\n };\n ExpensesFactory.prototype.saveConfirmedExpenseWarning = function (assignmentId, memberId, expenseHeaderId, expenseWarnings) {\n return this.expensesWarningsService.saveExpenseWarnings(assignmentId, memberId, expenseHeaderId, expenseWarnings);\n };\n ExpensesFactory.prototype.getConfirmedExpenseWarnings = function (memberid, assignmentId) {\n return this.expensesWarningsService.getConfirmedExpenseWarnings(memberid, assignmentId);\n };\n ExpensesFactory.prototype.addExpenseWarningMessage = function (expenseWarning, expenseLine) {\n var expenseWarningType = this.getExpenseWarningText(expenseWarning.expenseWarningId, this.expensesEnums.ExpenseWarningCodeTypes.Amount);\n if (expenseWarningType) {\n expenseLine.expenseWarning.warningMessage = expenseWarningType.warningMessage;\n expenseLine.expenseWarning.showWarningAmount = expenseLine.gross > expenseWarning.valueLimit;\n expenseLine.expenseWarning.warning = expenseWarning;\n }\n };\n ExpensesFactory.prototype.removeExpenseWarnings = function (expenseWarning, expenseLine) {\n var exp = _.find(this.regularExpenses, function (e) { return e.description !== expenseLine.description && e.expenseWarning.warning === expenseWarning; });\n if (exp) {\n exp.expenseWarning = new Shared.ExpenseWarning();\n }\n };\n ExpensesFactory.prototype.removeConfirmedExpense = function (expense) {\n var defer = this.$q.defer();\n if (!expense.expenseWarning || !expense.expenseWarning.warning)\n return defer.promise;\n var expenseConfirmation = _\n .filter(this.confirmedExpenseWarning, function (n) { return (n.warning.codeValue === expense.expenseWarning.warning.codeValue); });\n if (expenseConfirmation.length > 0) {\n for (var i = 0; i < expenseConfirmation.length; i++) {\n var index = this.confirmedExpenseWarning.indexOf(expenseConfirmation[i]);\n this.confirmedExpenseWarning.splice(index, 1);\n }\n }\n return defer.promise;\n };\n ExpensesFactory.prototype.populateConfirmedExpenseWarnings = function (memberid, assignmentId) {\n var _this = this;\n var defer = this.$q.defer();\n this.getConfirmedExpenseWarnings(memberid, assignmentId)\n .then(function (data) {\n _this.expensesWarningsConfirmed = data;\n defer.resolve(_this.expensesWarningsConfirmed);\n });\n return defer.promise;\n };\n ExpensesFactory.prototype.deleteIndividualConfirmedExpenseLine = function (warningCodeValue) {\n var _this = this;\n var defer = this.$q.defer();\n if (this.expensesWarningsConfirmed.length > 0) {\n var warnings = _.filter(this.expensesWarningsConfirmed, function (cWarning) { return (cWarning.expenseCodeValue === warningCodeValue &&\n cWarning.expenseId === _this.expenseHeader.id.toString()); });\n if (warnings.length > 0) {\n _.forEach(warnings, function (confirmedExpenseWarning) {\n _this.expensesWarningsService\n .deleteExpenseWarningLogById(confirmedExpenseWarning.expenseWarningLogId);\n });\n this.populateConfirmedExpenseWarnings(parseInt(this.memberSrv.member.memberId), this.selectedAssignment.assignmentId);\n defer.resolve(true);\n }\n }\n else {\n defer.resolve(false);\n }\n return defer.promise;\n };\n ExpensesFactory.prototype.getLatestConfirmedExpense = function (expenseWarning, warningCodeType) {\n var expenseWarnings = _.filter(this.expensesWarningsConfirmed, function (e) {\n switch (warningCodeType) {\n case Shared.ExpenseWarningCodeTypes.TwentyFourMonthRule:\n return e.expenseCodeValue.trim() === expenseWarning.codeValue.trim() && e.twentyFourMonthRuleApplied;\n default:\n return e.expenseCodeValue.trim() === expenseWarning.codeValue.trim() && !e.twentyFourMonthRuleApplied;\n }\n });\n return expenseWarnings.sort(function (first, second) {\n if (first.dateConfirmed > second.dateConfirmed)\n return -1;\n if (first.dateConfirmed < second.dateConfirmed)\n return 1;\n return 0;\n })[0];\n };\n ExpensesFactory.prototype.setExpenseWarningMessage = function (expenseLine, expenseWarning, expenseWarningCodeTypes) {\n var expenseWarningType = this.getExpenseWarningText(expenseWarning.expenseWarningId, expenseWarningCodeTypes);\n if (expenseWarningType) {\n expenseLine.expenseWarning.warning = expenseWarning;\n expenseLine.expenseWarning.warningMessage = expenseWarningType.expenseWarningText.replace('(i)', '');\n }\n else {\n expenseLine.expenseWarning = new Shared.ExpenseWarning();\n }\n };\n ExpensesFactory.prototype.countExpenseTabWarnings = function (expenseLine, warningCount) {\n var _this = this;\n _.forEach(expenseLine, function (warning) {\n var expenseConfirmedMonth = _.find(_this.confirmedExpenseWarning, function (confirmedExpenseWarning) {\n return confirmedExpenseWarning.warning.codeValue === warning.expenseWarning.warning.codeValue &&\n (confirmedExpenseWarning.showWarningMonthRule ===\n warning.expenseWarning.warning.twentyFourMthRuleApplicable &&\n confirmedExpenseWarning.confirmedTwentyFour);\n });\n var expenseConfirmedHighRisk = _.find(_this.confirmedExpenseWarning, function (confirmedExpenseWarning) {\n return confirmedExpenseWarning.warning.codeValue === warning.expenseWarning.warning.codeValue &&\n confirmedExpenseWarning.showWarningHighRisk === warning.expenseWarning.showWarningHighRisk\n && confirmedExpenseWarning.confirmed;\n });\n var expenseConfirmedAmount = _.find(_this.confirmedExpenseWarning, function (confirmedExpenseWarning) {\n return confirmedExpenseWarning.warning.codeValue === warning.expenseWarning.warning.codeValue &&\n ((confirmedExpenseWarning.showWarningAmount === warning.expenseWarning.showWarningAmount)\n && confirmedExpenseWarning.confirmed);\n });\n if (!expenseConfirmedMonth && warning.expenseWarning.warning.twentyFourMthRuleApplicable && warning.expenseWarning.showWarningMonthRule && !warning.expenseWarning.confirmedTwentyFour)\n warningCount++;\n if (!expenseConfirmedHighRisk && warning.expenseWarning.warning.highRisk && !warning.expenseWarning.confirmed)\n warningCount++;\n if (!expenseConfirmedAmount && warning.gross >= warning.expenseWarning.warning.valueLimit && !warning.expenseWarning.confirmed)\n warningCount++;\n });\n return warningCount;\n };\n ExpensesFactory.prototype.obtainPresentedTabWarnings = function (tabExpenses) {\n return _.filter(tabExpenses, function (tabExpenses) {\n return !tabExpenses.markedAsDelete && tabExpenses.expenseWarning &&\n (tabExpenses.expenseWarning.showWarningMonthRule || tabExpenses.expenseWarning.showWarningHighRisk || tabExpenses.expenseWarning.showWarningAmount);\n });\n };\n ExpensesFactory.prototype.clearConfirmedExpenseWarnings = function () {\n this.confirmedExpenseWarning = new Array();\n };\n ExpensesFactory.$inject = [\"$http\", \"$q\", \"$window\", \"expensesSrv\", \"receiptSrv\", \"memberSrv\", \"flowFactory\", \"expenses.enums\", \"brookson.utilities.date\", \"currency.enums\", \"shared.config\", \"expensesWarningsService\", \"$uibModal\", \"localStorageService\", \"appSettings\"];\n return ExpensesFactory;\n }());\n Shared.ExpensesFactory = ExpensesFactory;\n})(Shared || (Shared = {}));\nangular\n .module(\"app.shared\")\n .service(\"brooksonFactoriesExpenses\", Shared.ExpensesFactory);\n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var BankLinkFactory = /** @class */ (function () {\n function BankLinkFactory($state, $uibModal, $timeout, bankLinkSrv, moneyManagerSrv, memberSrv, authenticationSrv, bankLinkEnums, appSettings, fileDownloadSrv, brooksonModalReceiptBank, expensesSrv, screenSize, growl, expensesEnums, dateUtils, serviceLineSrv) {\n var _this = this;\n this.$state = $state;\n this.$uibModal = $uibModal;\n this.$timeout = $timeout;\n this.bankLinkSrv = bankLinkSrv;\n this.moneyManagerSrv = moneyManagerSrv;\n this.memberSrv = memberSrv;\n this.authenticationSrv = authenticationSrv;\n this.bankLinkEnums = bankLinkEnums;\n this.appSettings = appSettings;\n this.fileDownloadSrv = fileDownloadSrv;\n this.brooksonModalReceiptBank = brooksonModalReceiptBank;\n this.expensesSrv = expensesSrv;\n this.screenSize = screenSize;\n this.growl = growl;\n this.expensesEnums = expensesEnums;\n this.dateUtils = dateUtils;\n this.serviceLineSrv = serviceLineSrv;\n this.bankAccountsFlatList = [];\n this.transactions = [];\n this.categories = [];\n this.vatRatesConfig = [];\n this.transactionTypes = [];\n this.addYodleeFasklinkUrl = '';\n this.editYodleeFasklinkUrl = '';\n this.refreshYodleeFasklinkUrl = '';\n this.bankEnabled = false;\n this.csvUploadRequired = false;\n this.bankActionRequired = false;\n this.transactionsList = [];\n this.businessOnly = false;\n this.modifiedTransactions = [];\n this.showAside = false;\n this.receipts = [];\n this.paginationArray = [];\n this.currentPage = 1;\n this.itemsPerPage = 10;\n this.informationDetail = {\n mandate: false,\n yodlee: false,\n noLink: false\n };\n this.relatedCategores = [];\n this.orderBy = 'transactionDate';\n this.reverseSort = false;\n this.isMobile = false;\n this.refreshedYodleeAccounts = [];\n this.confirmedTransactions = [];\n this.warningTransactions = [];\n this.confirmedTransactionsTotal = 0;\n this.acceptRisk = \"true\";\n this.getBankAccounts = function () {\n return _this.bankLinkSrv.getBankAccounts().then(function (data) {\n _this.bankAccounts = data;\n _.forEach(data.bankAccountsMandateLink, function (account) {\n _this.addBankLogoAndIconToBankAccount(account);\n _this.bankAccountsFlatList.push(account);\n });\n _.forEach(data.bankAccountsYodleeLink, function (account) {\n _this.addBankLogoAndIconToBankAccount(account);\n _this.bankAccountsFlatList.push(account);\n });\n _.forEach(data.bankAccountsNoDataLink, function (account) {\n _this.addBankLogoAndIconToBankAccount(account);\n _this.bankAccountsFlatList.push(account);\n });\n _.forEach(_this.bankAccountsFlatList, function (account) {\n account.displayString = account.bankName + \" - \" + account.accountNumber;\n });\n if (_this.screenSize.is('md,lg')) {\n _this.bankAccountsFlatList.unshift({ displayString: \"All accounts\", bankAccountId: \"*\" });\n }\n if (_this.bankAccountsFlatList.length) {\n _this.selectedBankAccount = _this.bankAccountsFlatList[0];\n }\n else {\n _this.$timeout(function () {\n _this.$state.go('brookson.bankLink.introduction');\n });\n }\n if (_this.transactions && _this.transactions.length > 0) {\n _this.addBankNameToTransactions(_this.transactions);\n _.forEach(_this.transactions, function (transaction) { return _this.setRelatedTransationCategories(transaction); });\n }\n return data;\n });\n };\n this.addBankLogoAndIconToBankAccount = function (account) {\n var icon = _this.bankLinkEnums.BankIcons[account.bankName.toUpperCase()];\n var logo = _this.bankLinkEnums.BankLogos[account.bankName.toUpperCase()];\n account.icon = icon;\n account.logo = logo;\n };\n this.addBankNameToTransactions = function (transactions) {\n _.forEach(transactions, function (transaction) {\n var relatedBankAccount = _.find(_this.bankAccountsFlatList, function (bankAccount) { return (bankAccount.bankAccountId === transaction.bankId); });\n if (relatedBankAccount) {\n transaction.bankName = relatedBankAccount.bankName;\n transaction.bankId = relatedBankAccount.bankAccountId;\n transaction.icon = relatedBankAccount.icon;\n transaction.logo = relatedBankAccount.logo;\n }\n });\n };\n this.getCategories = function () {\n return _this.bankLinkSrv.getCategories().then(function (data) {\n // We remove a couple of categories from the list, historic reasons mean we need to keep them in NAV\n _.remove(data, function (category) {\n if (category.code === \"DLA\" || category.code === \"SALARY\") {\n return true;\n }\n });\n _.forEach(data, function (category) {\n category.transactionTypeLabel = category.transactionType === 0 ? \"Personal\" : \"Business\";\n // Hack: don't want to change it properly in NAV so SW said to do it in the view\n if (category.code === \"EXP0185\") {\n category.description = \"Subsistence\";\n }\n });\n _this.categories = data;\n _.filter(_this.transactions, function (transaction) {\n return transaction.transactionType === _this.bankLinkEnums.TransactionType.UNALLOCATED;\n }).forEach(function (transaction) { return _this.setRelatedTransationCategories(transaction); });\n return data;\n });\n };\n this.setRelatedTransationCategories = function (transaction) {\n var relatedBankAccount = _.find(_this.bankAccountsFlatList, function (bankAccount) { return (bankAccount.bankAccountId === transaction.bankId); });\n if (!relatedBankAccount) {\n return;\n }\n var nonSoleTraderCategories = _.filter(_this.categories, function (category) {\n return !_.startsWith(category.code, \"ST\");\n });\n if (relatedBankAccount.accountType === _this.bankLinkEnums.BankAccountType.CREDIT_CARD) {\n transaction.relatedCategories = nonSoleTraderCategories.filter(function (category) {\n return category.creditCardApplicable && (category.type === \"Debit\" ? transaction.debitAmount < 0 : transaction.creditAmount > 0);\n });\n return;\n }\n var categoriesWithNoCcDiv = _.filter(nonSoleTraderCategories, function (category) { return category.code !== \"CC DIV\"; });\n var creditOrDebitCategories = _.filter(categoriesWithNoCcDiv, function (category) {\n return category.type === \"Debit\" ? transaction.debitAmount < 0 : transaction.creditAmount > 0;\n });\n var categoriesGroupedByDescription = _.groupBy(creditOrDebitCategories, 'description');\n transaction.relatedCategories =\n _.map(categoriesGroupedByDescription, function (categoryGrouping) {\n if (categoryGrouping.length > 1) {\n var applicableCategory = _.find(categoryGrouping, function (category) {\n return !category.creditCardApplicable;\n });\n return applicableCategory;\n }\n return categoryGrouping[0];\n });\n };\n this.getTransactionTypes = function () {\n _.forEach(_this.bankLinkEnums.TransactionType, function (type) {\n if (_this.bankLinkEnums.TransactionType.properties[type] && _this.bankLinkEnums.TransactionType.properties[type].description) {\n _this.transactionTypes.push({ value: type, description: _this.bankLinkEnums.TransactionType.properties[type].description });\n }\n });\n _this.selectedTransactionType = _.find(_this.transactionTypes, function (transactionTypes) { return (transactionTypes.value === _this.bankLinkEnums.TransactionType.UNALLOCATED); });\n };\n this.addYodleeAccount = function () {\n return _this.bankLinkSrv.addYodleeAccount().then(function (data) {\n _this.addYodleeFasklinkUrl = data;\n return data;\n });\n };\n this.getAllVatRatesConfig = function () {\n return _this.bankLinkSrv.getAllVatRatesConfig(true).then(function (data) {\n _this.vatRatesConfig = data;\n return data;\n });\n };\n this.editYodleeAccount = function (id) {\n return _this.bankLinkSrv.editYodleeAccount(id).then(function (data) {\n _this.editYodleeFasklinkUrl = data;\n return data;\n });\n };\n this.isCsvUploadRequired = function () {\n return _this.bankLinkSrv.isCsvUploadRequired().then(function (data) {\n _this.csvUploadRequired = data;\n return data;\n });\n };\n this.refreshYodleeAccount = function (id) {\n return _this.bankLinkSrv.refreshYodleeAccount(id).then(function (data) {\n _this.refreshYodleeFasklinkUrl = data;\n return data;\n });\n };\n this.isBankEnabled = function () {\n return _this.bankLinkSrv.isBankEnabled().then(function (data) {\n _this.bankEnabled = data;\n return data;\n });\n };\n this.isBankActionRequired = function () {\n return _this.bankLinkSrv.isBankActionRequired().then(function (data) {\n _this.bankActionRequired = data;\n return data;\n });\n };\n this.addBalanceToTransactions = function (transactions) {\n var transactionsOrderedByDate = _.orderBy(transactions, 'transactionDate', 'desc');\n var groupedTransactionsByBankAccount = _.groupBy(transactionsOrderedByDate, 'bankId');\n _.forEach(groupedTransactionsByBankAccount, function (transactionGroup, key) {\n var bankId = key;\n var bankAccount = _.find(_this.moneyManagerData.bankAccounts, function (bankAccount) { return (bankAccount.bankAccountID === bankId); });\n if (bankAccount) {\n var endBalance = bankAccount.balance;\n _.forEach(transactionGroup, function (transaction) {\n transaction.balance = endBalance;\n endBalance = endBalance - transaction.creditAmount - transaction.debitAmount;\n });\n }\n });\n };\n this.setOtherTransactionCategoryDescription = function (transactions) {\n _.forEach(transactions, function (transaction) {\n if (transaction.transactionType !== 0 && transaction.transactionType === _this.bankLinkEnums.TransactionType.UNALLOCATED) {\n transaction.transactionCategory.description = \"Other\";\n }\n });\n };\n this.setTransactionsReceiptImageThumbnail = function (transactions) {\n _.forEach(transactions, function (transaction) {\n if (transaction.receiptID) {\n _this.expensesSrv.getReceiptImageData(transaction.receiptID, null, null, null, true).then(function (imageData) {\n transaction.receiptThumbnail = imageData;\n });\n }\n });\n };\n this.getTransactions = function (getReceiptImageThumbnailData) {\n return _this.moneyManagerSrv.getTransactions().then(function (data) {\n if (data == null) {\n return null;\n }\n _this.transactions = data.transactions;\n _this.setOtherTransactionCategoryDescription(_this.transactions);\n //if (getReceiptImageThumbnailData) {\n // this.setTransactionsReceiptImageThumbnail(this.transactions);\n //}\n _.filter(_this.transactions, function (transaction) { return transaction.transactionType === _this.bankLinkEnums.TransactionType.UNALLOCATED; })\n .forEach(function (transaction) {\n transaction.gross = transaction.debitAmount * -1;\n return _this.setRelatedTransationCategories(transaction);\n });\n // this.expensesNotYetTaken = data.expensesNotYetTaken;\n // this.salaryNotYetTaken = data.salaryNotYetTaken;\n if (_this.bankAccountsFlatList && _this.bankAccountsFlatList.length > 0) {\n _this.addBankNameToTransactions(_this.transactions);\n }\n if (_this.moneyManagerData && _this.moneyManagerData.bankAccounts && _this.moneyManagerData.bankAccounts.length > 0) {\n _this.addBalanceToTransactions(_this.transactions);\n }\n _this.filterTransactions(_this.selectedBankAccount, _this.selectedTransactionType);\n return data;\n });\n };\n this.getMoneyManagerData = function (silentMode) {\n return _this.moneyManagerSrv.getMoneyManagerData(silentMode).then(function (data) {\n _this.moneyManagerData = data;\n if (_this.transactions && _this.transactions.length > 0) {\n _this.addBalanceToTransactions(_this.transactions);\n }\n _this.filterTransactions(_this.selectedBankAccount, _this.selectedTransactionType);\n return data;\n });\n };\n this.selectedTransactionTypeChanged = function (transactionType) {\n if (!transactionType) {\n transactionType = _this.selectedTransactionType;\n }\n _this.filterTransactions(_this.selectedBankAccount, transactionType);\n };\n this.selectedBankAccountChanged = function (bankAccount) {\n if (!bankAccount) {\n bankAccount = _this.selectedBankAccount;\n }\n _this.filterTransactions(bankAccount, _this.selectedTransactionType);\n };\n this.filterTransactions = function (selectedBankAccount, selectedTransactionType) {\n var filteredList;\n if (selectedBankAccount && selectedBankAccount.bankAccountId) {\n if (selectedBankAccount.bankAccountId !== \"*\") {\n filteredList = _.filter(_this.transactions, function (transaction) { return (transaction.bankId === selectedBankAccount.bankAccountId); });\n }\n else {\n filteredList = _this.transactions;\n }\n }\n if (selectedTransactionType && selectedTransactionType.value !== undefined) {\n if (filteredList) {\n if (selectedTransactionType.value !== _this.bankLinkEnums.TransactionType.ALL) {\n filteredList = _.filter(filteredList, function (transaction) {\n return transaction.transactionType === selectedTransactionType.value;\n });\n }\n }\n else {\n if (selectedTransactionType.value !== _this.bankLinkEnums.TransactionType.ALL) {\n filteredList = _.filter(_this.transactions, function (transaction) { return (transaction.transactionType === selectedTransactionType.value); });\n }\n }\n }\n if (filteredList === undefined) {\n filteredList = [];\n }\n if (_this.businessOnly) {\n filteredList = _.filter(filteredList, function (transacation) { return transacation.debitAmount < 0; });\n }\n _this.transactionsList = filteredList;\n _this.createPaginationArray();\n };\n this.addModifiedTransaction = function (category, transaction) {\n _.remove(_this.modifiedTransactions, function (t) { return t.transactionId === transaction.transactionId; });\n transaction.transactionCategory = category;\n if (category) {\n _this.modifiedTransactions.push(transaction);\n }\n transaction.isVatReclaimable = _this.serviceLineSrv.businessDetailSummary.getEffectiveVatSchemeOn(_this.dateUtils.convertToJsDate(transaction.transactionDate)) ===\n Shared.VatScheme.nonFlatRate &&\n transaction.transactionCategory &&\n transaction.transactionCategory.isVatable;\n if (!transaction.isVatReclaimable) {\n transaction.hasValidVatReceipt = false;\n transaction.vat = 0;\n transaction.net = (-transaction.gross || 0) - (transaction.vat || 0);\n }\n };\n this.check24MonthRuleApplicable = function (transaction) {\n return (\n // Check whether transaction category is 24 month rule applicable\n transaction.transactionCategory.is24MonthRuleApplicable\n // AND\n &&\n // Check whether assignment is over 24 months old\n _this.selectedAssignment &&\n _this.selectedAssignment.dateStarted &&\n _this.dateUtils.isOverNMonthsAgo(_this.dateUtils.convertToJsDate(_this.selectedAssignment.dateStarted), 24));\n };\n this.getAllocationConfirmationModal = function (form) {\n _this.headerForm = form;\n _this.$uibModal.open({\n animation: true,\n templateUrl: 'src/app/shared/views/bank/modals/brookson.bankLink.modals.allocationConfirmation.html',\n controller: 'bankAllocationConfirmationCtrl',\n controllerAs: '$ctrl',\n size: \"lg\"\n });\n };\n this.saveTransactions = function () {\n _.forEach(_this.modifiedTransactions, function (transaction) {\n transaction.transactionType = transaction.transactionCategory.transactionType;\n });\n var modifiedTransactionsCount = _this.modifiedTransactions.length;\n _.each(_this.modifiedTransactions, function (transaction) {\n if (!transaction.passes24MonthRule) {\n transaction.accept24MonthRuleRisk = _this.acceptRisk === \"true\";\n }\n });\n _this.bankLinkSrv.updateTransactions(_this.modifiedTransactions)\n .then(function (result) {\n var successfullyUpdatedTransactions = _.filter(_this.modifiedTransactions, function (t) {\n return _.find(result, function (r) { return r.transactionId === t.transactionId; }) != null;\n });\n var unsuccessfullyUpdatedTransactions = _.filter(_this.modifiedTransactions, function (t) {\n return _.find(result, function (r) { return r.transactionId === t.transactionId; }) == null;\n });\n _this.updateSuccessfulllyAllocatedTransaction(successfullyUpdatedTransactions, result);\n var config = { title: \"Bank\", ttl: 5000, disableCountDown: true };\n if (result.length === modifiedTransactionsCount) {\n _this.growl.success(\"The modified transactions were successfully allocated\", config);\n _this.headerForm.$setPristine();\n _this.headerForm = null;\n }\n else {\n _this.growl.warning(\"We were unable to update all of your allocations. If this error persists, please contact customer service.\", config);\n _.forEach(unsuccessfullyUpdatedTransactions, function (transaction) {\n return _this.growl.error(\"Unable to update transaction \".concat(transaction.transactionDate, \" : \").concat(transaction.description, \".\"), config);\n });\n }\n _this.modifiedTransactions.length = 0;\n _this.filterTransactions(_this.selectedBankAccount, _this.selectedTransactionType);\n });\n };\n this.updateSuccessfulllyAllocatedTransaction = function (transactions, transactionAllocationResult) {\n _.forEach(transactions, function (transaction) {\n _.remove(_this.transactions, function (t) { return t === transaction; });\n });\n _.forEach(transactions, function (transaction) {\n var relatedResult = _.find(transactionAllocationResult, function (t) { return t.transactionId === transaction.transactionId; });\n transaction.transactionStatus = relatedResult.transactionStatus;\n transaction.transactionType = transaction.transactionCategory.transactionType;\n transaction.transactionCategory = relatedResult.transactionCategory;\n transaction.vat = relatedResult.vat;\n transaction.hasValidVatReceipt = relatedResult.hasValidVatReceipt;\n transaction.receiptID = relatedResult.receiptID;\n _this.transactions.push(transaction);\n });\n _this.transactions = _.orderBy(_this.transactions, ['transactionDate', 'transactionId'], ['desc', 'desc']);\n };\n this.downloadFile = function (bankName) {\n var url = \"api/BankLink/DownloadMandateForm?id=\" + bankName;\n var expectedMediaType = \"application/octet-stream\";\n var memberId = _this.memberSrv.getMember().memberId;\n _this.fileDownloadSrv.downloadAndSave(url, null, 'Mandate - ' + bankName + ' - ' + memberId + '.pdf', expectedMediaType);\n };\n this.selectBankAccountFromAsideMenu = function (bankAccount) {\n _this.selectedBankAccount = bankAccount;\n _this.selectedBankAccountChanged(bankAccount);\n _this.showAside = false;\n };\n this.getReceipts = function () {\n _this.expensesSrv.getReceipts().then(function (data) {\n _this.receipts = data;\n });\n };\n this.receiptAttached = function (transaction) {\n return function (receipt) {\n transaction.receiptID = receipt.receiptId;\n transaction.receiptThumbnail = receipt.imageData;\n var localReceipt = _.find(_this.receipts, function (n) { return (n.receiptId === transaction.receiptID); });\n localReceipt.status = _this.expensesEnums.ReceiptStatus.UNSUBMITTED;\n localReceipt.isSelected = false;\n _this.addModifiedTransaction(transaction.transactionCategory, transaction);\n };\n };\n this.receiptAttachedToAllocated = function (transaction) {\n return function (receipt) {\n transaction.receiptID = receipt.receiptId;\n var localReceipt = _.find(_this.receipts, function (n) { return (n.receiptId === transaction.receiptID); });\n localReceipt.status = _this.expensesEnums.ReceiptStatus.UNSUBMITTED;\n localReceipt.isSelected = false;\n _this.updateAllocatedTransaction(transaction);\n };\n };\n this.receiptDeleted = function (transaction) {\n var receipt = _.find(_this.receipts, function (n) { return (n.receiptId === transaction.receiptID); });\n receipt.status = _this.expensesEnums.ReceiptStatus.UNATTACHED;\n transaction.receiptID = 0;\n _this.addModifiedTransaction(transaction.transactionCategory, transaction);\n };\n this.receiptsTotal = function () {\n return _.filter(_this.receipts, function (receipt) { return (receipt.status === _this.expensesEnums.ReceiptStatus.UNATTACHED); }).length;\n };\n this.flowOptions = function (transaction) {\n transaction.flowOptions = _this.expensesSrv.createReceiptFlowFactory();\n return transaction.flowOptions;\n };\n this.flowFileAdded = function (file, flow, transaction) {\n if (!{ jpg: 1, png: 1, pdf: 1, jpeg: 1, gif: 1 }[file.getExtension()]) {\n transaction.fileTypeValidationError = true;\n }\n if (file.size > 10000000) {\n transaction.fileSizeValidationError = true;\n }\n if (transaction.fileTypeValidationError || transaction.fileSizeValidationError) {\n _this.$timeout(function (transaction) {\n transaction.fileTypeValidationError = false;\n transaction.fileSizeValidationError = false;\n }, 4000, true, transaction);\n return false;\n }\n flow.files = [];\n return true;\n };\n this.flowFileSuccess = function (file, response, flow, transaction) {\n var receipt = angular.fromJson(response);\n transaction.receiptID = receipt.receiptId;\n if (transaction.transactionType === _this.bankLinkEnums.TransactionType.BUSINESS) {\n flow.files = [];\n _this.updateAllocatedTransaction(transaction);\n }\n else {\n _this.addModifiedTransaction(transaction.transactionCategory, transaction);\n transaction.receiptThumbnail = receipt.imageDataEncoded;\n receipt.imageData = receipt.imageDataEncoded;\n _this.receipts.push(receipt);\n _this.$timeout(function (flow) { flow.files = []; }, 2000, true, flow);\n }\n };\n this.flowFilesSubmitted = function (files, event, flow) {\n _this.authenticationSrv.refreshToken().then(function (data) {\n flow.opts.headers.Authorization = \"Bearer \" + data.access_token;\n flow.upload();\n });\n };\n this.createPaginationArray = function () {\n _this.paginationArray = [];\n var pages = _this.transactionsList.length / _this.itemsPerPage;\n pages = pages < 1 ? pages : Math.ceil(pages);\n for (var i = 0; i < pages; i++) {\n _this.paginationArray.push(i);\n }\n _this.currentPage = 1;\n };\n this.filterTransactionType = function (item) {\n if (item.value === _this.bankLinkEnums.TransactionType.OUTGOINGS)\n return false;\n if (_this.businessOnly && item.value === _this.bankLinkEnums.TransactionType.PERSONAL)\n return false;\n return true;\n };\n this.isViewingPersonal = function () {\n return _this.selectedTransactionType.value === _this.bankLinkEnums.TransactionType.PERSONAL;\n };\n this.colSpanCount = function () {\n return _this.isViewingPersonal() ? 8 : 9;\n };\n this.isViewingAll = function () {\n return _this.selectedTransactionType.value === _this.bankLinkEnums.TransactionType.ALL;\n };\n this.isMobile = this.screenSize.is('sm,xs') ? true : false;\n this.memberSrv.getMemberDetails(true, true)\n .then(function (data) {\n _this.userName = data.firstname + \" \" + data.lastname;\n });\n }\n BankLinkFactory.prototype.updateAllocatedTransaction = function (transaction) {\n var trans = [];\n trans.push(transaction);\n this.bankLinkSrv.updateTransactions(trans);\n };\n BankLinkFactory.$inject = [\n '$state', '$uibModal', '$timeout', 'bankLinkSrv', 'moneyManagerSrv', 'memberSrv',\n 'authenticationSrv', 'bankLink.enums', 'appSettings', 'brookson.file.download',\n 'brookson.modal.receipt-bank', 'brooksonFactoriesExpenses', 'screenSize', 'growl',\n 'expenses.enums', 'brookson.utilities.date', 'serviceLineSrv'\n ];\n return BankLinkFactory;\n }());\n Shared.BankLinkFactory = BankLinkFactory;\n})(Shared || (Shared = {}));\nangular\n .module(\"app.shared\")\n .service(\"bankLinkFactory\", Shared.BankLinkFactory);\nvar Shared;\n(function (Shared) {\n var MicroCalendlyBooking = /** @class */ (function () {\n function MicroCalendlyBooking() {\n }\n return MicroCalendlyBooking;\n }());\n Shared.MicroCalendlyBooking = MicroCalendlyBooking;\n var EventType;\n (function (EventType) {\n EventType[EventType[\"AccountantIntroduction\"] = 0] = \"AccountantIntroduction\";\n EventType[EventType[\"AdvisoryDocument\"] = 1] = \"AdvisoryDocument\";\n EventType[EventType[\"FinancialHealthCheck\"] = 2] = \"FinancialHealthCheck\";\n })(EventType = Shared.EventType || (Shared.EventType = {}));\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n var CalendlyService = /** @class */ (function () {\n function CalendlyService($http) {\n var _this = this;\n this.$http = $http;\n this.getCalendlyIntroductionBooking = function (silentMode) {\n return _this.$http.get(\"api/Calendly/GetCalendlyIntroductionBooking\", {\n silentMode: silentMode ? silentMode : false\n })\n .then(function (response) {\n return response.data;\n });\n };\n this.getCalendlyAdvisoryBooking = function (silentMode) {\n return _this.$http.get(\"api/Calendly/GetCalendlyAdvisoryBooking\", {\n silentMode: silentMode ? silentMode : false\n })\n .then(function (response) {\n return response.data;\n });\n };\n this.getCalendlyFinancialHealthCheckBooking = function (silentMode) {\n return _this.$http.get(\"api/Calendly/GetCalendlyFinancialHealthCheckBooking\", {\n silentMode: silentMode ? silentMode : false\n })\n .then(function (response) {\n return response.data;\n });\n };\n }\n CalendlyService.$inject = ['$http'];\n return CalendlyService;\n }());\n Shared.CalendlyService = CalendlyService;\n})(Shared || (Shared = {}));\nangular.module('app.shared')\n .service('calendlySrv', Shared.CalendlyService);\n/// \nvar Shared;\n(function (Shared) {\n /**\n *\n * Factory to handle all the intro walkthroughs for each section\n * @export\n * @class BrooksonFactoriesCalendly\n * @implements {IBrooksonFactoriesCalendly}\n */\n var BrooksonFactoriesCalendly = /** @class */ (function () {\n function BrooksonFactoriesCalendly($q, service) {\n var _this = this;\n this.$q = $q;\n this.service = service;\n this.getCalendlyIntroductionBooking = function () {\n return _this.service.getCalendlyIntroductionBooking(true).then(function (response) {\n return response;\n });\n };\n this.getCalendlyAdvisoryBooking = function () {\n return _this.service.getCalendlyAdvisoryBooking(true).then(function (response) {\n return response;\n });\n };\n this.getCalendlyFinancialHealthCheckBooking = function () {\n return _this.service.getCalendlyFinancialHealthCheckBooking(true).then(function (response) {\n return response;\n });\n };\n }\n /**\n *\n * DI\n * @static\n */\n BrooksonFactoriesCalendly.$inject = ['$q', 'calendlySrv'];\n return BrooksonFactoriesCalendly;\n }());\n Shared.BrooksonFactoriesCalendly = BrooksonFactoriesCalendly;\n})(Shared || (Shared = {}));\nangular.module('app.shared')\n .service('brooksonFactoriesCalendly', Shared.BrooksonFactoriesCalendly);\n/// \nvar Shared;\n(function (Shared) {\n var BrooksonUiFeedbackFactory = /** @class */ (function () {\n function BrooksonUiFeedbackFactory($http, $state, $location, $uibModal, $timeout, $document, uaParser, $window) {\n var _this = this;\n this.$http = $http;\n this.$state = $state;\n this.$location = $location;\n this.$uibModal = $uibModal;\n this.$timeout = $timeout;\n this.$document = $document;\n this.uaParser = uaParser;\n this.$window = $window;\n // Feedback Data //\n this.userFeedback = new Shared.UserFeedback();\n // HTML Selectors //\n this.modalElementSelector = 'div[uib-modal-window]';\n this.modalBackdropElementSelector = 'div[uib-modal-backdrop]';\n this.sendFeedbackElementSelector = 'div.send-feedback';\n this.isDrawing = false;\n this.onMouseDown = function (event) {\n _this.centerX = event.pageX;\n _this.centerY = event.pageY;\n _this.ctx.beginPath();\n _this.isDrawing = true;\n _this.redraw();\n };\n this.onMouseMove = function (event) {\n if (_this.isDrawing) {\n var width = event.pageX - _this.centerX;\n var height = event.pageY - _this.centerY;\n _this.ctx.clearRect(0, 0, _this.$document.width(), _this.$document.height());\n _this.addAlphaBackground();\n _this.ctx.clearRect(_this.centerX, _this.centerY, width, height);\n _this.redraw();\n }\n };\n this.onMouseUp = function (event) {\n _this.isDrawing = false;\n var width = event.pageX - _this.centerX;\n var height = event.pageY - _this.centerY;\n _this.ctx.fillStyle = 'rgba(0,0,0,0)';\n _this.ctx.strokeRect(_this.centerX, _this.centerY, width, height);\n _this.ctx.fillRect(_this.centerX, _this.centerY, width, height);\n var highlight = '
    ';\n angular.element('body').append(highlight);\n _this.redraw();\n };\n }\n // Send Feedback Methods //\n BrooksonUiFeedbackFactory.prototype.hideSendFeedback = function () {\n var sendFeedback = angular.element(this.sendFeedbackElementSelector);\n sendFeedback.addClass('hidden');\n };\n BrooksonUiFeedbackFactory.prototype.showSendFeedback = function () {\n var sendFeedback = angular.element(this.sendFeedbackElementSelector);\n sendFeedback.removeClass('hidden');\n };\n // Modal Methods //\n BrooksonUiFeedbackFactory.prototype.openModal = function () {\n var _this = this;\n this.isFeedbackMode = true;\n var modalSettings = {\n animation: true,\n size: \"lg\",\n templateUrl: \"src/app/shared/views/modals/brookson.modals.feedback.html\",\n controller: ['brooksonUiFeedbackFactory', '$detection', Shared.BrooksonModalFeedbackController],\n controllerAs: '$ctrl'\n };\n this.$uibModalInstance = this.$uibModal.open(modalSettings);\n this.$uibModalInstance.result.then(function () {\n _this.closeModal();\n }, function () {\n _this.closeModal();\n });\n this.$uibModalInstance.rendered.then(function (a) {\n _this.styleModal();\n });\n };\n BrooksonUiFeedbackFactory.prototype.styleModal = function () {\n var modal = $('.modal');\n modal.css('position', 'absolute');\n modal.css('marginTop', $(window).scrollTop() + 'px');\n modal.css('bottom', 'auto');\n this.$timeout(function () {\n var modalBackdrop = $('.modal-backdrop');\n modalBackdrop.css('position', 'absolute');\n modalBackdrop.css('top', '0');\n modalBackdrop.css('left', '0');\n modalBackdrop.css('width', '100%');\n modalBackdrop.css('height', Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight) + 'px');\n }, 0);\n };\n BrooksonUiFeedbackFactory.prototype.hideModal = function () {\n var modal = angular.element(this.modalElementSelector);\n var modalBackdrop = angular.element(this.modalBackdropElementSelector);\n modal.addClass('hidden');\n modalBackdrop.addClass('hidden');\n };\n BrooksonUiFeedbackFactory.prototype.showModal = function () {\n var modal = angular.element(this.modalElementSelector);\n var modalBackdrop = angular.element(this.modalBackdropElementSelector);\n modal.removeClass('hidden');\n modalBackdrop.removeClass('hidden');\n this.styleModal();\n };\n BrooksonUiFeedbackFactory.prototype.closeModal = function () {\n this.isFeedbackMode = false;\n this.$uibModalInstance.close();\n this.destroyCanvas();\n };\n // Requests //\n BrooksonUiFeedbackFactory.prototype.getUserFeedbackCategories = function () {\n var _this = this;\n return this.$http.get('api/UserFeedback/GetUserFeedbackCategories').then(function (response) {\n _this.userFeedbackCategories = response.data;\n return _this.userFeedbackCategories;\n });\n };\n BrooksonUiFeedbackFactory.prototype.postUserFeedback = function () {\n var _this = this;\n return this.$http.post('api/UserFeedback/PostUserFeedback', this.userFeedback).then(function (data) {\n if (data) {\n _this.$uibModalInstance.dismiss();\n }\n });\n };\n // User Information //\n BrooksonUiFeedbackFactory.prototype.getUserAgentInfo = function () {\n var browser = this.uaParser.getBrowser();\n var device = this.uaParser.getDevice();\n var cpu = this.uaParser.getCPU();\n var engine = this.uaParser.getEngine();\n var os = this.uaParser.getOS();\n this.userFeedback.browser = browser.name;\n this.userFeedback.browserVersion = browser.version;\n this.userFeedback.cpuArchitecture = cpu.architecture;\n this.userFeedback.deviceType = device.type;\n this.userFeedback.deviceModel = device.model;\n this.userFeedback.deviceVendor = device.vendor;\n this.userFeedback.engineName = engine.name;\n this.userFeedback.engineVersion = engine.version;\n this.userFeedback.os = os.name;\n this.userFeedback.osVersion = os.version;\n };\n BrooksonUiFeedbackFactory.prototype.getState = function () {\n this.userFeedback.state = this.$state.current.name;\n this.userFeedback.stateParams = JSON.stringify(this.$state.params);\n };\n BrooksonUiFeedbackFactory.prototype.getUrl = function () {\n this.userFeedback.url = this.$location.absUrl();\n };\n // Screenshot Methods //\n BrooksonUiFeedbackFactory.prototype.takeScreenshot = function () {\n var _this = this;\n var options = {\n onrendered: function (canvas) {\n _this.isScreenshotMode = false;\n _this.showModal();\n _this.showSendFeedback();\n _this.destroyCanvas();\n canvas.style.width = '100%';\n canvas.style.borderRadius = '12px';\n _this.$timeout(function () {\n _this.userFeedback.screenshotBase64 = canvas.toDataURL();\n });\n }\n };\n this.hideModal();\n this.hideSendFeedback();\n html2canvas(document.body, options);\n };\n BrooksonUiFeedbackFactory.prototype.resetScreenshot = function () {\n this.userFeedback.screenshotBase64 = null;\n };\n BrooksonUiFeedbackFactory.prototype.destroyCanvas = function () {\n this.removeDocumentEvents();\n var canvas = angular.element(\"#\".concat(BrooksonUiFeedbackFactory.CANVAS_ID));\n if (canvas)\n canvas.remove();\n var highlights = angular.element(\".\".concat(BrooksonUiFeedbackFactory.FEEDBACK_HIGHLIGHT_CLASS));\n highlights.remove();\n this.ctx = null;\n };\n // Document Events //\n BrooksonUiFeedbackFactory.prototype.setupDocumentEvents = function () {\n var _this = this;\n this.$document.on('mousedown', function (event) {\n _this.onMouseDown(event);\n });\n this.$document.on('mouseup', function (event) {\n _this.onMouseUp(event);\n });\n this.$document.on('mousemove', function (event) {\n _this.onMouseMove(event);\n });\n };\n BrooksonUiFeedbackFactory.prototype.removeDocumentEvents = function () {\n this.$document.off('mousedown');\n this.$document.off('mouseup');\n this.$document.off('mousemove');\n };\n BrooksonUiFeedbackFactory.prototype.addAlphaBackground = function () {\n if (!this.ctx)\n throw Error(\"User feedback context does not exist\");\n this.ctx.fillStyle = 'rgba(102,102,102,0.5)';\n this.ctx.fillRect(0, 0, this.$document.width(), this.$document.height());\n };\n BrooksonUiFeedbackFactory.prototype.createCanvas = function () {\n if (!this.ctx) {\n var canvas = \"\");\n var body = angular.element('body');\n body.append(canvas);\n angular.element(\"#\".concat(BrooksonUiFeedbackFactory.CANVAS_ID)).attr({\n 'width': this.$document.width(),\n 'height': this.$document.height()\n });\n var canvasElement = document.getElementById(BrooksonUiFeedbackFactory.CANVAS_ID);\n this.ctx = canvasElement.getContext('2d');\n this.setupDocumentEvents();\n this.addAlphaBackground();\n }\n };\n BrooksonUiFeedbackFactory.prototype.redraw = function () {\n var _this = this;\n var highlights = angular.element(\".\".concat(BrooksonUiFeedbackFactory.FEEDBACK_HIGHLIGHT_CLASS));\n _.forEach(highlights, function (highlight) {\n _this.ctx.clearRect(parseInt(highlight.style.left), parseInt(highlight.style.top), parseInt(highlight.style.width), parseInt(highlight.style.height));\n _this.ctx.strokeRect(parseInt(highlight.style.left), parseInt(highlight.style.top), parseInt(highlight.style.width), parseInt(highlight.style.height));\n _this.ctx.fillRect(parseInt(highlight.style.left), parseInt(highlight.style.top), parseInt(highlight.style.width), parseInt(highlight.style.height));\n });\n };\n BrooksonUiFeedbackFactory.CANVAS_ID = 'feedback-canvas';\n BrooksonUiFeedbackFactory.FEEDBACK_HIGHLIGHT_CLASS = 'feedback-highlight';\n BrooksonUiFeedbackFactory.$inject = ['$http', '$state', '$location', '$uibModal', '$timeout', '$document', 'uaParser', \"$window\"];\n return BrooksonUiFeedbackFactory;\n }());\n Shared.BrooksonUiFeedbackFactory = BrooksonUiFeedbackFactory;\n})(Shared || (Shared = {}));\nangular.module('app.shared').service('brooksonUiFeedbackFactory', Shared.BrooksonUiFeedbackFactory);\nvar Shared;\n(function (Shared) {\n var ConnectIntro = /** @class */ (function () {\n function ConnectIntro() {\n }\n return ConnectIntro;\n }());\n Shared.ConnectIntro = ConnectIntro;\n})(Shared || (Shared = {}));\n/// \n/// \nvar Shared;\n(function (Shared) {\n var BrooksonServicesIntro = /** @class */ (function () {\n function BrooksonServicesIntro($http) {\n var _this = this;\n this.$http = $http;\n this.getConnectIntros = function (silentMode) {\n return _this.$http.get(\"api/Intro/GetConnectIntros\", {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n };\n this.setFirstTimeLoginSeen = function (silentMode) {\n return _this.$http.post(\"api/Intro/SetFirstTimeLoginSeen\", {}, {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n };\n }\n BrooksonServicesIntro.$inject = ['$http'];\n return BrooksonServicesIntro;\n }());\n Shared.BrooksonServicesIntro = BrooksonServicesIntro;\n})(Shared || (Shared = {}));\nangular.module('app.shared')\n .service('brooksonServicesIntro', Shared.BrooksonServicesIntro);\nvar Shared;\n(function (Shared) {\n var IR35ModalService = /** @class */ (function () {\n function IR35ModalService($http) {\n this.$http = $http;\n }\n IR35ModalService.prototype.getListOfJobTitles = function () {\n return this.$http.get('api/IR35Modal/getListOfJobTitles').then(function (response) {\n return response.data;\n });\n };\n IR35ModalService.prototype.getListOfSectors = function () {\n return this.$http.get('api/IR35Modal/getListOfSectors').then(function (response) {\n return response.data;\n });\n };\n IR35ModalService.prototype.insertIR35Assessment = function (answers) {\n return this.$http.post('api/IR35Modal/insertIR35Assessment', answers)\n .then(function (response) {\n return response.data;\n });\n };\n IR35ModalService.prototype.showIR35AssessmentModal = function () {\n return this.$http.get('api/IR35Modal/showIR35AssessmentModal').then(function (response) {\n return response.data;\n });\n };\n IR35ModalService.$inject = ['$http'];\n return IR35ModalService;\n }());\n Shared.IR35ModalService = IR35ModalService;\n})(Shared || (Shared = {}));\nangular.module('app.shared').service('ir35ModalService', Shared.IR35ModalService);\nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var AssignmentRateCompact = /** @class */ (function () {\n function AssignmentRateCompact() {\n // RATEID\n this.rateID = null;\n // PERIOD\n this.period = null;\n // DESCRIPTION\n this.description = null;\n // AMOUNT\n this.amount = 0;\n // CURRENCY\n this.currency = null;\n // RATETYPE\n this.rateType = null;\n // PAYMENTCODE\n this.paymentCode = null;\n // STARTDATE\n this.startDate = null;\n // ENDDATE\n this.endDate = null;\n this.canBeDeleted = false;\n this.canBeEdited = false;\n }\n return AssignmentRateCompact;\n }());\n Shared.AssignmentRateCompact = AssignmentRateCompact;\n})(Shared || (Shared = {}));\n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var AssignmentCompact = /** @class */ (function () {\n function AssignmentCompact() {\n // ASSIGNMENTID\n this.assignmentID = null;\n // ASSIGNMENTNAME\n this.assignmentName = null;\n // ASSIGNMENTADDRESS\n this.assignmentAddress = null;\n // ASSIGNMENTADDRESSOBJ\n this.assignmentAddressObj = null;\n // ASSIGNMENTNOTES\n this.assignmentNotes = null;\n // MEMBERID\n this.memberID = 0;\n // CUSTOMERNAME\n this.customerName = null;\n // CLIENT\n this.client = null;\n // AGENCY\n this.agency = null;\n // COMPANY\n this.company = null;\n // CURRENCY\n this.currency = null;\n // DATESTARTED\n this.dateStarted = null;\n // DATEENDED\n this.dateEnded = null;\n // MEMBERADVISEDSTATUSOLD\n this.memberAdvisedStatusOld = null;\n // CUSTOMER\n this.customer = null;\n // RATES\n this.rates = [];\n // ISSELFBILLING\n this.isSelfBilling = false;\n // PREFERREDEMAILADDRESSES\n this.preferredEmailAddresses = [];\n // UNIQUEIDENTIFIERNUMBER\n this.uniqueIdentifierNumber = null;\n // AGENCYREFERENCE\n this.agencyReference = null;\n // LOCATIONS\n this.locations = [];\n // DEEMED\n this.deemed = false;\n this.publicSector = null;\n this.sectorSelector = null;\n this.ir35AssignmentSelector = null;\n this.jobTitle = null;\n this.jobTitleOption = null;\n this.industry = null;\n }\n return AssignmentCompact;\n }());\n Shared.AssignmentCompact = AssignmentCompact;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var ClientRate = /** @class */ (function () {\n function ClientRate() {\n // CLIENTRATEID\n this.clientRateID = 0;\n // CLIENTID\n this.clientID = 0;\n // RATE\n this.rate = 0;\n // CLIENTRATETYPE\n this.clientRateType = 0;\n // ISDEFAULT\n this.isDefault = false;\n // ISDELETED\n this.isDeleted = false;\n }\n return ClientRate;\n }());\n Shared.ClientRate = ClientRate;\n})(Shared || (Shared = {}));\n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var CustomerCompact = /** @class */ (function () {\n function CustomerCompact() {\n // CUSTOMERNUMBER\n this.customerNumber = null;\n // CUSTOMERNAME\n this.customerName = null;\n // CUSTOMERADDRESS\n this.customerAddress = null;\n // CUSTOMERADDRESSOBJ\n this.customerAddressObj = null;\n // CUSTOMEREMAIL\n this.customerEmail = null;\n // CONTACTNAME\n this.contactName = null;\n // CONTACTNUMBER\n this.contactNumber = null;\n // CONTACTEMAIL\n this.contactEmail = null;\n // BILLINGADDRESS\n this.billingAddress = null;\n // BILLINGADDRESSOBJ\n this.billingAddressObj = null;\n // ASSIGNMENTS\n this.assignments = [];\n // STATUS\n this.status = false;\n // ISSELFBILLING\n this.isSelfBilling = false;\n // SELFBILLINGMETHOD\n this.selfBillingMethod = 0;\n // RATES\n this.rates = [];\n // CUSTOMERADDRESSADDRESSLINE1\n this.customerAddressAddressLine1 = null;\n // CUSTOMERADDRESSADDRESSLINE2\n this.customerAddressAddressLine2 = null;\n // CUSTOMERADDRESSADDRESSLINE3\n this.customerAddressAddressLine3 = null;\n // CUSTOMERADDRESSTOWN\n this.customerAddressTown = null;\n // CUSTOMERADDRESSCOUNTY\n this.customerAddressCounty = null;\n // CUSTOMERADDRESSPOSTCODE\n this.customerAddressPostcode = null;\n // CUSTOMERADDRESSCOUNTRY\n this.customerAddressCountry = null;\n // BILLINGADDRESSADDRESSLINE1\n this.billingAddressAddressLine1 = null;\n // BILLINGADDRESSADDRESSLINE2\n this.billingAddressAddressLine2 = null;\n // BILLINGADDRESSADDRESSLINE3\n this.billingAddressAddressLine3 = null;\n // BILLINGADDRESSTOWN\n this.billingAddressTown = null;\n // BILLINGADDRESSCOUNTY\n this.billingAddressCounty = null;\n // BILLINGADDRESSPOSTCODE\n this.billingAddressPostcode = null;\n // BILLINGADDRESSCOUNTRY\n this.billingAddressCountry = null;\n // AGENCYREFERENCE\n this.agencyReference = null;\n // CLIENTID\n this.clientId = 0;\n // CLIENTADDRESSID\n this.clientAddressId = 0;\n // BILLINGADDRESSID\n this.billingAddressId = 0;\n // NARRATIVE\n this.narrative = null;\n // PONUMBER\n this.poNumber = null;\n this.isDirectEngagement = false;\n }\n return CustomerCompact;\n }());\n Shared.CustomerCompact = CustomerCompact;\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var PaymentCode = /** @class */ (function () {\n function PaymentCode() {\n // CODE\n this.code = null;\n // DESCRIPTION\n this.description = null;\n // LINETYPE\n this.lineType = null;\n // TIMEUNITS\n this.timeUnits = null;\n // GUIDANCE\n this.guidance = null;\n // RECEIPTREQUIRED\n this.receiptRequired = false;\n // ISBANDED\n this.isBanded = false;\n // CATEGORY\n this.category = null;\n // ACCOUNTTYPE\n this.accountType = null;\n // DEFAULTEXPENSERATE\n this.defaultExpenseRate = 0;\n // ISPUBLIC\n this.isPublic = false;\n // ISMILEAGE\n this.isMileage = false;\n // ISOFFSITE\n this.isOffSite = false;\n }\n return PaymentCode;\n }());\n Shared.PaymentCode = PaymentCode;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var PaymentFrequency;\n (function (PaymentFrequency) {\n PaymentFrequency[PaymentFrequency[\"weekly\"] = 0] = \"weekly\";\n PaymentFrequency[PaymentFrequency[\"fortnightly\"] = 2] = \"fortnightly\";\n PaymentFrequency[PaymentFrequency[\"monthly\"] = 3] = \"monthly\";\n })(PaymentFrequency = Shared.PaymentFrequency || (Shared.PaymentFrequency = {}));\n var PaymentFrequencyParser = /** @class */ (function () {\n function PaymentFrequencyParser() {\n }\n PaymentFrequencyParser.getDescription = function (value) {\n switch (value) {\n case 0:\n return PaymentFrequency.weekly;\n case 2:\n return PaymentFrequency.fortnightly;\n case 3:\n return PaymentFrequency.monthly;\n default:\n return PaymentFrequency.weekly;\n }\n };\n PaymentFrequencyParser.getEnum = function (value) {\n switch (value) {\n case 0:\n return new Shared.EnumObj('Weekly', 0);\n case 2:\n return new Shared.EnumObj('Fortnightly', 2);\n case 3:\n return new Shared.EnumObj('Monthly', 3);\n default:\n return new Shared.EnumObj('Weekly', 0);\n }\n };\n return PaymentFrequencyParser;\n }());\n Shared.PaymentFrequencyParser = PaymentFrequencyParser;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var PayPersonBureau;\n (function (PayPersonBureau) {\n PayPersonBureau[PayPersonBureau[\"none\"] = -99] = \"none\";\n PayPersonBureau[PayPersonBureau[\"bur15\"] = 0] = \"bur15\";\n PayPersonBureau[PayPersonBureau[\"bur16\"] = 2] = \"bur16\";\n PayPersonBureau[PayPersonBureau[\"bur17\"] = 3] = \"bur17\";\n })(PayPersonBureau = Shared.PayPersonBureau || (Shared.PayPersonBureau = {}));\n})(Shared || (Shared = {}));\n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var TimesheetFrequencyDetails = /** @class */ (function () {\n function TimesheetFrequencyDetails() {\n this.payPersonBureauDescription = null;\n this.timesheetFrequencies = [];\n this.timesheetFrequencyDescription = null;\n this.timesheetFrequencyOptions = [];\n }\n return TimesheetFrequencyDetails;\n }());\n Shared.TimesheetFrequencyDetails = TimesheetFrequencyDetails;\n})(Shared || (Shared = {}));\n/// \n/// \n/// \n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var AssignmentSrv = /** @class */ (function () {\n function AssignmentSrv($http, sharedConfig, dateUtils, invoicingEnums) {\n this.$http = $http;\n this.sharedConfig = sharedConfig;\n this.dateUtils = dateUtils;\n this.invoicingEnums = invoicingEnums;\n this.serviceBase = sharedConfig.baseApiUrl;\n var publicOrPrivateAssignment = this.invoicingEnums.Sectors.properties;\n delete publicOrPrivateAssignment['2'];\n this.publicOrPrivateAssignment = publicOrPrivateAssignment;\n this.ir35CapturedAssignment = this.invoicingEnums.Ir35Captured.properties;\n this.timesheetFrequency = this.invoicingEnums.TimesheetFrequency.properties;\n }\n AssignmentSrv.prototype.getAssignment = function (assignmentRef) {\n var _this = this;\n var url = this.serviceBase + 'api/Assignment/GetAssignment/' + assignmentRef;\n return this.$http.get(url).then(function (response) {\n if (response.data.publicSectorFromDate) {\n response.data.publicSectorFromDate = _this.dateUtils.convertToJsDate(response.data.publicSectorFromDate);\n }\n return response.data;\n });\n };\n AssignmentSrv.prototype.getAssignments = function (silentMode, umbrellaExpenses) {\n var _this = this;\n var url = this.serviceBase + 'api/Assignment/GetAssignments?umbrellaExpenses=' + umbrellaExpenses;\n var params = {\n headers: {\n silentMode: silentMode ? silentMode : false\n }\n };\n return this.$http.get(url, params).then(function (response) {\n _.forEach(response.data, function (assignment) {\n if (assignment.publicSectorFromDate) {\n assignment.publicSectorFromDate = _this.dateUtils.convertToJsDate(assignment.publicSectorFromDate);\n }\n });\n return response.data;\n });\n };\n AssignmentSrv.prototype.getAssignmentsForFullInvoice = function (silentMode, umbrellaExpenses) {\n var _this = this;\n var url = this.serviceBase + 'api/Assignment/GetAssignmentsForFullInvoice?umbrellaExpenses=' + umbrellaExpenses;\n var params = {\n headers: {\n silentMode: silentMode ? silentMode : false\n }\n };\n return this.$http.get(url, params).then(function (response) {\n _.forEach(response.data, function (assignment) {\n if (assignment.publicSectorFromDate) {\n assignment.publicSectorFromDate = _this.dateUtils.convertToJsDate(assignment.publicSectorFromDate);\n }\n });\n return response.data;\n });\n };\n AssignmentSrv.prototype.getPaymentCodes = function () {\n var _this = this;\n var url = this.serviceBase + 'api/Assignment/getPaymentCodes';\n //return this.$http.get(url).then((response: ng.IHttpPromiseCallbackArg>) => response.data);\n return this.$http.get(url).then(function (response) {\n _this.paymentCodes = response.data;\n return _this.paymentCodes;\n });\n };\n AssignmentSrv.prototype.getPaymentCodeValue = function (paymentCode) {\n var paymentCodeObj = _.find(this.paymentCodes, function (paymentCodeIndex) {\n return paymentCodeIndex.code === paymentCode;\n });\n return (paymentCodeObj) ? paymentCodeObj.description : '';\n };\n AssignmentSrv.prototype.getTimesheetFrequencyDetails = function () {\n var url = this.serviceBase + 'api/Assignment/GetTimesheetFrequencyDetails';\n return this.$http.get(url).then(function (response) { return response.data; });\n };\n AssignmentSrv.prototype.getAllAssignments = function (silentMode) {\n var url = this.serviceBase + 'api/Assignment/GetCustomers';\n var config = {\n headers: {\n silentMode: silentMode ? silentMode : false\n }\n };\n return this.$http.get(url, config).then(function (response) {\n _.forEach(response.data, function (customer) {\n _.forEach(customer.assignments, function (assignment) {\n if (assignment.publicSectorFromDate) {\n assignment.publicSectorFromDate = new Date(assignment.publicSectorFromDate.toString());\n }\n });\n });\n return response.data;\n });\n };\n AssignmentSrv.prototype.getAssignmentsForInvoiceCrediting = function (invoiceId) {\n var _this = this;\n var id = invoiceId.replace(\":\", \"-\");\n var url = this.serviceBase + 'api/Assignment/GetAssignmentsForInvoiceCrediting?invoiceId=' + id;\n var config = {\n headers: {\n silentMode: false\n }\n };\n return this.$http.get(url, config).then(function (response) {\n _.forEach(response.data, function (assignment) {\n if (assignment.publicSectorFromDate) {\n assignment.publicSectorFromDate = _this.dateUtils.convertToJsDate(assignment.publicSectorFromDate);\n }\n });\n return response.data;\n });\n };\n AssignmentSrv.prototype.closeAssignment = function (id) {\n var url = this.serviceBase + 'api/Assignment/CloseAssignment';\n var data = {\n assignmentId: id\n };\n return this.$http.put(url, data).then(function (response) { return response.data; });\n };\n AssignmentSrv.prototype.reopenAssignment = function (id) {\n var url = this.serviceBase + 'api/Assignment/ReopenAssignment';\n var data = {\n assignmentId: id\n };\n return this.$http.put(url, data).then(function (response) { return response.data; });\n };\n AssignmentSrv.$inject = ['$http', 'shared.config', \"brookson.utilities.date\", \"invoicing.enums\"];\n return AssignmentSrv;\n }());\n Shared.AssignmentSrv = AssignmentSrv;\n})(Shared || (Shared = {}));\nangular.module('app.shared').service('AssignmentSrv', Shared.AssignmentSrv);\n/// \n/// \n/// \n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var BrooksonFactoriesIntro = /** @class */ (function () {\n function BrooksonFactoriesIntro($q, service, localStorageService, memberSrv, assignmentSrv, ir35ModalService) {\n var _this = this;\n this.$q = $q;\n this.service = service;\n this.localStorageService = localStorageService;\n this.memberSrv = memberSrv;\n this.assignmentSrv = assignmentSrv;\n this.ir35ModalService = ir35ModalService;\n this.insertAuthorsationCode = function (authorisationCode) {\n return _this.memberSrv.insertAuthorsationCode(authorisationCode)\n .then(function (data) {\n return data;\n });\n };\n this.getAllAssignments = function () {\n return _this.assignmentSrv.getAssignments().then(function (data) {\n return data;\n });\n };\n this.showIR35AssessmentModal = function () {\n return _this.ir35ModalService.showIR35AssessmentModal().then(function (data) {\n return data;\n });\n };\n this.insertIR35Assessment = function (answers) {\n return _this.ir35ModalService.insertIR35Assessment(answers).then(function (data) {\n return data;\n });\n };\n this.getListOfJobTitles = function () {\n return _this.ir35ModalService.getListOfJobTitles().then(function (data) {\n return data;\n });\n };\n this.getListOfSectors = function () {\n return _this.ir35ModalService.getListOfSectors().then(function (data) {\n return data;\n });\n };\n /**\n * Returns an object containing each section on whether a user has seen the walkthrough\n * or not. It first checks local storage, if it exists, it will not make another request\n */\n this.getConnectIntros = function () {\n var data = _this.getIntrosFromLocalStorage();\n if (data) {\n var defer = _this.$q.defer();\n defer.resolve(data);\n return defer.promise;\n }\n return _this.service.getConnectIntros(true).then(function (data) {\n _this.connectIntros = data;\n _this.setIntrosIntroLocalStorage();\n return data;\n });\n };\n this.setFirstTimeLoginSeen = function () {\n _this.connectIntros.firstTimeLogin = true;\n _this.setIntrosIntroLocalStorage();\n return _this.service.setFirstTimeLoginSeen(true).then(function (response) {\n return response;\n });\n };\n this.startIntro = function () { };\n this.getIntrosFromLocalStorage = function () {\n var data = _this.localStorageService.get(_this.getLocalStorageKey());\n _this.connectIntros = data;\n return data;\n };\n this.setIntrosIntroLocalStorage = function () {\n _this.localStorageService.set(_this.getLocalStorageKey(), _this.connectIntros);\n };\n this.getLocalStorageKey = function () { return \"\".concat(BrooksonFactoriesIntro.INTRO_LOCAL_STORAGE_KEY, \"-\").concat(_this.member.memberId); };\n this.member = this.memberSrv.getMember();\n }\n BrooksonFactoriesIntro.INTRO_LOCAL_STORAGE_KEY = \"brookson.intro\";\n BrooksonFactoriesIntro.$inject = ['$q', 'brooksonServicesIntro', 'localStorageService', 'memberSrv', 'AssignmentSrv', 'ir35ModalService'];\n return BrooksonFactoriesIntro;\n }());\n Shared.BrooksonFactoriesIntro = BrooksonFactoriesIntro;\n})(Shared || (Shared = {}));\nangular.module('app.shared')\n .service('brooksonFactoriesIntro', Shared.BrooksonFactoriesIntro);\n/// \n(function () {\n 'use strict';\n angular\n .module('app.shared')\n .factory('brookson.logger', logger);\n logger.$inject = ['$log', 'loggerSrv', 'logging.enums'];\n function logger($log, loggerSrv, loggingEnums) {\n var service = {\n error: error,\n info: info,\n success: success,\n warning: warning,\n log: log\n };\n return service;\n function error(title, data, cause) {\n $log.error('Error: ' + title + '\\nStack: ' + data + '\\nCause: ' + cause);\n loggerSrv.log(loggingEnums.LoggingLevel.ERROR, title, data, cause);\n }\n function info(title, data, cause) {\n $log.info('Error: ' + title + '\\nStack: ' + data + '\\nCause: ' + cause);\n loggerSrv.log(loggingEnums.LoggingLevel.INFO, title, data, cause);\n }\n function success(title, data, cause) {\n $log.info('Error: ' + title + '\\nStack: ' + data + '\\nCause: ' + cause);\n loggerSrv.log(loggingEnums.LoggingLevel.INFO, title, data, cause);\n }\n function warning(title, data, cause) {\n $log.warn('Error: ' + title + '\\nStack: ' + data + '\\nCause: ' + cause);\n loggerSrv.log(loggingEnums.LoggingLevel.WARN, title, data, cause);\n }\n function log(title, data, cause) {\n $log.log('Error: ' + title + '\\nStack: ' + data + '\\nCause: ' + cause);\n loggerSrv.log(loggingEnums.LoggingLevel.INFO, title, data, cause);\n }\n }\n})();\nvar Shared;\n(function (Shared) {\n /**\n *\n * Factory to handle toggling the privary feature\n * @export\n * @class BrooksonFactoryPrivacy\n * @implements {IBrooksonFactoryPrivacy}\n */\n var BrooksonFactoryPrivacy = /** @class */ (function () {\n /**\n * Creates an instance of BrooksonFactoryPrivacy.\n *\n * @param {ng.IDocumentService} $document\n */\n function BrooksonFactoryPrivacy($document, $http, hotkeys, screenSize) {\n var _this = this;\n this.$document = $document;\n this.$http = $http;\n this.hotkeys = hotkeys;\n this.screenSize = screenSize;\n /**\n *\n * Stores the value on whether privacy mode is enabled\n * @private\n * @type {boolean}\n */\n this.privacyModeEnabled = false;\n /**\n *\n * The hotkey to toggle privacy mode\n * WARNING: This is used by the hotkey library and also used to display the hotkey on screen.\n * @private\n * @type {string}\n */\n this.hotKeyToEnablePrivacyMode = \"Ctrl + Shift + H\";\n /**\n * Turn the privacy feature on and off\n */\n this.togglePrivacy = function () {\n _this.privacyModeEnabled = !_this.privacyModeEnabled;\n _this.toggleBlur();\n _this.setPrivacyMode(_this.privacyModeEnabled, true);\n };\n /**\n *\n * Toggles the blur class on the blur-area element identifier\n * @private\n */\n this.toggleBlur = function () {\n var blurArea = angular.element('.blur-area');\n if (_this.privacyModeEnabled)\n blurArea.addClass('blur');\n else\n blurArea.removeClass('blur');\n };\n /**\n * Uses the hotkeys library to create a hotkey for enabling and disabling\n *\n * @private\n */\n this.setupHotkeys = function () {\n var formatHotKey = _this.hotKeyToEnablePrivacyMode.replace(/ /g, '').toLowerCase();\n _this.hotkeys.add({\n combo: formatHotKey,\n callback: function () {\n _this.togglePrivacy();\n }\n });\n };\n this.setupHotkeys();\n }\n /**\n * Returns whether the last state of the dashboard was in privacy mode or not\n *\n * @private\n * @param {boolean} [silentMode]\n * @returns {ng.IPromise}\n */\n BrooksonFactoryPrivacy.prototype.isPrivacyModeEnabled = function (silentMode) {\n var _this = this;\n return this.$http.get(\"api/Dashboard/IsPrivacyModeEnabled\", {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n if (!_this.screenSize.is(\"lg\")) {\n response.data = false; //this will be toggled to true for anything but lg\n }\n if (response.data)\n _this.togglePrivacy();\n return response.data;\n });\n };\n /**\n * Sets the PrivacyModeEnabled flag in the database to either true or false\n *\n * @param {boolean} enabled\n * @param {boolean} [silentMode]\n * @returns {ng.IPromise}\n */\n BrooksonFactoryPrivacy.prototype.setPrivacyMode = function (enabled, silentMode) {\n return this.$http.post(\"api/Dashboard/SetPrivacyMode\", {\n enabled: enabled\n }, {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n };\n /**\n *\n * DI\n * @static\n */\n BrooksonFactoryPrivacy.$inject = ['$document', '$http', 'hotkeys', 'screenSize'];\n return BrooksonFactoryPrivacy;\n }());\n Shared.BrooksonFactoryPrivacy = BrooksonFactoryPrivacy;\n})(Shared || (Shared = {}));\nangular.module('app.shared')\n .service('brookson.factory.privacy', Shared.BrooksonFactoryPrivacy);\nvar Shared;\n(function (Shared) {\n var SdcQuestionnaireAnswer = /** @class */ (function () {\n function SdcQuestionnaireAnswer() {\n }\n return SdcQuestionnaireAnswer;\n }());\n Shared.SdcQuestionnaireAnswer = SdcQuestionnaireAnswer;\n})(Shared || (Shared = {}));\n/// \n/// \nvar Shared;\n(function (Shared) {\n var SdcQuestionnaireInput = /** @class */ (function () {\n function SdcQuestionnaireInput() {\n }\n return SdcQuestionnaireInput;\n }());\n Shared.SdcQuestionnaireInput = SdcQuestionnaireInput;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var AssignmentInfo = /** @class */ (function () {\n function AssignmentInfo() {\n }\n return AssignmentInfo;\n }());\n Shared.AssignmentInfo = AssignmentInfo;\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n var SdcQuestionnaireOutcome = /** @class */ (function () {\n function SdcQuestionnaireOutcome() {\n }\n return SdcQuestionnaireOutcome;\n }());\n Shared.SdcQuestionnaireOutcome = SdcQuestionnaireOutcome;\n})(Shared || (Shared = {}));\n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var SdcQuestionnaire = /** @class */ (function () {\n function SdcQuestionnaire() {\n }\n return SdcQuestionnaire;\n }());\n Shared.SdcQuestionnaire = SdcQuestionnaire;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var SdcQuestionnaireInputForm = /** @class */ (function () {\n function SdcQuestionnaireInputForm() {\n }\n return SdcQuestionnaireInputForm;\n }());\n Shared.SdcQuestionnaireInputForm = SdcQuestionnaireInputForm;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var AssignmentSdcOutcome = /** @class */ (function () {\n function AssignmentSdcOutcome() {\n }\n return AssignmentSdcOutcome;\n }());\n Shared.AssignmentSdcOutcome = AssignmentSdcOutcome;\n})(Shared || (Shared = {}));\n/// \n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var SdcService = /** @class */ (function () {\n function SdcService($http) {\n var _this = this;\n this.$http = $http;\n /**\n * Returns the latest questionnaire for a given assignment\n *\n *\n * @memberOf SdcService\n */\n this.getLatestQuestionnaire = function (assignmentId) {\n return _this.$http.get(\"api/Sdc/GetLatestQuestionnaire?assignmentId=\".concat(assignmentId)).then(function (response) {\n return response.data;\n });\n };\n /**\n * Returns whether a user has passed SDC based on their input\n *\n *\n * @memberOf SdcService\n */\n this.getOutcome = function (input) {\n return _this.$http.post(\"api/Sdc/GetOutcome\", input).then(function (response) {\n return response.data;\n });\n };\n /**\n * Searches Digita for a list of Job Titles based on the query provided\n *\n *\n * @memberOf SdcService\n */\n this.searchJobTitle = function (data, silentMode) {\n return _this.$http.get(\"api/Sdc/SearchJobTitle?query=\".concat(data), {\n silentMode: silentMode ? silentMode : false,\n cache: true\n }).then(function (response) {\n return response.data;\n });\n };\n /**\n * Returns a list of assignment outcomes for the member\n *\n *\n * @memberOf SdcService\n */\n this.getAssignmentOutcomes = function (silentMode) {\n return _this.$http.get(\"api/Sdc/GetAssignmentOutcomes\", {\n silentMode: silentMode ? silentMode : false,\n cache: true\n }).then(function (response) {\n return response.data;\n });\n };\n /**\n * Declines as assignment to submit expenses\n *\n *\n * @memberOf SdcService\n */\n this.declineExpensesForAssignment = function (assignmentId, silentMode) {\n return _this.$http.patch(\"api/Sdc/DeclineExpensesForAssignment?assignmentId=\".concat(assignmentId), {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n };\n }\n SdcService.$inject = ['$http'];\n return SdcService;\n }());\n Shared.SdcService = SdcService;\n})(Shared || (Shared = {}));\nangular.module('app.shared').service('sdcService', Shared.SdcService);\n/// \n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var SdcFactory = /** @class */ (function () {\n function SdcFactory(sdcService) {\n var _this = this;\n this.sdcService = sdcService;\n this.sdcQuestionnaireInput = new Shared.SdcQuestionnaireInput();\n this.sdcQuestionnaireInputForm = new Shared.SdcQuestionnaireInputForm();\n this.sdcQuestionnaire = new Shared.SdcQuestionnaire();\n this.sdcOutcome = new Shared.SdcQuestionnaireOutcome();\n /**\n * Returns the latest SDC questionnaire for a given assignment\n *\n *\n * @memberOf SdcService\n */\n this.getLatestQuestionnaire = function (assignmentId) {\n return _this.sdcService.getLatestQuestionnaire(assignmentId).then(function (data) {\n if (data) {\n _this.sdcQuestionnaire = data;\n var jobTitle = new Shared.JobTitle();\n jobTitle.titleText = _this.sdcQuestionnaire.extraInfo.jobTitle;\n _this.sdcQuestionnaire.extraInfo.jobTitleOption = jobTitle;\n _this.sdcQuestionnaireInputForm = _this.createSdcQuestionnaireInputForm(_this.sdcQuestionnaire.answers);\n }\n return data;\n });\n };\n /**\n * Returns whether a user has passed SDC based on their input\n *\n *\n * @memberOf SdcService\n */\n this.getOutcome = function (form) {\n _this.createSdcQuestionnaireInput(form);\n return _this.sdcService.getOutcome(_this.sdcQuestionnaireInput).then(function (data) {\n _this.sdcOutcome = data;\n return data;\n });\n };\n /**\n * Searches Digita for Job Titles based on the query\n *\n *\n * @memberOf SdcFactory\n */\n this.searchJobTitle = function (query, silentMode) {\n return _this.sdcService.searchJobTitle(query, silentMode);\n };\n /**\n * Sets the array of rates\n *\n *\n * @memberOf SdcFactory\n */\n this.setRates = function (rates) {\n _this.rates = rates;\n };\n this.hasOutcomeSet = function () {\n return _this.sdcOutcome && _this.sdcOutcome.outcome !== Shared.SdcOutcomeType.NotAssessed;\n };\n this.hasFailedOutcome = function () {\n return _this.hasOutcomeSet() && _this.sdcOutcome.outcome === Shared.SdcOutcomeType.Fail;\n };\n /**\n * Creates a model for the input fields on the form\n * It will assign the property values based on the array of answers\n *\n * @private\n *\n * @memberOf SdcFactory\n */\n this.createSdcQuestionnaireInputForm = function (answers) {\n var form = new Shared.SdcQuestionnaireInputForm();\n if (!answers || answers.length === 0)\n return form;\n form.sdcWillIncurExpenses = _this.getAnswerValue(answers, SdcFactory.SDC_QKEY_WILLINCUREXPENSES);\n form.sdcIntendMultipleAssignments = _this.getAnswerValue(answers, SdcFactory.SDC_QKEY_INTENDMULTIPLEASSIGNMENTS);\n form.sdcDoesClientSupervise = _this.getAnswerValue(answers, SdcFactory.SDC_QKEY_DOESCLIENTSUPERVISE);\n form.sdcDoesClientInstruct = _this.getAnswerValue(answers, SdcFactory.SDC_QKEY_DOESCLIENTINSTRUCT);\n form.sdcCannotOverruleImplementation = _this.getAnswerValue(answers, SdcFactory.SDC_QKEY_CANNOTOVERRULEIMPLEMENTATION);\n form.sdcCannotOverrulePlan = _this.getAnswerValue(answers, SdcFactory.SDC_QKEY_CANNOTOVERRULEPLAN);\n form.sdcInPermanentTeam = _this.getAnswerValue(answers, SdcFactory.SDC_QKEY_PERMANENTTEAMSAMEROLE);\n return form;\n };\n /**\n * Finds an answer in an array of ansawers and returns the values\n *\n * @private\n *\n * @memberOf SdcFactory\n */\n this.getAnswerValue = function (answers, key) {\n var result = _.find(answers, function (answer) { return answer.questionKey === key; });\n if (!result)\n return null;\n return result.answer;\n };\n /**\n * Adds the question key and answer to the answers array if the user has answered the question\n *\n * @private\n *\n * @memberOf SdcFactory\n */\n this.setAnswerValue = function (answers, questionKey, answer) {\n if (answers === void 0) { answers = []; }\n if (!_.isUndefined(answer)) {\n var questionnaireAnswer = new Shared.SdcQuestionnaireAnswer();\n questionnaireAnswer.questionKey = questionKey;\n questionnaireAnswer.answer = answer;\n answers.push(questionnaireAnswer);\n }\n };\n /**\n * Creates an Sdc Questionnaire input model to be sent to the GetOutcome endpoint\n *\n * @private\n *\n * @memberOf SdcFactory\n */\n this.createSdcQuestionnaireInput = function (form) {\n _this.sdcQuestionnaireInput = new Shared.SdcQuestionnaireInput();\n var answers = new Array();\n _this.setAnswerValue(answers, SdcFactory.SDC_QKEY_WILLINCUREXPENSES, form.sdcWillIncurExpenses);\n _this.setAnswerValue(answers, SdcFactory.SDC_QKEY_INTENDMULTIPLEASSIGNMENTS, form.sdcIntendMultipleAssignments);\n _this.setAnswerValue(answers, SdcFactory.SDC_QKEY_DOESCLIENTSUPERVISE, form.sdcDoesClientSupervise);\n _this.setAnswerValue(answers, SdcFactory.SDC_QKEY_DOESCLIENTINSTRUCT, form.sdcDoesClientInstruct);\n _this.setAnswerValue(answers, SdcFactory.SDC_QKEY_CANNOTOVERRULEIMPLEMENTATION, form.sdcCannotOverruleImplementation);\n _this.setAnswerValue(answers, SdcFactory.SDC_QKEY_CANNOTOVERRULEPLAN, form.sdcCannotOverrulePlan);\n _this.setAnswerValue(answers, SdcFactory.SDC_QKEY_PERMANENTTEAMSAMEROLE, form.sdcInPermanentTeam);\n _this.setAnswerValue(answers, SdcFactory.SDC_QKEY_RATEVALUEDAILY, _this.findRateValue(SdcFactory.PAYMENT_CODE_STANDARD_DAILY));\n _this.setAnswerValue(answers, SdcFactory.PAYMENT_CODE_STANDARD_HOURLY, _this.findRateValue(SdcFactory.PAYMENT_CODE_STANDARD_HOURLY));\n _this.sdcQuestionnaireInput.agencyNumber = _this.sdcQuestionnaire.agencyNumber;\n _this.sdcQuestionnaireInput.answers = answers;\n if (_this.sdcQuestionnaire.extraInfo) {\n _this.sdcQuestionnaireInput.assignmentIndustry = _this.sdcQuestionnaire.extraInfo.assignmentIndustry;\n _this.sdcQuestionnaireInput.clientAddress = _this.sdcQuestionnaire.extraInfo.clientAddress;\n _this.sdcQuestionnaireInput.workSiteAddress = _this.sdcQuestionnaire.extraInfo.siteAddress;\n _this.sdcQuestionnaireInput.clientName = _this.sdcQuestionnaire.extraInfo.clientName;\n _this.sdcQuestionnaireInput.expectedLengthOfAssignmentMonths = _this.sdcQuestionnaire.extraInfo.expectedLengthOfAssignmentMonths;\n _this.sdcQuestionnaireInput.startDate = _this.sdcQuestionnaire.extraInfo.dateStartedAtWorkSite;\n if (_this.sdcQuestionnaire.extraInfo.jobTitleOption) {\n _this.sdcQuestionnaireInput.jobTitle = _this.sdcQuestionnaire.extraInfo.jobTitleOption.titleText;\n }\n }\n else {\n console.warn(\"No extra info has been added to the SDC questionnaire input model\");\n }\n };\n this.findRateValue = function (paymentCode) {\n var rate = _.find(_this.rates, function (rate) {\n return rate.paymentCode === paymentCode;\n });\n if (!rate) {\n console.warn(\"There was no rate matching the payment code: \".concat(paymentCode));\n return 0;\n }\n return rate.amount;\n };\n }\n SdcFactory.SDC_QKEY_RATEVALUEHOURLY = \"PAY RATE VALUE HOURLY\";\n SdcFactory.SDC_QKEY_RATEVALUEDAILY = \"PAY RATE VALUE DAILY\";\n SdcFactory.SDC_QKEY_WILLINCUREXPENSES = \"WILL INCUR EXPENSES\";\n SdcFactory.SDC_QKEY_INTENDMULTIPLEASSIGNMENTS = \"INTEND MULTIPLE ASSIGNMENTS\";\n SdcFactory.SDC_QKEY_DOESCLIENTSUPERVISE = \"DOES CLIENT SUPERVISE\";\n SdcFactory.SDC_QKEY_DOESCLIENTINSTRUCT = \"DOES CLIENT INSTRUCT\";\n SdcFactory.SDC_QKEY_CANNOTOVERRULEIMPLEMENTATION = \"CANNOT OVERRULE IMPLEMENTATION\";\n SdcFactory.SDC_QKEY_CANNOTOVERRULEPLAN = \"CANNOT OVERRULE PLAN\";\n SdcFactory.SDC_QKEY_PERMANENTTEAMSAMEROLE = \"IN PERM TEAM SAME ROLE\";\n SdcFactory.SDC_QKEY_ASSIGNMENTCURRENCY = \"ASSIGNMENT CURRENCY\";\n SdcFactory.PAYMENT_CODE_STANDARD_DAILY = \"STD DAYS\";\n SdcFactory.PAYMENT_CODE_STANDARD_HOURLY = \"STD\";\n SdcFactory.$inject = ['sdcService'];\n return SdcFactory;\n }());\n Shared.SdcFactory = SdcFactory;\n})(Shared || (Shared = {}));\nangular.module('app.shared').service('sdcFactory', Shared.SdcFactory);\n/// \n(function () {\n 'use strict';\n angular.module('app.shared').factory('brooksonSignalrFactory', brooksonSignalrFactory);\n brooksonSignalrFactory.$inject = ['$rootScope'];\n function brooksonSignalrFactory(rootScope) {\n if (!$.connection) {\n throw ('SignalR required');\n }\n var connected = false;\n var connect = $.connection.hub.start().then(function () { connected = true; });\n var openBankingSubscriptions = [];\n var openBankingReconsentSubscriptions = [];\n var fullInvoicePdfSubscriptions = [];\n var ensureConnected = function (callback) {\n if ($.connection.hub.state === $.signalR.connectionState.connected) {\n callback();\n }\n else if ($.connection.hub.state === $.signalR.connectionState.disconnected) {\n $.connection.hub.start()\n .done(function () {\n connected = true;\n callback();\n });\n }\n };\n // Base connect instance\n var instance = {\n connect: function (callback) {\n connect.then(function () {\n if (callback) {\n rootScope.$apply(function () {\n callback();\n });\n }\n });\n }\n };\n // OpenBanking Methods\n var openBankingHub = $.connection.openBankingHub;\n instance.openBanking = {\n subscribeToPage: function (memberId, companyRef) {\n ensureConnected(function () { openBankingHub.server.subscribeToPage(memberId, companyRef); });\n openBankingSubscriptions.push(memberId + '-' + companyRef);\n },\n unSubscribeFromPage: function (memberId, companyRef) {\n ensureConnected(function () { openBankingHub.server.unSubscribeFromPage(memberId, companyRef); });\n var index = openBankingSubscriptions.indexOf(memberId + '-' + companyRef);\n openBankingSubscriptions.splice(index, 1);\n }\n };\n var openBankingReconsentHub = $.connection.openBankingReconsentHub;\n instance.openBankingReconsent = {\n subscribeToPage: function (memberId, companyRef) {\n ensureConnected(function () { openBankingReconsentHub.server.subscribeToPage(memberId, companyRef); });\n openBankingReconsentSubscriptions.push(memberId + '-' + companyRef);\n },\n unSubscribeFromPage: function (memberId, companyRef) {\n ensureConnected(function () { openBankingReconsentHub.server.unSubscribeFromPage(memberId, companyRef); });\n var index = openBankingReconsentSubscriptions.indexOf(memberId + '-' + companyRef);\n openBankingReconsentSubscriptions.splice(index, 1);\n }\n };\n // Full Invoice Methods\n var fullInvoiceHub = $.connection.fullInvoicegHub;\n instance.fullInvoicePdfNotifications = {\n subscribeToPage: function (memberId, companyRef) {\n ensureConnected(function () { fullInvoiceHub.server.subscribeToPage(memberId, companyRef); });\n fullInvoicePdfSubscriptions.push(memberId + '-' + companyRef);\n },\n unSubscribeFromPage: function (memberId, companyRef) {\n ensureConnected(function () { fullInvoiceHub.server.unSubscribeFromPage(memberId, companyRef); });\n var index = fullInvoicePdfSubscriptions.indexOf(memberId + '-' + companyRef);\n fullInvoicePdfSubscriptions.splice(index, 1);\n }\n };\n // Radar Listeners\n openBankingHub.client.notification = function (notification) {\n rootScope.$apply(function () {\n rootScope.$broadcast(notification.Action, notification);\n });\n };\n openBankingReconsentHub.client.notification = function (notification) {\n rootScope.$apply(function () {\n rootScope.$broadcast(notification.Action, notification);\n });\n };\n fullInvoiceHub.client.notification = function (notification) {\n rootScope.$apply(function () {\n rootScope.$broadcast(notification.Action, notification);\n });\n };\n return instance;\n }\n})();\nvar Shared;\n(function (Shared) {\n function FilterAddress() {\n return function (input) {\n return input ? input.replace(/\\n/g, \"
    \") : '';\n };\n }\n Shared.FilterAddress = FilterAddress;\n})(Shared || (Shared = {}));\nangular.module(\"app.shared\").filter(\"address\", Shared.FilterAddress);\nvar Shared;\n(function (Shared) {\n function FilterBankAccount() {\n return function (value) {\n if (value && value.length >= 6 && value.indexOf('-') === -1) {\n return value.substr(0, 2) + \"-\" + value.substr(2, 2) + \"-\" + value.substr(4, 2);\n }\n return value;\n };\n }\n Shared.FilterBankAccount = FilterBankAccount;\n})(Shared || (Shared = {}));\nangular.module(\"app.shared\").filter(\"sortcode\", Shared.FilterBankAccount);\nvar Shared;\n(function (Shared) {\n function FilterBankAccountType() {\n return function (input) {\n var result = 'unknown';\n switch (input) {\n case 0:\n result = \"Current Account\";\n break;\n case 1:\n result = \"Deposit Account\";\n break;\n case 2:\n result = \"Credit Card\";\n break;\n case 3:\n result = \"Deposit Bond\";\n break;\n default:\n break;\n }\n return result;\n };\n }\n Shared.FilterBankAccountType = FilterBankAccountType;\n})(Shared || (Shared = {}));\nangular.module(\"app.shared\").filter(\"bankAccountType\", Shared.FilterBankAccountType);\nvar Shared;\n(function (Shared) {\n function FilterBoolean() {\n return function (input) {\n return input ? 'Yes' : 'No';\n };\n }\n Shared.FilterBoolean = FilterBoolean;\n})(Shared || (Shared = {}));\nangular.module(\"app.shared\").filter(\"boolean\", Shared.FilterBoolean);\nvar Shared;\n(function (Shared) {\n function FilterCurrency($filter, currencyEnums) {\n return function (input, code, useValue, fractionSize) {\n code = code ? code : currencyEnums.CurrencyCodes.GBP;\n input = input ? input : 0;\n return useValue ? $filter('currency')(input, currencyEnums.CurrencyCodes.properties[code].value, fractionSize)\n : $filter('currency')(input, currencyEnums.CurrencyCodes.properties[code].code, fractionSize);\n };\n }\n Shared.FilterCurrency = FilterCurrency;\n FilterCurrency.$inject = ['$filter', 'currency.enums'];\n})(Shared || (Shared = {}));\nangular.module(\"app.shared\").filter(\"brooksonCurrency\", Shared.FilterCurrency);\nvar Shared;\n(function (Shared) {\n function FilterBkShortDate(brooksonUtilitiesDate) {\n return function (input, format, defaultValue) {\n if (!input) {\n return '';\n }\n var m = brooksonUtilitiesDate.convertToMoment(input);\n if (m.year() === 1 || isNaN(m.year()) || m.year() === 1753) {\n if (defaultValue) {\n var convertToDate = brooksonUtilitiesDate.convertToMoment(defaultValue).format(format);\n return convertToDate === 'Invalid date' ? defaultValue : convertToDate;\n }\n else {\n return '';\n }\n }\n return m.format(format);\n };\n }\n Shared.FilterBkShortDate = FilterBkShortDate;\n FilterBkShortDate.$inject = ['brookson.utilities.date'];\n function FilterBkRelativeDate(brooksonUtilitiesDate) {\n return function (input) {\n if (!input) {\n return '';\n }\n var m = brooksonUtilitiesDate.convertToMoment(input);\n if (m.year() === 1 || isNaN(m.year()) || m.year() === 1753) {\n return '';\n }\n return m.from(moment());\n };\n }\n Shared.FilterBkRelativeDate = FilterBkRelativeDate;\n FilterBkRelativeDate.$inject = ['brookson.utilities.date'];\n})(Shared || (Shared = {}));\nangular.module(\"app.shared\")\n .filter(\"bkShortDate\", Shared.FilterBkShortDate)\n .filter(\"bkRelativeDate\", Shared.FilterBkRelativeDate);\nvar Shared;\n(function (Shared) {\n function DisplayLineBrakes() {\n return function (input) {\n return input ? input.replace(/\\n/g, \"
    \") : '';\n };\n }\n Shared.DisplayLineBrakes = DisplayLineBrakes;\n})(Shared || (Shared = {}));\nangular.module(\"app.shared\").filter(\"lineBrakes\", Shared.DisplayLineBrakes);\nvar Shared;\n(function (Shared) {\n function FilterStartFrom() {\n return function (input, start) {\n if (input && _.isArray(input)) {\n start = +start;\n return input.slice(start);\n }\n return [];\n };\n }\n Shared.FilterStartFrom = FilterStartFrom;\n})(Shared || (Shared = {}));\nangular.module(\"app.shared\").filter(\"startFrom\", Shared.FilterStartFrom);\nvar Shared;\n(function (Shared) {\n function FilterBytes() {\n return function (bytes, precision, displayUnit) {\n if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) {\n return '-';\n }\n if (typeof precision === 'undefined') {\n precision = 1;\n }\n var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'];\n var number = Math.floor(Math.log(bytes) / Math.log(1024));\n var value = (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision);\n value = isNaN(value) ? 0 : value;\n if (displayUnit === false) {\n return value;\n }\n else {\n return value + ' ' + units[number];\n }\n };\n }\n Shared.FilterBytes = FilterBytes;\n})(Shared || (Shared = {}));\nangular.module(\"app.shared\").filter(\"bytes\", Shared.FilterBytes);\nvar Shared;\n(function (Shared) {\n var ActionsToTakeSummary = /** @class */ (function () {\n function ActionsToTakeSummary() {\n // ADDRESSLINE1\n this.expensesToAuthorize = null;\n // ADDRESSLINE2\n this.holidaysToAuthorize = null;\n // ADDRESSLINE3\n this.overtimeToAuthorize = null;\n }\n return ActionsToTakeSummary;\n }());\n Shared.ActionsToTakeSummary = ActionsToTakeSummary;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var Models;\n (function (Models) {\n var AgencyMarginCompact = /** @class */ (function () {\n function AgencyMarginCompact() {\n }\n return AgencyMarginCompact;\n }());\n Models.AgencyMarginCompact = AgencyMarginCompact;\n })(Models = Shared.Models || (Shared.Models = {}));\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var Calendar = /** @class */ (function () {\n function Calendar() {\n }\n return Calendar;\n }());\n Shared.Calendar = Calendar;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var CompanyDetails = /** @class */ (function () {\n function CompanyDetails() {\n }\n return CompanyDetails;\n }());\n Shared.CompanyDetails = CompanyDetails;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var ConnectReceipt = /** @class */ (function () {\n function ConnectReceipt() {\n }\n return ConnectReceipt;\n }());\n Shared.ConnectReceipt = ConnectReceipt;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var CS01ConfirmationDetails = /** @class */ (function () {\n function CS01ConfirmationDetails() {\n this.amendmentdetails = '';\n }\n return CS01ConfirmationDetails;\n }());\n Shared.CS01ConfirmationDetails = CS01ConfirmationDetails;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var DashboardWidget = /** @class */ (function () {\n function DashboardWidget() {\n }\n return DashboardWidget;\n }());\n Shared.DashboardWidget = DashboardWidget;\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n var DashboardUserWidget = /** @class */ (function (_super) {\n __extends(DashboardUserWidget, _super);\n function DashboardUserWidget() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return DashboardUserWidget;\n }(Shared.DashboardWidget));\n Shared.DashboardUserWidget = DashboardUserWidget;\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n var DashboardUser = /** @class */ (function () {\n function DashboardUser() {\n }\n return DashboardUser;\n }());\n Shared.DashboardUser = DashboardUser;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var FixedTaxData = /** @class */ (function () {\n function FixedTaxData() {\n // TAXFREEDIVIDENDALLOWANCE\n this.taxFreeDividendAllowance = 0;\n // LOWERRATEDIVIDENDTAXRATE\n this.lowerRateDividendTaxRate = 0;\n // HIGHERRATEDIVIDENDTAXRATE\n this.higherRateDividendTaxRate = 0;\n // ADDITIONALRATEDIVIDENDTAXRATE\n this.additionalRateDividendTaxRate = 0;\n // PERSONALALLOWANCE\n this.personalAllowance = 0;\n // BASICRATETHRESHOLD\n this.basicRateThreshold = 0;\n // HIGHERRATETHRESHOLD\n this.higherRateThreshold = 0;\n // FULLPERSONALALLOWANCEUPPERLIMIT\n this.fullPersonalAllowanceUpperLimit = 0;\n // LOWERRATEINCOMETAX\n this.lowerRateIncomeTax = 0;\n // BASICRATEINCOMETAX\n this.basicRateIncomeTax = 0;\n // HIGHERRATETAX\n this.higherRateTax = 0;\n // ADDITIONALRATETAX\n this.additionalRateTax = 0;\n // EMPLOYMENTINCOMESTUDENTREPAYTHRESHOLD\n this.employmentIncomeStudentRepayThreshold = 0;\n // NONEMPLOYMENTINCOMESTUDENTREPAYTHRESHOLD\n this.nonEmploymentIncomeStudentRepayThreshold = 0;\n // REPAYMENTPERCENTAGE\n this.repaymentPercentage = 0;\n // CHILDBENEFITTAXCHARGETHRESHOLD\n this.childBenefitTaxChargeThreshold = 0;\n // PERCENTAGEINCREMENTS\n this.percentageIncrements = 0;\n }\n return FixedTaxData;\n }());\n Shared.FixedTaxData = FixedTaxData;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var ForecastCalculations = /** @class */ (function () {\n function ForecastCalculations() {\n // MONTHSYEARTODATE\n this.monthsYearToDate = 0;\n // MONTHSREMAINING\n this.monthsRemaining = 0;\n // WEEKSYEARTODATE\n this.weeksYearToDate = 0;\n // WEEKSREMAINING\n this.weeksRemaining = 0;\n // WEEKSYEARTODATEFROMTAXSTART\n this.weeksYearToDateFromTaxStart = 0;\n // WEEKSREMAININGFROMTAXSTART\n this.weeksRemainingFromTaxStart = 0;\n // PSCEMPLOYMENT\n this.pscEmployment = 0;\n // CURRENTDIRECTORSFEEWEEKLY\n this.currentDirectorsFeeWeekly = 0;\n // SHAREHOLDERSPLIT\n this.shareholderSplit = 0;\n // CONFIRMEDASDIVIDENDS\n this.confirmedAsDividends = 0;\n // UNCONFIRMEDTRANSACTIONS\n this.unconfirmedTransactions = 0;\n // TRANSACTIONSBEINGPROCESSED\n this.transactionsBeingProcessed = 0;\n // TAXDEDUCTEDFROMPSCINCOME\n this.taxDeductedFromPSCIncome = 0;\n this.isMonthlyBureau = false;\n }\n return ForecastCalculations;\n }());\n Shared.ForecastCalculations = ForecastCalculations;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var Notification = /** @class */ (function () {\n function Notification() {\n // ID\n this.id = 0;\n // COMPANYCONTACTNO\n this.companyContactNo = null;\n // TYPE\n this.type = null;\n // TITLE\n this.title = null;\n // METADESCRIPTION\n this.metaDescription = null;\n // LINK\n this.link = null;\n // SYMBOL\n this.symbol = null;\n // COLOUR\n this.colour = null;\n // SHOWGUIDE\n this.showGuide = false;\n // ACTION\n this.action = null;\n this.sortOrder = 0;\n this.onClick = null;\n this.documentCategoryMappingId = 0;\n }\n return Notification;\n }());\n Shared.Notification = Notification;\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var GetNotificationsResponse = /** @class */ (function () {\n function GetNotificationsResponse() {\n // SMARTTILENOTIFICATIONS\n this.smartTileNotifications = [];\n // ALERTNOTIFICATIONS\n this.alertNotifications = [];\n // ACTIONNOTIFACTIONS\n this.actionTileNotifications = [];\n // ACTIONNOTIFACTIONS\n this.bannersNotifications = [];\n }\n return GetNotificationsResponse;\n }());\n Shared.GetNotificationsResponse = GetNotificationsResponse;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var GLEntrySummary = /** @class */ (function () {\n function GLEntrySummary() {\n // ENTRYNO\n this.entryNo = 0;\n // GLACCOUNTNO\n this.glAccountNo = null;\n // BALACCOUNTNO\n this.balAccountNo = null;\n // DESCRIPTION\n this.description = null;\n // DESCRIPTION2\n this.description2 = null;\n // AMOUNT\n this.amount = 0;\n // POSTINGDATE\n this.postingDate = null;\n // DOCUMENTDATE\n this.documentDate = null;\n // PERIODSTART\n this.periodStart = null;\n // PERIODEND\n this.periodEnd = null;\n }\n return GLEntrySummary;\n }());\n Shared.GLEntrySummary = GLEntrySummary;\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var HolidayRequest = /** @class */ (function () {\n function HolidayRequest() {\n }\n return HolidayRequest;\n }());\n Shared.HolidayRequest = HolidayRequest;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var IntroVideo = /** @class */ (function () {\n function IntroVideo() {\n }\n return IntroVideo;\n }());\n Shared.IntroVideo = IntroVideo;\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var MemberCurrentStage = /** @class */ (function () {\n function MemberCurrentStage() {\n // MEMBERID\n this.memberId = 0;\n // STAGE\n this.stage = 0;\n // STEP3\n this.step3 = false;\n // STEP4\n this.step4 = false;\n // COMPLETIONDATE\n this.completionDate = null;\n // COUNTOFASSIGNMENTREQUIRINGACTIONS\n this.countOfAssignmentRequiringActions = 0;\n // ISIR35CONFIRMED\n this.isIr35Confirmed = false;\n // ISDRAFTSCONFIRMED\n this.isDraftsConfirmed = false;\n // SHOWCONFIRMATIONMESSAGE\n this.showConfirmationMessage = false;\n }\n return MemberCurrentStage;\n }());\n Shared.MemberCurrentStage = MemberCurrentStage;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var UserInputData = /** @class */ (function () {\n function UserInputData() {\n // PERSONALTAXTRACKERDATAID\n this.personalTaxTrackerDataId = 0;\n // YEAR\n this.year = null;\n // OTHEREMPLOYMENTINCOME\n this.otherEmploymentIncome = 0;\n // OTHEREMPLOYMENTINCOMEYTD\n this.otherEmploymentIncomeYTD = 0;\n // PENSIONINCOME\n this.pensionIncome = 0;\n // PENSIONINCOMEYTD\n this.pensionIncomeYTD = 0;\n // INTERESTINCOME\n this.interestIncome = 0;\n // INTERESTINCOMEYTD\n this.interestIncomeYTD = 0;\n // TAXABLEBENEFITSINKIND\n this.taxableBenefitsInKind = 0;\n // TAXABLEBENEFITSINKINDYTD\n this.taxableBenefitsInKindYTD = 0;\n // OTHERDIVIDENDINCOME\n this.otherDividendIncome = 0;\n // OTHERDIVIDENDINCOMEYTD\n this.otherDividendIncomeYTD = 0;\n // PERSONALPENSIONPAYMENTS\n this.personalPensionPayments = 0;\n // PERSONALPENSIONPAYMENTSYTD\n this.personalPensionPaymentsYTD = 0;\n // CHILDBENEFITAMOUNTRECEIVED\n this.childBenefitAmountReceived = 0;\n // CHILDBENEFITAMOUNTRECEIVEDYTD\n this.childBenefitAmountReceivedYTD = 0;\n // STUDENTLOANBALANCEATBEGINNINGOFTAXYEAR\n this.studentLoanBalanceAtBeginningOfTaxYear = 0;\n // STUDENTLOANBALANCEATBEGINNINGOFTAXYEARYTD\n this.studentLoanBalanceAtBeginningOfTaxYearYTD = 0;\n // TAXALREADYPAID\n this.taxAlreadyPaid = 0;\n // PAYMENTONACCOUNTPAIDJANUARY\n this.paymentOnAccountPaidJanuary = 0;\n // PAYMENTONACCOUNTPAIDJULY\n this.paymentOnAccountPaidJuly = 0;\n // DIVIDENDS\n this.dividends = 0;\n }\n return UserInputData;\n }());\n Shared.UserInputData = UserInputData;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var UmbrellaTaxData = /** @class */ (function () {\n function UmbrellaTaxData() {\n this.grossSalaryFromUmbrella = 0;\n this.taxDeductedUmbrellaEarnings = 0;\n this.grossSalaryFromUmbrellaYTD = 0;\n this.taxDeductedUmbrellaEarningsYTD = 0;\n }\n return UmbrellaTaxData;\n }());\n Shared.UmbrellaTaxData = UmbrellaTaxData;\n})(Shared || (Shared = {}));\n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var PersonalTaxTrackerData = /** @class */ (function () {\n function PersonalTaxTrackerData() {\n // FIXEDTAXDATA\n this.fixedTaxData = null;\n // FORECASTCALCULATIONS\n this.forecastCalculations = null;\n // USERINPUTDATA\n this.userInputData = null;\n // COMPANYNAME\n this.companyName = null;\n this.umbrellaTaxTracker = null;\n this.hasUmbrella = null;\n }\n return PersonalTaxTrackerData;\n }());\n Shared.PersonalTaxTrackerData = PersonalTaxTrackerData;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var ProfitAndLossSummary = /** @class */ (function () {\n function ProfitAndLossSummary() {\n }\n return ProfitAndLossSummary;\n }());\n Shared.ProfitAndLossSummary = ProfitAndLossSummary;\n})(Shared || (Shared = {}));\n/// \n/// \nvar Shared;\n(function (Shared) {\n var PscInformation = /** @class */ (function () {\n function PscInformation() {\n this.navPersonalInformation = null;\n this.jobTitle = null;\n this.jobTitleOption = null;\n this.industry = null;\n this.assignmentId = null;\n this.doSubmitPSC = null;\n }\n return PscInformation;\n }());\n Shared.PscInformation = PscInformation;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var RemusRewardParameters = /** @class */ (function () {\n function RemusRewardParameters() {\n }\n return RemusRewardParameters;\n }());\n Shared.RemusRewardParameters = RemusRewardParameters;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n var TaskAction = /** @class */ (function () {\n function TaskAction() {\n // ACTIONID\n this.actionId = null;\n // ACTION_WEB_TASK_NO\n this.action_Web_Task_no = null;\n // ACTIONTITLE\n this.actionTitle = null;\n // ACTIONDESCRIPTION\n this.actionDescription = null;\n // EXTENDEDACTIONDESCRIPTION\n this.extendedActionDescription = null;\n // RESPONSIBILITY\n this.responsibility = null;\n // DUEDATE\n this.dueDate = null;\n // DEADLINE\n this.deadline = null;\n // STATUS\n this.status = null;\n // ACTIONORDER\n this.actionOrder = 0;\n // ATTACHMENT\n this.attachment = null;\n // ISINWARNING\n this.isInWarning = false;\n // BUTTON1TEXT\n this.button1Text = null;\n // BUTTON2TEXT\n this.button2Text = null;\n // CATEGORYID\n this.categoryId = 0;\n this.categoryDesc = \"\";\n this.documents = [];\n this.closeable = false;\n this.closeMessage = \"\";\n this.taskCode = \"\";\n this.taskTitle = \"\";\n this.camelCase = \"\";\n }\n return TaskAction;\n }());\n Shared.TaskAction = TaskAction;\n var TaskStatus;\n (function (TaskStatus) {\n TaskStatus[TaskStatus[\"completed\"] = 0] = \"completed\";\n TaskStatus[TaskStatus[\"current\"] = 1] = \"current\";\n TaskStatus[TaskStatus[\"future\"] = 2] = \"future\";\n TaskStatus[TaskStatus[\"overdue\"] = 3] = \"overdue\";\n })(TaskStatus = Shared.TaskStatus || (Shared.TaskStatus = {}));\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var Task = /** @class */ (function () {\n function Task() {\n // TASKTITLE\n this.taskTitle = null;\n // COMPLETEDDATE\n this.completedDate = null;\n // TASKACTIONS\n this.taskActions = [];\n // TASKCODE\n this.taskCode = null;\n // BUSINESS\n this.business = false;\n }\n return Task;\n }());\n Shared.Task = Task;\n var TaskObject = /** @class */ (function () {\n function TaskObject() {\n this.title = null;\n this.type = null;\n this.startsAt = null;\n this.endsAt = null;\n this.action_Web_Task_no = null;\n this.status = null;\n this.actionId = null;\n this.actionTitle = null;\n this.timestamp = null;\n this.events = null;\n this.highlightMonth = false;\n }\n return TaskObject;\n }());\n Shared.TaskObject = TaskObject;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var UserFeedback = /** @class */ (function () {\n function UserFeedback() {\n // USERFEEDBACKID\n this.userFeedbackId = 0;\n // USERFEEDBACKCATEGORYID\n this.userFeedbackCategoryId = 0;\n // DESCRIPTION\n this.description = null;\n // SCREENSHOT\n this.screenshot = [];\n // SCREENSHOTBASE64\n this.screenshotBase64 = null;\n // DATE\n this.date = null;\n // BROWSER\n this.browser = null;\n // BROWSERVERSION\n this.browserVersion = null;\n // DEVICETYPE\n this.deviceType = null;\n // DEVICEMODEL\n this.deviceModel = null;\n // DEVICEVENDOR\n this.deviceVendor = null;\n // OS\n this.os = null;\n // OSVERSION\n this.osVersion = null;\n // ENGINENAME\n this.engineName = null;\n // ENGINE\n this.engineVersion = null;\n // CPUARCHITECTURE\n this.cpuArchitecture = null;\n // URL\n this.url = null;\n // STATE\n this.state = null;\n // STATEPARAMS\n this.stateParams = null;\n // EMAIL\n this.email = null;\n // NAME\n this.name = null;\n }\n return UserFeedback;\n }());\n Shared.UserFeedback = UserFeedback;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var UtrNumber = /** @class */ (function () {\n function UtrNumber() {\n this.utrReceived = null;\n this.utrNumber = null;\n }\n return UtrNumber;\n }());\n Shared.UtrNumber = UtrNumber;\n})(Shared || (Shared = {}));\n/// \n/// \nvar Shared;\n(function (Shared) {\n var WelcomeScreen = /** @class */ (function () {\n function WelcomeScreen() {\n }\n return WelcomeScreen;\n }());\n Shared.WelcomeScreen = WelcomeScreen;\n})(Shared || (Shared = {}));\n/// \n(function () {\n 'use strict';\n angular\n .module('app.shared')\n .factory('brooksonDocumentPreview', brooksonDocumentPreview);\n brooksonDocumentPreview.$inject = ['documentStorage.enums', 'documentStorageSrv', 'screenSize', 'brookson.ui.image-preview.modal', 'FileSaver', 'brookson.pdf.modal', '$detection', '$window'];\n function brooksonDocumentPreview(enums, documentStorageSrv, screenSize, brooksonUiImagePreviewModal, FileSaver, brooksonPdfModal, $detection, $window) {\n var service = {\n previewDoc: previewDoc\n };\n return service;\n ////////////////\n function previewDoc(document) {\n if (document.dataSource === enums.DocumentDataSource.DROPBOX) {\n documentStorageSrv.getFullSizedImage(document).then(function (data) {\n brooksonUiImagePreviewModal.showImagePreviewModal(data);\n });\n }\n else {\n documentStorageSrv.getSelectedPDF(document.documentId, document.path).then(function (data) {\n var blobObject = new Blob([data], { type: 'application/pdf' });\n // If it's iOS and particularly Safari, we can't get a new window with a blob... so do this...\n FileSaver.saveAs(blobObject, document.path);\n });\n }\n document.lastOpened = moment();\n }\n function callback(id, path) {\n return documentStorageSrv.getSelectedPDF(id, path).then(function (data) {\n return data;\n });\n }\n }\n})();\n/// \n(function () {\n 'use strict';\n angular\n .module('app.shared')\n .factory('brookson.file.download', fileDownloadSrv);\n fileDownloadSrv.$inject = ['$http', 'FileSaver', 'Blob', 'growl'];\n function fileDownloadSrv($http, FileSaver, Blob, growl) {\n var service = {\n download: download,\n downloadAndSave: downloadAndSave\n };\n return service;\n function download(url, requestData, fileName, expectedMediaType) {\n var responseType = 'arraybuffer';\n return $http.post(url, requestData, {\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': expectedMediaType\n },\n responseType: responseType\n }).then(function (response) {\n return response;\n });\n }\n function downloadAndSave(url, requestData, fileName, expectedMediaType) {\n download(url, requestData, fileName, expectedMediaType)\n .then(function (response) { return openSaveAsDialog(fileName, response.data, expectedMediaType); })\n .catch(function (e) { return growl.error('We were unable to retrieve your document'); });\n }\n function openSaveAsDialog(filename, content, mediaType) {\n var blob = new Blob([content], { type: mediaType });\n FileSaver.saveAs(blob, filename);\n }\n }\n})();\n/// \n(function () {\n \"use strict\";\n var app = angular.module(\"app.shared\");\n app.factory(\"brookson.http.gritter\", [\"growl\", \"$q\", brooksonHttpGritter])\n .config(['$httpProvider', httpInterceptorGritterConfig]);\n function brooksonHttpGritter(growl, $q) {\n var extractMessages = function (response) {\n if (response.headers) {\n var messages = response.headers(\"gritter-messages\");\n if (messages) {\n messages = JSON.parse(messages);\n var config = {\n ttl: 5000,\n disableCountDown: true\n };\n _.forEach(messages, function (message) {\n switch (message.Severity) {\n case \"success\":\n config.ttl = 15000;\n config.title = message.Title;\n growl.success(message.Text, config);\n break;\n case \"info\":\n config.title = message.Title;\n growl.info(message.Text, config);\n break;\n case \"warning\":\n config.ttl = 15000;\n config.title = message.Title;\n growl.warning(message.Text, config);\n break;\n case \"error\":\n config.ttl = 15000;\n config.title = message.Title;\n growl.error(message.Text, config);\n break;\n default:\n config.ttl = -1;\n config.title = message.Title;\n growl.error(message.Text, config);\n }\n });\n }\n }\n return response;\n };\n return {\n 'response': function (response) {\n return extractMessages(response);\n },\n 'responseError': function (response) {\n return $q.reject(extractMessages(response));\n }\n };\n }\n function httpInterceptorGritterConfig($httpProvider) {\n $httpProvider.interceptors.push(\"brookson.http.gritter\");\n }\n})();\n/// \n(function () {\n \"use strict\";\n var app = angular.module(\"app.shared\");\n app.factory(\"brookson.http.interceptor\", ['$q', '$injector', brooksonHttpInterceptor])\n .config(['$httpProvider', httpInterceptorConfig]);\n function brooksonHttpInterceptor($q, $injector) {\n var numRequests = 0;\n var showing = false;\n var previousResponseErrors = [];\n var hide = function (r) {\n if (r && (!r.config.silentMode || (r.config.headers.silentMode !== undefined && !r.config.headers.silentMode)) && !--numRequests) {\n NProgress.done(true);\n showing = false;\n }\n return r;\n };\n return {\n 'request': function (config) {\n if (!config.silentMode || (config.headers.silentMode !== undefined && !config.headers.silentMode)) {\n numRequests++;\n if (!showing) {\n showing = true;\n NProgress.start();\n }\n }\n return config;\n },\n 'response': function (response) {\n return hide(response);\n },\n 'responseError': function (response) {\n if (response && response.status !== 401 && response.data.error !== 'invalid_grant') {\n var previousResponseError = _.find(previousResponseErrors, function (previousError) {\n return previousError.config.url === response.config.url &&\n previousError.method === response.method &&\n previousError.status === response.status;\n });\n if (!previousResponseError) {\n var logger = $injector.get('brookson.logger');\n if (response.config.data != null && response.config.data.password != null) {\n angular.forEach(response.config.data.password, function (item, key) {\n // substitute all passwords enterd by the user before logging\n response.config.data.password[key] = \"********\";\n });\n }\n logger.error(\"HTTP Error: \" + response.config.url, response);\n previousResponseErrors.push(response);\n }\n }\n return $q.reject(hide(response));\n }\n };\n }\n function httpInterceptorConfig($httpProvider) {\n $httpProvider.interceptors.push(\"brookson.http.interceptor\");\n }\n})();\n/// \n/// \nvar Shared;\n(function (Shared) {\n var BrooksonModalFeedbackController = /** @class */ (function () {\n function BrooksonModalFeedbackController(factory, $detection) {\n this.factory = factory;\n this.$detection = $detection;\n this.factory.getUserFeedbackCategories();\n this.factory.resetScreenshot();\n this.factory.userFeedback.userFeedbackCategoryId = null;\n this.factory.userFeedback = new Shared.UserFeedback();\n this.factory.userFeedback.userFeedbackCategoryId = null;\n }\n // Public Methods //\n BrooksonModalFeedbackController.prototype.closeModal = function () {\n this.factory.closeModal();\n };\n BrooksonModalFeedbackController.prototype.submitButtonPressed = function (form) {\n if (form.$invalid) {\n return;\n }\n this.factory.getUserAgentInfo();\n this.factory.getState();\n this.factory.getUrl();\n this.factory.postUserFeedback();\n };\n BrooksonModalFeedbackController.prototype.takeScreenshotButtonPressed = function () {\n // If mobile, take screenshot only\n if (this.$detection.isAndroid() || this.$detection.isiOS() || this.$detection.isWindowsPhone() || this.$detection.isBB10()) {\n this.factory.takeScreenshot();\n }\n else {\n this.factory.hideModal();\n this.factory.isScreenshotMode = true;\n this.factory.createCanvas();\n }\n };\n return BrooksonModalFeedbackController;\n }());\n Shared.BrooksonModalFeedbackController = BrooksonModalFeedbackController;\n})(Shared || (Shared = {}));\n/// \n(function () {\n \"use strict\";\n var app = angular.module(\"app.shared\");\n app.factory(\"brookson.modal.glentries\", [\n \"$q\", \"$uibModal\", \"$sce\", \"screenSize\", function ($q, $uibModal, $sce, screenSize) {\n var options = {\n animation: true,\n size: \"lg\",\n templateUrl: screenSize.is('xs') ?\n \"src/app/shared/views/modals/brookson.modals.gl-entries.mobile.html\" :\n \"src/app/shared/views/modals/brookson.modals.gl-entries.html\"\n };\n var _show = function (payload, reportType, title) {\n var defer = $q.defer();\n var glEntriesOptions = options;\n glEntriesOptions.controller = ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) {\n $scope.cancel = cancel;\n $scope.payload = payload;\n $scope.reportType = reportType;\n $scope.title = title;\n $scope.total = 0;\n function cancel() {\n $uibModalInstance.dismiss('cancel');\n }\n function activate() {\n $scope.total = $scope.reportType === \"BS\"\n ? _.first(payload).balance\n : _.reduce(payload, function (sum, n) { return sum + n.amount; }, 0);\n }\n activate();\n }];\n $uibModal.open(glEntriesOptions);\n return defer.promise;\n };\n return {\n show: _show\n };\n }\n ]);\n})();\nvar Shared;\n(function (Shared) {\n var IR35DetailCaptureRequiresCompletion = /** @class */ (function () {\n function IR35DetailCaptureRequiresCompletion() {\n }\n return IR35DetailCaptureRequiresCompletion;\n }());\n Shared.IR35DetailCaptureRequiresCompletion = IR35DetailCaptureRequiresCompletion;\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n var IR35DetailCaptureService = /** @class */ (function () {\n function IR35DetailCaptureService($http) {\n var _this = this;\n this.$http = $http;\n // Returns whether the member is required to complete the IR35 Detail Capture form or not\n this.getIR35DetailCaptureOutcome = function (silentMode) {\n return _this.$http.get(\"api/IR35/ir35DetailCapture\", {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n _this.ir35DetailCaptureRequiresCompletion = response.data;\n return response.data;\n });\n };\n // Posts back to the server what the user chose\n this.postIR35DetailCapture = function (sector) {\n return _this.$http.post(\"api/IR35/ir35DetailCapture\", sector).then(function (response) {\n return response.data;\n });\n };\n }\n IR35DetailCaptureService.$inject = ['$http'];\n return IR35DetailCaptureService;\n }());\n Shared.IR35DetailCaptureService = IR35DetailCaptureService;\n})(Shared || (Shared = {}));\nangular.module('app.shared').service('ir35DetailCaptureService', Shared.IR35DetailCaptureService);\n/// \nvar Shared;\n(function (Shared) {\n /**\n * Brookson IR35 Detail Capture Modal Service\n */\n var BrooksonIR35DetailCaptureModalService = /** @class */ (function () {\n function BrooksonIR35DetailCaptureModalService($uibModal) {\n var _this = this;\n this.$uibModal = $uibModal;\n /**\n * The options for the bootstrap modal\n */\n this.options = {\n animation: true,\n size: \"md\",\n templateUrl: \"src/app/shared/views/modals/brookson.modals.ir35DetailCapture.html\",\n keyboard: false,\n controller: BrooksonIR35DetailCaptureModalController,\n controllerAs: \"$ctrl\",\n backdrop: 'static',\n windowClass: \"ir35-detail-capture\"\n };\n this.show = function () {\n return _this.$uibModal.open(_this.options);\n };\n }\n BrooksonIR35DetailCaptureModalService.$inject = ['$uibModal'];\n return BrooksonIR35DetailCaptureModalService;\n }());\n Shared.BrooksonIR35DetailCaptureModalService = BrooksonIR35DetailCaptureModalService;\n /**\n * The controller for the Brookson IR35 Detail Capture Modal\n */\n var BrooksonIR35DetailCaptureModalController = /** @class */ (function () {\n function BrooksonIR35DetailCaptureModalController($uibModalInstance, ir35DetailCaptureService, $window, memberService) {\n var _this = this;\n this.$uibModalInstance = $uibModalInstance;\n this.ir35DetailCaptureService = ir35DetailCaptureService;\n this.$window = $window;\n this.memberService = memberService;\n // From the backend: whether or not the popup modal can be cancelled or not\n this.canBeCancelled = false;\n // One of the three buttons has been pressed...\n this.buttonPressed = function (sector) {\n console.log('buttonPressed', sector);\n _this.ir35DetailCaptureService.postIR35DetailCapture(sector).then(function (data) {\n _this.close();\n });\n };\n // Close the modal\n this.close = function () {\n _this.$uibModalInstance.dismiss('cancel');\n };\n this.validApiSource = this.$window.appSettings.validApiSource;\n this.isInternal = this.$window.appSettings.isInternal;\n this.canBeCancelled = (this.memberService.member.isAdmin || this.isInternal || this.validApiSource);\n }\n BrooksonIR35DetailCaptureModalController.$inject = ['$uibModalInstance', 'ir35DetailCaptureService', '$window', 'memberSrv'];\n return BrooksonIR35DetailCaptureModalController;\n }());\n Shared.BrooksonIR35DetailCaptureModalController = BrooksonIR35DetailCaptureModalController;\n})(Shared || (Shared = {}));\nangular.module(\"app.shared\").service(\"brookson.modal.ir35DetailCapture\", Shared.BrooksonIR35DetailCaptureModalService);\nvar Shared;\n(function (Shared) {\n var PublicSectorAssignmentCheckService = /** @class */ (function () {\n function PublicSectorAssignmentCheckService($http) {\n var _this = this;\n this.$http = $http;\n // Returns whether the member is required to complete the Public Sector Assignment Check form or not\n this.getPublicSectorAssignmentCheckOutcome = function (silentMode) {\n return _this.$http.get(\"api/Assignment/GetAllOpenUnknownSectorAssignments\", {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n _this.publicSectorAssignmentCheckRequiresCompletion = response.data;\n if (response.data !== null) {\n response.data.forEach(function (assignment) {\n assignment.jobTitleOption = new Shared.JobTitle();\n assignment.jobTitleOption.titleText = assignment.jobTitle;\n });\n }\n return response.data;\n });\n };\n // Posts back to the server what the user chose\n this.postPublicSectorAssignmentCheck = function (assignments) {\n assignments.forEach(function (assignment) {\n assignment.jobTitle = assignment.jobTitleOption.titleText;\n });\n return _this.$http.post(\"api/Assignment/SaveAssignmentSectorData\", assignments).then(function (response) {\n return response.data;\n });\n };\n }\n PublicSectorAssignmentCheckService.$inject = ['$http'];\n return PublicSectorAssignmentCheckService;\n }());\n Shared.PublicSectorAssignmentCheckService = PublicSectorAssignmentCheckService;\n})(Shared || (Shared = {}));\nangular.module('app.shared').service('publicSectorAssignmentCheckService', Shared.PublicSectorAssignmentCheckService);\n/// \nvar Shared;\n(function (Shared) {\n var BrooksonPublicSectorAssignmentCheckModalService = /** @class */ (function () {\n function BrooksonPublicSectorAssignmentCheckModalService($uibModal) {\n var _this = this;\n this.$uibModal = $uibModal;\n this.options = {\n animation: true,\n size: \"md\",\n templateUrl: \"src/app/shared/views/modals/brookson.modals.publicSectorAssignmentCheck.html\",\n keyboard: false,\n controller: BrooksonPublicSectorAssignmentCheckModalController,\n controllerAs: \"$ctrl\",\n backdrop: 'static',\n windowClass: \"public-sector-assignment-check\"\n };\n this.show = function () {\n return _this.$uibModal.open(_this.options);\n };\n }\n BrooksonPublicSectorAssignmentCheckModalService.$inject = ['$uibModal'];\n return BrooksonPublicSectorAssignmentCheckModalService;\n }());\n Shared.BrooksonPublicSectorAssignmentCheckModalService = BrooksonPublicSectorAssignmentCheckModalService;\n var BrooksonPublicSectorAssignmentCheckModalController = /** @class */ (function () {\n function BrooksonPublicSectorAssignmentCheckModalController($uibModalInstance, publicSectorAssignmentCheckService, $window, memberService) {\n var _this = this;\n this.$uibModalInstance = $uibModalInstance;\n this.publicSectorAssignmentCheckService = publicSectorAssignmentCheckService;\n this.$window = $window;\n this.memberService = memberService;\n // From the backend: whether or not the popup modal can be cancelled or not\n this.canBeCancelled = false;\n this.submitAssignments = function () {\n _this.publicSectorAssignmentCheckService.postPublicSectorAssignmentCheck(_this.publicSectorAssignmentCheckService.publicSectorAssignmentCheckRequiresCompletion).then(function () {\n _this.close();\n });\n };\n // Close the modal\n this.close = function () {\n _this.$uibModalInstance.dismiss('cancel');\n };\n this.isInternal = this.$window.appSettings.isInternal;\n this.validApiSource = this.$window.appSettings.validApiSource;\n this.canBeCancelled = (this.memberService.member.isAdmin || this.isInternal || this.validApiSource);\n }\n BrooksonPublicSectorAssignmentCheckModalController.$inject = ['$uibModalInstance', 'publicSectorAssignmentCheckService', '$window', 'memberSrv'];\n return BrooksonPublicSectorAssignmentCheckModalController;\n }());\n Shared.BrooksonPublicSectorAssignmentCheckModalController = BrooksonPublicSectorAssignmentCheckModalController;\n})(Shared || (Shared = {}));\nangular.module(\"app.shared\").service(\"publicSectorAssignmentCheckModalService\", Shared.BrooksonPublicSectorAssignmentCheckModalService);\n/// \n(function () {\n \"use strict\";\n var app = angular.module(\"app.shared\");\n app.factory(\"brookson.modal.receipt-bank\", [\n \"$q\", \"$uibModal\", \"$sce\", 'expenses.enums', function ($q, $uibModal, $sce, enums) {\n var options = {\n animation: true,\n size: \"lg\",\n templateUrl: \"src/app/shared/views/modals/brookson.modals.receipt-bank.attach-receipt.html\"\n };\n var _attachReceipt = function (receipts, receiptId) {\n var defer = $q.defer();\n var attachReceiptModal = options;\n attachReceiptModal.controller = ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) {\n // Data\n $scope.enums = enums;\n $scope.selectedReceipt = receiptId;\n $scope.receipts = receipts;\n $scope.currentPage = 1;\n // Methods\n $scope.cancel = cancel;\n $scope.attachReceipt = attachReceipt;\n $scope.receiptSelected = receiptSelected;\n activate();\n function activate() {\n if ($scope.receipts && $scope.selectedReceipt) {\n _.forEach($scope.receipts, function (receipt) {\n if (receipt.receiptId === receiptId) {\n receipt.isSelected = true;\n }\n });\n }\n }\n function cancel() {\n $uibModalInstance.dismiss('cancel');\n }\n function attachReceipt() {\n //check to see if any receipts are selected\n var receipt = _.find($scope.receipts, function (receipt) { return receipt.isSelected === true; });\n if (receipt) {\n $scope.selectedReceipt = receipt.receiptId;\n $uibModalInstance.close();\n defer.resolve(receipt);\n }\n else {\n return;\n }\n }\n function receiptSelected(data) {\n if (data.isSelected) {\n $scope.selectedReceipt = data.receiptId;\n _.forEach($scope.receipts, function (receipt) {\n if (data.receiptId !== receipt.receiptId) {\n receipt.isSelected = false;\n }\n });\n }\n else {\n $scope.selectedReceipt = 0;\n }\n }\n }];\n $uibModal.open(attachReceiptModal);\n return defer.promise;\n };\n return {\n attachReceipt: _attachReceipt\n };\n }\n ]);\n})();\n/// \n(function () {\n \"use strict\";\n var app = angular.module(\"app.shared\");\n app.factory(\"brookson.modal.receipt-preview\", [\n \"$q\", \"$uibModal\", function ($q, $uibModal) {\n var options = {\n animation: true,\n size: \"md\",\n templateUrl: \"src/app/shared/views/modals/brookson.modals.receipt-preview.html\"\n };\n var _show = function (receiptId) {\n var defer = $q.defer();\n var receiptPreview = options;\n receiptPreview.controller = ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) {\n $scope.cancel = cancel;\n $scope.receiptId = receiptId;\n function cancel() {\n $uibModalInstance.dismiss('cancel');\n }\n }];\n $uibModal.open(receiptPreview);\n return defer.promise;\n };\n return {\n show: _show\n };\n }\n ]);\n})();\nvar Shared;\n(function (Shared) {\n /**\n * Brookson SDC Modal Service\n *\n * @export\n * @class BrooksonSdcModalService\n * @implements {IBrooksonSdcModalService}\n */\n var BrooksonSdcModalService = /** @class */ (function () {\n /**\n * Creates an instance of BrooksonSdcModalService.\n *\n * @param {ng.ui.bootstrap.IModalService} $uibModal\n *\n * @memberOf BrooksonSdcModalService\n */\n function BrooksonSdcModalService($uibModal) {\n var _this = this;\n this.$uibModal = $uibModal;\n /**\n * The options for the bootstrap modal\n *\n * @type {ng.ui.bootstrap.IModalSettings}\n * @memberOf BrooksonSdcModalService\n */\n this.options = {\n animation: true,\n size: \"md\",\n templateUrl: \"src/app/shared/views/modals/brookson.modals.sdc.html\",\n keyboard: false,\n controller: BrooksonSdcModalController,\n controllerAs: \"$ctrl\",\n backdrop: 'static',\n windowClass: 'modal-sdcOutcome'\n };\n /**\n * Displays the SDC Unassessed Assignments modal\n *\n *\n * @memberOf BrooksonSdcModalService\n */\n this.show = function () {\n return _this.$uibModal.open(_this.options);\n };\n }\n /**\n * Dependency Injection\n *\n * @static\n *\n * @memberOf BrooksonSdcModalService\n */\n BrooksonSdcModalService.$inject = ['$uibModal'];\n return BrooksonSdcModalService;\n }());\n Shared.BrooksonSdcModalService = BrooksonSdcModalService;\n /**\n * The controller for the Brookson SDC Modal\n *\n * @export\n * @class BrooksonSdcModalController\n */\n var BrooksonSdcModalController = /** @class */ (function () {\n /**\n * Creates an instance of BrooksonSdcModalController.\n *\n * @param {BrooksonSdcModalScope} $scope\n * @param {Shared.ISdcService} sdcService\n * @param {Shared.IAssignmentService} assignmentSrv\n *\n * @memberOf BrooksonSdcModalController\n */\n function BrooksonSdcModalController($scope, sdcService, assignmentSrv, navigation) {\n var _this = this;\n this.$scope = $scope;\n this.sdcService = sdcService;\n this.assignmentSrv = assignmentSrv;\n this.navigation = navigation;\n /**\n * A list of assignment id's that are making the CloseAssignment request\n *\n * @type {Array}\n * @memberOf BrooksonSdcModalController\n */\n this.assignmentEndedRequestInProgress = [];\n /**\n * A list of assignment id's that are making the DeclineExpensesForAssignment request\n *\n * @type {Array}\n * @memberOf BrooksonSdcModalController\n */\n this.noClaimOnAssignmentRequestInProgress = [];\n /**\n * Event fired when the \"Yes I wish to claim\" button is pressed\n *\n *\n * @memberOf BrooksonSdcModalController\n */\n this.claimOnAssignmentButtonPressed = function (assignment) {\n _this.claimOnAssignment(assignment);\n };\n /**\n * Event fired when the \"No I do not wish to claim\" button is pressed\n *\n *\n * @memberOf BrooksonSdcModalController\n */\n this.noClaimOnAssignmentButtonPressed = function (assignment) {\n _this.noClaimOnAssignment(assignment);\n };\n /**\n * Event fired when the \"This assignment has ended\" button is pressed\n *\n *\n * @memberOf BrooksonSdcModalController\n */\n this.closeAssignmentButtonPressed = function (assignment) {\n _this.closeAssignment(assignment);\n };\n /**\n * Returns whether the assignment ended button should be disabled for this assignment\n *\n *\n * @memberOf BrooksonSdcModalController\n */\n this.disableAssignmentEndedButton = function (assignment) {\n return _.some(_this.assignmentEndedRequestInProgress, function (assignmentId) {\n return assignmentId === assignment.assignmentId;\n });\n };\n /**\n * Returns whether the no claim assignment button should be disabled for this assignment\n *\n *\n * @memberOf BrooksonSdcModalController\n */\n this.disableAssignmentNoClainButton = function (assignment) {\n return _.some(_this.noClaimOnAssignmentRequestInProgress, function (assignmentId) {\n return assignmentId === assignment.assignmentId;\n });\n };\n /**\n * Returns a list of assignment outcomes from the API\n *\n * @private\n *\n * @memberOf BrooksonSdcModalController\n */\n this.getAssignmentOutcomes = function () {\n return _this.sdcService.getAssignmentOutcomes().then(_this.handleGetAssignmentOutcomesResponse);\n };\n /**\n * Sets the appropiate properties when the reponse has returned from the API GetAssignnmentOutcome response\n *\n * @private\n *\n * @memberOf BrooksonSdcModalController\n */\n this.handleGetAssignmentOutcomesResponse = function (data) {\n _this.assignmentOutcomes = data.filter(function (x) { return x.outcome === Shared.SdcOutcomeType.NotAssessed; });\n return _this.assignmentOutcomes;\n };\n /**\n * Closes the modal\n *\n * @private\n *\n * @memberOf BrooksonSdcModalController\n */\n this.closeModal = function () {\n _this.$scope.$close();\n };\n /**\n * Navigate to the edit assignment page so the user can complete an SDC questionnaire\n *\n * @private\n *\n * @memberOf BrooksonSdcModalController\n */\n this.claimOnAssignment = function (assignment) {\n _this.navigation.assignments.editAssignment(assignment.assignmentId);\n };\n /**\n * Submits an SDC questionnaire with the incurr expenses key\n *\n * @private\n *\n * @memberOf BrooksonSdcModalController\n */\n this.noClaimOnAssignment = function (assignment) {\n _this.noClaimOnAssignmentRequestInProgress.push(assignment.assignmentId);\n _this.sdcService.declineExpensesForAssignment(assignment.assignmentId).then(function (data) {\n _.remove(_this.noClaimOnAssignmentRequestInProgress, function (inProgress) {\n return inProgress === assignment.assignmentId;\n });\n if (data) {\n _this.removeAssignmentFromList(assignment);\n }\n });\n };\n /**\n * Closes the assignment and removes it from the list if the request was successful\n *\n * @private\n *\n * @memberOf BrooksonSdcModalController\n */\n this.closeAssignment = function (assignment) {\n _this.assignmentEndedRequestInProgress.push(assignment.assignmentId);\n _this.assignmentSrv.closeAssignment(assignment.assignmentId).then(function (data) {\n _.remove(_this.assignmentEndedRequestInProgress, function (inProgress) {\n return inProgress === assignment.assignmentId;\n });\n if (data) {\n _this.removeAssignmentFromList(assignment);\n }\n });\n };\n /**\n * Removes a given assignment from the list\n *\n * @private\n *\n * @memberOf BrooksonSdcModalController\n */\n this.removeAssignmentFromList = function (assignment) {\n _.remove(_this.assignmentOutcomes, assignment);\n if (_this.assignmentOutcomes.length === 0) {\n _this.closeModal();\n }\n };\n this.getAssignmentOutcomes();\n }\n /**\n * Angular DI\n *\n * @static\n *\n * @memberOf BrooksonSdcModalController\n */\n BrooksonSdcModalController.$inject = ['$scope', 'sdcService', 'AssignmentSrv', 'brookson.navigation'];\n return BrooksonSdcModalController;\n }());\n Shared.BrooksonSdcModalController = BrooksonSdcModalController;\n})(Shared || (Shared = {}));\nangular.module(\"app.shared\").service(\"brookson.modal.sdc\", Shared.BrooksonSdcModalService);\nvar Shared;\n(function (Shared) {\n 'use strict';\n var BrooksonModalSelect = /** @class */ (function () {\n function BrooksonModalSelect($uibModal) {\n var _this = this;\n this.$uibModal = $uibModal;\n this.showSelect = function (items, title) {\n var options = {\n animation: true,\n size: \"md\",\n templateUrl: \"src/app/shared/views/modals/brookson.modals.select.html\",\n controller: Shared.BrooksonModalSelectController,\n resolve: {\n selectItems: function () { return items; },\n title: function () { return title; }\n }\n };\n return _this.$uibModal.open(options).result;\n };\n }\n BrooksonModalSelect.$inject = ['$uibModal'];\n return BrooksonModalSelect;\n }());\n Shared.BrooksonModalSelect = BrooksonModalSelect;\n angular\n .module('app.shared')\n .service('brookson.modal.select.service', BrooksonModalSelect);\n})(Shared || (Shared = {}));\n(function (Shared) {\n 'use strict';\n var BrooksonModalSelectController = /** @class */ (function () {\n function BrooksonModalSelectController($scope, $uibModalInstance, selectItems, title) {\n var _this = this;\n this.$scope = $scope;\n this.$uibModalInstance = $uibModalInstance;\n this.selectItems = selectItems;\n this.title = title;\n this.cancel = function () {\n _this.$uibModalInstance.dismiss();\n };\n this.ok = function () {\n _this.$uibModalInstance.close(_.filter(_this.selectItems, function (item) { return item.selected; }));\n };\n $scope.cancel = this.cancel;\n $scope.ok = this.ok;\n $scope.selectItems = this.selectItems;\n $scope.title = this.title;\n }\n BrooksonModalSelectController.$inject = ['$scope', '$uibModalInstance', 'selectItems', 'title'];\n return BrooksonModalSelectController;\n }());\n Shared.BrooksonModalSelectController = BrooksonModalSelectController;\n angular\n .module('app.shared')\n .controller('brooksonModalSelectController', BrooksonModalSelectController);\n})(Shared || (Shared = {}));\n(function (Shared) {\n var ModalSelectItem = /** @class */ (function () {\n function ModalSelectItem(description, id, selected) {\n this.description = null;\n this.id = null;\n this.selected = false;\n this.description = description;\n this.id = id;\n this.selected = selected;\n }\n return ModalSelectItem;\n }());\n Shared.ModalSelectItem = ModalSelectItem;\n})(Shared || (Shared = {}));\n/// \n(function () {\n \"use strict\";\n var app = angular.module(\"app.shared\");\n app.factory(\"brookson.modal.vehicle-details\", [\n \"$q\", \"$uibModal\", \"$sce\", 'expenses.enums', function ($q, $uibModal, $sce, enums) {\n var options = {\n animation: true,\n size: \"lg\",\n templateUrl: \"src/app/shared/views/modals/brookson.modals.add-edit-vehicle.html\"\n };\n var _vehicleDetails = function (vehicles, registration) {\n var defer = $q.defer();\n var addVehicleModal = options;\n addVehicleModal.controller = ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) {\n // Data\n $scope.enums = enums;\n $scope.selectedVehicles = registration;\n $scope.vehicles = vehicles;\n // Methods\n $scope.cancel = cancel;\n $scope.selectVehicle = selectVehicle;\n $scope.vehicleSelected = vehicleSelected;\n activate();\n function activate() {\n if ($scope.vehicles && $scope.selectedVehicles) {\n _.forEach($scope.vehicles, function (vehicle) {\n if (vehicle.registration === registration) {\n vehicle.isSelected = true;\n }\n });\n }\n }\n function cancel() {\n $uibModalInstance.dismiss('cancel');\n }\n function selectVehicle() {\n var vehicle = _.find($scope.vehicles, function (vehicle) { return vehicle.isSelected === true; });\n if (vehicle) {\n $scope.vehicleSelected = vehicle.registration;\n $uibModalInstance.close();\n defer.resolve(vehicle);\n }\n else {\n return;\n }\n }\n function vehicleSelected(data) {\n if (data.isSelected) {\n $scope.selectedVehicle = data.registration;\n _.forEach($scope.vehicles, function (vehicle) {\n if (data.receiptId !== vehicle.registration) {\n vehicle.isSelected = false;\n }\n });\n }\n else {\n $scope.selectedVehicle = 0;\n }\n }\n }];\n $uibModal.open(addVehicleModal);\n return defer.promise;\n };\n return {\n selectVehicle: _vehicleDetails\n };\n }\n ]);\n})();\n/// \n(function () {\n 'use strict';\n angular\n .module('app.shared')\n .service('notificationSrv', notificationSrv);\n notificationSrv.$inject = ['$http', 'shared.config'];\n function notificationSrv($http, sharedConfig) {\n var service = {};\n var serviceBase = sharedConfig.baseApiUrl;\n // Methods\n service.getNotifications = getNotifications;\n service.closeNotification = closeNotification;\n function getNotifications(silentMode) {\n return $http.get('api/Notifications/GetNotifications', {\n silentMode: silentMode ? silentMode : false,\n cache: true\n }).then(function (response) {\n return response.data;\n });\n }\n function closeNotification(notification) {\n return $http.delete(serviceBase + \"api/Notifications/DeleteNotification/\" + notification.id)\n .then(function (response) {\n return response.data;\n });\n }\n return service;\n }\n})();\n/// \n/// \n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var TaskPlannerSrv = /** @class */ (function () {\n function TaskPlannerSrv($http, $q, logger, growl, $stateParams, documentStorageSrv, brooksonPdfModal, enums, screenSize, $cacheFactory, $rootScope) {\n var _this = this;\n this.$http = $http;\n this.$q = $q;\n this.logger = logger;\n this.growl = growl;\n this.$stateParams = $stateParams;\n this.documentStorageSrv = documentStorageSrv;\n this.brooksonPdfModal = brooksonPdfModal;\n this.enums = enums;\n this.screenSize = screenSize;\n this.$cacheFactory = $cacheFactory;\n this.$rootScope = $rootScope;\n this.sectionTitle = '';\n this.selectedTask = {};\n this.selectedAction = new Shared.TaskAction();\n //private methods\n this.buildMonthsArray = function () {\n var months = [];\n var i;\n for (i = -2; i < 10; i++) {\n var selectedMonth = moment(_this.viewDate).add(i, 'month').startOf('month');\n var currentMonth = moment().startOf('month');\n //var month = {\n // timestamp: selectedMonth,\n // events: [],\n // highlightMonth: (moment(selectedMonth).isSame(currentMonth) ? true : false)\n //};\n var month = new Shared.TaskObject();\n month.timestamp = selectedMonth;\n month.events = [];\n month.highlightMonth = (moment(selectedMonth).isSame(currentMonth) ? true : false);\n months.push(month);\n }\n return months;\n };\n this.flattenActions = function (data) {\n var result = [];\n result = _.chain(data).map(function (task) {\n return _.map(task.taskActions, function (taskAction) {\n taskAction.taskGroup = task.taskTitle;\n return taskAction;\n });\n }).flatten().value();\n return result;\n };\n //public methods\n this.updateUTR = function (utrNumber, branchId) {\n var url = 'api/Planner/UpdateUTRNumbers';\n return _this.$http.post(url, {\n UtrNumber: utrNumber, BranchId: branchId\n }).then(function (response) {\n _this.buildMonths(false, false).then(function (data) {\n var config = { title: \"Task Planner\" };\n _this.growl.success(\"UTR has been updated.\", config);\n _this.closeTask(_this.selectedAction).then(function () {\n var cache = _this.$cacheFactory.get('$http');\n cache.remove('api/Planner/GetTasks');\n _this.getAndParseTasks().then(function () {\n _this.updateCurrentTaskAndAction();\n });\n });\n });\n return response.data;\n }).catch(function () {\n var config = { title: \"Task Planner\" };\n _this.growl.error(\"UTR failed to update.\", config);\n });\n };\n this.updateAuthCode = function (authCode) {\n var url = 'api/Planner/UpdateAuthCode';\n return _this.$http.post(url, {\n AuthCode: authCode\n }).then(function (response) {\n _this.buildMonths(false, false).then(function (data) {\n var config = { title: \"Task Planner\" };\n _this.growl.success(\"Auth Code has been updated.\", config);\n _this.closeTask(_this.selectedAction).then(function () {\n var cache = _this.$cacheFactory.get('$http');\n cache.remove('api/Planner/GetTasks');\n _this.getAndParseTasks().then(function () {\n _this.updateCurrentTaskAndAction();\n });\n });\n });\n return response.data;\n }).catch(function () {\n var config = { title: \"Task Planner\" };\n _this.growl.error(\"Auth Code failed to update.\", config);\n });\n };\n this.updateCurrentTaskAndAction = function () {\n if (_this.tasks.length) {\n var task = _.find(_this.tasks, function (n) { return (n.id.toLowerCase() === _this.$stateParams['taskID'].toLowerCase()); });\n if (!task || task.taskActions.length === 0) {\n _this.taskActions = [];\n }\n else {\n _this.taskActions = task.taskActions;\n _this.selectedTask = task;\n _this.taskTitle = task.taskTitle;\n if (_this.selectedAction.action_Web_Task_no) {\n var action = _.find(_this.taskActions, function (m) { return (m.action_Web_Task_no === _this.selectedAction.action_Web_Task_no); });\n if (action) {\n _this.selectedAction.status = action.status;\n _this.selectedAction = action;\n }\n }\n }\n }\n };\n this.buildMonths = function (silentMode, cacheMode) {\n if (silentMode === void 0) { silentMode = true; }\n if (cacheMode === void 0) { cacheMode = true; }\n // Get the tasks, once complete, filter them into the monthly buckets\n return _this.getTasks(silentMode, cacheMode).then(function (data) {\n _this.flatActions = _this.flattenActions(data);\n return _this.getTasksComplete(data);\n });\n };\n this.getAndParseTasks = function (silentMode) {\n return _this.getTasks(silentMode).then(function (data) {\n return _this.parseTasks(data);\n });\n };\n this.parseTasks = function (data) {\n // Do any special parsing of the tasks here\n var deferred = _this.$q.defer();\n _this.sectionTitles.business.overdue = 0;\n _this.sectionTitles.personal.overdue = 0;\n // Add on an ID for menus and an overdue counter\n for (var i = 0; i < data.length; i++) {\n data[i].id = _.camelCase(data[i].taskTitle);\n data[i].overdue = 0;\n data[i].taskActions = _.orderBy(data[i].taskActions, ['actionOrder'], ['asc']);\n var taskActions = data[i].taskActions;\n for (var j = 0; j < taskActions.length; j++) {\n // Status: 0 = Completed, 1 = Current, 2 = Future, 3 = Overdue\n // Overdue calcs\n if (taskActions[j].status === 3) {\n // BUSINESS\n if (data[i].business) {\n _this.sectionTitles.business.overdue++;\n }\n else {\n // PERSONAL\n _this.sectionTitles.personal.overdue++;\n }\n data[i].overdue++;\n }\n // /Overdue calcs\n }\n }\n _this.tasks = data;\n deferred.resolve(data);\n return deferred.promise;\n };\n this.getTasksComplete = function (data) {\n var months = [];\n var deferred = _this.$q.defer();\n months = _this.buildMonthsArray();\n // Loop over each month and find any data within data\n for (var month = 0; month < months.length; month++) {\n var currentMonth = moment(months[month].timestamp);\n var i;\n for (i = 0; i < data.length; i++) {\n var j;\n for (j = 0; j < data[i].taskActions.length; j++) {\n var taskDate = data[i].taskActions[j].dueDate;\n if (moment(taskDate).startOf('month').isSame(currentMonth)) {\n var date = moment(taskDate);\n //var task = {\n // title: data[i].taskTitle,\n // type: 'info',\n // startsAt: date,\n // endsAt: date,\n // action_Web_Task_no: data[i].taskActions[j].action_Web_Task_no,\n // // Status: 0 = Completed, 1 = Current, 2 = Future, 3 = Overdue\n // status: data[i].taskActions[j].status,\n // actionId: data[i].taskActions[j].actionId,\n // actionTitle: data[i].taskActions[j].actionTitle\n //};\n var task = new Shared.TaskObject();\n task.title = data[i].taskTitle;\n task.type = 'info';\n task.startsAt = date;\n task.endsAt = date;\n task.action_Web_Task_no = data[i].taskActions[j].action_Web_Task_no;\n task.status = data[i].taskActions[j].status;\n task.actionId = data[i].taskActions[j].actionId;\n task.actionTitle = data[i].taskActions[j].actionTitle;\n months[month].events.push(task);\n }\n }\n }\n }\n _this.annualMonths = months;\n deferred.resolve(_this.annualMonths);\n return deferred.promise;\n };\n this.getTasks = function (silentMode, cacheMode) {\n if (cacheMode === void 0) { cacheMode = true; }\n var url = 'api/Planner/GetTasks';\n if (_this.overrideCacheMode)\n cacheMode = false;\n return _this.$http.get(url, {\n silentMode: silentMode ? silentMode : false,\n cache: cacheMode\n }).then(function (response) {\n if (response.data === \"nill\") {\n response.data = [];\n }\n return response.data;\n });\n };\n this.getActionsByDay = function (day) {\n var result = [];\n result = _.filter(_this.flatActions, function (n) {\n return moment(n.dueDate).isSame(day, 'day');\n });\n return result;\n };\n this.getActionById = function (id) {\n var result = [];\n result = _.filter(_this.flatActions, function (n) {\n return n.actionId === id;\n });\n return result;\n };\n this.addMonth = function () {\n _this.viewDate = moment(_this.viewDate).add(1, 'months');\n _this.buildMonths(false);\n };\n this.subtractMonth = function () {\n _this.viewDate = moment(_this.viewDate).subtract(1, 'months');\n _this.buildMonths(false);\n };\n this.getTaskActions = function (silentMode) {\n if (silentMode === void 0) { silentMode = false; }\n return _this.getTasks(silentMode).then(function (data) {\n var result = [];\n _.forEach(data, function (task) {\n result = _.concat(result, task.taskActions);\n });\n return result;\n });\n };\n this.getTasksToBeDisplayed = function (silentMode, cacheMode) {\n if (silentMode === void 0) { silentMode = false; }\n if (cacheMode === void 0) { cacheMode = true; }\n return _this.$http.get('api/Planner/GetTasksToBeDisplayed', {\n silentMode: silentMode,\n cache: cacheMode\n }).then(function (response) {\n return response.data;\n });\n };\n this.getFolderByID = function (folderID, silentMode) {\n if (silentMode === void 0) { silentMode = false; }\n var url = 'api/DocumentStorage/GetFolderById/' + folderID;\n return _this.$http.get(url, {\n silentMode: silentMode,\n cache: true\n }).then(function (data) {\n return data.data.documents;\n });\n };\n this.get3MonthsRelatedDocs = function (folderID) {\n return _this.getFolderByID(folderID)\n .then(_this.getFolderByIDComplete)\n .catch(function (error) {\n // logger, error\n });\n };\n this.getFolderByIDComplete = function (data) {\n var docData = data;\n var docs = [];\n // #5102 FUTURE VAT2 was bringing back previous VAT return doc if created too early.\n if (!(_this.selectedAction.status === Shared.TaskStatus.future && _this.selectedAction.action_Web_Task_no === 'VAT2')) {\n var threeMonthsAgo = moment().subtract(3, 'months');\n docs = _.filter(docData, function (o) {\n return moment(o.date).isAfter(threeMonthsAgo);\n });\n }\n _this.selectedAction.documents = docs;\n return _this.selectedAction.documents;\n };\n this.getYearEndStage = function (silentMode) {\n var url = 'api/Planner/GetYearEndStage';\n return _this.$http.get(url, {\n cache: 'true',\n params: {\n silentMode: silentMode ? silentMode : false\n }\n })\n .then(function (response) {\n return response.data;\n });\n };\n this.getYearEndMemberConfirmationStatus = function (silentMode) {\n if (silentMode === void 0) { silentMode = false; }\n var url = 'api/Planner/GetYearEndMemberConfirmationStatus';\n return _this.$http.get(url, {\n cache: 'true',\n silentMode: silentMode\n }).then(function (response) {\n return response.data;\n });\n };\n this.exportCalendar = function (silentMode) {\n var url = 'api/Planner/ExportTasks';\n return _this.$http.get(url, {\n cache: true,\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n };\n this.generateCalendarKey = function (silentMode) {\n var url = 'api/Planner/GenerateCalendarKey';\n return _this.$http.get(url, {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n };\n this.getTaskCalendarSync = function (silentMode) {\n var url = 'api/Planner/GetTaskCalendarSync';\n return _this.$http.get(url, {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n };\n this.showTaskCompletionInput = function (webTaskNo, actionDetails) {\n if (actionDetails) {\n _this.selectedAction = actionDetails;\n }\n if (_this.selectedAction.action_Web_Task_no === webTaskNo && (_this.selectedAction.status > 0 && _this.selectedAction.status < 4)) {\n return true;\n }\n return false;\n };\n this.confirmAccountsStep = function (step) {\n var url = 'api/Planner/UpdateConfirmAccountsStep';\n return _this.$http.post(url, {\n step: step\n }).then(function (response) {\n _this.buildMonths(false, false).then(function (data) {\n var config = { title: \"Task Planner\" };\n _this.growl.success(\"Step \".concat(step, \" has been updated\"), config);\n //return response.data;\n });\n return response.data;\n })\n .catch(function () {\n var config = { title: \"Task Planner\" };\n _this.growl.error(\"Account confirmation failed to update.\", config);\n var defer = _this.$q.defer();\n defer.resolve(false);\n return defer.promise;\n });\n };\n this.getYearEndStatus = function () {\n var url = 'api/Planner/GetYearEndStatus';\n return _this.$http.get(url, {\n cache: true\n }).then(function (response) {\n return response.data;\n });\n };\n this.updatePackStatus = function () {\n var url = 'api/SelfAssessment/UpdatePackStatus';\n return _this.$http.post(url, {\n status: 2\n }).then(function (response) {\n _this.closeTask(_this.selectedAction).then(function () {\n var cache = _this.$cacheFactory.get('$http');\n cache.remove('api/Planner/GetTasks');\n _this.getAndParseTasks().then(function () {\n _this.updateCurrentTaskAndAction();\n });\n });\n return response.data;\n });\n };\n this.getTaxPackStatus = function () {\n var url = 'api/SelfAssessment/GetTaxPackStatus';\n return _this.$http.get(url, {\n cache: false\n }).then(function (response) {\n return response.data;\n });\n };\n this.getUtrNumber = function () {\n var url = 'api/SelfAssessment/GetUtrNumber';\n return _this.$http.get(url, {\n cache: false\n }).then(function (response) {\n return response.data;\n });\n };\n this.previewDocument = function (document) {\n _this.brooksonPdfModal.view(document.documentId, document.path, _this.previewCallback);\n };\n this.previewCallback = function (id, path) {\n return _this.documentStorageSrv.getSelectedPDF(id, path).then(function (data) { return data; });\n };\n /**\n * Returns whether the user is viewing on a small device\n */\n this.isMobile = function () { return _this.screenSize.is('xs', 'sm'); };\n /**\n * Closes a task by adding an entry into the database based on the task action number.\n *\n *\n * @memberOf TaskPlannerSrv\n */\n this.closeTask = function (taskAction, silentMode) {\n var actionWebTaskNo = taskAction.action_Web_Task_no;\n var actionNumber = taskAction.actionId;\n var actionNumbers = actionWebTaskNo + '|' + actionNumber;\n return _this.$http.put('api/Planner/CloseTask/' + actionNumbers, {}, {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n };\n this.getIsPayBeforeSubmit = function (silentMode) {\n var url = 'api/SelfAssessment/GetIsPayBeforeSubmit';\n return _this.$http.get(url, { silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n };\n this.sectionTitles = {\n business: {\n name: 'Business Tasks',\n overdue: 0\n },\n personal: {\n name: 'Personal',\n overdue: 0\n },\n personalTax: {\n name: 'Personal Tax'\n },\n saPersonalTax: {\n name: 'SA Personal Tax'\n },\n paye: {\n name: 'PAYE'\n },\n payroll: {\n name: 'Payroll'\n },\n utr: {\n name: 'UTR'\n },\n vat: {\n name: 'VAT'\n },\n yearEnd: {\n name: 'Year End'\n }\n };\n }\n TaskPlannerSrv.$inject = ['$http', '$q', 'brookson.logger', 'growl', '$stateParams', 'documentStorageSrv', 'brookson.pdf.modal', 'taskPlanner.enums', 'screenSize', '$cacheFactory', '$rootScope'];\n return TaskPlannerSrv;\n }());\n Shared.TaskPlannerSrv = TaskPlannerSrv;\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .service('taskPlannerSrv', Shared.TaskPlannerSrv);\n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n /**\n * Model for local storage to identify whether notifications have been shown\n *\n * @export\n * @class NotificationsShown\n */\n var NotificationsShown = /** @class */ (function () {\n function NotificationsShown() {\n }\n return NotificationsShown;\n }());\n Shared.NotificationsShown = NotificationsShown;\n /**\n * A model of all the notifications / smart tiles when getNotifications is called\n *\n * @export\n * @class Notifications\n */\n var Notifications = /** @class */ (function () {\n /**\n * Creates an instance of Notifications.\n *\n * @param {Array} notifications\n * @param {Array} tiles\n * @param {Array} planner\n * @param {Array} banners\n *\n * @memberOf Notifications\n */\n function Notifications(notifications, tiles, planner, banners) {\n this.notifications = notifications;\n this.tiles = tiles;\n this.planner = planner;\n this.banners = banners;\n }\n return Notifications;\n }());\n Shared.Notifications = Notifications;\n /**\n * A notification manager to help maintain the notifications and smart tiles\n *\n * @export\n * @class BrooksonNotificationManager\n * @implements {IBrooksonNotificationManager}\n */\n var BrooksonNotificationManager = /** @class */ (function () {\n /**\n * Creates an instance of BrooksonNotificationManager.\n *\n * @param {ng.IQService} $q\n * @param {ng.IWindowService} $window\n * @param {INotificationService} notificationSrv\n * @param {ITaskPlannerSrv} taskPlannerSrv\n * @param {*} moneyManagerSrv\n * @param {IBrooksonUtilitiesDate} brooksonUtilitiesDate\n * @param {ng.growl.IGrowlService} growl\n * @param {ITaskPlannerEnums} taskPlannerEnums\n * @param {IBankLinkEnums} bankLinkEnums\n * @param {ng.local.storage.ILocalStorageService} localStorageService\n * @param {IBrooksonNavigation} brooksonNavigation\n * @param {*} screenSize\n *\n * @memberOf BrooksonNotificationManager\n */\n function BrooksonNotificationManager($q, $window, notificationSrv, taskPlannerSrv, moneyManagerSrv, brooksonUtilitiesDate, growl, taskPlannerEnums, bankLinkEnums, localStorageService, brooksonNavigation, screenSize, calendlyService, dateUtils) {\n var _this = this;\n this.$q = $q;\n this.$window = $window;\n this.notificationSrv = notificationSrv;\n this.taskPlannerSrv = taskPlannerSrv;\n this.moneyManagerSrv = moneyManagerSrv;\n this.brooksonUtilitiesDate = brooksonUtilitiesDate;\n this.growl = growl;\n this.taskPlannerEnums = taskPlannerEnums;\n this.bankLinkEnums = bankLinkEnums;\n this.localStorageService = localStorageService;\n this.brooksonNavigation = brooksonNavigation;\n this.screenSize = screenSize;\n this.calendlyService = calendlyService;\n this.dateUtils = dateUtils;\n /**\n * Property that stores whether a type of notification has been shown\n *\n * @private\n * @type {NotificationsShown}\n * @memberOf BrooksonNotificationManager\n */\n this.notificationsShown = {\n taskPlannerNotifications: false,\n unallocatedTransactions: false\n };\n /**\n * Gets a model of all the notifications\n *\n * @returns {ng.IPromise}\n *\n * @memberOf BrooksonNotificationManager\n */\n this.getNotifications = function () {\n return _this.$q.all([_this.getTaskPlannerNotifications(), _this.getSmartNotifications(), _this.getUnallocatedTransactions()]).then(function (data) {\n var planner = data[0];\n var smartNotifications = data[1];\n var unallocatedTransactionNotification = data[2];\n planner.forEach(function (task) {\n task.camelCase = _.camelCase(task.taskTitle);\n return task;\n });\n var notifications = [];\n notifications = _.concat(notifications, smartNotifications.alertNotifications);\n if (unallocatedTransactionNotification)\n notifications.push(unallocatedTransactionNotification);\n _this.calendlyService.getCalendlyFinancialHealthCheckBooking().then(function (financialHealthCheckCalendlyBooking) {\n if (financialHealthCheckCalendlyBooking) {\n var endDate = _this.dateUtils.convertToJsDate(financialHealthCheckCalendlyBooking.endDate);\n var minimumPreviousDate = new Date();\n minimumPreviousDate.setDate(minimumPreviousDate.getDate() - 30);\n if (!(endDate <= minimumPreviousDate)) {\n smartNotifications.actionTileNotifications = smartNotifications.actionTileNotifications.filter(function (f) { return f.action !== \"FinancialHealthCheck\"; });\n }\n }\n var tiles = [];\n tiles = _.concat(tiles, smartNotifications.actionTileNotifications);\n tiles = _.concat(tiles, smartNotifications.smartTileNotifications);\n var result = new Notifications(notifications, tiles, planner, smartNotifications.bannersNotifications);\n _this.notifications = result;\n });\n return _this.notifications;\n });\n };\n /**\n * Returns any task planner notifications\n *\n * @returns {ng.IPromise>}\n *\n * @memberOf BrooksonNotificationManager\n */\n this.getTaskPlannerNotifications = function () {\n return _this.taskPlannerSrv.getTasksToBeDisplayed(true).then(function (data) {\n if (!_this.getNotificationKey(BrooksonNotificationManager.TASK_PLANNER_NOTIFICATION_KEY)) {\n var taskActions = data;\n _.filter(taskActions, function (taskAction) {\n return taskAction.responsibility === _this.taskPlannerEnums.TaskResponsibility.ME;\n });\n var overDueTaskActions = _.filter(taskActions, function (taskAction) { return taskAction.status === _this.taskPlannerEnums.TaskStatus.OVERDUE; });\n var upcomingTaskActions = _.filter(taskActions, function (taskAction) { return taskAction.status !== _this.taskPlannerEnums.TaskStatus.OVERDUE; });\n /**\n * If there is more than 1 upcoming task action to be completed, only display\n * one notification so we don't clutter the dashboard\n * */\n if (upcomingTaskActions.length === 1) {\n _.forEach(upcomingTaskActions, function (taskAction) {\n if (!_this.screenSize.is('xs, sm')) {\n _this.growl.warning(taskAction.actionTitle + \" is upcoming \" + moment(taskAction.dueDate).format(\"DD/MM/YYYY\") + \"\", {\n title: \"Task Planner\",\n ttl: 5000,\n disableCountDown: true,\n variables: {\n onClick: function () {\n _this.goToTask(taskAction);\n }\n }\n });\n }\n });\n }\n else if (upcomingTaskActions.length > 1) {\n _this.growl.warning(\"You have tasks that are upcoming.\", {\n title: \"Task Planner\",\n ttl: 5000,\n disableCountDown: true,\n variables: {\n onClick: function () {\n _this.goToTaskPlanner();\n }\n }\n });\n }\n /**\n * If there is more than 1 overdue task action to be completed, only display\n * one notification so we don't clutter the dashboard\n * */\n if (overDueTaskActions.length === 1) {\n _.forEach(overDueTaskActions, function (taskAction) {\n if (!_this.screenSize.is('xs, sm')) {\n _this.growl.error(taskAction.actionTitle + \" is overdue \" + moment(taskAction.dueDate).format(\"DD/MM/YYYY\") + \"\", {\n title: \"Task Planner\",\n ttl: -1,\n disableCountDown: true,\n variables: {\n onClick: function () {\n _this.goToTask(taskAction);\n }\n }\n });\n }\n });\n }\n else if (overDueTaskActions.length > 1) {\n _this.growl.error(\"You have tasks that are overdue.\", {\n title: \"Task Planner\",\n ttl: -1,\n disableCountDown: true,\n variables: {\n onClick: function () {\n _this.goToTaskPlanner();\n }\n }\n });\n }\n _this.setNotificationKey(BrooksonNotificationManager.TASK_PLANNER_NOTIFICATION_KEY);\n }\n return data;\n });\n };\n /**\n * Go to a Task in Task Planner\n *\n * @param {TaskAction} task\n *\n * @memberOf IBrooksonNotificationManager\n */\n this.goToTask = function (task) {\n _this.brooksonNavigation.taskPlanner.selectedActionTask('todo', task.actionId);\n };\n /**\n *\n *\n *\n * @memberOf BrooksonNotificationManager\n */\n this.getUnallocatedTransactions = function () {\n if (_this.getNotificationKey(BrooksonNotificationManager.UNALLOCATED_TRANSACTIONS_CLEAR_KEY)) {\n var deferred = _this.$q.defer();\n deferred.resolve();\n return deferred.promise;\n }\n return _this.moneyManagerSrv.getTransactions('', true).then(function (data) {\n var result = null;\n if (data == null) {\n return result;\n }\n var transactions = data.transactions;\n var transactionsToAllocate = _.filter(transactions, {\n transactionType: _this.bankLinkEnums.TransactionType.UNALLOCATED\n }).length;\n if (transactionsToAllocate > 0) {\n if (!_this.getNotificationKey(BrooksonNotificationManager.UNALLOCATED_TRANSACTIONS_KEY)) {\n _this.growl.warning(\"You have \".concat(transactionsToAllocate, \" unallocated transaction\").concat(transactionsToAllocate === 1 ? '' : 's'), {\n title: \"Bank\",\n ttl: 5000,\n disableCountDown: true,\n variables: {\n /**\n *\n */\n onClick: function () {\n _this.brooksonNavigation.bankLink.main();\n }\n }\n });\n }\n result = {\n title: 'Bank',\n metaDescription: \"\".concat(transactionsToAllocate, \" unallocated transaction\").concat(transactionsToAllocate === 1 ? '' : 's'),\n colour: 'yellow',\n symbol: 'money'\n };\n result.onClick = function () { return _this.brooksonNavigation.expenses.business(); };\n }\n _this.notificationsShown.unallocatedTransactions = true;\n _this.setNotificationKey(BrooksonNotificationManager.UNALLOCATED_TRANSACTIONS_KEY);\n return result;\n });\n };\n /**\n * Dismisses a smart tile\n *\n * @param {Notification} smartTile\n *\n * @memberOf IBrooksonNotificationManager\n */\n this.closeSmartTile = function (smartTile) {\n _.pull(_this.notifications.tiles, smartTile);\n _this.notificationSrv.closeNotification(smartTile);\n };\n /**\n * Closes all of the alerts\n *\n *\n * @memberOf IBrooksonNotificationManager\n */\n this.closeAlerts = function () {\n _.forEach(_this.notifications.notifications, function (alert) {\n if (alert.id)\n _this.notificationSrv.closeNotification(alert);\n });\n _this.notifications.notifications.length = 0;\n _this.setNotificationKey(BrooksonNotificationManager.UNALLOCATED_TRANSACTIONS_CLEAR_KEY);\n };\n /**\n * Reset the local storage value to state that the user has not viewed the notifications\n *\n *\n * @memberOf IBrooksonNotificationManager\n */\n this.clearNotificationsShown = function () {\n _this.localStorageService.set(BrooksonNotificationManager.LOCAL_STORAGE_KEY, {});\n };\n /**\n * Returns a list of all the smart notifications to be displayed\n *\n * @private\n * @returns {ng.IPromise}\n *\n * @memberOf BrooksonNotificationManager\n */\n this.getSmartNotifications = function () {\n return _this.notificationSrv.getNotifications(true).then(function (data) { return data; });\n };\n /**\n * Returns a value from notificaiton local storage container and returns the property\n *\n * @private\n * @param {string} notification\n * @returns\n *\n * @memberOf BrooksonNotificationManager\n */\n this.getNotificationKey = function (notification) {\n var data = _this.localStorageService.get(BrooksonNotificationManager.LOCAL_STORAGE_KEY);\n _this.notificationsShown = data === null ? {} : data;\n return _this.notificationsShown[notification];\n };\n /**\n * Sets that a certain type of notification has been displayed to the user by setting it in local storage\n *\n * @private\n *\n * @memberOf BrooksonNotificationManager\n */\n this.setNotificationKey = function (notification) {\n _this.notificationsShown[notification] = true;\n _this.localStorageService.set(BrooksonNotificationManager.LOCAL_STORAGE_KEY, _this.notificationsShown);\n };\n /**\n * Redirects the user to Task Planner\n *\n *\n * @memberOf BrooksonNotificationManager\n */\n this.goToTaskPlanner = function () {\n _this.brooksonNavigation.taskPlanner.main();\n };\n }\n /**\n * The local storage key for storing whether a user has seen notifications\n *\n * @static\n * @type {string}\n * @memberOf BrooksonNotificationManager\n */\n BrooksonNotificationManager.LOCAL_STORAGE_KEY = 'brookson.notifications';\n /**\n * The local storage key for whether they have seen the task planner notifications\n *\n * @static\n * @type {string}\n * @memberOf BrooksonNotificationManager\n */\n BrooksonNotificationManager.TASK_PLANNER_NOTIFICATION_KEY = 'taskPlannerNotifications';\n /**\n * The local storage key for whether they have seen the unallocated transactions notifications\n *\n * @static\n * @type {string}\n * @memberOf BrooksonNotificationManager\n */\n BrooksonNotificationManager.UNALLOCATED_TRANSACTIONS_KEY = 'unallocatedTransactions';\n /**\n * The local storage key for whether the user has dismissed all of the alerts\n *\n * @static\n * @type {string}\n * @memberOf BrooksonNotificationManager\n */\n BrooksonNotificationManager.UNALLOCATED_TRANSACTIONS_CLEAR_KEY = 'unallocatedTransactionsClear';\n /**\n * Angular Dependency Injection\n *\n * @static\n *\n * @memberOf BrooksonNotificationManager\n */\n BrooksonNotificationManager.$inject = ['$q', '$window', 'notificationSrv', 'taskPlannerSrv', 'moneyManagerSrv', 'brookson.utilities.date', 'growl', 'taskPlanner.enums', 'bankLink.enums', 'localStorageService', 'brookson.navigation', 'screenSize', 'calendlySrv', 'brookson.utilities.date'];\n return BrooksonNotificationManager;\n }());\n Shared.BrooksonNotificationManager = BrooksonNotificationManager;\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .service('brookson.notifications.manager', Shared.BrooksonNotificationManager);\n/// \nvar _this = this;\n/*! Angular-PDF Version: 1.2.4 | Released under an MIT license */\n(function (PDFJS) {\n 'use strict';\n angular.module('app.shared').directive('ngPdf', ['$window', function ($window) {\n var renderTask = null;\n var pdfLoaderTask = null;\n var backingScale = function (canvas) {\n var ctx = canvas.getContext('2d');\n var dpr = window.devicePixelRatio || 1;\n var bsr = ctx.webkitBackingStorePixelRatio ||\n ctx.mozBackingStorePixelRatio ||\n ctx.msBackingStorePixelRatio ||\n ctx.oBackingStorePixelRatio ||\n ctx.backingStorePixelRatio || 1;\n return dpr / bsr;\n };\n var setCanvasDimensions = function (canvas, w, h) {\n var ratio = backingScale(canvas);\n canvas.width = Math.floor(w * ratio);\n canvas.height = Math.floor(h * ratio);\n canvas.style.width = Math.floor(w) + 'px';\n canvas.style.height = Math.floor(h) + 'px';\n canvas.getContext('2d').setTransform(ratio, 0, 0, ratio, 0, 0);\n return canvas;\n };\n var controller = ['$scope', '$attrs', function ($scope, $attrs) {\n var vm = _this;\n vm.pdfId = $attrs.pdfid;\n vm.pdfpath = $attrs.pdfpath;\n activate();\n ////////////////\n function activate() {\n $scope.callback(vm.pdfId, vm.pdfpath).then(function (result) {\n $scope.pdfUrl = result;\n });\n }\n }];\n return {\n restrict: 'E',\n templateUrl: function (element, attr) {\n return attr.templateUrl ? attr.templateUrl : 'partials/viewer.html';\n },\n controller: controller,\n link: function (scope, element, attrs) {\n var url = scope.pdfUrl;\n var pdfDoc = null;\n var pageNum = (attrs.page ? attrs.page : 1);\n var scale = attrs.scale > 0 ? attrs.scale : 1;\n var canvas;\n if (attrs) {\n canvas = document.getElementById(attrs.canvasid);\n }\n else {\n canvas = document.getElementById('pdf-canvas');\n }\n var ctx = canvas.getContext('2d');\n var windowEl = angular.element($window);\n windowEl.on('scroll', function () {\n scope.$apply(function () {\n scope.scroll = windowEl[0].scrollY;\n });\n });\n PDFJS.disableWorker = false;\n scope.pageNum = pageNum;\n scope.renderPage = function (num) {\n if (renderTask) {\n renderTask._internalRenderTask.cancel();\n }\n pdfDoc.getPage(num).then(function (page) {\n var viewport;\n var pageWidthScale;\n var pageHeightScale;\n var renderContext;\n if (attrs.scale === 'page-fit' && !scale) {\n viewport = page.getViewport(1);\n pageWidthScale = element[0].clientWidth / viewport.width;\n pageHeightScale = element[0].clientHeight / viewport.height;\n scale = Math.min(pageWidthScale, pageHeightScale);\n }\n else {\n viewport = page.getViewport(scale);\n }\n setCanvasDimensions(canvas, viewport.width, viewport.height);\n renderContext = {\n canvasContext: ctx,\n viewport: viewport\n };\n renderTask = page.render(renderContext);\n renderTask.promise.then(function () {\n if (typeof scope.onPageRender === 'function') {\n scope.onPageRender();\n }\n });\n });\n };\n scope.goPrevious = function () {\n if (scope.pageToDisplay <= 1) {\n return;\n }\n scope.pageToDisplay = parseInt(scope.pageToDisplay) - 1;\n scope.pageNum = scope.pageToDisplay;\n };\n scope.goNext = function () {\n if (scope.pageToDisplay >= pdfDoc.numPages) {\n return;\n }\n scope.pageToDisplay = parseInt(scope.pageToDisplay) + 1;\n scope.pageNum = scope.pageToDisplay;\n };\n scope.zoomIn = function () {\n scale = parseFloat(scale) + 0.2;\n scope.renderPage(scope.pageToDisplay);\n return scale;\n };\n scope.zoomOut = function () {\n scale = parseFloat(scale) - 0.2;\n scope.renderPage(scope.pageToDisplay);\n return scale;\n };\n scope.changePage = function () {\n scope.renderPage(scope.pageToDisplay);\n };\n scope.rotate = function () {\n if (canvas.getAttribute('class') === 'rotate0') {\n canvas.setAttribute('class', 'rotate90');\n }\n else if (canvas.getAttribute('class') === 'rotate90') {\n canvas.setAttribute('class', 'rotate180');\n }\n else if (canvas.getAttribute('class') === 'rotate180') {\n canvas.setAttribute('class', 'rotate270');\n }\n else {\n canvas.setAttribute('class', 'rotate0');\n }\n };\n function clearCanvas() {\n if (ctx) {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n }\n }\n function renderPDF() {\n clearCanvas();\n if (url) {\n pdfLoaderTask = PDFJS.getDocument(url, null, null, scope.onProgress);\n pdfLoaderTask.then(function (_pdfDoc) {\n if (typeof scope.onLoad === 'function') {\n scope.onLoad();\n }\n pdfDoc = _pdfDoc;\n scope.renderPage(scope.pageToDisplay);\n scope.$apply(function () {\n scope.pageCount = _pdfDoc.numPages;\n });\n }, function (error) {\n if (error) {\n if (typeof scope.onError === 'function') {\n scope.onError(error);\n }\n }\n });\n }\n }\n scope.$watch('pageNum', function (newVal) {\n scope.pageToDisplay = parseInt(newVal);\n if (pdfDoc !== null) {\n scope.renderPage(scope.pageToDisplay);\n }\n });\n scope.$watch('pdfUrl', function (newVal) {\n if (newVal !== '') {\n url = newVal;\n scope.pageToDisplay = 1;\n if (pdfLoaderTask) {\n pdfLoaderTask.destroy().then(function () {\n renderPDF();\n });\n }\n else {\n renderPDF();\n }\n }\n });\n }\n };\n }]);\n})(window.PDFJS);\n/// \n(function () {\n 'use strict';\n var app = angular.module('app.shared');\n app.factory('brookson.pdf.modal', brooksonPdfModal);\n brooksonPdfModal.$inject = ['$uibModal'];\n function brooksonPdfModal($uibModal) {\n var service = {\n view: view\n };\n return service;\n ////////////////\n function view(id, path, callback) {\n $uibModal.open({\n animation: true,\n controller: 'brooksonPdfModalCtrl',\n templateUrl: 'src/app/shared/views/modals/brookson.modals.pdf-modal.html',\n size: \"lg\",\n resolve: {\n callback: function () {\n return callback;\n },\n documentID: function () {\n return id;\n },\n documentPath: function () {\n return path;\n }\n }\n });\n }\n }\n app.controller('brooksonPdfModalCtrl', ['$scope', '$uibModalInstance', 'callback', 'documentID', 'documentPath', 'documentStorageSrv', 'FileSaver',\n function ($scope, $uibModalInstance, callback, documentID, documentPath, documentStorageSrv, FileSaver) {\n $scope.callback = callback;\n $scope.documentID = documentID;\n $scope.documentPath = documentPath;\n $scope.downloadPDF = function () {\n documentStorageSrv.getSelectedPDF(documentID, documentPath).then(function (data) {\n var blobObject = new Blob([data], { type: 'application/pdf' });\n FileSaver.saveAs(blobObject, documentPath += \".pdf\");\n });\n };\n $scope.cancel = function () {\n $uibModalInstance.dismiss('cancel');\n };\n }]);\n})();\n/// \n(function () {\n 'use strict';\n var app = angular.module('app.shared');\n app.factory('brookson.ui.image-preview.modal', [\"$q\", \"$uibModal\", function ($q, $uibModal) {\n var options = {\n animation: true,\n size: \"lg\",\n templateUrl: \"src/app/shared/views/ui/brookson.ui.image-preview.modal.html\"\n };\n var _showImagePreviewModal = function (imageData) {\n var defer = $q.defer();\n var confirmationOptions = options;\n confirmationOptions.controller = ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) {\n $scope.imageData = imageData;\n $scope.close = function () {\n $uibModalInstance.close();\n defer.resolve();\n };\n }];\n $uibModal.open(confirmationOptions);\n return defer.promise;\n };\n return {\n showImagePreviewModal: _showImagePreviewModal\n };\n }]);\n})();\n/// \n(function () {\n \"use strict\";\n var app = angular.module(\"app.shared\");\n app.factory(\"brookson.ui.popup\", [\n \"$q\", \"$uibModal\", \"$sce\", \"$sanitize\", function ($q, $uibModal, $sce, $sanitize) {\n var options = {\n animation: true,\n size: \"sm\",\n templateUrl: \"src/app/shared/views/ui/brookson.ui.popup.html\"\n };\n var _showConfirmationPopup = function (title, message, acceptText, closeText) {\n var defer = $q.defer();\n var confirmationOptions = options;\n confirmationOptions.controller = ['$scope', '$uibModalInstance', '$rootScope', function ($scope, $uibModalInstance, $rootScope) {\n $scope.title = title;\n $scope.message = $sanitize($sce.trustAsHtml(message));\n if (acceptText) {\n $scope.acceptButtonText = acceptText;\n }\n else {\n $scope.acceptButtonText = \"Ok\";\n }\n if (closeText) {\n $scope.closeButtonText = closeText;\n }\n else {\n $scope.closeButtonText = \"Cancel\";\n }\n $scope.ok = function () {\n $uibModalInstance.close();\n defer.resolve();\n };\n $scope.cancel = function () {\n $uibModalInstance.dismiss();\n $rootScope.$broadcast('UserCancelledConfirmationPopup', { userClickedCancelledButton: true });\n defer.reject();\n };\n }];\n $uibModal.open(confirmationOptions);\n return defer.promise;\n };\n var _showTemplatedConfirmationPopup = function (title, messageTemplateUrl, model, acceptText, closeText, popupSize) {\n var defer = $q.defer();\n popupSize = popupSize || \"sm\";\n var infoOptions = {\n animation: true,\n size: popupSize,\n windowClass: \"templated-confirmation-popup\",\n templateUrl: \"src/app/shared/views/ui/brookson.ui.templated-confirmation-popup.html\"\n };\n infoOptions.controller = ['$scope', '$uibModalInstance', 'memberSrv', function ($scope, $uibModalInstance, memberSrv) {\n $scope.title = title;\n $scope.messageTemplateUrl = messageTemplateUrl;\n $scope.model = model;\n $scope.businessType = memberSrv.member.businessType;\n if (acceptText) {\n $scope.acceptButtonText = acceptText;\n }\n else {\n $scope.acceptButtonText = \"Ok\";\n }\n if (closeText) {\n $scope.closeButtonText = closeText;\n }\n else {\n $scope.closeButtonText = \"Cancel\";\n }\n $scope.ok = function () {\n $uibModalInstance.close();\n defer.resolve();\n };\n $scope.cancel = function () {\n $uibModalInstance.dismiss();\n defer.reject();\n };\n }];\n $uibModal.open(infoOptions);\n return defer.promise;\n };\n var _showSaveAs = function (title, message, acceptText, closeText) {\n var defer = $q.defer();\n options.templateUrl = \"src/app/shared/views/ui/brookson.ui.popup.input.html\";\n options.size = \"md\";\n var confirmationOptions = options;\n confirmationOptions.controller = ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) {\n $scope.title = title;\n $scope.message = $sanitize($sce.trustAsHtml(message));\n $scope.result = \"\";\n if (acceptText) {\n $scope.acceptButtonText = acceptText;\n }\n else {\n $scope.acceptButtonText = \"Ok\";\n }\n if (closeText) {\n $scope.closeButtonText = closeText;\n }\n else {\n $scope.closeButtonText = \"Cancel\";\n }\n $scope.ok = function () {\n $uibModalInstance.close();\n defer.resolve($scope.result);\n };\n $scope.cancel = function () {\n $uibModalInstance.dismiss();\n defer.reject();\n };\n }];\n $uibModal.open(confirmationOptions);\n return defer.promise;\n };\n var _showYesNoPopup = function (title, message) {\n var defer = $q.defer();\n var yesNoOptions = options;\n yesNoOptions.controller = ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) {\n $scope.title = title;\n $scope.message = $sanitize($sce.trustAsHtml(message));\n $scope.acceptButtonText = \"Yes\";\n $scope.closeButtonText = \"No\";\n $scope.ok = function () {\n $uibModalInstance.close();\n defer.resolve();\n };\n $scope.cancel = function () {\n $uibModalInstance.dismiss();\n defer.reject();\n };\n }];\n $uibModal.open(yesNoOptions);\n return defer.promise;\n };\n var _showInfoPopup = function (title, message) {\n var defer = $q.defer();\n var infoOptions = options;\n infoOptions.controller = ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) {\n $scope.title = title;\n $scope.message = $sanitize($sce.trustAsHtml(message));\n $scope.acceptButtonText = \"Ok\";\n $scope.ok = function () {\n $uibModalInstance.close();\n defer.resolve();\n };\n $scope.cancel = function () {\n $uibModalInstance.dismiss();\n defer.reject();\n };\n }];\n $uibModal.open(infoOptions);\n return defer.promise;\n };\n var _showTemplatedInfoPopup = function (title, messageTemplateUrl) {\n var defer = $q.defer();\n var infoOptions = {\n animation: true,\n size: \"sm\",\n windowClass: \"templated-info-popup\",\n templateUrl: \"src/app/shared/views/ui/brookson.ui.templated-info-popup.html\"\n };\n infoOptions.controller = ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) {\n $scope.title = title;\n $scope.messageTemplateUrl = messageTemplateUrl;\n $scope.acceptButtonText = \"Ok\";\n $scope.ok = function () {\n $uibModalInstance.close();\n defer.resolve();\n };\n $scope.cancel = function () {\n $uibModalInstance.dismiss();\n defer.reject();\n };\n }];\n $uibModal.open(infoOptions);\n return defer.promise;\n };\n var _showTemplatedHelpPopup = function (title, messageTemplateUrl) {\n var defer = $q.defer();\n var infoOptions = {\n animation: true,\n size: \"sm\",\n windowClass: \"templated-info-popup\",\n templateUrl: \"src/app/shared/views/ui/brookson.ui.templated-help-popup.html\"\n };\n infoOptions.controller = ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) {\n $scope.title = title;\n $scope.messageTemplateUrl = messageTemplateUrl;\n $scope.acceptButtonText = \"Ok\";\n $scope.ok = function () {\n $uibModalInstance.close();\n defer.resolve();\n };\n $scope.cancel = function () {\n $uibModalInstance.dismiss();\n defer.reject();\n };\n }];\n $uibModal.open(infoOptions);\n return defer.promise;\n };\n var _showErrorPopup = function (message, errorRef) {\n var defer = $q.defer();\n var errorOptions = options;\n errorOptions.controller = ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) {\n $scope.title = \"Sorry\";\n $scope.message = $sanitize($sce.trustAsHtml(message));\n $scope.acceptButtonText = \"Ok\";\n if (errorRef) {\n var errorMsg = \"(Ref: \" + errorRef + \")\";\n $scope.errorRef = $sce.trustAsHtml(errorMsg);\n }\n $scope.ok = function () {\n $uibModalInstance.close();\n defer.resolve();\n };\n $scope.cancel = function () {\n $uibModalInstance.dismiss();\n defer.reject();\n };\n }];\n $uibModal.open(errorOptions);\n return defer.promise;\n };\n var _showAcceptPopup = function (title, message, acceptText, size) {\n var defer = $q.defer();\n options.size = size ? size : 'sm';\n var acceptOptions = options;\n acceptOptions.controller = ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) {\n $scope.title = title;\n $scope.message = $sanitize($sce.trustAsHtml(message));\n if (acceptText) {\n $scope.acceptButtonText = acceptText;\n }\n else {\n $scope.acceptButtonText = \"Ok\";\n }\n $scope.ok = function () {\n $uibModalInstance.close();\n defer.resolve();\n };\n }];\n $uibModal.open(acceptOptions);\n return defer.promise;\n };\n return {\n showConfirmationPopup: _showConfirmationPopup,\n showTemplatedConfirmationPopup: _showTemplatedConfirmationPopup,\n showYesNoPopup: _showYesNoPopup,\n showInfoPopup: _showInfoPopup,\n showTemplatedInfoPopup: _showTemplatedInfoPopup,\n showTemplatedHelpPopup: _showTemplatedHelpPopup,\n showErrorPopup: _showErrorPopup,\n showAcceptPopup: _showAcceptPopup,\n showSaveAs: _showSaveAs\n };\n }\n ]);\n})();\n/// \n(function () {\n 'use strict';\n angular\n .module('app.shared')\n .factory('brookson.ui.scroll-top', brooksonUiScrollTop);\n brooksonUiScrollTop.$inject = ['$window'];\n function brooksonUiScrollTop($window) {\n // Data\n var self = $window;\n // Methods\n var _currentYPosition = function () {\n if (self.pageYOffset)\n return self.pageYOffset;\n if ($window.document.documentElement && $window.document.documentElement.scrollTop)\n return $window.document.documentElement.scrollTop;\n if ($window.document.body.scrollTop)\n return $window.document.body.scrollTop;\n return 0;\n };\n var _smoothScroll = function (setSpeed) {\n var startY = _currentYPosition();\n var stopY = 0;\n var distance = stopY > startY ? stopY - startY : startY - stopY;\n if (distance < 100) {\n $window.scrollTo(0, stopY);\n return;\n }\n setSpeed = setSpeed ? setSpeed : 1500;\n var speed = Math.round(setSpeed / 100);\n var step = Math.round(distance / 25);\n var leapY = stopY > startY ? startY + step : startY - step;\n var timer = 0;\n if (stopY > startY) {\n for (var i = startY; i < stopY; i += step) {\n $window.setTimeout(\"window.scrollTo(0, \" + leapY + \")\", timer * speed);\n leapY += step;\n if (leapY > stopY)\n leapY = stopY;\n timer++;\n }\n return;\n }\n for (var j = startY; j > stopY; j -= step) {\n $window.setTimeout(\"window.scrollTo(0, \" + leapY + \")\", timer * speed);\n leapY -= step;\n if (leapY < stopY)\n leapY = stopY;\n timer++;\n }\n };\n var service = {\n currentYPosition: _currentYPosition,\n smoothScroll: _smoothScroll\n };\n return service;\n }\n})();\n(function () {\n 'use strict';\n angular.module('app.shared')\n .directive('compile', [\n '$compile', function ($compile) {\n return function (scope, element, attrs) {\n scope.$watch(function (scope) {\n // watch the 'compile' expression for changes\n return scope.$eval(attrs.compile);\n }, function (value) {\n // when the 'compile' expression changes\n // assign it into the current DOM\n element.html(value);\n // compile the new DOM and link it to the current\n // scope.\n // NOTE: we only compile .childNodes so that\n // we don't get into infinite loop compiling ourselves\n element.removeAttr(\"compile\");\n $compile(element)(scope);\n });\n };\n }\n ]);\n})();\n/// \n(function () {\n 'use strict';\n angular\n .module('app.shared')\n .service('authInterceptorSrv', authInterceptorSrv);\n authInterceptorSrv.$inject = ['$q', '$window', '$injector', 'memberSrv', 'authenticationSrv'];\n function authInterceptorSrv($q, $window, $injector, memberSrv, authenticationSrv) {\n var MAX_RETRY_COUNT = 3;\n var authInterceptorServiceFactory = {};\n var $http;\n var refreshingRequest = false;\n var requestQueue = [];\n var _request = function (config) {\n config.headers = config.headers || {};\n var authData = memberSrv.getMember();\n if (authData) {\n if (authData.isAuthenticated) {\n config.headers.Authorization = 'Bearer ' + authData.token;\n if ($window.brookson && $window.brookson.antiForgeryToken) {\n config.headers.__RequestVerificationToken = $window.brookson.antiForgeryToken || \"no request verification token\";\n }\n }\n }\n return config;\n };\n var _responseError = function (rejection) {\n var deferred = $q.defer();\n if (rejection.status === 401) {\n requestQueue.push({ config: rejection.config, deferred: deferred });\n if (!refreshingRequest) {\n refreshingRequest = true;\n authenticationSrv.refreshToken().then(function (response) {\n //retry login with new refresh\n _.each(requestQueue, function (request) {\n if (!request.config.retryCount || request.config.retryCount < MAX_RETRY_COUNT) {\n _retryHttpRequest(request.config, request.deferred);\n }\n else {\n request.deferred.reject(\"Too many of the same request has been made\");\n }\n });\n requestQueue = [];\n refreshingRequest = false;\n }, function (err) {\n requestQueue = [];\n authenticationSrv.logout();\n deferred.reject(rejection);\n });\n }\n }\n else {\n deferred.reject(rejection);\n }\n return deferred.promise;\n };\n var _retryHttpRequest = function (config, deferred) {\n $http = $http || $injector.get('$http');\n if (!config.retryCount)\n config.retryCount = 0;\n config.retryCount++;\n $http(config).then(function (response) {\n deferred.resolve(response);\n }, function (response) {\n deferred.reject(response);\n });\n };\n authInterceptorServiceFactory.request = _request;\n authInterceptorServiceFactory.responseError = _responseError;\n return authInterceptorServiceFactory;\n }\n})();\nvar Shared;\n(function (Shared) {\n var AutoAllocation;\n (function (AutoAllocation) {\n var AutoAllocationItem = /** @class */ (function () {\n function AutoAllocationItem() {\n }\n return AutoAllocationItem;\n }());\n AutoAllocation.AutoAllocationItem = AutoAllocationItem;\n var MatchingTransactions = /** @class */ (function () {\n function MatchingTransactions() {\n this.count = 0;\n this.items = [];\n }\n return MatchingTransactions;\n }());\n AutoAllocation.MatchingTransactions = MatchingTransactions;\n })(AutoAllocation = Shared.AutoAllocation || (Shared.AutoAllocation = {}));\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n var AutoAllocationService = /** @class */ (function () {\n function AutoAllocationService($http, $q, appSettings, localStorageService) {\n var _this = this;\n this.$http = $http;\n this.$q = $q;\n this.appSettings = appSettings;\n this.localStorageService = localStorageService;\n this.member = {};\n this.duplicateKeyword = function (newSetting) {\n newSetting.validationMessage = \"\";\n if (_.isUndefined(newSetting.keyword))\n return false;\n var uniqueKeywordCheck = _.find(_this.companyConfig, function (config) {\n return config.keyword.toLowerCase() === newSetting.keyword.toLowerCase();\n });\n if (!_.isUndefined(uniqueKeywordCheck)) {\n if (!uniqueKeywordCheck.enabled) {\n newSetting.validationMessage = \"A disabled rule already exists with this keyword.\";\n }\n else {\n newSetting.validationMessage = \"A rule already exists with this keyword.\";\n }\n _this.resetTransactionMatches(newSetting);\n return true;\n }\n return false;\n };\n this.resetTransactionMatches = function (autoSetting) {\n if (_.isUndefined(autoSetting.transactionMatches)) {\n autoSetting.transactionMatches = new Shared.AutoAllocation.MatchingTransactions();\n }\n autoSetting.transactionMatches.count = 0;\n autoSetting.transactionMatches.items = [];\n };\n this.searchTransactions = function (autoSetting) {\n if (!_.isUndefined(autoSetting.keyword) && autoSetting.keyword.length >= 1) {\n var transactionMatches = _.filter(_this.transactions, function (transaction) {\n return _.unescape(transaction.description).toLowerCase().indexOf(_.unescape(autoSetting.keyword).toLowerCase()) > -1\n && transaction.debitAmount < 0 && (transaction.transactionType === 0 || transaction.transactionType === 2);\n });\n transactionMatches = _.orderBy(angular.copy(transactionMatches), function (matchedTransactions) { return matchedTransactions.transactionDate; }, \"desc\");\n if (transactionMatches.length === 0) {\n var noRecordsFound = { description: \"No business paid transactions found\", transactionDate: null, debitAmount: null };\n transactionMatches.push(noRecordsFound);\n }\n autoSetting.transactionMatches = new Shared.AutoAllocation.MatchingTransactions();\n autoSetting.transactionMatches.count = transactionMatches.length;\n autoSetting.transactionMatches.items = transactionMatches.slice(0, 10);\n _this.decorateKeyword(autoSetting);\n }\n else {\n _this.resetTransactionMatches(autoSetting);\n }\n };\n this.memberModel = this.localStorageService.get(\"brookson.member\");\n this.transactions = [];\n }\n AutoAllocationService.prototype.getAutoAllocationSettings = function (silentMode) {\n var deferred = this.$q.defer();\n var url = \"api/autoallocation/getconfig\";\n this.$http.get(url)\n .then(function (response) {\n deferred.resolve(response.data);\n });\n return deferred.promise;\n };\n AutoAllocationService.prototype.saveNewAutoAllocationSetting = function (model) {\n var deferred = this.$q.defer();\n var url = \"api/autoallocation/addnew\";\n this.$http.post(url, model)\n .then(function (response) {\n deferred.resolve(response.data);\n });\n return deferred.promise;\n };\n AutoAllocationService.prototype.updateAutoAllocationSetting = function (model) {\n var deferred = this.$q.defer();\n var url = \"api/autoallocation/update\";\n this.$http.post(url, model)\n .then(function (response) {\n deferred.resolve(response.data);\n });\n return deferred.promise;\n };\n AutoAllocationService.prototype.internalNavUser = function () {\n if (!this.appSettings.isInternal)\n return false;\n };\n AutoAllocationService.prototype.RequestedFromAllowedApiSource = function () {\n if (!this.appSettings.validApiSource)\n return false;\n if (_.isNull(this.memberModel) || _.isNull(this.memberModel.navReferral)) {\n return false;\n }\n return true;\n };\n AutoAllocationService.prototype.getSettingsList = function (includeDisabled) {\n var list = this.companyConfig;\n if (!includeDisabled) {\n list = _.filter(list, function (config) {\n return config.enabled === true;\n });\n }\n list = _.orderBy(angular.copy(list), function (data) { return data.id; });\n this.populateNavCategories(list);\n return list;\n };\n AutoAllocationService.prototype.populateNavCategories = function (companyConfig) {\n var _this = this;\n _.forEach(companyConfig, function (autoAllocationSettings) {\n autoAllocationSettings.navCategory = _.find(_this.categoryList, function (category) {\n return category.code === autoAllocationSettings.categoryCode;\n });\n });\n };\n AutoAllocationService.prototype.createNewAllocationSetting = function () {\n var newAutoSetting = new Shared.AutoAllocation.AutoAllocationItem();\n var createdBy = \"Customer\";\n if (!_.isNull(this.memberModel.isAdmin)) {\n createdBy = \"Superuser\";\n }\n else if (!_.isNull(this.memberModel.navReferral)) {\n createdBy = this.memberModel.navReferral;\n }\n newAutoSetting.id = -1;\n newAutoSetting.enabled = true;\n newAutoSetting.createdBy = createdBy;\n newAutoSetting.memberId = parseInt(this.memberModel.memberId);\n newAutoSetting.company = this.memberModel.companyRef;\n return newAutoSetting;\n };\n AutoAllocationService.prototype.decorateKeyword = function (autoSetting) {\n if (_.isUndefined(autoSetting))\n return;\n if (_.isUndefined(autoSetting.transactionMatches) || autoSetting.transactionMatches.count === 0)\n return;\n _.forEach(autoSetting.transactionMatches.items, function (matchedTransaction) {\n matchedTransaction.description = _.unescape(matchedTransaction.description.toUpperCase())\n .replace(_.escape(autoSetting.keyword).toUpperCase(), \"\".concat(_.escape(autoSetting.keyword).toUpperCase(), \"\"));\n });\n };\n AutoAllocationService.$inject = [\"$http\", \"$q\", \"appSettings\", \"localStorageService\"];\n return AutoAllocationService;\n }());\n Shared.AutoAllocationService = AutoAllocationService;\n})(Shared || (Shared = {}));\nangular.module(\"app.shared\").service(\"autoAllocationService\", Shared.AutoAllocationService);\n/// \nvar Shared;\n(function (Shared) {\n var BrooksonServicesCompanyYearEnd = /** @class */ (function () {\n function BrooksonServicesCompanyYearEnd($http) {\n var _this = this;\n this.$http = $http;\n this.getCompanyYearEndTileDetails = function (silentMode) {\n return _this.$http.get(\"api/CompanyYearEnd/GetCompanyYearEndTile\", {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n };\n this.setDraftAccountsConfirmed = function (taxYear, reason) {\n var url = 'api/CompanyYearEnd/SetDraftAccountsConfirmed';\n var requestData = {\n taxYear: taxYear,\n reason: reason\n };\n var config = {\n silentMode: false\n };\n return _this.$http.post(url, requestData, config).then(function (response) {\n return response.data;\n });\n };\n }\n BrooksonServicesCompanyYearEnd.$inject = ['$http'];\n return BrooksonServicesCompanyYearEnd;\n }());\n Shared.BrooksonServicesCompanyYearEnd = BrooksonServicesCompanyYearEnd;\n})(Shared || (Shared = {}));\nangular.module('app.shared')\n .service('brooksonServicesCompanyYearEnd', Shared.BrooksonServicesCompanyYearEnd);\n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var CS01ConfirmationService = /** @class */ (function () {\n function CS01ConfirmationService($injector, sharedConfig) {\n var _this = this;\n this.$injector = $injector;\n this.sharedConfig = sharedConfig;\n this.GetNextIfOpen = function () {\n _this.$http = _this.$http || _this.$injector.get(\"$http\");\n var url = _this.serviceBase + \"api/CS01Confirmation/GetNextIfOpen\";\n return _this.$http.get(url)\n .then(function (response) {\n return response.data;\n });\n };\n this.GetCompanyDetails = function () {\n _this.$http = _this.$http || _this.$injector.get(\"$http\");\n var url = _this.serviceBase + \"api/CS01Confirmation/GetCompanyDetails\";\n return _this.$http.get(url)\n .then(function (response) {\n return response.data;\n });\n };\n this.SaveResponse = function (CS01ConfirmationDetails) {\n _this.$http = _this.$http || _this.$injector.get(\"$http\");\n var url = _this.serviceBase + \"api/CS01Confirmation/Save\";\n var request = CS01ConfirmationDetails;\n return _this.$http.post(url, request)\n .then(function (response) {\n return response.data;\n });\n };\n this.serviceBase = sharedConfig.baseApiUrl;\n }\n CS01ConfirmationService.$inject = ['$injector', 'shared.config'];\n return CS01ConfirmationService;\n }());\n Shared.CS01ConfirmationService = CS01ConfirmationService;\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .service('cs01ConfirmationSrv', Shared.CS01ConfirmationService);\n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var DashboardService = /** @class */ (function () {\n function DashboardService($http, popup, $q, selectModal, fileDownloadSrv) {\n var _this = this;\n this.$http = $http;\n this.popup = popup;\n this.$q = $q;\n this.selectModal = selectModal;\n this.fileDownloadSrv = fileDownloadSrv;\n this.showMasonryItems = false;\n this.customiseOn = false;\n this.userDashboards = [];\n this.addWidget = function (widget) {\n var dashCopy = angular.copy(_this.currentDashboard);\n dashCopy.widgets.push(widget);\n _this.currentDashboard = dashCopy;\n };\n this.removeWidget = function (widgetName) {\n var dashCopy = angular.copy(_this.currentDashboard);\n _.remove(dashCopy.widgets, function (widget) {\n return widget.componentName === widgetName;\n });\n _this.currentDashboard = dashCopy;\n };\n this.reloadMasonry = function () {\n _this.msnry.reloadItems();\n _this.msnry.layout();\n _this.showMasonryItems = true;\n };\n // Returns a list of dashboards and widgets for the member\n this.getDashboardsForMember = function (silentMode) {\n return _this.$http.get('api/Dashboard/GetDashboardsForMember', {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n _this.userDashboards = _.sortBy(response.data, 'dashboardUserId');\n if (!_.some(_this.userDashboards, { 'isDefault': true })) {\n //if you can't find a default then set the first as default\n _this.userDashboards[0].isDefault = true;\n _this.insertDashboardForMember(_this.userDashboards[0]);\n }\n return _this.userDashboards;\n });\n };\n // Returns a list of all the available widgets include their component name and display name\n this.getDashboardWidgets = function (silentMode) {\n return _this.$http.get('api/Dashboard/GetDashboardWidgets', {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n _this.allWidgets = response.data;\n return _this.allWidgets;\n });\n };\n // Inserts or updates a customised dashboard for the member. It will update if there is an dashboardWidgetId value\n this.insertDashboardForMember = function (data, showGritterMessage, silentMode) {\n if (showGritterMessage === void 0) { showGritterMessage = true; }\n return _this.$http.post('api/Dashboard/InsertDashboardForMember?showGritterMessage=' + showGritterMessage, data, {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n };\n this.saveExisting = function (currentDash, showGritterMessage) {\n if (showGritterMessage === void 0) { showGritterMessage = true; }\n return _this.insertDashboardForMember(currentDash, showGritterMessage).then(function (result) {\n _this.replaceDashboard(result);\n });\n };\n this.saveAsNew = function (currentDash) {\n return _this.popup.showSaveAs(\"Save Dashboard\", \"Save your dashboard as:\").then(function (fileName) {\n var dashCopy = angular.copy(currentDash);\n dashCopy.name = fileName;\n dashCopy.dashboardUserId = null;\n dashCopy.isDefault = false;\n dashCopy.isBrookson = false;\n _.each(dashCopy.widgets, function (widget) { widget.dashboardUserWidgetsId = null; widget.dashboardUserId = null; });\n return _this.insertDashboardForMember(dashCopy).then(function (result) {\n _this.userDashboards.push(result);\n _this.currentDashboard = result;\n return result;\n });\n });\n };\n this.showDelete = function () {\n // return this.popup.selectOptions();\n var items = [];\n items = _.chain(_this.userDashboards).filter({ 'isBrookson': false }).map(function (v) {\n if (!v.isBrookson) {\n return new Shared.ModalSelectItem(v.name, v.dashboardUserId, false);\n }\n }).value();\n return _this.selectModal.showSelect(items, \"Remove Dashboards\").then(function (selected) {\n if (selected.length) {\n return _.filter(_this.userDashboards, function (item) {\n return _.some(selected, function (select) { return select.id === item.dashboardUserId; });\n });\n }\n });\n };\n this.deleteDashboards = function (dashboards, silentMode) {\n return _this.$http.post('api/Dashboard/DeleteDashboards', dashboards, {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n //refresh the list of dashboards\n _this.getDashboardsForMember();\n });\n };\n this.makeDefault = function (currentDash) {\n var promises = [];\n _.each(_this.userDashboards, function (dash) {\n if (dash.dashboardUserId === currentDash.dashboardUserId) {\n dash.isDefault = true;\n promises.push(_this.insertDashboardForMember(dash));\n }\n else if (dash.isDefault === true) {\n dash.isDefault = false;\n promises.push(_this.insertDashboardForMember(dash));\n }\n });\n return _this.$q.all(promises).then(function (promises) {\n _.each(promises, function (result) {\n _this.replaceDashboard(result);\n });\n });\n };\n this.resetCurrentDashboard = function () {\n var dash = _.find(_this.userDashboards, function (dash) {\n return dash.dashboardUserId === _this.currentDashboard.dashboardUserId;\n });\n _this.currentDashboard = dash;\n };\n this.replaceDashboard = function (newDash) {\n var index = _.indexOf(_this.userDashboards, _.find(_this.userDashboards, { dashboardUserId: newDash.dashboardUserId }));\n _this.userDashboards.splice(index, 1, newDash);\n };\n this.downloadFile = function (documentType) {\n var url = \"api/Dashboard/DownloadEmploymentDocuments?documentType=\" + documentType;\n console.log(url);\n var expectedMediaType = \"application/octet-stream\";\n _this.fileDownloadSrv.downloadAndSave(url, null, documentType + '.pdf', expectedMediaType);\n };\n }\n Object.defineProperty(DashboardService.prototype, \"currentDashboard\", {\n get: function () {\n return this._currentDashboard;\n },\n set: function (v) {\n this._currentDashboard = angular.copy(v);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(DashboardService.prototype, \"availableWidgets\", {\n get: function () {\n if (this.allWidgets && this.currentDashboard) {\n return _.differenceBy(this.allWidgets, this.currentDashboard.widgets, 'dashboardWidgetId');\n }\n return [];\n },\n enumerable: false,\n configurable: true\n });\n DashboardService.prototype.getDateIsNull = function (value) {\n if (!value) {\n return true;\n }\n return moment(value).format(\"DD/MM/YYYY\") === '01/01/1753';\n };\n DashboardService.$inject = ['$http', 'brookson.ui.popup', '$q', 'brookson.modal.select.service', 'brookson.file.download'];\n return DashboardService;\n }());\n Shared.DashboardService = DashboardService;\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .service('dashboardService', Shared.DashboardService);\n/// \n(function () {\n 'use strict';\n angular\n .module('app.shared')\n .service('dialogueSrv', dialogueSrv);\n dialogueSrv.$inject = ['$http', '$q', 'shared.config', 'dialogue.enums', 'localStorageService', 'memberSrv'];\n function dialogueSrv($http, $q, sharedConfig, enums, localStorageService, memberSrv) {\n var member = memberSrv.getMember();\n var dialogueSrvFactory = {};\n var serviceBase = sharedConfig.baseApiUrl;\n var localStorageData = null;\n var localStorageDashboardData = null;\n // Get\n function hasExpensesNoticeBeenDisplayed() {\n if (getData().expensesNotice !== member.memberId) {\n return $http.get(serviceBase + 'api/Dialogue/HasExpensesNoticeBeenDisplayed', {\n silentMode: true\n }).then(function (response) {\n if (response.data === true) {\n localStorageData.expensesNotice = member.memberId;\n setData();\n }\n return response.data;\n });\n }\n else {\n var deferred = $q.defer();\n deferred.resolve(true);\n return deferred.promise;\n }\n }\n // Set\n function setExpensesNoticeDisplayed() {\n return $http.get(serviceBase + 'api/Dialogue/SetExpensesNoticeDisplayed', {\n silentMode: true\n }).then(function (response) {\n if (response.data === true) {\n localStorageData.expensesNotice = member.memberId;\n setData();\n }\n return response.data;\n });\n }\n // Get\n function hasFinancialReviewBannerHidden() {\n if (getDashboardData().hidemortgagereviewbanner !== member.memberId) {\n return $http.get(serviceBase + 'api/Dialogue/HasFinancialReviewBannerHidden', {\n silentMode: true\n }).then(function (response) {\n if (response.data === true) {\n localStorageDashboardData.hidemortgagereviewbanner = member.memberId;\n setData();\n }\n return response.data;\n });\n }\n else {\n var deferred = $q.defer();\n deferred.resolve(true);\n return deferred.promise;\n }\n }\n // Set\n function setFinancialReviewBannerHidden() {\n return $http.get(serviceBase + 'api/Dialogue/SetFinancialReviewBannerHidden', {\n silentMode: true\n }).then(function (response) {\n if (response.data === true) {\n localStorageDashboardData.hidemortgagereviewbanner = member.memberId;\n setData();\n }\n return response.data;\n });\n }\n // Set\n function setFinancialReviewBannerClosed() {\n localStorageDashboardData.hidemortgagereviewbanner = member.memberId;\n setDashboardData();\n }\n // Set\n function setRecommendAFriendTileClosed() {\n localStorageDashboardData.recommendAFriendTile = member.memberId;\n setDashboardData();\n }\n // Get\n function hasRecommendAFriendTileHidden() {\n if (getDashboardData().recommendAFriendTile !== member.memberId) {\n return $http.get(serviceBase + 'api/Dialogue/HasRecommendAFriendTileHidden', {\n silentMode: true\n }).then(function (response) {\n if (response.data === true) {\n localStorageDashboardData.recommendAFriendTile = member.memberId;\n setDashboardData();\n }\n return response.data;\n });\n }\n else {\n var deferred = $q.defer();\n deferred.resolve(true);\n return deferred.promise;\n }\n }\n // Set\n function setRecommendAFriendTileHidden() {\n return $http.get(serviceBase + 'api/Dialogue/SetRecommendAFriendTileHidden', {\n silentMode: true\n }).then(function (response) {\n if (response.data === true) {\n localStorageDashboardData.recommendAFriendTile = member.memberId;\n setDashboardData();\n }\n return response.data;\n });\n }\n // Local storage\n function setData() {\n localStorageService.set('brookson.dialogues', localStorageData);\n }\n function getData() {\n var data = localStorageService.get('brookson.dialogues');\n return data === null ? {} : data;\n }\n function setDashboardData() {\n localStorageService.set('brookson.dashboard', localStorageDashboardData);\n }\n function getDashboardData() {\n var data = localStorageService.get('brookson.dashboard');\n return data === null ? {} : data;\n }\n localStorageData = getData();\n localStorageDashboardData = getDashboardData();\n dialogueSrvFactory.hasExpensesNoticeBeenDisplayed = hasExpensesNoticeBeenDisplayed;\n dialogueSrvFactory.setExpensesNoticeDisplayed = setExpensesNoticeDisplayed;\n dialogueSrvFactory.hasFinancialReviewBannerHidden = hasFinancialReviewBannerHidden;\n dialogueSrvFactory.setFinancialReviewBannerHidden = setFinancialReviewBannerHidden;\n dialogueSrvFactory.setFinancialReviewBannerClosed = setFinancialReviewBannerClosed;\n dialogueSrvFactory.setRecommendAFriendTileClosed = setRecommendAFriendTileClosed;\n dialogueSrvFactory.hasRecommendAFriendTileHidden = hasRecommendAFriendTileHidden;\n dialogueSrvFactory.setRecommendAFriendTileHidden = setRecommendAFriendTileHidden;\n return dialogueSrvFactory;\n }\n})();\nvar Shared;\n(function (Shared) {\n var DocumentCompact = /** @class */ (function () {\n function DocumentCompact() {\n }\n return DocumentCompact;\n }());\n Shared.DocumentCompact = DocumentCompact;\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n var FolderCompact = /** @class */ (function () {\n function FolderCompact() {\n }\n return FolderCompact;\n }());\n Shared.FolderCompact = FolderCompact;\n})(Shared || (Shared = {}));\n/// \n/// \nvar Shared;\n(function (Shared) {\n var DocumentStorageData = /** @class */ (function () {\n function DocumentStorageData() {\n }\n return DocumentStorageData;\n }());\n Shared.DocumentStorageData = DocumentStorageData;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var DocumentStorageFolder = /** @class */ (function () {\n function DocumentStorageFolder() {\n }\n return DocumentStorageFolder;\n }());\n Shared.DocumentStorageFolder = DocumentStorageFolder;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var FavouriteRequest = /** @class */ (function () {\n function FavouriteRequest() {\n }\n return FavouriteRequest;\n }());\n Shared.FavouriteRequest = FavouriteRequest;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var GetFullSizedImageRequest = /** @class */ (function () {\n function GetFullSizedImageRequest() {\n }\n return GetFullSizedImageRequest;\n }());\n Shared.GetFullSizedImageRequest = GetFullSizedImageRequest;\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n var SharedDrive = /** @class */ (function () {\n function SharedDrive() {\n }\n return SharedDrive;\n }());\n Shared.SharedDrive = SharedDrive;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var SharedDrives = /** @class */ (function () {\n function SharedDrives() {\n }\n return SharedDrives;\n }());\n Shared.SharedDrives = SharedDrives;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var SharedDriveFolder = /** @class */ (function () {\n function SharedDriveFolder() {\n }\n return SharedDriveFolder;\n }());\n Shared.SharedDriveFolder = SharedDriveFolder;\n})(Shared || (Shared = {}));\n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n 'use strict';\n var DocumentStorageService = /** @class */ (function () {\n function DocumentStorageService($rootScope, $http, enums, fileDownloadSrv) {\n var _this = this;\n this.$rootScope = $rootScope;\n this.$http = $http;\n this.enums = enums;\n this.fileDownloadSrv = fileDownloadSrv;\n this.folders = [];\n this.recentDocuments = [];\n this.favourites = [];\n this.sharedDrives = {\n dropboxSharedDrive: {}\n };\n this.folderId = 0;\n this.sharedDriveId = 0;\n this.sharedDrivePath = '';\n this.folder = {};\n this.sharedDriveFolder = null;\n this.orderByField = 'date';\n this.reverseSort = true;\n this.isMobile = false;\n this.getFolder = function () {\n if (_this.folderId > 0) {\n _this.folder = _.find(_this.folders, function (folder) {\n return folder.folderID === parseInt(_this.folderId.toString());\n });\n if (_this.folder && _this.subFolderID) {\n _this.folder = _.find(_this.folder.folders, function (folder) {\n return folder.folderID === parseInt(_this.subFolderID.toString());\n });\n }\n }\n else {\n if (_this.folders.length > 0) {\n _this.folderId = _this.folders[0].folderID;\n _this.folder = _this.folders[0];\n }\n }\n return _this.folder;\n };\n this.getSharedDriveFolder = function () {\n if (_this.sharedDriveId > 0) {\n _this.folder = _this.sharedDrives.dropboxSharedDrive;\n if (_this.sharedDrivePath) {\n _this.sharedDriveFolder = _this.getNestedFolder(_this.folder, _this.sharedDrivePath);\n }\n else {\n _this.sharedDriveFolder = _this.folder ? _this.folder.folder : {};\n }\n }\n return _this.folder;\n };\n this.getNestedFolder = function (data, path) {\n if (data.path === path) {\n return data;\n }\n var result;\n var p;\n for (p in data) {\n if (data.hasOwnProperty(p) && data[p] !== null && typeof data[p] === 'object') {\n result = _this.getNestedFolder(data[p], path);\n if (result) {\n return result;\n }\n }\n }\n return result;\n };\n this.getPreviousFolder = function (folderPath) {\n if (!folderPath || folderPath === '/') {\n return folderPath;\n }\n var splitFolderPath = folderPath.split('/');\n var slicedFolderPath = _.slice(splitFolderPath, 0, splitFolderPath.length - 1);\n if (slicedFolderPath.length <= 1) {\n return '/';\n }\n var previousFolderPath = slicedFolderPath.join('/');\n return previousFolderPath;\n };\n this.isSharedDriveAttached = function () {\n return _this.sharedDrives.dropboxSharedDrive.sharedDriveId > 0;\n };\n this.getFolderName = function () {\n if (!_this.currentCategory && _this.folder) {\n return _this.folder.name;\n }\n return _this.currentCategory;\n };\n this.getFavourites = function () {\n _this.favourites.length = 0;\n _.forEach(_this.folders, function (folder) {\n var favourites = _.filter(folder.documents, { isFavourite: true });\n _.merge(_this.favourites, _this.favourites.concat(favourites));\n });\n var favourites = _this.getSharedDriveFavourites(_this.sharedDrives.dropboxSharedDrive.folder);\n _.merge(_this.favourites, _this.favourites.concat(favourites));\n return _this.favourites;\n };\n this.getSharedDriveFavourites = function (data) {\n if (data) {\n var fav = _.filter(data.documents, { isFavourite: true });\n var f = void 0;\n for (f in data.folders) {\n if (data.folders.hasOwnProperty(f)) {\n fav = fav.concat(_this.getSharedDriveFavourites(data.folders[f]));\n }\n }\n return fav;\n }\n else {\n return [];\n }\n };\n this.removeFavourite = function (category, documentId, documentPath) {\n _.forEach(_this.folders, function (folder) {\n _.forEach(folder.documents, function (document) {\n if (document.documentId === documentId && document.path === documentPath) {\n document.isFavourite = false;\n }\n });\n });\n _.forEach(_this.recentDocuments, function (document) {\n if (document.documentId === documentId && document.path === documentPath) {\n document.isFavourite = false;\n }\n });\n _this.setSharedDriveFavouriteValue(_this.sharedDrives.dropboxSharedDrive.folder, documentId, documentPath, false);\n _this.getFavourites();\n return _this.unfavouriteDocument(category, documentId, documentPath);\n };\n this.setFavourite = function (dataSource, documentId, documentPath) {\n _.forEach(_this.folders, function (folder) {\n _.forEach(folder.documents, function (document) {\n if (document.documentId === documentId && document.path === documentPath) {\n document.isFavourite = true;\n }\n });\n });\n _.forEach(_this.recentDocuments, function (document) {\n if (document.documentId === documentId && document.path === documentPath) {\n document.isFavourite = true;\n }\n });\n _this.setSharedDriveFavouriteValue(_this.sharedDrives.dropboxSharedDrive.folder, documentId, documentPath, true);\n _this.getFavourites();\n return _this.favouriteDocument(dataSource, documentId, documentPath);\n };\n this.setSharedDriveFavouriteValue = function (data, documentId, documentPath, value) {\n if (data) {\n _.forEach(data.documents, function (document) {\n if (document.documentId === documentId && document.path === documentPath) {\n document.isFavourite = value;\n }\n });\n var f = void 0;\n for (f in data.folders) {\n if (data.folders.hasOwnProperty(f)) {\n _.forEach(data.folders[f].documents, function (document) {\n if (document.documentId === documentId && document.path === documentPath) {\n document.isFavourite = value;\n }\n });\n _this.setSharedDriveFavouriteValue(data.folders[f], documentId, documentPath, value);\n }\n }\n }\n };\n this.getSelected = function () {\n var selected = [];\n _.forEach(_this.folders, function (folder) {\n _this.findSelected(folder.documents, selected);\n });\n _this.findSelected(_this.recentDocuments, selected);\n _this.findSelected(_this.favourites, selected);\n _this.getSharedDriveSelected(_this.sharedDrives.dropboxSharedDrive.folder, selected);\n return selected;\n };\n this.getSharedDriveSelected = function (data, selected) {\n if (!data) {\n return;\n }\n _this.findSelected(data.documents, selected);\n var f;\n for (f in data.folders) {\n if (data.folders.hasOwnProperty(f)) {\n _this.getSharedDriveSelected(data.folders[f], selected);\n }\n }\n };\n this.findSelected = function (documents, selected) {\n var selectedDocs = _.chain(documents)\n .filter({ selected: true })\n .value();\n _.forEach(selectedDocs, function (selectedDoc) {\n selected.push(selectedDoc);\n });\n };\n this.downloadFile = function (document) {\n var url = \"api/DocumentStorage/DownloadFile\";\n var expectedMediaType = \"application/octet-stream\";\n var requestData = {\n sharedDriveId: document.sharedDriveId,\n path: document.path,\n dataSource: document.dataSource\n };\n _this.fileDownloadSrv.downloadAndSave(url, requestData, document.name, expectedMediaType);\n };\n this.downloadEmploymentFile = function (documentType) {\n var url = \"api/Dashboard/DownloadEmploymentDocuments?documentType=\" + documentType;\n console.log(url);\n var expectedMediaType = \"application/octet-stream\";\n _this.fileDownloadSrv.downloadAndSave(url, null, documentType + '.pdf', expectedMediaType);\n };\n this.getThumbnail = function (document, silentMode) {\n return _this.$http.get('api/DocumentStorage/GetThumbnail?sharedDriveId=' + document.sharedDriveId + '&dataSource=' + document.dataSource + '&path=' + document.path, {\n silentMode: silentMode ? silentMode : false\n })\n .then(function (response) {\n return response.data;\n });\n };\n this.getFullSizedImage = function (document, silentMode) {\n return _this.$http.post('api/DocumentStorage/GetFullSizedImage', document, {\n silentMode: silentMode ? silentMode : false\n })\n .then(function (response) {\n return response.data;\n });\n };\n this.getSelectedDocumentZip = function () {\n var selected = _this.getSelected();\n if (selected.length > 0) {\n var url = \"api/DocumentStorage/GetZipDocuments\";\n var expectedMediaType = \"application/zip\";\n var requestData = selected;\n _this.fileDownloadSrv.downloadAndSave(url, requestData, \"Brookson.Documents.zip\", expectedMediaType);\n }\n };\n this.getSharedDrives = function () {\n return _this.$http.get('api/DocumentStorage/GetSharedDrives')\n .then(function (response) {\n _this.sharedDrives = response.data;\n return _this.sharedDrives;\n });\n };\n this.favouriteDocument = function (dataSource, documentId, documentPath) {\n var request = {\n dataSource: dataSource,\n documentId: documentId,\n documentPath: documentPath\n };\n return _this.$http.post('api/DocumentStorage/FavouriteDocument', request, {\n silentMode: true\n })\n .then(function (response) {\n return response.data;\n });\n };\n this.unfavouriteDocument = function (dataSource, documentId, documentPath) {\n var request = {\n dataSource: dataSource,\n documentId: documentId,\n documentPath: documentPath\n };\n return _this.$http.post('api/DocumentStorage/UnfavouriteDocument', request, {\n silentMode: true\n })\n .then(function (response) {\n return response.data;\n });\n };\n this.getSelectedPDF = function (id, path) {\n if (id) {\n var url = \"api/DocumentStorage/GetPDFDocument\";\n var expectedMediaType = \"application/pdf\";\n var requestData = {\n documentId: id,\n documentPath: path\n };\n return _this.fileDownloadSrv.download(url, requestData, \"Brookson.Documents.zip\", expectedMediaType)\n .then(function (response) {\n return response.data;\n });\n }\n };\n this.getFolders = function (silentMode) {\n return _this.$http.get('api/DocumentStorage/GetFolders', {\n silentMode: silentMode ? silentMode : false\n })\n .then(function (response) {\n if (response.data) {\n _this.folders.length = 0;\n _this.folders.push.apply(_this.folders, response.data.folders);\n _this.recentDocuments.length = 0;\n _this.recentDocuments.push.apply(_this.recentDocuments, response.data.recentDocuments);\n _this.folders = _.sortBy(_this.folders, function (folder) {\n return folder.name;\n });\n _this.getFolder();\n }\n return response.data;\n });\n };\n this.getDocumentStorageWidgetData = function (silentMode) {\n return _this.$http.get('api/DocumentStorage/GetDocumentStorageWidgetData', {\n silentMode: silentMode ? silentMode : false\n })\n .then(function (response) {\n if (response.data) {\n _this.recentDocuments.length = 0;\n _this.recentDocuments.push.apply(_this.recentDocuments, response.data.recentDocuments);\n _this.getFolder();\n }\n return response.data;\n });\n };\n this.setupWatched = function () {\n _this.$rootScope.$watch(function () {\n return _this.folderId;\n }, function () {\n _this.getFolder();\n _this.getFavourites();\n }, true);\n _this.$rootScope.$watch(function () {\n return _this.subFolderID;\n }, function () {\n _this.getFolder();\n _this.getFavourites();\n }, true);\n _this.$rootScope.$watch(function () {\n return _this.sharedDrives;\n }, function () {\n _this.getSharedDriveFolder();\n _this.getFavourites();\n }, true);\n };\n this.fileView = this.enums.FileView.DETAILED;\n this.currentCategory = this.enums.DocumentCategory.FOLDER;\n this.setupWatched();\n }\n DocumentStorageService.$inject = ['$rootScope', '$http', 'documentStorage.enums', 'brookson.file.download'];\n return DocumentStorageService;\n }());\n Shared.DocumentStorageService = DocumentStorageService;\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .service('documentStorageSrv', Shared.DocumentStorageService);\n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var DropboxService = /** @class */ (function () {\n function DropboxService($http, $q, $window, $timeout, flowFactory, authenticationSrv) {\n var _this = this;\n this.$http = $http;\n this.$q = $q;\n this.$window = $window;\n this.$timeout = $timeout;\n this.flowFactory = flowFactory;\n this.authenticationSrv = authenticationSrv;\n this.connect = function () {\n return _this.$http.get('api/Dropbox/Connect').then(function (response) {\n return response.data;\n });\n };\n this.disconnect = function (sharedDriveId) {\n return _this.$http.delete('api/Dropbox/Disconnect?id=' + sharedDriveId).then(function (response) {\n return response.data;\n });\n };\n this.createDropboxFileFactory = function () {\n var options = {\n target: '/api/Dropbox/UploadFile',\n permanentErrors: ['404', '500', '501'],\n headers: {\n \"__RequestVerificationToken\": _this.$window.brookson.antiForgeryToken,\n \"Accept\": \"application/json\"\n },\n testChunks: false,\n simultaneousUploads: 1,\n chunkSize: 9007199254740992\n };\n return _this.flowFactory.create(options);\n };\n this.flowFilesSubmitted = function (files, event, flow, path) {\n _this.authenticationSrv.refreshToken().then(function (data) {\n flow.opts.query.dropboxUploadPath = path;\n flow.opts.headers.Authorization = \"Bearer \" + data.access_token;\n flow.upload();\n });\n };\n this.flowComplete = function ($flow) {\n _this.$timeout(function (flow) {\n flow.files = [];\n }, 2000, true, $flow);\n };\n }\n DropboxService.$inject = ['$http', '$q', '$window', '$timeout', 'flowFactory', 'authenticationSrv'];\n return DropboxService;\n }());\n Shared.DropboxService = DropboxService;\n})(Shared || (Shared = {}));\nangular.module('app.shared').service('dropboxSrv', Shared.DropboxService);\nvar EmploymentStatus;\n(function (EmploymentStatus) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var EsaQuestionaireAnswer = /** @class */ (function () {\n function EsaQuestionaireAnswer() {\n this.sectionNumber = 0;\n }\n return EsaQuestionaireAnswer;\n }());\n EmploymentStatus.EsaQuestionaireAnswer = EsaQuestionaireAnswer;\n})(EmploymentStatus || (EmploymentStatus = {}));\nvar EmploymentStatus;\n(function (EmploymentStatus) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var ESAContractFile = /** @class */ (function () {\n function ESAContractFile() {\n // ESACONTRACTFILEID\n this.esaContractFileId = 0;\n // ESAQUESTIONAIREID\n this.esaQuestionaireId = 0;\n // CONTRACTFILE\n this.contractFile = null;\n // CONTRACTFILENAME\n this.contractFileName = null;\n // CONTRACTFILESIZE\n this.contractFileSize = 0;\n }\n return ESAContractFile;\n }());\n EmploymentStatus.ESAContractFile = ESAContractFile;\n})(EmploymentStatus || (EmploymentStatus = {}));\nvar EmploymentStatus;\n(function (EmploymentStatus) {\n var IndustrySector = /** @class */ (function () {\n function IndustrySector(name, value, group) {\n this.name = name;\n this.value = value;\n this.group = group;\n }\n return IndustrySector;\n }());\n EmploymentStatus.IndustrySector = IndustrySector;\n})(EmploymentStatus || (EmploymentStatus = {}));\n/// \n/// \n/// \nvar EmploymentStatus;\n(function (EmploymentStatus) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var EsaQuestionaire = /** @class */ (function () {\n /**\n *\n */\n function EsaQuestionaire(assignmentID) {\n // ESAQUESTIONAIREID\n this.esaQuestionaireId = 0;\n // REVIEWID\n this.reviewId = 0;\n // DATECREATED\n this.dateCreated = null;\n // VERSION\n this.version = 0;\n // EMPSTATUSHELPCONFIRM\n this.empStatusHelpConfirm = false;\n // ANSWERSTRUECONFIRM\n this.answersTrueConfirm = false;\n // CONTACTTIME\n this.contactTime = null;\n // ASSIGNMENTID\n this.assignmentId = null;\n // SAVED\n this.saved = false;\n // SITELOCATION\n this.siteLocation = null;\n // JOBTITLE\n this.jobTitle = null;\n // INDUSTRYSECTOR\n this.industrySector = null;\n // DATESUBMITTED\n this.dateSubmitted = null;\n // ESAQUESTIONAIREANSWERS\n this.esaQuestionaireAnswers = [];\n //ESACONTRACTFILE\n this.contractFileExists = false;\n //FLOW\n this.flow = null;\n //FLOWOPTIONS\n this.flowOptions = null;\n //ESACONTRACTFILE\n this.esaContractFile = null;\n //DELETE CONTRACT\n this.deleteContract = false;\n this.assignmentId = assignmentID;\n this.dateCreated = new Date();\n this.version = 3;\n this.dateSubmitted = new Date();\n }\n return EsaQuestionaire;\n }());\n EmploymentStatus.EsaQuestionaire = EsaQuestionaire;\n})(EmploymentStatus || (EmploymentStatus = {}));\nvar EmploymentStatus;\n(function (EmploymentStatus) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var EsaQuestionaireQuestions = /** @class */ (function () {\n function EsaQuestionaireQuestions() {\n // QUESTIONNUMBERID\n this.questionNumberID = 0;\n // QUESTIONNUMBER\n this.questionNumber = 0;\n // QUESTION\n this.question = null;\n }\n return EsaQuestionaireQuestions;\n }());\n EmploymentStatus.EsaQuestionaireQuestions = EsaQuestionaireQuestions;\n})(EmploymentStatus || (EmploymentStatus = {}));\n/// \nvar EmploymentStatus;\n(function (EmploymentStatus) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var EsaQuestionaireQuestions3 = /** @class */ (function (_super) {\n __extends(EsaQuestionaireQuestions3, _super);\n function EsaQuestionaireQuestions3() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n // GROUP\n _this.group = null;\n // SUPPLEMENTALQUESTION\n _this.supplementalQuestion = null;\n return _this;\n }\n return EsaQuestionaireQuestions3;\n }(EmploymentStatus.EsaQuestionaireQuestions));\n EmploymentStatus.EsaQuestionaireQuestions3 = EsaQuestionaireQuestions3;\n})(EmploymentStatus || (EmploymentStatus = {}));\nvar EmploymentStatus;\n(function (EmploymentStatus) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var MemberAdvisedStatus = /** @class */ (function () {\n function MemberAdvisedStatus() {\n // MEMBERADVISEDSTATUSID\n this.memberAdvisedStatusId = 0;\n // STATUS\n this.status = null;\n // ASSIGNMENTID\n this.assignmentId = null;\n // DATECREATED\n this.dateCreated = null;\n }\n return MemberAdvisedStatus;\n }());\n EmploymentStatus.MemberAdvisedStatus = MemberAdvisedStatus;\n})(EmploymentStatus || (EmploymentStatus = {}));\nvar EmploymentStatus;\n(function (EmploymentStatus) {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n // More info: http://frhagn.github.io/Typewriter/\n var AssignmentHeader = /** @class */ (function () {\n function AssignmentHeader() {\n this.diff = null;\n // AGENCY\n this.agency = null;\n // DATESTARTED\n this.dateStarted = null;\n // DATEENDED\n this.dateEnded = null;\n // ASSIGNMENTID\n this.assignmentId = null;\n // CLIENT\n this.client = null;\n // ASSIGNMENTNAME\n this.assignmentName = null;\n // INSTRUCTIONTEXT\n this.instructionText = null;\n // OVERALLSTATUSTEXT\n this.overallStatusText = null;\n // ASSIGNMENTADDRESS\n this.assignmentAddress = null;\n // ASSIGNMENTNOTES\n this.assignmentNotes = null;\n // CUSTOMER\n this.customer = null;\n // AGENCYREFERENCE\n this.agencyReference = null;\n // STATUSSTYLE\n this.ir35Status = null;\n }\n return AssignmentHeader;\n }());\n EmploymentStatus.AssignmentHeader = AssignmentHeader;\n var IR35Status = /** @class */ (function () {\n function IR35Status() {\n }\n return IR35Status;\n }());\n EmploymentStatus.IR35Status = IR35Status;\n})(EmploymentStatus || (EmploymentStatus = {}));\n/// \n/// \n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var GetQuestionnaireRequest = /** @class */ (function () {\n function GetQuestionnaireRequest(assignmentId, reviewId) {\n this.assignmentId = assignmentId;\n this.reviewId = reviewId;\n }\n return GetQuestionnaireRequest;\n }());\n Shared.GetQuestionnaireRequest = GetQuestionnaireRequest;\n var EmploymentStatusSrv = /** @class */ (function () {\n function EmploymentStatusSrv($http, $q, sharedConfig) {\n var _this = this;\n this.$http = $http;\n this.$q = $q;\n this.sharedConfig = sharedConfig;\n this.IR35Status_TaxedAsPAYE = { text: \"Taxed as PAYE (No Review)\", style: 'label-success' };\n this.IR35Status_TaxedAsSelfEmployed = { text: \"Taxed as Self Employed (No Review)\", style: 'label-success' };\n this.IR35Status_Caution = { text: \"Caution\", style: 'label-warning' };\n this.IR35Status_ActionRequired = { text: \"Action Required\", style: 'label-danger' };\n this.IR35Status_WithdrawnReview = { text: \"Review Incomplete\", style: 'label-warning' };\n this.IR35Status_AssessmentFormSubmit = { text: \"Assessment Form Submitted\", style: 'label-success' };\n this.IR35Status_AssessmentFormStarted = { text: \"Assessment Form Incomplete\", style: 'label-warning' };\n this.FinalOutcome_Captured = { text: \"Captured\", style: 'label-success' };\n this.FinalOutcome_NotCaptured = { text: \"Not Captured\", style: 'label-success' };\n this.FinalOutcome_Inconclusive = { text: \"Inconclusive\", style: 'label-warning' };\n this.FinalOutcome_UnderReview = { text: \"Under Review\", style: 'label-warning' };\n this.removeContractData = function (esaQuestionnaireId, silentMode) {\n var url = _this.serviceBase + 'api/IR35/RemoveContractData';\n return _this.$http.post(url, esaQuestionnaireId).then(function (response) { return response.data; });\n };\n this.saveIR35Status = function (memberStatus) {\n var url = _this.serviceBase + 'api/IR35/SaveIr35Status';\n return _this.$http.post(url, memberStatus).then(function (response) { return response.data; });\n };\n this.getIR35Status = function (assignmentId) {\n var url = _this.serviceBase + 'api/IR35/GetIr35Status';\n var config = { params: { assignmentId: assignmentId } };\n return _this.$http.get(url, config).then(function (response) { return response.data; });\n };\n this.CheckIR35AssessmentAllowed = function () {\n var url = _this.serviceBase + 'api/IR35/CheckIR35AssessmentAllowed';\n return _this.$http.get(url).then(function (response) { return response.data; });\n };\n this.serviceBase = sharedConfig.baseApiUrl;\n this.$http = $http;\n this.$q = $q;\n this.questions = [];\n }\n EmploymentStatusSrv.prototype.getAssignments = function (silentMode, cache) {\n if (cache === void 0) { cache = true; }\n var url = this.serviceBase + 'api/IR35/GetAssignments';\n var params = {\n cache: cache,\n silentMode: silentMode ? silentMode : false\n };\n return this.$http.get(url, params).then(function (response) { return response.data; });\n };\n EmploymentStatusSrv.prototype.getQuestions = function (silentMode) {\n var _this = this;\n var url = this.serviceBase + 'api/IR35/GetQuestionList';\n var params = {\n cache: true,\n silentMode: silentMode ? silentMode : false\n };\n var defer = this.$q.defer();\n if (!this.questions || !this.questions.length) {\n this.$http.get(url, params).then(function (response) {\n defer.resolve(response.data);\n _this.questions = response.data;\n });\n }\n else {\n defer.resolve(this.questions);\n }\n return defer.promise;\n };\n EmploymentStatusSrv.prototype.getQuestionnaire = function (assignmentId, reviewId) {\n var url = this.serviceBase + 'api/IR35/GetQuestionnaire';\n var config = { params: { assignmentId: assignmentId, reviewId: reviewId } };\n return this.$http.get(url, config).then(function (response) { return response.data; });\n };\n EmploymentStatusSrv.prototype.saveQuestionnaire = function (qnnaire) {\n var url = this.serviceBase + 'api/IR35/SaveQuestionnaire';\n var defer = this.$q.defer();\n this.$http.post(url, qnnaire).then(function (result) {\n defer.resolve(result.data);\n }).catch(function () {\n defer.reject();\n });\n return defer.promise;\n };\n EmploymentStatusSrv.prototype.getQuestionByQuestionNumber = function (questionNumber) {\n return _.filter(this.questions, { 'questionNumber': questionNumber });\n };\n EmploymentStatusSrv.prototype.getQuestionByQuestionNumberAndGroup = function (questionNumber, group) {\n return _.filter(this.questions, { 'questionNumber': questionNumber, 'group': group });\n };\n EmploymentStatusSrv.$inject = ['$http', '$q', 'shared.config'];\n return EmploymentStatusSrv;\n }());\n angular\n .module('app.shared')\n .service('employmentStatusSrv', EmploymentStatusSrv);\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n var FinancialCenterService = /** @class */ (function () {\n function FinancialCenterService($http, sharedConfig, dateUtils) {\n this.$http = $http;\n this.sharedConfig = sharedConfig;\n this.dateUtils = dateUtils;\n this.serviceBase = sharedConfig.baseApiUrl;\n }\n FinancialCenterService.prototype.getProfitAndLossSummary = function (startDate, endDate) {\n var url = this.serviceBase + \"api/FinancialCenter/GetProfitAndLossSummary\";\n var requestData = {\n startDate: this.dateUtils.convertToServerString(startDate),\n endDate: this.dateUtils.convertToServerString(endDate)\n };\n return this.$http.get(url, { params: requestData }).then(function (response) { return response.data; });\n };\n FinancialCenterService.$inject = [\"$http\", \"shared.config\", \"brookson.utilities.date\"];\n return FinancialCenterService;\n }());\n Shared.FinancialCenterService = FinancialCenterService;\n})(Shared || (Shared = {}));\nangular.module(\"app.shared\").service(\"financialCenterSrv\", Shared.FinancialCenterService);\n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var HolidaysSrv = /** @class */ (function () {\n function HolidaysSrv($http, dateUtils) {\n this.$http = $http;\n this.dateUtils = dateUtils;\n }\n HolidaysSrv.prototype.submitHolidayRequest = function (startDate, endDate, employeeName) {\n var url = \"api/Holiday/SubmitHolidayRequest\";\n var requestData = {\n startDate: this.dateUtils.convertToServerString(startDate),\n endDate: this.dateUtils.convertToServerString(endDate),\n employeeName: employeeName\n };\n return this.$http.get(url, { params: requestData }).then(function (response) { return response.data; });\n };\n HolidaysSrv.prototype.approveHolidayRequest = function (requestId) {\n var url = \"api/Holiday/ApproveHolidayRequest?requestId=\" + requestId;\n var config = {\n headers: {\n silentMode: false\n }\n };\n return this.$http.get(url, config).then(function (response) {\n return response.data;\n });\n };\n HolidaysSrv.prototype.rejectHolidayRequest = function (requestId, reason) {\n var url = \"api/Holiday/RejectHolidayRequest\";\n var requestData = {\n holidayRequestId: requestId,\n reason: reason\n };\n var config = {\n headers: {\n silentMode: false\n }\n };\n return this.$http.post(url, requestData, config).then(function (response) {\n return response.data;\n });\n };\n HolidaysSrv.prototype.getCompanyHolidays = function (startDate, endDate) {\n var url = \"api/Holiday/GetCompanyHolidays\";\n var requestData = {\n startDate: this.dateUtils.convertToServerString(startDate),\n endDate: this.dateUtils.convertToServerString(endDate)\n };\n return this.$http.get(url, { params: requestData }).then(function (response) { return response.data; });\n };\n HolidaysSrv.prototype.getCompanyHolidayRequests = function (startDate, endDate, status) {\n var url = \"api/Holiday/GetCompanyHolidayRequests\";\n var requestData = {\n startDate: startDate,\n endDate: endDate,\n status: status\n };\n var config = {\n headers: {\n silentMode: false\n }\n };\n return this.$http.post(url, requestData, config).then(function (response) {\n return response.data;\n });\n };\n HolidaysSrv.prototype.getUserHolidayRequests = function (startDate, endDate, status) {\n var url = \"api/Holiday/GetUserHolidayRequests\";\n var requestData = {\n startDate: startDate,\n endDate: endDate,\n status: status\n };\n var config = {\n headers: {\n silentMode: false\n }\n };\n return this.$http.post(url, requestData, config).then(function (response) {\n return response.data;\n });\n };\n HolidaysSrv.prototype.getBankHolidays = function (country, endDate, region, startDate) {\n throw new Error(\"Not implemented\");\n };\n HolidaysSrv.prototype.getRemainingHolidayAllowance = function () {\n var url = \"api/Holiday/GetRemainingHolidayTime\";\n return this.$http.get(url).then(function (response) {\n return response.data;\n });\n };\n HolidaysSrv.prototype.getEmployeeHolidayAllowance = function () {\n var url = \"api/Holiday/GetEmployeeHolidayAllowance\";\n return this.$http.get(url).then(function (response) {\n return response.data;\n });\n };\n HolidaysSrv.prototype.deleteHolidayRequest = function (holidayRequestId, employeeId) {\n var url = \"api/Holiday/DeleteHolidayRequest?holidayRequestId=\".concat(holidayRequestId, \"&employeeId=\").concat(employeeId);\n var config = {\n headers: {\n silentMode: false\n }\n };\n return this.$http.delete(url, config).then(function (response) {\n return response.data;\n }, function (error) {\n return false;\n });\n };\n HolidaysSrv.prototype.getStartOfHolidayYear = function () {\n var url = \"api/Holiday/GetStartOfHolidayYear\";\n return this.$http.get(url).then(function (response) {\n return response.data;\n });\n };\n HolidaysSrv.prototype.getNextHoliday = function () {\n var url = \"api/Holiday/GetNextHoliday\";\n return this.$http.get(url).then(function (response) {\n return response.data;\n });\n };\n HolidaysSrv.prototype.getCompanyActiveHolidayRequests = function () {\n var url = \"api/Holiday/GetCompanyActiveHolidayRequests\";\n var config = {\n headers: {\n silentMode: false\n }\n };\n return this.$http.get(url, config).then(function (response) {\n return response.data;\n });\n };\n HolidaysSrv.$inject = [\"$http\", \"brookson.utilities.date\"];\n return HolidaysSrv;\n }());\n Shared.HolidaysSrv = HolidaysSrv;\n})(Shared || (Shared = {}));\nangular.module(\"app.shared\").service(\"holidaysSrv\", Shared.HolidaysSrv);\n/// \n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var Invoicing;\n (function (Invoicing) {\n var InvoiceType;\n (function (InvoiceType) {\n InvoiceType[InvoiceType[\"any\"] = 0] = \"any\";\n InvoiceType[InvoiceType[\"salesLedger\"] = 1] = \"salesLedger\";\n InvoiceType[InvoiceType[\"invoicing\"] = 2] = \"invoicing\";\n InvoiceType[InvoiceType[\"receipts\"] = 3] = \"receipts\";\n InvoiceType[InvoiceType[\"credits\"] = 4] = \"credits\";\n })(InvoiceType = Invoicing.InvoiceType || (Invoicing.InvoiceType = {}));\n })(Invoicing = Shared.Invoicing || (Shared.Invoicing = {}));\n})(Shared || (Shared = {}));\n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var Invoicing;\n (function (Invoicing) {\n var TimesheetCompactUmbrella = /** @class */ (function () {\n function TimesheetCompactUmbrella() {\n }\n return TimesheetCompactUmbrella;\n }());\n Invoicing.TimesheetCompactUmbrella = TimesheetCompactUmbrella;\n })(Invoicing = Shared.Invoicing || (Shared.Invoicing = {}));\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n var Invoicing;\n (function (Invoicing) {\n var InvoiceUmbrellaCompact = /** @class */ (function () {\n function InvoiceUmbrellaCompact() {\n }\n return InvoiceUmbrellaCompact;\n }());\n Invoicing.InvoiceUmbrellaCompact = InvoiceUmbrellaCompact;\n })(Invoicing = Shared.Invoicing || (Shared.Invoicing = {}));\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n var Invoicing;\n (function (Invoicing) {\n var PaymentUmbrellaCompact = /** @class */ (function () {\n function PaymentUmbrellaCompact() {\n }\n return PaymentUmbrellaCompact;\n }());\n Invoicing.PaymentUmbrellaCompact = PaymentUmbrellaCompact;\n })(Invoicing = Shared.Invoicing || (Shared.Invoicing = {}));\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n var Invoicing;\n (function (Invoicing) {\n var PayslipUmbrellaCompact = /** @class */ (function () {\n function PayslipUmbrellaCompact() {\n }\n return PayslipUmbrellaCompact;\n }());\n Invoicing.PayslipUmbrellaCompact = PayslipUmbrellaCompact;\n })(Invoicing = Shared.Invoicing || (Shared.Invoicing = {}));\n})(Shared || (Shared = {}));\n/// \n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var Invoicing;\n (function (Invoicing) {\n var InvoicePreference = /** @class */ (function () {\n function InvoicePreference() {\n }\n return InvoicePreference;\n }());\n Invoicing.InvoicePreference = InvoicePreference;\n })(Invoicing = Shared.Invoicing || (Shared.Invoicing = {}));\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n var Invoicing;\n (function (Invoicing) {\n var FullInvoice = /** @class */ (function () {\n function FullInvoice() {\n }\n return FullInvoice;\n }());\n Invoicing.FullInvoice = FullInvoice;\n var FullInvoiceLine = /** @class */ (function () {\n function FullInvoiceLine() {\n }\n return FullInvoiceLine;\n }());\n Invoicing.FullInvoiceLine = FullInvoiceLine;\n var FullInvoiceAttachment = /** @class */ (function () {\n function FullInvoiceAttachment() {\n }\n return FullInvoiceAttachment;\n }());\n Invoicing.FullInvoiceAttachment = FullInvoiceAttachment;\n })(Invoicing = Shared.Invoicing || (Shared.Invoicing = {}));\n})(Shared || (Shared = {}));\n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var BrooksonInvoicingService = /** @class */ (function () {\n function BrooksonInvoicingService($http, sharedConfig) {\n var _this = this;\n this.$http = $http;\n this.sharedConfig = sharedConfig;\n this.init = function () {\n _this.serviceBase = _this.sharedConfig.baseApiUrl;\n };\n this.getInvoicesByType = function (pageSize, pageNo, invoiceType, ledgerStatus) {\n var requestData = {\n pageNo: pageNo,\n pageSize: pageSize,\n ledgerStatus: ledgerStatus,\n invoiceType: invoiceType\n };\n return _this.$http.post(_this.serviceBase + 'api/Invoicing/GetInvoices', requestData)\n .then(function (response) {\n return response.data;\n });\n };\n this.createInvoice = function (invoice) {\n var requestData = {\n invoice: invoice\n };\n return _this.$http.post(_this.serviceBase + 'api/Invoicing/CreateInvoice', requestData)\n .then(function (response) {\n return response.data;\n });\n };\n this.createInvoiceOverride = function (invoice) {\n var requestData = {\n invoice: invoice\n };\n return _this.$http.post(_this.serviceBase + 'api/Invoicing/CreateInvoiceOverride', requestData)\n .then(function (response) {\n return response.data;\n });\n };\n this.getInvoice = function (id) {\n return _this.$http.get(_this.serviceBase + 'api/Invoicing/GetDetailedInvoiceById/' + id.replace(\":\", '-'))\n .then(function (response) {\n return response.data;\n });\n };\n this.getInvoicingOverview = function () {\n return _this.$http.get(_this.serviceBase + 'api/Invoicing/GetInvoicingOverview', {\n silentMode: true\n })\n .then(function (response) {\n return response.data;\n });\n };\n this.getTimesheetUmbreallaOverview = function () {\n return _this.$http.get(_this.serviceBase + 'api/Invoicing/GetTimesheetUmbrellaCompact', {\n silentMode: true\n })\n .then(function (response) {\n return response.data;\n });\n };\n this.getInvoicingUmbrellaOverview = function () {\n return _this.$http.get(_this.serviceBase + 'api/Invoicing/GetInvoicingUmbrellaDashboard', {\n silentMode: true\n })\n .then(function (response) {\n return response.data;\n });\n };\n this.saveInvoice = function (invoice, silentMode) {\n var requestData = {\n invoice: invoice\n };\n return _this.$http.post('api/Invoicing/SaveInvoice', requestData, {\n silentMode: silentMode ? silentMode : false\n })\n .then(function (response) {\n return response.data;\n });\n };\n this.updateDefaultHoursPerDay = function (defaultHours) {\n return _this.$http.post('api/Invoicing/UpdateDefaultHoursPerDay', defaultHours).then(function (response) {\n return response.data;\n });\n };\n this.getSavedInvoice = function (invoiceId, silentMode) {\n return _this.$http.get(\"api/Invoicing/GetSavedInvoice/\".concat(invoiceId), {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n };\n this.getSavedInvoiceForCrediting = function (invoiceId, silentMode) {\n var id = invoiceId.replace(\":\", \"-\");\n return _this.$http.get(\"api/Invoicing/GetInvoiceForCrediting/\".concat(id), {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n return response.data;\n });\n };\n this.deleteSavedInvoice = function (invoiceId, silentMode) {\n return _this.$http.delete(\"api/Invoicing/DeleteSavedInvoice/\".concat(invoiceId), {\n silentMode: silentMode ? silentMode : false\n })\n .then(function (response) {\n return response.data;\n });\n };\n this.deleteSavedFullInvoice = function (invoiceId, silentMode) {\n return _this.$http.delete(\"api/Invoicing/DeleteSavedFullInvoice/\".concat(invoiceId), {\n silentMode: silentMode ? silentMode : false\n })\n .then(function (response) {\n return response.data;\n });\n };\n this.calculateTotals = function (invoice) {\n var gross = 0;\n var net = 0;\n for (var index in invoice.appliedRates) {\n if (invoice.appliedRates.hasOwnProperty(index)) {\n var rate = invoice.appliedRates[index];\n if (rate.amountGross) {\n gross += rate.amountGross;\n }\n if (rate.amountNet) {\n net += rate.amountNet;\n }\n }\n }\n gross += invoice.expenses ? invoice.expenses : 0;\n return {\n gross: gross,\n net: net\n };\n };\n this.hidePublicSectorModal = function (assignment) {\n return _this.$http.post(_this.serviceBase + \"api/Invoicing/HidePublicSectorModal\", assignment).then(function (response) { return response.data; });\n };\n this.creditInvoice = function (invoiceId, replacementInvoice) {\n var data = {\n InvoiceId: invoiceId,\n ReplacementInvoice: replacementInvoice\n };\n return _this.$http.post(_this.serviceBase + \"api/Invoicing/creditInvoice\", data).then(function (response) {\n return response.data;\n });\n };\n this.saveInvoicePreferences = function (invoicePreferences) {\n return _this.$http.post(_this.serviceBase + \"api/Invoicing/saveInvoicePreferences\", invoicePreferences).then(function (response) {\n return response.data;\n });\n };\n this.getCompanyInvoicePreferences = function () {\n return _this.$http.get(_this.serviceBase + \"api/Invoicing/getCompanyInvoicePreferences\").then(function (response) {\n return response.data;\n });\n };\n this.saveFullInvoice = function (fullinvoice) {\n return _this.$http.post(_this.serviceBase + \"api/Invoicing/saveFullInvoice\", fullinvoice).then(function (response) {\n return response.data;\n });\n };\n this.getFullInvoiceById = function (fullinvoiceId) {\n var model = {\n fullinvoiceId: fullinvoiceId\n };\n return _this.$http.post(_this.serviceBase + \"api/Invoicing/getFullInvoiceById\", model).then(function (response) {\n return response.data;\n });\n };\n this.getAttachmentsById = function (fullinvoiceId) {\n var model = {\n fullinvoiceId: fullinvoiceId\n };\n return _this.$http.post(_this.serviceBase + \"api/Invoicing/getAttachmentsById\", model).then(function (response) {\n return response.data;\n });\n };\n this.removeAttachmentById = function (fullInvoiceId, attachmentId, azureFilename) {\n var model = {\n fullinvoiceId: fullInvoiceId,\n attachmentId: attachmentId,\n azureFileName: azureFilename\n };\n return _this.$http.post(_this.serviceBase + \"api/Invoicing/removeAttachmentById\", model).then(function (response) {\n return response.data;\n });\n };\n this.getInvoicePdfSharedAccessSignatureUrl = function (invoiceNumber) {\n var model = {\n invoiceNumber: invoiceNumber\n };\n return _this.$http.post(_this.serviceBase + \"api/Invoicing/InvoicePdfSharedAccessSignatureUrl\", model).then(function (response) {\n return response.data;\n });\n };\n this.downloadInvoicePdf = function (invoiceNumber) {\n var model = {\n invoiceNumber: invoiceNumber\n };\n return _this.$http.post(_this.serviceBase + \"Invoicing/DownloadInvoicePdf\", model).then(function (response) {\n return response.data;\n });\n };\n this.getCurrentVatrate = function (vatBusPostingGroup, vatProdPostingGroup) {\n var model = {\n vatBusPostingGroup: vatBusPostingGroup,\n vatProdPostingGroup: vatProdPostingGroup\n };\n return _this.$http.post(_this.serviceBase + 'api/invoicing/getCurrentVatrate', model).then(function (response) {\n return response.data;\n });\n };\n this.determineVatStatusByPeriodEndDate = function (periodEndDate) {\n var model = {\n periodEndDate: periodEndDate\n };\n return _this.$http.post(_this.serviceBase + 'api/invoicing/determineVatStatusByPeriodEndDate', model).then(function (response) {\n return response.data;\n });\n };\n this.umbrellaCheck = function (companyRef) {\n var model = {\n CompanyRef: companyRef\n };\n return _this.$http.post(_this.serviceBase + 'api/invoicing/IsUmbrellaCompany', model).then(function (response) {\n return response.data;\n });\n };\n this.regenerateFullInvoicePdf = function (invoice) {\n return _this.$http.post(_this.serviceBase + 'api/invoicing/RegenerateFullInvoice', invoice).then(function (response) {\n return response.data;\n });\n };\n this.init();\n }\n BrooksonInvoicingService.$inject = ['$http', 'shared.config'];\n return BrooksonInvoicingService;\n }());\n Shared.BrooksonInvoicingService = BrooksonInvoicingService;\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .service('invoicingSrv', Shared.BrooksonInvoicingService);\n(function () {\n 'use strict';\n angular\n .module('app.shared')\n .service('loggerSrv', loggerSrv);\n loggerSrv.$inject = ['$injector', 'shared.config'];\n function loggerSrv($injector, sharedConfig) {\n // Service\n var service = {};\n // Data\n var serviceBase = sharedConfig.baseApiUrl;\n var $http;\n // Methods\n service.log = log;\n function log(level, title, data, cause) {\n $http = $http || $injector.get('$http');\n var request = {\n loggingLevel: level,\n url: location.href,\n title: title,\n data: data ? angular.toJson(data, true) : data,\n cause: cause\n };\n return $http.post(serviceBase + 'api/Logging/Log', request, {\n silentMode: true\n }).then(function (response) {\n return response.data;\n });\n }\n return service;\n }\n})();\nvar Shared;\n(function (Shared) {\n var BrooksonUmbrellaTrustModalService = /** @class */ (function () {\n function BrooksonUmbrellaTrustModalService($uibModal) {\n var _this = this;\n this.$uibModal = $uibModal;\n this.options = {\n animation: true,\n size: \"md\",\n template: \"
    \\n
    \\n

    Notice

    \\n
    \\n
    \\n
    \\n
    \\n

    Please ensure that you submit timesheets on the appropriate Trust timesheet portal, which you should have received an email activation for. Connect is for your records and reference only and not viewed by your Trust.

    \\n
    \\n
    \\n
    \\n
    \\n \\n
    \\n
    \",\n keyboard: false,\n controller: BrooksonUmbrellaTrustModalController,\n controllerAs: \"$ctrl\",\n backdrop: \"static\",\n windowClass: \"modal-umbrellaTrustModal\"\n };\n this.show = function () {\n return _this.$uibModal.open(_this.options);\n };\n }\n BrooksonUmbrellaTrustModalService.$inject = ['$uibModal'];\n return BrooksonUmbrellaTrustModalService;\n }());\n Shared.BrooksonUmbrellaTrustModalService = BrooksonUmbrellaTrustModalService;\n var BrooksonUmbrellaTrustModalController = /** @class */ (function () {\n function BrooksonUmbrellaTrustModalController($uibModalInstance) {\n var _this = this;\n this.$uibModalInstance = $uibModalInstance;\n this.close = function () {\n _this.$uibModalInstance.dismiss(\"cancel\");\n };\n }\n BrooksonUmbrellaTrustModalController.$inject = ['$uibModalInstance'];\n return BrooksonUmbrellaTrustModalController;\n }());\n})(Shared || (Shared = {}));\nangular\n .module(\"app.shared\")\n .service(\"umbrellaTrustModalService\", Shared.BrooksonUmbrellaTrustModalService);\nvar Shared;\n(function (Shared) {\n var openbankingWidget;\n (function (openbankingWidget) {\n var WidgetAccount = /** @class */ (function () {\n function WidgetAccount() {\n }\n return WidgetAccount;\n }());\n openbankingWidget.WidgetAccount = WidgetAccount;\n var accountType;\n (function (accountType) {\n accountType[accountType[\"Business\"] = 0] = \"Business\";\n accountType[accountType[\"Personal\"] = 1] = \"Personal\";\n accountType[accountType[\"DLA\"] = 2] = \"DLA\";\n })(accountType = openbankingWidget.accountType || (openbankingWidget.accountType = {}));\n var bankType;\n (function (bankType) {\n bankType[bankType[\"Current\"] = 0] = \"Current\";\n bankType[bankType[\"Deposit\"] = 1] = \"Deposit\";\n bankType[bankType[\"Credit_Card\"] = 2] = \"Credit_Card\";\n bankType[bankType[\"Deposit_Bond\"] = 3] = \"Deposit_Bond\";\n })(bankType = openbankingWidget.bankType || (openbankingWidget.bankType = {}));\n var ConsentStatus;\n (function (ConsentStatus) {\n ConsentStatus[ConsentStatus[\"ConsentError\"] = -3] = \"ConsentError\";\n ConsentStatus[ConsentStatus[\"AccessTokenError\"] = -2] = \"AccessTokenError\";\n ConsentStatus[ConsentStatus[\"NotConsented\"] = 0] = \"NotConsented\";\n ConsentStatus[ConsentStatus[\"AccessTokenPending\"] = 1] = \"AccessTokenPending\";\n ConsentStatus[ConsentStatus[\"AccessTokenReceived\"] = 2] = \"AccessTokenReceived\";\n ConsentStatus[ConsentStatus[\"BankAccountsReceived\"] = 3] = \"BankAccountsReceived\";\n ConsentStatus[ConsentStatus[\"BankBalancesReceived\"] = 4] = \"BankBalancesReceived\";\n ConsentStatus[ConsentStatus[\"BankTransactionsReceive\"] = 5] = \"BankTransactionsReceive\";\n })(ConsentStatus = openbankingWidget.ConsentStatus || (openbankingWidget.ConsentStatus = {}));\n })(openbankingWidget = Shared.openbankingWidget || (Shared.openbankingWidget = {}));\n})(Shared || (Shared = {}));\n/// \n/// \nvar Shared;\n(function (Shared) {\n var OpenbankingWidgetService = /** @class */ (function () {\n function OpenbankingWidgetService($http, $q) {\n var _this = this;\n this.$http = $http;\n this.$q = $q;\n this.getOpenBankingWidgetData = function (silentMode) {\n var deferred = _this.$q.defer();\n var url = \"api/ob/GetOpenBankingWidgetData\";\n _this.$http.get(url, { silentMode: silentMode ? silentMode : false })\n .then(function (response) {\n deferred.resolve(response.data);\n });\n return deferred.promise;\n };\n this.getGetBankStatementData = function (silentMode) {\n var deferred = _this.$q.defer();\n var url = \"api/ob/GetBankStatementData\";\n _this.$http.get(url, { silentMode: silentMode ? silentMode : false })\n .then(function (response) {\n deferred.resolve(response.data);\n });\n return deferred.promise;\n };\n this.disableWidgetButtons = function (disable, silentMode) {\n var deferred = _this.$q.defer();\n var url = \"api/ob/DisableWidgetButtons?disable=\" + disable;\n _this.$http.get(url, { silentMode: silentMode ? silentMode : false })\n .then(function (response) {\n deferred.resolve(response.data);\n });\n return deferred.promise;\n };\n }\n OpenbankingWidgetService.$inject = ['$http', '$q'];\n return OpenbankingWidgetService;\n }());\n Shared.OpenbankingWidgetService = OpenbankingWidgetService;\n})(Shared || (Shared = {}));\nangular.module(\"app.shared\").service('openbankingWidgetService', Shared.OpenbankingWidgetService);\nvar Shared;\n(function (Shared) {\n var UmbrellaTaxTracker = /** @class */ (function () {\n function UmbrellaTaxTracker() {\n }\n return UmbrellaTaxTracker;\n }());\n Shared.UmbrellaTaxTracker = UmbrellaTaxTracker;\n})(Shared || (Shared = {}));\n/// \n/// \n/// \n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var PersonalTaxTrackerService = /** @class */ (function () {\n function PersonalTaxTrackerService($http, $q, $timeout, personalTaxEnums, brooksonUtilitiesDate) {\n var _this = this;\n this.$http = $http;\n this.$q = $q;\n this.$timeout = $timeout;\n this.personalTaxEnums = personalTaxEnums;\n this.brooksonUtilitiesDate = brooksonUtilitiesDate;\n this.title = \"Personal Tax\";\n this.companyName = '';\n this.msnry = null;\n this.isEditingDividends = false;\n this.debounceLength = 1000;\n this.detailedViewToggles = {\n all: false,\n incomeSummary: false,\n forecastCalculations: false,\n tracker: false,\n liabilityDue: false\n };\n this.selectedTaxYearChanged = function (selectedTaxYear) {\n _this.clearData();\n _this.taxYearOffset = -1 * _this.availableTaxYears.indexOf(selectedTaxYear);\n return _this.getPersonalTaxTrackerDataByOffset(_this.taxYearOffset);\n };\n this.clearData = function () {\n _this.fixedTaxData = {};\n _this.forecastCalculations = {};\n _this.umbrellaTaxData = {};\n _this.userInputData = {\n // Income Calculations\n otherEmploymentIncome: 0,\n otherEmploymentIncomeYTD: 0,\n pensionIncome: 0,\n pensionIncomeYTD: 0,\n interestIncome: 0,\n interestIncomeYTD: 0,\n taxableBenefitsInKind: 0,\n taxableBenefitsInKindYTD: 0,\n dividends: 0,\n otherDividendIncome: 0,\n otherDividendIncomeYTD: 0,\n personalPensionPayments: 0,\n personalPensionPaymentsYTD: 0,\n childBenefitAmountReceived: 0,\n childBenefitAmountReceivedYTD: 0,\n studentLoanBalanceAtBeginningOfTaxYear: 0,\n studentLoanBalanceAtBeginningOfTaxYearYTD: 0,\n // Tax Payments\n taxAlreadyPaid: 0,\n paymentOnAccountPaidJanuary: 0,\n paymentOnAccountPaidJuly: 0\n };\n };\n this.roundedDecimal = function (value) {\n return _.round(value) / Math.pow(10, 2);\n };\n this.resetEditingDividends = function () {\n _this.isEditingDividends = false;\n _this.userInputData.dividends = 0;\n };\n this.personalTaxData = {\n umbrellaTaxTracker: {\n // payYear: number;\n // sumGrossPay: number;\n // sumPaye: number;\n payYear: function () {\n if (!_this.personalTaxData.umbrellaTaxTracker) {\n return 0;\n }\n return _this.personalTaxData.umbrellaTaxTracker.payYear();\n },\n sumGrossPay: function () {\n if (!_this.personalTaxData.umbrellaTaxTracker) {\n return 0;\n }\n return _this.personalTaxData.umbrellaTaxTracker.sumGrossPay();\n },\n sumPaye: function () {\n if (!_this.personalTaxData.umbrellaTaxTracker) {\n return 0;\n }\n return _this.personalTaxData.umbrellaTaxTracker.sumPaye();\n },\n },\n fixedTaxData: {\n grossPensionContribution: function () {\n // =L47/0.8\n return _this.userInputData.personalPensionPayments / 0.8;\n },\n basicRateThresholdPension: function () {\n return _this.personalTaxData.fixedTaxData.basicRateThreshold() + _this.personalTaxData.fixedTaxData.grossPensionContribution();\n },\n basicRateThresholdDividends: function () {\n return _this.personalTaxData.fixedTaxData.basicRateThresholdPension() - _this.personalTaxData.fixedTaxData.taxFreeDividendAllowance();\n },\n higherRateThresholdPension: function () {\n return _this.personalTaxData.fixedTaxData.higherRateThreshold() + _this.personalTaxData.fixedTaxData.grossPensionContribution();\n },\n higherRateThresholdDividends: function () {\n return _this.personalTaxData.fixedTaxData.higherRateThresholdPension() - _this.personalTaxData.fixedTaxData.taxFreeDividendAllowance();\n },\n higherRateAllowanceDividends: function () {\n return _this.personalTaxData.fixedTaxData.higherRateThresholdDividends() - _this.personalTaxData.fixedTaxData.basicRateThresholdDividends();\n },\n taxFreeDividendAllowance: function () {\n return _this.fixedTaxData.taxFreeDividendAllowance;\n },\n lowerRateDividendTaxRate: function () {\n return _this.fixedTaxData.lowerRateDividendTaxRate;\n },\n higherRateDividendTaxRate: function () {\n return _this.fixedTaxData.higherRateDividendTaxRate;\n },\n additionalRateDividendTaxRate: function () {\n return _this.fixedTaxData.additionalRateDividendTaxRate;\n },\n personalAllowance: function () {\n return _this.fixedTaxData.personalAllowance;\n },\n basicRateThreshold: function () {\n return _this.fixedTaxData.basicRateThreshold;\n },\n higherRateDividendThreshold: function () {\n return _this.personalTaxData.fixedTaxData.higherRateThresholdPension() - _this.personalTaxData.fixedTaxData.taxFreeDividendAllowance();\n },\n higherRateThreshold: function () {\n return _this.fixedTaxData.higherRateThreshold;\n },\n fullPersonalAllowanceUpperLimit: function () {\n return _this.fixedTaxData.fullPersonalAllowanceUpperLimit;\n },\n lowerRateIncomeTax: function () {\n return _this.fixedTaxData.lowerRateIncomeTax;\n },\n basicRateIncomeTax: function () {\n return _this.fixedTaxData.basicRateIncomeTax;\n },\n higherRateTax: function () {\n return _this.fixedTaxData.higherRateTax;\n },\n additionalRateTax: function () {\n return _this.fixedTaxData.additionalRateTax;\n },\n employmentIncomeStudentRepayThreshold: function () {\n return _this.fixedTaxData.employmentIncomeStudentRepayThreshold;\n },\n nonEmploymentIncomeStudentRepayThreshold: function () {\n return _this.fixedTaxData.nonEmploymentIncomeStudentRepayThreshold;\n },\n repaymentPercentage: function () {\n return _this.fixedTaxData.repaymentPercentage;\n },\n childBenefitTaxChargeThreshold: function () {\n return _this.fixedTaxData.childBenefitTaxChargeThreshold;\n },\n percentageIncrements: function () {\n return _this.fixedTaxData.percentageIncrements;\n }\n },\n forecastCalculations: {\n forecastTotal: function () {\n return _this.personalTaxData.forecastCalculations.confirmedAsDividends() +\n _this.personalTaxData.forecastCalculations.unconfirmedTransactionsWithShareholderSplit() +\n _this.personalTaxData.forecastCalculations.transactionsBeingProcessedWithShareholderSplit();\n },\n forecastPSCEmployment: function () {\n return _this.personalTaxData.forecastCalculations.pscEmployment() +\n _this.personalTaxData.forecastCalculations.feesRemainingForYear();\n },\n forecastPSCDividendIncome: function () {\n if (_this.userInputData.dividends > 0) {\n return _this.userInputData.dividends;\n }\n else {\n return _this.personalTaxData.forecastCalculations.forecastTotal() *\n (_this.personalTaxData.forecastCalculations.weeksYearToDateFromTaxStart() +\n _this.personalTaxData.forecastCalculations.weeksRemainingFromTaxStart()) /\n _this.personalTaxData.forecastCalculations.weeksYearToDateFromTaxStart();\n }\n },\n yearToDatePSCEmployment: function () {\n return _this.personalTaxData.forecastCalculations.pscEmployment();\n },\n yearToDatePSCDividendIncome: function () {\n return _this.personalTaxData.forecastCalculations.confirmedAsDividends() +\n _this.personalTaxData.forecastCalculations.unconfirmedTransactionsWithShareholderSplit() +\n _this.personalTaxData.forecastCalculations.transactionsBeingProcessedWithShareholderSplit();\n },\n monthsYearToDate: function () {\n return _this.forecastCalculations.monthsYearToDate;\n },\n monthsRemaining: function () {\n return _this.forecastCalculations.monthsRemaining;\n },\n weeksYearToDate: function () {\n return _this.forecastCalculations.weeksYearToDate;\n },\n weeksRemaining: function () {\n return _this.forecastCalculations.weeksRemaining;\n },\n weeksYearToDateFromTaxStart: function () {\n return _this.forecastCalculations.weeksYearToDateFromTaxStart;\n },\n weeksRemainingFromTaxStart: function () {\n return _this.forecastCalculations.weeksRemainingFromTaxStart;\n },\n pscEmployment: function () {\n return _this.forecastCalculations.pscEmployment;\n },\n currentDirectorsFeeWeekly: function () {\n return _this.forecastCalculations.currentDirectorsFeeWeekly < 0 ? 0 : _this.forecastCalculations.currentDirectorsFeeWeekly;\n },\n currentDirectorsFeeMonthly: function () {\n return _this.forecastCalculations.pscEmployment / _this.forecastCalculations.monthsYearToDate;\n },\n feesRemainingForYear: function () {\n //the weekly fee now accounts also for the months remaining for the current payroll period (this could do with changing to WeeksOrMonthsRemaining)\n return _this.personalTaxData.forecastCalculations.currentDirectorsFeeWeekly() *\n _this.personalTaxData.forecastCalculations.weeksRemaining();\n },\n shareholderSplit: function () {\n return _this.forecastCalculations.shareholderSplit;\n },\n confirmedAsDividends: function () {\n return _this.forecastCalculations.confirmedAsDividends;\n },\n unconfirmedTransactionsWithShareholderSplit: function () {\n return _this.forecastCalculations.unconfirmedTransactions * (_this.forecastCalculations.shareholderSplit / 100);\n },\n transactionsBeingProcessedWithShareholderSplit: function () {\n return _this.forecastCalculations.transactionsBeingProcessed * (_this.forecastCalculations.shareholderSplit / 100);\n },\n taxDeductedFromPSCIncome: function () {\n return _this.forecastCalculations.taxDeductedFromPSCIncome;\n }\n },\n incomeCalculations: {\n pscEmploymentIncome: {\n // K28\n yearToDate: function () {\n return _this.personalTaxData.forecastCalculations.yearToDatePSCEmployment();\n },\n // L28\n forecast: function () {\n return _this.personalTaxData.forecastCalculations.forecastPSCEmployment();\n }\n },\n nonDividendIncome: {\n // =K33+SUM(K34:K37)\n yearToDate: function () {\n return _this.personalTaxData.incomeCalculations.pscEmploymentIncome.yearToDate() +\n (_this.userInputData.otherEmploymentIncomeYTD +\n _this.userInputData.pensionIncomeYTD +\n _this.userInputData.interestIncomeYTD +\n _this.userInputData.taxableBenefitsInKindYTD);\n },\n // =L33+SUM(L34:L37)\n forecast: function () {\n return _this.personalTaxData.incomeCalculations.pscEmploymentIncome.forecast() +\n (_this.userInputData.otherEmploymentIncome +\n _this.userInputData.pensionIncome +\n _this.userInputData.interestIncome +\n _this.userInputData.taxableBenefitsInKind);\n }\n },\n pscDividendIncome: {\n // K40\n yearToDate: function () {\n return _this.personalTaxData.forecastCalculations.yearToDatePSCDividendIncome();\n },\n // L40\n forecast: function () {\n return _this.personalTaxData.forecastCalculations.forecastPSCDividendIncome();\n }\n },\n dividendIncome: {\n // K36\n yearToDate: function () {\n return _this.personalTaxData.incomeCalculations.pscDividendIncome.yearToDate() + _this.userInputData.otherDividendIncome;\n },\n // L36\n forecast: function () {\n return _this.personalTaxData.incomeCalculations.pscDividendIncome.forecast() + _this.userInputData.otherDividendIncome;\n }\n },\n grossTaxableIncome: {\n // K38\n yearToDate: function () {\n return _this.personalTaxData.incomeCalculations.nonDividendIncome.yearToDate() + _this.personalTaxData.incomeCalculations.dividendIncome.yearToDate();\n },\n // L38\n forecast: function () {\n return _this.personalTaxData.incomeCalculations.nonDividendIncome.forecast() + _this.personalTaxData.incomeCalculations.dividendIncome.forecast();\n }\n }\n },\n taxCalculationWorkings: {\n nonDividendIncome: {\n yearToDate: function () {\n if (!_this.umbrellaTaxTracker) {\n return _this.personalTaxData.incomeCalculations.nonDividendIncome.yearToDate();\n }\n return _this.personalTaxData.incomeCalculations.nonDividendIncome.yearToDate() + _this.umbrellaTaxTracker.sumGrossPay; // + this.personalTaxData.umbrellaTaxTracker.sumGrossPay();\n },\n forecast: function () {\n if (!_this.umbrellaTaxTracker) {\n return _this.personalTaxData.incomeCalculations.nonDividendIncome.forecast();\n }\n return _this.personalTaxData.incomeCalculations.nonDividendIncome.forecast() + _this.umbrellaTaxTracker.sumGrossPay; // + this.personalTaxData.umbrellaTaxTracker.sumGrossPay();\n }\n },\n dividends: {\n yearToDate: function () {\n return _this.personalTaxData.incomeCalculations.dividendIncome.yearToDate();\n },\n forecast: function () {\n return _this.personalTaxData.incomeCalculations.dividendIncome.forecast();\n }\n },\n grossTaxableIncome: {\n yearToDate: function () {\n return _this.personalTaxData.taxCalculationWorkings.nonDividendIncome.yearToDate() + _this.personalTaxData.incomeCalculations.dividendIncome.yearToDate();\n },\n forecast: function () {\n return _this.personalTaxData.incomeCalculations.nonDividendIncome.forecast() + _this.personalTaxData.incomeCalculations.dividendIncome.forecast();\n }\n },\n annualPersonalAllowance: {\n yearToDate: function () {\n return _this.personalTaxData.fixedTaxData.personalAllowance(); // =F10\n },\n forecast: function () {\n return _this.personalTaxData.fixedTaxData.personalAllowance(); // =F10\n }\n },\n fullPaUpperLimit: {\n yearToDate: function () {\n return _this.personalTaxData.fixedTaxData.fullPersonalAllowanceUpperLimit(); // =F20\n },\n forecast: function () {\n return _this.personalTaxData.fixedTaxData.fullPersonalAllowanceUpperLimit(); // F20\n }\n },\n grossIncomeAboveUpperLimit: {\n yearToDate: function () {\n return ((_this.personalTaxData.taxCalculationWorkings.grossTaxableIncome.yearToDate() - _this.personalTaxData.taxCalculationWorkings.fullPaUpperLimit.yearToDate()) > 0) ?\n (_this.personalTaxData.taxCalculationWorkings.grossTaxableIncome.yearToDate() - _this.personalTaxData.taxCalculationWorkings.fullPaUpperLimit.yearToDate())\n : 0; // =IF(K77-K76>0,K77-K76,0)\n },\n forecast: function () {\n return ((_this.personalTaxData.taxCalculationWorkings.grossTaxableIncome.forecast() - _this.personalTaxData.taxCalculationWorkings.fullPaUpperLimit.forecast()) > 0) ?\n (_this.personalTaxData.taxCalculationWorkings.grossTaxableIncome.forecast() - _this.personalTaxData.taxCalculationWorkings.fullPaUpperLimit.forecast())\n : 0; // =IF(L77-L76>0,L77-L76,0)\n }\n },\n reductionInPA: {\n yearToDate: function () {\n return _this.personalTaxData.taxCalculationWorkings.grossIncomeAboveUpperLimit.yearToDate() / 2 > _this.personalTaxData.taxCalculationWorkings.annualPersonalAllowance.yearToDate() ?\n _this.personalTaxData.taxCalculationWorkings.annualPersonalAllowance.yearToDate()\n : _this.personalTaxData.taxCalculationWorkings.grossIncomeAboveUpperLimit.yearToDate() / 2; // =IF(K78/2>K75,K75,K78/2)\n },\n forecast: function () {\n return _this.personalTaxData.taxCalculationWorkings.grossIncomeAboveUpperLimit.forecast() / 2 > _this.personalTaxData.taxCalculationWorkings.annualPersonalAllowance.forecast() ?\n _this.personalTaxData.taxCalculationWorkings.annualPersonalAllowance.forecast()\n : _this.personalTaxData.taxCalculationWorkings.grossIncomeAboveUpperLimit.forecast() / 2; // =IF(L78/2>L75,L75,L78/2)\n }\n },\n paAfterSalaryAndDividendIncome: {\n yearToDate: function () {\n return _this.personalTaxData.taxCalculationWorkings.annualPersonalAllowance.yearToDate() - _this.personalTaxData.taxCalculationWorkings.reductionInPA.yearToDate(); // =K75-K79\n },\n forecast: function () {\n return _this.personalTaxData.taxCalculationWorkings.annualPersonalAllowance.forecast() - _this.personalTaxData.taxCalculationWorkings.reductionInPA.forecast(); // =L75-L79\n }\n },\n personalAllowance: {\n yearToDate: function () {\n return _this.personalTaxData.taxCalculationWorkings.paAfterSalaryAndDividendIncome.yearToDate();\n },\n forecast: function () {\n return _this.personalTaxData.taxCalculationWorkings.paAfterSalaryAndDividendIncome.forecast();\n }\n },\n salaryWithinPA: {\n // =IF(K51>($K$87/12*L5),($K$87/12*L5),K51)\n yearToDate: function () {\n return _this.personalTaxData.taxCalculationWorkings.nonDividendIncome.yearToDate() > (_this.personalTaxData.taxCalculationWorkings.paAfterSalaryAndDividendIncome.yearToDate() / 12 * _this.personalTaxData.forecastCalculations.monthsYearToDate())\n ? (_this.personalTaxData.taxCalculationWorkings.paAfterSalaryAndDividendIncome.yearToDate() / 12 * _this.personalTaxData.forecastCalculations.monthsYearToDate())\n : _this.personalTaxData.taxCalculationWorkings.nonDividendIncome.yearToDate();\n },\n forecast: function () {\n return _this.personalTaxData.taxCalculationWorkings.nonDividendIncome.forecast() > _this.personalTaxData.taxCalculationWorkings.paAfterSalaryAndDividendIncome.forecast() ?\n _this.personalTaxData.taxCalculationWorkings.paAfterSalaryAndDividendIncome.forecast()\n : _this.personalTaxData.taxCalculationWorkings.nonDividendIncome.forecast(); // =IF(L50>L80,L80,L50)\n }\n },\n salaryAtBR: {\n yearToDate: function () {\n // =IF(K51-K57>($F$15/12*L5),($F$15/12*L5),K51-K57)\n return (_this.personalTaxData.taxCalculationWorkings.nonDividendIncome.yearToDate() - _this.personalTaxData.taxCalculationWorkings.salaryWithinPA.yearToDate()) > (_this.personalTaxData.fixedTaxData.basicRateThresholdPension() / 12 * _this.personalTaxData.forecastCalculations.monthsYearToDate()) ?\n (_this.personalTaxData.fixedTaxData.basicRateThresholdPension() / 12 * _this.personalTaxData.forecastCalculations.monthsYearToDate())\n : (_this.personalTaxData.taxCalculationWorkings.nonDividendIncome.yearToDate() - _this.personalTaxData.taxCalculationWorkings.salaryWithinPA.yearToDate());\n },\n forecast: function () {\n return (_this.personalTaxData.taxCalculationWorkings.nonDividendIncome.forecast() - _this.personalTaxData.taxCalculationWorkings.salaryWithinPA.forecast()) > _this.personalTaxData.fixedTaxData.basicRateThresholdPension() ?\n _this.personalTaxData.fixedTaxData.basicRateThresholdPension()\n : (_this.personalTaxData.taxCalculationWorkings.nonDividendIncome.forecast() - _this.personalTaxData.taxCalculationWorkings.salaryWithinPA.forecast());\n }\n },\n salaryAtHR: {\n yearToDate: function () {\n // =IF(K57-SUM(K63:K64)>($F$20/12*L6)-($F$16/12*L6),($F$20/12*L6)-SUM(K63:K64),K57-SUM(K63:K64))\n var k57 = _this.personalTaxData.taxCalculationWorkings.nonDividendIncome.yearToDate();\n var k63Sum = _this.personalTaxData.taxCalculationWorkings.salaryWithinPA.yearToDate() + _this.personalTaxData.taxCalculationWorkings.salaryAtBR.yearToDate();\n var f20 = _this.personalTaxData.fixedTaxData.higherRateThresholdPension() / 12 * _this.personalTaxData.forecastCalculations.monthsYearToDate();\n var f16 = _this.personalTaxData.fixedTaxData.basicRateThresholdPension() / 12 * _this.personalTaxData.forecastCalculations.monthsYearToDate();\n return k57 - k63Sum > f20 - f16\n ? f20 - k63Sum\n : k57 - k63Sum;\n },\n forecast: function () {\n // =IF(L51-SUM(L57:L58)>$F$19-$F$15,$F$19-SUM(L57:L58),L51-SUM(L57:L58))\n // SUM(L57:L58)\n var v1 = (_this.personalTaxData.taxCalculationWorkings.salaryWithinPA.forecast() + _this.personalTaxData.taxCalculationWorkings.salaryAtBR.forecast());\n var f19 = _this.personalTaxData.fixedTaxData.higherRateThresholdPension();\n var f15 = _this.personalTaxData.fixedTaxData.basicRateThresholdPension();\n var l51 = _this.personalTaxData.taxCalculationWorkings.nonDividendIncome.forecast();\n return (l51 - v1) > f19 - f15\n ? f19 - v1\n : l51 - v1;\n }\n },\n salaryAtAR: {\n yearToDate: function () {\n return _this.personalTaxData.taxCalculationWorkings.nonDividendIncome.yearToDate() - (_this.personalTaxData.taxCalculationWorkings.salaryWithinPA.yearToDate() + _this.personalTaxData.taxCalculationWorkings.salaryAtBR.yearToDate() + _this.personalTaxData.taxCalculationWorkings.salaryAtHR.yearToDate()); // =K50-SUM(K56:K58)\n },\n forecast: function () {\n return _this.personalTaxData.taxCalculationWorkings.nonDividendIncome.forecast() - (_this.personalTaxData.taxCalculationWorkings.salaryWithinPA.forecast() + _this.personalTaxData.taxCalculationWorkings.salaryAtBR.forecast() + _this.personalTaxData.taxCalculationWorkings.salaryAtHR.forecast()); // =L50-SUM(L56:L58)\n }\n },\n salaryAtBRTax: {\n yearToDate: function () {\n return _this.roundedDecimal((_this.personalTaxData.taxCalculationWorkings.salaryAtBR.yearToDate() * _this.personalTaxData.fixedTaxData.basicRateIncomeTax()));\n },\n forecast: function () {\n return _this.roundedDecimal((_this.personalTaxData.taxCalculationWorkings.salaryAtBR.forecast() * _this.personalTaxData.fixedTaxData.basicRateIncomeTax()));\n }\n },\n salaryAtHRTax: {\n yearToDate: function () {\n //=ROUND((K58*$F24),2)\n return _this.roundedDecimal(_this.personalTaxData.taxCalculationWorkings.salaryAtHR.yearToDate() * _this.personalTaxData.fixedTaxData.higherRateTax());\n },\n forecast: function () {\n //ROUND((L58*$F24),2)\n return _this.roundedDecimal(_this.personalTaxData.taxCalculationWorkings.salaryAtHR.forecast() * _this.personalTaxData.fixedTaxData.higherRateTax());\n }\n },\n salaryAtARTax: {\n yearToDate: function () {\n //=ROUND((K59*$F25),2)\n return _this.roundedDecimal(_this.personalTaxData.taxCalculationWorkings.salaryAtAR.yearToDate() * _this.personalTaxData.fixedTaxData.additionalRateTax());\n },\n forecast: function () {\n //ROUND((L59*$F25),2)\n return _this.roundedDecimal(_this.personalTaxData.taxCalculationWorkings.salaryAtAR.forecast() * _this.personalTaxData.fixedTaxData.additionalRateTax());\n }\n },\n totalGrossSalary: {\n yearToDate: function () {\n return _this.personalTaxData.taxCalculationWorkings.salaryWithinPA.yearToDate() + _this.personalTaxData.taxCalculationWorkings.salaryAtBR.yearToDate() + _this.personalTaxData.taxCalculationWorkings.salaryAtHR.yearToDate() + _this.personalTaxData.taxCalculationWorkings.salaryAtAR.yearToDate(); //=SUM(K56:K59)\n },\n forecast: function () {\n return _this.personalTaxData.taxCalculationWorkings.salaryWithinPA.forecast() + _this.personalTaxData.taxCalculationWorkings.salaryAtBR.forecast() + _this.personalTaxData.taxCalculationWorkings.salaryAtHR.forecast() + _this.personalTaxData.taxCalculationWorkings.salaryAtAR.forecast(); //=SUM(K56:K59)\n }\n },\n incomeTaxDueOnSalary: {\n yearToDate: function () {\n // =SUM(K69:K71)\n return (_this.personalTaxData.taxCalculationWorkings.salaryAtBRTax.yearToDate() + _this.personalTaxData.taxCalculationWorkings.salaryAtHRTax.yearToDate() + _this.personalTaxData.taxCalculationWorkings.salaryAtARTax.yearToDate());\n },\n forecast: function () {\n return (_this.personalTaxData.taxCalculationWorkings.salaryAtBR.forecast() * (_this.personalTaxData.fixedTaxData.basicRateIncomeTax() / 100))\n +\n (_this.personalTaxData.taxCalculationWorkings.salaryAtHR.forecast() * (_this.personalTaxData.fixedTaxData.higherRateTax() / 100))\n +\n (_this.personalTaxData.taxCalculationWorkings.salaryAtAR.forecast() * (_this.personalTaxData.fixedTaxData.additionalRateTax() / 100)); // =ROUND((L57*$F23)+(L58*$F24)+(L59*$F25),2)\n }\n },\n dividendsWithinPA: {\n yearToDate: function () {\n // =IF(K52<=($K$87/12*L5)-K57,K52,IF(K52>($K$87/12*L5)-K57,($K$87/12*L5)-K57,($K$87/12*L5)))\n //($K$87/12*L5)\n var v1 = (_this.personalTaxData.taxCalculationWorkings.paAfterSalaryAndDividendIncome.yearToDate() / 12 * _this.personalTaxData.forecastCalculations.monthsYearToDate());\n var k52 = _this.personalTaxData.taxCalculationWorkings.dividends.yearToDate();\n var k57 = _this.personalTaxData.taxCalculationWorkings.salaryWithinPA.yearToDate();\n return (k52 <= v1 - k57)\n ? k52\n : k52 > v1 - k57\n ? v1 - k57\n : v1;\n },\n forecast: function () {\n // =IF(L52<=L87-L57,L52,IF(L52>L87-L57,L87-L57,L87))\n var l52 = _this.personalTaxData.taxCalculationWorkings.dividends.forecast();\n var l87 = _this.personalTaxData.taxCalculationWorkings.paAfterSalaryAndDividendIncome.forecast();\n var l57 = _this.personalTaxData.taxCalculationWorkings.salaryWithinPA.forecast();\n return l52 <= (l87 - l57)\n ? l52\n : l52 > (l87 - l57)\n ? l87 - l57\n : l87;\n }\n },\n dividendsWithinTFDA: {\n yearToDate: function () {\n // =IF(K52-K68>($F$6/12*L5),($F$6/12*L5),K52-K68)\n // ($F$6/12*L5)\n var v1 = _this.personalTaxData.taxCalculationWorkings.dividends.yearToDate() - _this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.yearToDate();\n var f6 = (_this.personalTaxData.fixedTaxData.taxFreeDividendAllowance() / 12 * _this.personalTaxData.forecastCalculations.monthsYearToDate());\n return v1 > f6\n ? f6\n : v1;\n },\n forecast: function () {\n // =IF(L52-L68>$F$6,$F$6,L52-L68)\n var v1 = _this.personalTaxData.taxCalculationWorkings.dividends.forecast() - _this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.forecast();\n var f6 = _this.personalTaxData.fixedTaxData.taxFreeDividendAllowance();\n return v1 > f6 ? f6 : v1;\n }\n },\n dividendsAtBR: {\n yearToDate: function () {\n // =IF(K59>0,0,IF(K52-SUM(K68:K69)>=($F$15/12*L5)-K58-K69,IF((($F$15/12*L5)-K58-K69)<0,0,(($F$15/12*L5)-K58-K69)),IF((K52-SUM(K68:K69))<0,0,(K52-SUM(K68:K69)))))\n // K52-SUM(K68:K69)\n var v1 = (_this.personalTaxData.taxCalculationWorkings.dividends.yearToDate() - (_this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.yearToDate() + _this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.yearToDate()));\n // ($F$15/12*L5)-K58-K69\n var v2 = (_this.personalTaxData.fixedTaxData.basicRateThresholdPension() / 12 * _this.personalTaxData.forecastCalculations.monthsYearToDate()) - _this.personalTaxData.taxCalculationWorkings.salaryAtBR.yearToDate() - _this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.yearToDate();\n return _this.personalTaxData.taxCalculationWorkings.salaryAtHR.yearToDate() > 0\n ? 0\n : v1 >= v2\n ? v2 < 0\n ? 0\n : v2\n : v1 < 0\n ? 0\n : v1;\n },\n forecast: function () {\n // =IF(L59>0,0,IF(L52-SUM(L68:L69)>=$F$15-L58-L69,IF(($F$15-L58-L69)<0,0,($F$15-L58-L69)),IF((L52-SUM(L68:L69))<0,0,(L52-SUM(L68:L69)))))\n // L52-SUM(L68:L69)\n var v1 = (_this.personalTaxData.taxCalculationWorkings.dividends.forecast() - (_this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.forecast() + _this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.forecast()));\n // $F$15-L58-L69\n var v2 = (_this.personalTaxData.fixedTaxData.basicRateThresholdPension() - _this.personalTaxData.taxCalculationWorkings.salaryAtBR.forecast() - _this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.forecast());\n return _this.personalTaxData.taxCalculationWorkings.salaryAtHR.forecast() > 0\n ? 0\n : v1 >= v2\n ? v2 < 0\n ? 0\n : v2\n : v1 < 0\n ? 0\n : v1;\n }\n },\n dividendsAtHR: {\n yearToDate: function () {\n // =IF(K60>0,0,IF(K52-SUM(K68:K70)>=($F$19/12*L5)-SUM(K58:K59)-K69-K70,IF((($F$19/12*L5)-SUM(K58:K59)-SUM(K69:K70))<0,0,(($F$19/12*L5)-SUM(K58:K59)-SUM(K69:K70))),IF((K52-SUM(K68:K70))<0,0,(K52-SUM(K68:K70)))))\n // K52-SUM(K68:K70)\n var k52 = (_this.personalTaxData.taxCalculationWorkings.dividends.yearToDate() - (_this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.yearToDate() + _this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.yearToDate() + _this.personalTaxData.taxCalculationWorkings.dividendsAtBR.yearToDate()));\n // ($F$19/12*L5)-SUM(K58:K59)\n var f19 = (_this.personalTaxData.fixedTaxData.higherRateThresholdPension() / 12 * _this.personalTaxData.forecastCalculations.monthsYearToDate()) - (_this.personalTaxData.taxCalculationWorkings.salaryAtBR.yearToDate() +\n _this.personalTaxData.taxCalculationWorkings.salaryAtHR.yearToDate());\n // ($F$19/12*L5)-SUM(K58:K59)-SUM(K69:K70)\n var f19k68 = f19 - (_this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.yearToDate() + _this.personalTaxData.taxCalculationWorkings.dividendsAtBR.yearToDate());\n return _this.personalTaxData.taxCalculationWorkings.salaryAtAR.yearToDate() > 0\n ? 0\n : k52 >= f19 - _this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.yearToDate() - _this.personalTaxData.taxCalculationWorkings.dividendsAtBR.yearToDate()\n ? f19k68 < 0\n ? 0\n : f19k68\n : k52 < 0\n ? 0\n : k52;\n },\n forecast: function () {\n // =IF(L60>0,0,IF(L52-SUM(L68:L70)>=$F$19-SUM(L58:L59)-L69-L70,IF(($F$19-SUM(L58:L59)-SUM(L69:L70))<0,0,($F$19-SUM(L58:L59)-SUM(L69:L70))),IF((L52-SUM(L68:L70))<0,0,(L52-SUM(L68:L70)))))\n // L52-SUM(L68:L70)\n var k52 = (_this.personalTaxData.taxCalculationWorkings.dividends.forecast() - (_this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.forecast() + _this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.forecast() + _this.personalTaxData.taxCalculationWorkings.dividendsAtBR.forecast()));\n // $F$19-SUM(K58:K59)\n var f19 = _this.personalTaxData.fixedTaxData.higherRateThresholdPension() - (_this.personalTaxData.taxCalculationWorkings.salaryAtBR.forecast() +\n _this.personalTaxData.taxCalculationWorkings.salaryAtHR.forecast());\n // $F$19-SUM(K58:K59)-SUM(K69:K70)\n var f19k68 = f19 - (_this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.forecast() + _this.personalTaxData.taxCalculationWorkings.dividendsAtBR.forecast());\n return _this.personalTaxData.taxCalculationWorkings.salaryAtAR.forecast() > 0\n ? 0\n : k52 >= f19 - _this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.forecast() - _this.personalTaxData.taxCalculationWorkings.dividendsAtBR.forecast()\n ? f19k68 < 0\n ? 0\n : f19k68\n : k52 < 0\n ? 0\n : k52;\n }\n },\n dividendsAtAR: {\n yearToDate: function () {\n return _this.personalTaxData.taxCalculationWorkings.dividends.yearToDate() - (_this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.yearToDate() + _this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.yearToDate() + _this.personalTaxData.taxCalculationWorkings.dividendsAtBR.yearToDate() + _this.personalTaxData.taxCalculationWorkings.dividendsAtHR.yearToDate()); // =K51-SUM(K64:K67)\n },\n forecast: function () {\n return _this.personalTaxData.taxCalculationWorkings.dividends.forecast() - (_this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.forecast() + _this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.forecast() + _this.personalTaxData.taxCalculationWorkings.dividendsAtBR.forecast() + _this.personalTaxData.taxCalculationWorkings.dividendsAtHR.forecast()); // =K51-SUM(K64:K67) // =L51-SUM(L64:L67)\n }\n },\n totalDividends: {\n yearToDate: function () {\n return _this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.yearToDate() + _this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.yearToDate() + _this.personalTaxData.taxCalculationWorkings.dividendsAtBR.yearToDate() + _this.personalTaxData.taxCalculationWorkings.dividendsAtHR.yearToDate() + _this.personalTaxData.taxCalculationWorkings.dividendsAtAR.yearToDate(); // =SUM(K64:K68)\n },\n forecast: function () {\n return _this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.forecast() + _this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.forecast() + _this.personalTaxData.taxCalculationWorkings.dividendsAtBR.forecast() + _this.personalTaxData.taxCalculationWorkings.dividendsAtHR.forecast() + _this.personalTaxData.taxCalculationWorkings.dividendsAtAR.forecast(); // =SUM(L64:L68)\n }\n },\n dividendsAtBRTax: {\n yearToDate: function () {\n // ROUND((K69*$F7),2)\n return _this.roundedDecimal(_this.personalTaxData.taxCalculationWorkings.dividendsAtBR.yearToDate() * _this.personalTaxData.fixedTaxData.lowerRateDividendTaxRate());\n },\n forecast: function () {\n // =ROUND((L69*$F7),2)\n return _this.roundedDecimal(_this.personalTaxData.taxCalculationWorkings.dividendsAtBR.forecast() * _this.personalTaxData.fixedTaxData.lowerRateDividendTaxRate());\n }\n },\n dividendsAtHRTax: {\n yearToDate: function () {\n // ROUND((K70*$F8),2)\n return _this.roundedDecimal(_this.personalTaxData.taxCalculationWorkings.dividendsAtHR.yearToDate() * _this.personalTaxData.fixedTaxData.higherRateDividendTaxRate());\n },\n forecast: function () {\n //ROUND((L70*$F8),2)\n return _this.roundedDecimal(_this.personalTaxData.taxCalculationWorkings.dividendsAtHR.forecast() * _this.personalTaxData.fixedTaxData.higherRateDividendTaxRate());\n }\n },\n dividendsAtARTax: {\n yearToDate: function () {\n // ROUND((K71*$F9),2)\n return _this.roundedDecimal(_this.personalTaxData.taxCalculationWorkings.dividendsAtAR.yearToDate() * _this.personalTaxData.fixedTaxData.additionalRateDividendTaxRate());\n },\n forecast: function () {\n //ROUND((L71*$F9),2)\n return _this.roundedDecimal(_this.personalTaxData.taxCalculationWorkings.dividendsAtAR.forecast() * _this.personalTaxData.fixedTaxData.additionalRateDividendTaxRate());\n }\n },\n additionalTaxDueOnDividends: {\n yearToDate: function () {\n // =SUM(K80:K82)\n return (_this.personalTaxData.taxCalculationWorkings.dividendsAtBRTax.yearToDate() + _this.personalTaxData.taxCalculationWorkings.dividendsAtHRTax.yearToDate()\n + _this.personalTaxData.taxCalculationWorkings.dividendsAtARTax.yearToDate());\n },\n forecast: function () {\n // =SUM(L80:L82)\n return (_this.personalTaxData.taxCalculationWorkings.dividendsAtBRTax.forecast() +\n _this.personalTaxData.taxCalculationWorkings.dividendsAtHRTax.forecast() +\n _this.personalTaxData.taxCalculationWorkings.dividendsAtARTax.forecast());\n }\n },\n totalTaxDueAtSelfAssessment: {\n yearToDate: function () {\n return _this.personalTaxData.taxCalculationWorkings.incomeTaxDueOnSalary.yearToDate() + _this.personalTaxData.taxCalculationWorkings.additionalTaxDueOnDividends.yearToDate(); // =SUM(K62+K71)\n },\n forecast: function () {\n return _this.personalTaxData.taxCalculationWorkings.incomeTaxDueOnSalary.forecast() + _this.personalTaxData.taxCalculationWorkings.additionalTaxDueOnDividends.forecast(); // =SUM(L62+L71)\n }\n }\n },\n studentLoanRepayments: {\n earnedIncome: {\n yearToDate: function () {\n return _this.personalTaxData.taxCalculationWorkings.nonDividendIncome.yearToDate() - _this.userInputData.interestIncome; // =K56-K36\n },\n forecast: function () {\n return _this.personalTaxData.taxCalculationWorkings.nonDividendIncome.forecast() - _this.userInputData.interestIncome; // =L56-L36\n }\n },\n nonEarnedIncome: {\n yearToDate: function () {\n return _this.personalTaxData.taxCalculationWorkings.dividends.yearToDate() + _this.userInputData.interestIncome; // =K57+K36\n },\n forecast: function () {\n return _this.personalTaxData.taxCalculationWorkings.dividends.forecast() + _this.userInputData.interestIncome; // =L57+L36\n }\n },\n employmentIncomeStudentRepay: {\n yearToDate: function () {\n return _this.personalTaxData.studentLoanRepayments.earnedIncome.yearToDate();\n },\n forecast: function () {\n return _this.personalTaxData.studentLoanRepayments.earnedIncome.forecast();\n }\n },\n nonEmploymentIncomeStudentRepay: {\n yearToDate: function () {\n //=IF(K99<(F30/12*L6),0,K99)\n return _this.personalTaxData.studentLoanRepayments.nonEarnedIncome.yearToDate() < (_this.personalTaxData.fixedTaxData.nonEmploymentIncomeStudentRepayThreshold() / 12 * _this.personalTaxData.forecastCalculations.monthsRemaining())\n ? 0\n : _this.personalTaxData.studentLoanRepayments.nonEarnedIncome.yearToDate();\n },\n forecast: function () {\n // =IF(L99K49,K49,(K100+K101-(F29/12*L6))*F31))\n var k100K101 = ((_this.personalTaxData.studentLoanRepayments.employmentIncomeStudentRepay.yearToDate() + _this.personalTaxData.studentLoanRepayments.nonEmploymentIncomeStudentRepay.yearToDate()));\n var f29 = _this.personalTaxData.fixedTaxData.employmentIncomeStudentRepayThreshold() / 12 * _this.personalTaxData.forecastCalculations.monthsYearToDate();\n var f31 = _this.personalTaxData.fixedTaxData.repaymentPercentage();\n var k49 = _this.userInputData.studentLoanBalanceAtBeginningOfTaxYearYTD;\n return k100K101 < f29\n ? 0\n : (k100K101 - f29) * f31 > k49\n ? k49\n : (k100K101 - f29) * f31;\n },\n forecast: function () {\n // =IF((L100+L101)L49,L49,(L100+L101-F29)*F31))\n var l100 = _this.personalTaxData.studentLoanRepayments.employmentIncomeStudentRepay.forecast();\n var l101 = _this.personalTaxData.studentLoanRepayments.nonEmploymentIncomeStudentRepay.forecast();\n var f29 = _this.personalTaxData.fixedTaxData.employmentIncomeStudentRepayThreshold();\n var f31 = _this.personalTaxData.fixedTaxData.repaymentPercentage() / 100;\n var l49 = _this.userInputData.studentLoanBalanceAtBeginningOfTaxYear;\n return (l100 + l101) < f29\n ? 0\n : (l100 + l101 - f29) * f31 > l49\n ? l49\n : (l100 + l101 - f29) * f31;\n }\n }\n },\n childBenefitTaxCharge: {\n grossTaxableIncome: {\n yearToDate: function () {\n return _this.personalTaxData.taxCalculationWorkings.grossTaxableIncome.yearToDate(); // =K52\n },\n forecast: function () {\n return _this.personalTaxData.taxCalculationWorkings.grossTaxableIncome.forecast(); // =L52\n }\n },\n relativePercentageCharge: {\n yearToDate: function () {\n // =IF(K108>=(F33+F34*100),1,IF(K108= (_this.personalTaxData.fixedTaxData.childBenefitTaxChargeThreshold() + _this.personalTaxData.fixedTaxData.percentageIncrements() * 100)\n ? 1\n : _this.personalTaxData.childBenefitTaxCharge.grossTaxableIncome.yearToDate() < _this.personalTaxData.fixedTaxData.childBenefitTaxChargeThreshold() ?\n 0\n : (_this.personalTaxData.childBenefitTaxCharge.grossTaxableIncome.yearToDate() - _this.personalTaxData.fixedTaxData.childBenefitTaxChargeThreshold()) / _this.personalTaxData.fixedTaxData.percentageIncrements(); // =IF(K96>=($F32+$F33*100),1,IF(K96<$F32,0,(K96-$F32)/$F33/100))\n },\n forecast: function () {\n // =IF(L108>=(F33+F34*100),1,IF(L108=\n (_this.personalTaxData.fixedTaxData.childBenefitTaxChargeThreshold() + _this.personalTaxData.fixedTaxData.percentageIncrements() * 100)) {\n return 1;\n }\n else {\n if (_this.personalTaxData.childBenefitTaxCharge.grossTaxableIncome.forecast()\n <\n _this.personalTaxData.fixedTaxData.childBenefitTaxChargeThreshold()) {\n return 0;\n }\n else {\n return (_this.personalTaxData.childBenefitTaxCharge.grossTaxableIncome.forecast() - _this.personalTaxData.fixedTaxData.childBenefitTaxChargeThreshold())\n /\n _this.personalTaxData.fixedTaxData.percentageIncrements()\n /\n 100;\n }\n }\n }\n },\n childBenefitTaxCharge: {\n yearToDate: function () {\n return _this.personalTaxData.childBenefitTaxCharge.relativePercentageCharge.yearToDate() * _this.userInputData.childBenefitAmountReceivedYTD; //=K97*L42\n },\n forecast: function () {\n return _this.personalTaxData.childBenefitTaxCharge.relativePercentageCharge.forecast() * _this.userInputData.childBenefitAmountReceived; // =L97*L42\n }\n }\n },\n taxPayments: {\n totalIncomeTaxPayable: {\n yearToDate: function () {\n return _this.personalTaxData.taxCalculationWorkings.totalTaxDueAtSelfAssessment.yearToDate(); // K73\n },\n forecast: function () {\n return _this.personalTaxData.taxCalculationWorkings.totalTaxDueAtSelfAssessment.forecast(); // L73\n }\n },\n studentLoanPaymentDue: {\n yearToDate: function () {\n return _this.personalTaxData.studentLoanRepayments.studentPaymentAmount.yearToDate(); // K90\n },\n forecast: function () {\n return _this.personalTaxData.studentLoanRepayments.studentPaymentAmount.forecast(); // L102\n }\n },\n childBenefitTaxCharge: {\n yearToDate: function () {\n return _this.personalTaxData.childBenefitTaxCharge.childBenefitTaxCharge.yearToDate(); // K98\n },\n forecast: function () {\n return _this.personalTaxData.childBenefitTaxCharge.childBenefitTaxCharge.forecast(); // L98\n }\n },\n totalPayableOnSelfAssessment: {\n yearToDate: function () {\n // =K117+K118+K119\n return _this.personalTaxData.taxPayments.totalIncomeTaxPayable.yearToDate() +\n _this.personalTaxData.taxPayments.studentLoanPaymentDue.yearToDate() +\n _this.personalTaxData.taxPayments.childBenefitTaxCharge.yearToDate();\n },\n forecast: function () {\n // =L117+L118+L119\n return _this.personalTaxData.taxPayments.totalIncomeTaxPayable.forecast() +\n _this.personalTaxData.taxPayments.studentLoanPaymentDue.forecast() +\n _this.personalTaxData.taxPayments.childBenefitTaxCharge.forecast();\n }\n },\n paymentOnAccount: {\n yearToDate: function () {\n /*\n L126 : tax deducted from PSC income : this.personalTaxData.forecastCalculations.taxDeductedFromPSCIncome()\n L127 : tax already paid/deducted from income : this.userInputData.taxAlreadyPaid\n K118 : total income tax payable YTD : this.personalTaxData.taxPayments.totalIncomeTaxPayable.yearToDate()\n \n =IF((L126+L127)/K118>0.8,0,IF(K118>1000,K118/2,0))\n \n =IF(\n (L126 + L127)/K118>0.8,\n 0,\n IF(\n K118>1000,\n K118/2,\n 0\n )\n )\n */\n if ((_this.personalTaxData.forecastCalculations.taxDeductedFromPSCIncome() + _this.userInputData.taxAlreadyPaid) / _this.personalTaxData.taxPayments.totalIncomeTaxPayable.yearToDate() > 0.8) {\n return 0;\n }\n else {\n if (_this.personalTaxData.taxPayments.totalIncomeTaxPayable.yearToDate() > 1000) {\n return _this.personalTaxData.taxPayments.totalIncomeTaxPayable.yearToDate() / 2;\n }\n else {\n return 0;\n }\n }\n },\n forecast: function () {\n /*\n L117 : total income tax payable : this.personalTaxData.taxPayments.totalIncomeTaxPayable.forecast()\n L119 : child benefit tax charge : this.personalTaxData.taxPayments.childBenefitTaxCharge.forecast()\n L125 : tax deducted from PSC income : this.personalTaxData.forecastCalculations.taxDeductedFromPSCIncome()\n L126 : tax already paid/deducted from income : this.userInputData.taxAlreadyPaid\n \n =IF(L126/L117>0.8,0,IF(L117+L119-L125-L126>1000,(L117+L119-L125-L126)/2,0))\n \n =IF(\n L126/L117>0.8,\n 0,\n IF(\n L117+L119-L125-L126>1000,\n (L117+L119-L125-L126)/2,\n 0\n )\n )\n */\n if ((_this.userInputData.taxAlreadyPaid / _this.personalTaxData.taxPayments.totalIncomeTaxPayable.forecast()) > 0.8) {\n return 0;\n }\n else {\n if ((_this.personalTaxData.taxPayments.totalIncomeTaxPayable.forecast() + _this.personalTaxData.taxPayments.childBenefitTaxCharge.forecast() - _this.personalTaxData.forecastCalculations.taxDeductedFromPSCIncome() - _this.userInputData.taxAlreadyPaid) > 1000) {\n return (_this.personalTaxData.taxPayments.totalIncomeTaxPayable.forecast() + _this.personalTaxData.taxPayments.childBenefitTaxCharge.forecast() - _this.personalTaxData.forecastCalculations.taxDeductedFromPSCIncome() - _this.userInputData.taxAlreadyPaid) / 2;\n }\n else {\n return 0;\n }\n }\n }\n },\n totalTaxPayments: function () {\n // =SUM(L125:L128)\n return _this.personalTaxData.forecastCalculations.taxDeductedFromPSCIncome() +\n _this.userInputData.taxAlreadyPaid +\n _this.userInputData.paymentOnAccountPaidJanuary +\n _this.userInputData.paymentOnAccountPaidJuly;\n }\n },\n taxBandCapacity: {\n personalAllowance: {\n yearToDate: function () {\n // =(K92*L6/12)-K62-K73\n return (_this.personalTaxData.taxCalculationWorkings.paAfterSalaryAndDividendIncome.yearToDate() *\n _this.personalTaxData.forecastCalculations.monthsYearToDate() / 12) -\n _this.personalTaxData.taxCalculationWorkings.salaryWithinPA.yearToDate() -\n _this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.yearToDate();\n },\n forecast: function () {\n return _this.personalTaxData.taxCalculationWorkings.paAfterSalaryAndDividendIncome.forecast() - _this.personalTaxData.taxCalculationWorkings.salaryWithinPA.forecast() - _this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.forecast(); // =L80-L56-L64\n }\n },\n dividendAllowance: {\n yearToDate: function () {\n // =if(($F$7*L6/12)-K74<0,0,($F$7*L6/12)-K74)\n var sum = _this.personalTaxData.fixedTaxData.taxFreeDividendAllowance() *\n _this.personalTaxData.forecastCalculations.monthsYearToDate() / 12 -\n _this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.yearToDate();\n return sum < 0\n ? 0\n : sum;\n },\n forecast: function () {\n return _this.personalTaxData.fixedTaxData.taxFreeDividendAllowance() - _this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.forecast(); // =$F$6-L65\n }\n },\n basicRate7: {\n yearToDate: function () {\n // =IF((F16*L6/12)-(F7*L6/12)-K63-K75<0,0,(F16*L6/12)-(F7*L6/12)-K63-K75)\n var sum = (_this.personalTaxData.fixedTaxData.basicRateThresholdPension() * // F16\n _this.personalTaxData.forecastCalculations.monthsYearToDate() / 12) - // L6\n (_this.personalTaxData.fixedTaxData.taxFreeDividendAllowance() * // F7\n _this.personalTaxData.forecastCalculations.monthsYearToDate() / 12) - // L6\n _this.personalTaxData.taxCalculationWorkings.salaryAtBR.yearToDate() - // K63\n _this.personalTaxData.taxCalculationWorkings.dividendsAtBR.yearToDate(); // K75\n return (sum < 0) ? 0 : sum;\n },\n forecast: function () {\n // =IF(F16-F7-L63-L74-L75<0, 0, F16-F7-L63-L74-L75)\n var sum = _this.personalTaxData.fixedTaxData.basicRateThresholdPension() - // F16\n _this.personalTaxData.fixedTaxData.taxFreeDividendAllowance() - // F7\n _this.personalTaxData.taxCalculationWorkings.salaryAtBR.forecast() - // L63\n _this.personalTaxData.taxCalculationWorkings.dividendsAtBR.forecast(); // L75\n return (sum < 0) ? 0 : sum;\n }\n }\n }\n };\n // Widget Data\n this.incomeSummaryWidgetData = {\n hasUmbrella: function () {\n return _this.hasUmbrella;\n },\n directorsFees: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K28\n return _this.personalTaxData.incomeCalculations.pscEmploymentIncome.yearToDate();\n }\n else {\n // L28\n return _this.personalTaxData.incomeCalculations.pscEmploymentIncome.forecast();\n }\n },\n grossSalaryFromUmbrella: function () {\n if (_this.umbrellaTaxTracker) {\n return _this.umbrellaTaxTracker.sumGrossPay;\n }\n return 0; //this.personalTaxData.umbrellaTaxTracker.sumGrossPay(); \n },\n nonDividendIncome: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n return (_this.incomeSummaryWidgetData.directorsFees() +\n _this.incomeSummaryWidgetData.grossSalaryFromUmbrella() +\n _this.userInputData.otherEmploymentIncomeYTD +\n _this.userInputData.pensionIncomeYTD +\n _this.userInputData.interestIncomeYTD +\n _this.userInputData.taxableBenefitsInKindYTD);\n }\n else {\n // E9:E12\n return (_this.incomeSummaryWidgetData.directorsFees() +\n _this.incomeSummaryWidgetData.grossSalaryFromUmbrella() +\n _this.userInputData.otherEmploymentIncome +\n _this.userInputData.pensionIncome +\n _this.userInputData.interestIncome +\n _this.userInputData.taxableBenefitsInKind);\n }\n },\n dividends: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n return _this.personalTaxData.incomeCalculations.pscDividendIncome.yearToDate();\n }\n else {\n // L40\n return _this.personalTaxData.incomeCalculations.pscDividendIncome.forecast();\n }\n },\n dividendIncome: function () {\n // F16+F17\n return (_this.incomeSummaryWidgetData.dividends() +\n _this.userInputData.otherDividendIncome);\n },\n totalIncome: function () {\n // F14+F18\n return (_this.incomeSummaryWidgetData.nonDividendIncome() +\n _this.incomeSummaryWidgetData.dividendIncome());\n }\n };\n this.taxTrackerWidgetData = {\n nonDividendIncome: {\n personalAllowance: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K56\n return _this.personalTaxData.taxCalculationWorkings.salaryWithinPA.yearToDate();\n }\n else {\n // L56\n return _this.personalTaxData.taxCalculationWorkings.salaryWithinPA.forecast();\n }\n },\n basicRate: {\n income: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K57\n return _this.personalTaxData.taxCalculationWorkings.salaryAtBR.yearToDate();\n }\n else {\n // L57\n return _this.personalTaxData.taxCalculationWorkings.salaryAtBR.forecast();\n }\n },\n tax: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K62\n return _this.personalTaxData.taxCalculationWorkings.salaryAtBRTax.yearToDate();\n }\n else {\n // L62\n return _this.personalTaxData.taxCalculationWorkings.salaryAtBRTax.forecast();\n }\n }\n },\n higherRate: {\n income: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K58\n return _this.personalTaxData.taxCalculationWorkings.salaryAtHR.yearToDate();\n }\n else {\n // L58\n return _this.personalTaxData.taxCalculationWorkings.salaryAtHR.forecast();\n }\n },\n tax: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K63\n return _this.personalTaxData.taxCalculationWorkings.salaryAtHRTax.yearToDate();\n }\n else {\n // L63\n return _this.personalTaxData.taxCalculationWorkings.salaryAtHRTax.forecast();\n }\n }\n },\n additionalRate: {\n income: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K59\n return _this.personalTaxData.taxCalculationWorkings.salaryAtAR.yearToDate();\n }\n else {\n // L59\n return _this.personalTaxData.taxCalculationWorkings.salaryAtAR.forecast();\n }\n },\n tax: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K64\n return _this.personalTaxData.taxCalculationWorkings.salaryAtARTax.yearToDate();\n }\n else {\n // L64\n return _this.personalTaxData.taxCalculationWorkings.salaryAtARTax.forecast();\n }\n }\n },\n totalNonDividendIncome: {\n income: function () {\n // K10:K13\n return (_this.taxTrackerWidgetData.nonDividendIncome.personalAllowance() +\n _this.taxTrackerWidgetData.nonDividendIncome.basicRate.income() +\n _this.taxTrackerWidgetData.nonDividendIncome.higherRate.income() +\n _this.taxTrackerWidgetData.nonDividendIncome.additionalRate.income());\n },\n tax: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K71\n return _this.personalTaxData.taxCalculationWorkings.incomeTaxDueOnSalary.yearToDate();\n }\n else {\n // L71\n return _this.personalTaxData.taxCalculationWorkings.incomeTaxDueOnSalary.forecast();\n }\n }\n }\n },\n dividendIncome: {\n personalAllowance: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K64\n return _this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.yearToDate();\n }\n else {\n // L64\n return _this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.forecast();\n }\n },\n dividendAllowance: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K65\n return _this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.yearToDate();\n }\n else {\n // L65\n return _this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.forecast();\n }\n },\n basicRate: {\n income: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K66\n return _this.personalTaxData.taxCalculationWorkings.dividendsAtBR.yearToDate();\n }\n else {\n // L66\n return _this.personalTaxData.taxCalculationWorkings.dividendsAtBR.forecast();\n }\n },\n tax: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K74\n return _this.personalTaxData.taxCalculationWorkings.dividendsAtBRTax.yearToDate();\n }\n else {\n // L74\n return _this.personalTaxData.taxCalculationWorkings.dividendsAtBRTax.forecast();\n }\n }\n },\n higherRate: {\n income: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K67\n return _this.personalTaxData.taxCalculationWorkings.dividendsAtHR.yearToDate();\n }\n else {\n // L67\n return _this.personalTaxData.taxCalculationWorkings.dividendsAtHR.forecast();\n }\n },\n tax: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K75\n return _this.personalTaxData.taxCalculationWorkings.dividendsAtHRTax.yearToDate();\n }\n else {\n // L75\n return _this.personalTaxData.taxCalculationWorkings.dividendsAtHRTax.forecast();\n }\n }\n },\n taxableDividends: {\n income: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K68\n return _this.personalTaxData.taxCalculationWorkings.dividendsAtAR.yearToDate();\n }\n else {\n // L68\n return _this.personalTaxData.taxCalculationWorkings.dividendsAtAR.forecast();\n }\n },\n tax: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K76\n return _this.personalTaxData.taxCalculationWorkings.dividendsAtARTax.yearToDate();\n }\n else {\n // L76\n return _this.personalTaxData.taxCalculationWorkings.dividendsAtARTax.forecast();\n }\n }\n },\n totalDividendIncome: {\n income: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n return _this.personalTaxData.taxCalculationWorkings.totalDividends.yearToDate();\n }\n else {\n return _this.personalTaxData.taxCalculationWorkings.totalDividends.forecast();\n }\n },\n tax: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K77\n return _this.personalTaxData.taxCalculationWorkings.additionalTaxDueOnDividends.yearToDate();\n }\n else {\n // L77\n return _this.personalTaxData.taxCalculationWorkings.additionalTaxDueOnDividends.forecast();\n }\n }\n }\n },\n totalIncome: {\n income: function () {\n // K22+K14\n return (_this.taxTrackerWidgetData.nonDividendIncome.totalNonDividendIncome.income() +\n _this.taxTrackerWidgetData.dividendIncome.totalDividendIncome.income());\n },\n tax: function () {\n // L79\n return _this.personalTaxData.taxCalculationWorkings.totalTaxDueAtSelfAssessment.forecast();\n }\n },\n incomeLeftInEachTaxBand: {\n personalAllowance: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n return _this.personalTaxData.taxBandCapacity.personalAllowance.yearToDate();\n }\n else {\n return _this.personalTaxData.taxBandCapacity.personalAllowance.forecast();\n }\n },\n dividendIncome: {\n dividendAllowance: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K129\n return _this.personalTaxData.taxBandCapacity.dividendAllowance.yearToDate();\n }\n else {\n // L129\n return _this.personalTaxData.taxBandCapacity.dividendAllowance.forecast();\n }\n },\n basicRate: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K130\n return _this.personalTaxData.taxBandCapacity.basicRate7.yearToDate();\n }\n else {\n // L130\n return _this.personalTaxData.taxBandCapacity.basicRate7.forecast();\n }\n },\n higherRate: function () {\n return _this.taxTrackerWidgetData.incomeLeftInEachTaxBand.personalAllowance() + _this.taxTrackerWidgetData.incomeLeftInEachTaxBand.dividendIncome.dividendAllowance() + _this.taxTrackerWidgetData.incomeLeftInEachTaxBand.dividendIncome.basicRate();\n }\n },\n incomeAvailableBeforeHigherRateTax: function () {\n return _this.taxTrackerWidgetData.incomeLeftInEachTaxBand.personalAllowance() + _this.taxTrackerWidgetData.incomeLeftInEachTaxBand.dividendIncome.dividendAllowance() + _this.taxTrackerWidgetData.incomeLeftInEachTaxBand.dividendIncome.basicRate();\n }\n }\n };\n this.taxLiabilityDueWidgetData = {\n taxDeductedUmbrellaEarnings: function () {\n if (_this.umbrellaTaxTracker) {\n return _this.umbrellaTaxTracker.sumPaye;\n }\n return 0;\n },\n totalTaxPayable: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K105\n return _this.personalTaxData.taxCalculationWorkings.totalTaxDueAtSelfAssessment.yearToDate();\n }\n else {\n // L105\n return _this.personalTaxData.taxCalculationWorkings.totalTaxDueAtSelfAssessment.forecast();\n }\n },\n studentLoanPaymentDue: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K106\n return _this.personalTaxData.taxPayments.studentLoanPaymentDue.yearToDate();\n }\n else {\n // L106\n return _this.personalTaxData.taxPayments.studentLoanPaymentDue.forecast();\n }\n },\n childBenefitTaxCharge: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K107\n return _this.personalTaxData.taxPayments.childBenefitTaxCharge.yearToDate();\n }\n else {\n // L107\n return _this.personalTaxData.taxPayments.childBenefitTaxCharge.forecast();\n }\n },\n taxBillForThisYear: function () {\n // SUM(E30:E32)\n return _this.taxLiabilityDueWidgetData.totalTaxPayable() + _this.taxLiabilityDueWidgetData.studentLoanPaymentDue() + _this.taxLiabilityDueWidgetData.childBenefitTaxCharge();\n },\n taxDeductedFromDirectorsFees: function () {\n // L113\n return _this.personalTaxData.forecastCalculations.taxDeductedFromPSCIncome();\n },\n taxAlreadyPaid: function () {\n // L114\n return _this.userInputData.taxAlreadyPaid;\n },\n paymentsOnAccountPaidforJan: function () {\n // L115\n return _this.userInputData.paymentOnAccountPaidJanuary;\n },\n paymentOnAccountPaidForJuly: function () {\n // L116\n return _this.userInputData.paymentOnAccountPaidJuly;\n },\n paymentsMadeAgainstTaxBill: function () {\n // =SUM(F37:F40)\n return _this.taxLiabilityDueWidgetData.taxDeductedFromDirectorsFees() + _this.userInputData.taxAlreadyPaid + _this.userInputData.paymentOnAccountPaidJanuary + _this.userInputData.paymentOnAccountPaidJuly;\n },\n balancingPaymentDueJan: function () {\n // =E33-E39\n return _this.taxLiabilityDueWidgetData.taxBillForThisYear() - _this.taxLiabilityDueWidgetData.paymentOnAccountPaidForJuly() - _this.taxLiabilityDueWidgetData.paymentsOnAccountPaidforJan() - _this.taxLiabilityDueWidgetData.taxAlreadyPaid() - _this.taxLiabilityDueWidgetData.taxDeductedFromDirectorsFees() - _this.taxLiabilityDueWidgetData.taxDeductedUmbrellaEarnings();\n },\n unpaidTaxForTaxYear: function () {\n return _this.taxLiabilityDueWidgetData.paymentsMadeAgainstTaxBill() - _this.taxLiabilityDueWidgetData.balancingPaymentDueJan() - _this.taxLiabilityDueWidgetData.paymentOnAccountPaidForJuly();\n },\n paymentOnAccountDueJan: function () {\n return _this.taxLiabilityDueWidgetData.balancingPaymentDueJan() + _this.taxLiabilityDueWidgetData.paymentOnAccountDueJuly();\n },\n paymentOnAccountDueJuly: function () {\n if (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) {\n // K110\n return _this.personalTaxData.taxPayments.paymentOnAccount.yearToDate();\n }\n else {\n // L110\n return _this.personalTaxData.taxPayments.paymentOnAccount.forecast();\n }\n },\n totalPaymentDueJanThisYear: function () {\n // =SUM(S18+S15-S16)\n return _this.taxLiabilityDueWidgetData.paymentOnAccountDueJuly() +\n _this.taxLiabilityDueWidgetData.taxBillForThisYear() -\n _this.taxLiabilityDueWidgetData.paymentsMadeAgainstTaxBill();\n }\n };\n this.forecastCalculationsWidgetData = {\n monthsYearToDate: function () {\n // L5\n return _this.personalTaxData.forecastCalculations.monthsYearToDate();\n },\n monthsRemaining: function () {\n // L6\n return _this.personalTaxData.forecastCalculations.monthsRemaining();\n },\n weeksYearToDate: function () {\n return _this.personalTaxData.forecastCalculations.weeksYearToDate();\n },\n weeksRemaining: function () {\n return _this.personalTaxData.forecastCalculations.weeksRemaining();\n },\n weeksYearToDateFromTaxStart: function () {\n return _this.forecastCalculations.weeksYearToDateFromTaxStart;\n },\n weeksRemainingFromTaxStart: function () {\n return _this.forecastCalculations.weeksRemainingFromTaxStart;\n },\n pscEmployment: function () {\n // L8\n return _this.personalTaxData.forecastCalculations.pscEmployment();\n },\n currentDirectorsFeeWeekly: function () {\n // L9\n return _this.personalTaxData.forecastCalculations.currentDirectorsFeeWeekly();\n },\n forecastPSCEmployment: function () {\n // K44+(K45*K46)\n return _this.personalTaxData.forecastCalculations.forecastPSCEmployment();\n },\n confirmedAsDividends: function () {\n // L13\n return _this.personalTaxData.forecastCalculations.confirmedAsDividends();\n },\n unconfirmedTransactions: function () {\n // L14\n return _this.personalTaxData.forecastCalculations.unconfirmedTransactionsWithShareholderSplit();\n },\n transactionsBeingProcessed: function () {\n // L15\n return _this.personalTaxData.forecastCalculations.transactionsBeingProcessedWithShareholderSplit();\n },\n totalPSCDividendIncome: function () {\n // SUM(K50:K52)\n return (_this.forecastCalculationsWidgetData.confirmedAsDividends() +\n _this.forecastCalculationsWidgetData.unconfirmedTransactions() +\n _this.forecastCalculationsWidgetData.transactionsBeingProcessed());\n },\n forecastPSCDividendIncome: function () {\n // L19\n return _this.personalTaxData.forecastCalculations.forecastPSCDividendIncome();\n }\n };\n this.breakdownWidgetData = {\n pscEmployment: function () { return _this.incomeSummaryWidgetData.directorsFees(); },\n otherEmploymentIncome: function () { return (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) ? _this.userInputData.otherEmploymentIncomeYTD : _this.userInputData.otherEmploymentIncome; },\n pensionIncome: function () { return (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) ? _this.userInputData.pensionIncomeYTD : _this.userInputData.pensionIncome; },\n interestIncome: function () { return (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) ? _this.userInputData.interestIncomeYTD : _this.userInputData.interestIncome; },\n taxableBenefitsInKind: function () { return (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) ? _this.userInputData.taxableBenefitsInKindYTD : _this.userInputData.taxableBenefitsInKind; },\n pscDividendIncome: function () { return _this.incomeSummaryWidgetData.dividends(); },\n otherDividendIncome: function () { return (_this.selectedTimeframe.value === _this.personalTaxEnums.Timeframes.YEARTODATE) ? _this.userInputData.otherDividendIncomeYTD : _this.userInputData.otherDividendIncome; },\n };\n // Masonry\n this.reloadMasonry = function () {\n _this.$timeout(function () {\n if (_this.msnry) {\n _this.msnry.layout();\n _this.msnry.reloadItems();\n }\n }, 1);\n };\n // Requests\n this.getPersonalTaxTrackerData = function (silentMode) {\n return _this.$http.get('api/PersonalTaxTracker/GetPersonalTaxTrackerData', {\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n if (response.data) {\n if (response.data.fixedTaxData) {\n _this.fixedTaxData = response.data.fixedTaxData;\n }\n if (response.data.forecastCalculations) {\n _this.forecastCalculations = response.data.forecastCalculations;\n // This commented section is used for testing purposes to replicate the values seen on the spreadsheet\n // this.forecastCalculations = {\n // monthsYearToDate: 5,\n // monthsRemaining: 7,\n // pscEmployment: 3432.56,\n // currentDirectorsFeeWeekly: 156.98,\n // unconfirmedTransactions: 24000,\n // transactionsBeingProcessed: 0,\n // shareholderSplit: 100,\n // confirmedAsDividends: 9436,\n // taxDeductedFromPSCIncome: 565.80\n // };\n }\n if (response.data.umbrellaTaxTracker) {\n _this.umbrellaTaxTracker = response.data.umbrellaTaxTracker;\n }\n if (response.data.companyName) {\n _this.companyName = response.data.companyName;\n }\n if (response.data.hasUmbrella) {\n _this.hasUmbrella = response.data.hasUmbrella;\n }\n if (response.data.userInputData) {\n _.assign(_this.userInputData, response.data.userInputData);\n }\n }\n return response.data;\n });\n };\n this.getPersonalTaxTrackerDataByOffset = function (offset, silentMode) {\n return _this.$http.get('api/PersonalTaxTracker/GetPersonalTaxTrackerDataByOffset', {\n params: { offset: offset },\n silentMode: silentMode ? silentMode : false\n }).then(function (response) {\n if (response.data) {\n if (response.data.fixedTaxData) {\n _this.fixedTaxData = response.data.fixedTaxData;\n }\n if (response.data.forecastCalculations) {\n _this.forecastCalculations = response.data.forecastCalculations;\n // This commented section is used for testing purposes to replicate the values seen on the spreadsheet\n // this.forecastCalculations = {\n // monthsYearToDate: 5,\n // monthsRemaining: 7,\n // pscEmployment: 3432.56,\n // currentDirectorsFeeWeekly: 156.98,\n // unconfirmedTransactions: 24000,\n // transactionsBeingProcessed: 0,\n // shareholderSplit: 100,\n // confirmedAsDividends: 9436,\n // taxDeductedFromPSCIncome: 565.80\n // };\n }\n if (response.data.companyName) {\n _this.companyName = response.data.companyName;\n }\n if (response.data.hasUmbrella) {\n _this.hasUmbrella = response.data.hasUmbrella;\n }\n if (response.data.umbrellaTaxTracker) {\n _this.umbrellaTaxTracker = response.data.umbrellaTaxTracker;\n }\n if (response.data.userInputData) {\n _.assign(_this.userInputData, response.data.userInputData);\n }\n }\n return response.data;\n });\n };\n this.getConfirmedAsDividendsTransactions = function () {\n return _this.$http.get('api/PersonalTaxTracker/GetConfirmedAsDividendsTransactions/', {\n params: { offset: _this.taxYearOffset }\n }).then(function (response) { return response.data; });\n };\n this.getUnconfirmedTransactions = function () {\n return _this.$http.get('api/PersonalTaxTracker/GetUnconfirmedTransactions').then(function (response) { return response.data; });\n };\n this.postUserInputData = function () {\n return _this.$http.post('api/PersonalTaxTracker/PostPersonalTaxTrackerUserInputData', _this.userInputData, {\n silentMode: true\n }).then(function (response) { return response.data; });\n };\n this.clearData();\n this.selectedTimeframe = this.personalTaxEnums.Timeframes.properties[this.personalTaxEnums.Timeframes.FORECAST];\n this.selectedTimeframe.value = this.personalTaxEnums.Timeframes.FORECAST;\n //default to previous tax year\n this.getTaxYear();\n }\n PersonalTaxTrackerService.prototype.getTaxYear = function () {\n var offset = 0;\n var currentDate = new Date();\n if (currentDate >= new Date('04/06/' + currentDate.getFullYear()) &&\n currentDate <= new Date('05/01/' + currentDate.getFullYear())) {\n offset = -1;\n }\n this.taxYearOffset = offset;\n this.availableTaxYears = ['Current Tax Year', 'Previous Tax Year'];\n this.selectedTaxYear = this.availableTaxYears[offset === -1 ? 1 : offset];\n };\n PersonalTaxTrackerService.$inject = ['$http', '$q', '$timeout', 'personalTax.enums', 'brookson.utilities.date'];\n return PersonalTaxTrackerService;\n }());\n Shared.PersonalTaxTrackerService = PersonalTaxTrackerService;\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .service('personalTaxTrackerSrv', Shared.PersonalTaxTrackerService);\nvar Shared;\n(function (Shared) {\n var questionnaire;\n (function (questionnaire) {\n var QuestionaireFormItem = /** @class */ (function () {\n function QuestionaireFormItem() {\n }\n return QuestionaireFormItem;\n }());\n questionnaire.QuestionaireFormItem = QuestionaireFormItem;\n var QuestionnaireSubmission = /** @class */ (function () {\n function QuestionnaireSubmission() {\n }\n return QuestionnaireSubmission;\n }());\n questionnaire.QuestionnaireSubmission = QuestionnaireSubmission;\n var AuditTrail = /** @class */ (function () {\n function AuditTrail() {\n }\n return AuditTrail;\n }());\n questionnaire.AuditTrail = AuditTrail;\n var QuestionnaireMonthlySalaryPayments = /** @class */ (function () {\n function QuestionnaireMonthlySalaryPayments() {\n }\n return QuestionnaireMonthlySalaryPayments;\n }());\n questionnaire.QuestionnaireMonthlySalaryPayments = QuestionnaireMonthlySalaryPayments;\n })(questionnaire = Shared.questionnaire || (Shared.questionnaire = {}));\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n var QuestionnaireService = /** @class */ (function () {\n function QuestionnaireService($http, $q) {\n this.$http = $http;\n this.$q = $q;\n }\n QuestionnaireService.prototype.getQuestionnaireForm = function () {\n var deferred = this.$q.defer();\n var url = \"api/Questionnaire/GetQuestionnaireForm\";\n this.$http.get(url)\n .then(function (response) {\n deferred.resolve(response.data);\n });\n return deferred.promise;\n };\n QuestionnaireService.prototype.getDirectorFeesQuestionnaireForm = function () {\n var deferred = this.$q.defer();\n var url = \"api/Questionnaire/GetDirectorFeesQuestionnaireForm\";\n this.$http.get(url)\n .then(function (response) {\n deferred.resolve(response.data);\n });\n return deferred.promise;\n };\n QuestionnaireService.prototype.getMortgageQuestionnaireForm = function () {\n var deferred = this.$q.defer();\n var url = \"api/Questionnaire/GetMortgageQuestionnaireForm\";\n this.$http.get(url)\n .then(function (response) {\n deferred.resolve(response.data);\n });\n return deferred.promise;\n };\n QuestionnaireService.prototype.getDirectorFeesMonthlySalaryPayments = function () {\n var deferred = this.$q.defer();\n var url = \"api/Questionnaire/GetDirectorFeesMonthlySalaryPayments\";\n this.$http.get(url)\n .then(function (response) {\n deferred.resolve(response.data);\n });\n return deferred.promise;\n };\n QuestionnaireService.prototype.saveQuestionnaireForm = function (questionnaire) {\n var deferred = this.$q.defer();\n var url = \"api/Questionnaire/SaveForm\";\n this.$http.post(url, questionnaire)\n .then(function (response) {\n deferred.resolve(response.data);\n });\n return deferred.promise;\n };\n QuestionnaireService.prototype.saveQuestionnaireUpdateForm = function (questionnaire) {\n var deferred = this.$q.defer();\n var url = \"api/Questionnaire/SaveUpdateForm\";\n this.$http.post(url, questionnaire)\n .then(function (response) {\n deferred.resolve(response.data);\n });\n return deferred.promise;\n };\n QuestionnaireService.prototype.hasCustomerSubmittedForm = function () {\n var deferred = this.$q.defer();\n var url = \"api/Questionnaire/HasCustomerSubmittedFlexFormForm\";\n this.$http.get(url)\n .then(function (response) {\n deferred.resolve(response.data);\n });\n return deferred.promise;\n };\n QuestionnaireService.prototype.showDirectorFeeFormBanner = function () {\n var deferred = this.$q.defer();\n var url = \"api/Questionnaire/ShowDirectorFeesFormBanner\";\n this.$http.get(url)\n .then(function (response) {\n deferred.resolve(response.data);\n });\n return deferred.promise;\n };\n QuestionnaireService.prototype.hasCustomerSubmittedDirectorFeesForm = function () {\n var deferred = this.$q.defer();\n var url = \"api/Questionnaire/HasCustomerSubmittedDirectorFeesForm\";\n this.$http.get(url)\n .then(function (response) {\n deferred.resolve(response.data);\n });\n return deferred.promise;\n };\n QuestionnaireService.prototype.hasCustomerSubmittedMortgageForm = function () {\n var deferred = this.$q.defer();\n var url = \"api/Questionnaire/HasCustomerSubmittedMortgageForm\";\n this.$http.get(url)\n .then(function (response) {\n deferred.resolve(response.data);\n });\n return deferred.promise;\n };\n QuestionnaireService.prototype.recordAuditTrail = function (auditTrail) {\n var deferred = this.$q.defer();\n var url = \"api/Questionnaire/RecordAuditTrail\";\n this.$http.post(url, auditTrail)\n .then(function (response) {\n deferred.resolve(response.data);\n });\n return deferred.promise;\n };\n QuestionnaireService.$inject = [\"$http\", \"$q\"];\n return QuestionnaireService;\n }());\n Shared.QuestionnaireService = QuestionnaireService;\n})(Shared || (Shared = {}));\nangular.module(\"app.shared\").service('questionnaireSrv', Shared.QuestionnaireService);\n/// \n/// \nvar Shared;\n(function (Shared) {\n var RemusRewardSrv = /** @class */ (function () {\n function RemusRewardSrv($http) {\n var _this = this;\n this.$http = $http;\n this.selectedUmbrellaPackage = Shared.SelectedPackageEnum.umbrella;\n this.setPackageNavUmbrellaProtect = function () {\n var SelectedPackageRequestData = {\n umbrellaPlusService: true\n };\n return _this.$http.post('api/Intro/UpdateUmbrellaPlusService', SelectedPackageRequestData)\n .then(function (response) {\n return response.data;\n });\n };\n this.setSelectedPackageNav = function (selectedPackage) {\n var SelectedPackageRequestData = {\n umbrellaPlusService: ((selectedPackage === Shared.SelectedPackageEnum.umbrellaProtect) ? true : false)\n };\n return _this.$http.post('api/Intro/UpdateUmbrellaPlusService', SelectedPackageRequestData)\n .then(function (response) {\n return response.data;\n });\n };\n }\n RemusRewardSrv.prototype.getRemusRewardsUrlParameters = function () {\n return this.$http.get('api/RemusRewards/GetParameters')\n .then(function (response) {\n return response.data;\n });\n };\n RemusRewardSrv.prototype.isUserUmbrellaPlus = function () {\n return this.$http.get('api/RemusRewards/IsUserUmbrellaPlus')\n .then(function (response) {\n return response.data;\n });\n };\n RemusRewardSrv.prototype.setSelectedPackage = function (selectedPackage) {\n var _this = this;\n this.setSelectedPackageNav(selectedPackage).then(function (result) {\n _this.selectedUmbrellaPackage = selectedPackage;\n return result;\n });\n return false;\n };\n RemusRewardSrv.prototype.getAgencyMargin = function () {\n return this.$http.get('api/Intro/GetCurrentUmbrellaService')\n .then(function (response) {\n return response.data;\n });\n };\n RemusRewardSrv.prototype.getSelectedPackage = function () {\n var _this = this;\n return this.$http.get('api/RemusRewards/IsUserUmbrellaPlus')\n .then(function (response) {\n if (response.data) {\n return _this.selectedUmbrellaPackage = Shared.SelectedPackageEnum.umbrellaProtect;\n }\n else {\n return _this.selectedUmbrellaPackage = Shared.SelectedPackageEnum.umbrella;\n }\n });\n };\n RemusRewardSrv.$inject = [\"$http\", \"shared.config\"];\n return RemusRewardSrv;\n }());\n Shared.RemusRewardSrv = RemusRewardSrv;\n angular\n .module(\"app.shared\")\n .service(\"remusRewardSrv\", Shared.RemusRewardSrv);\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n var SmeManagementSrv = /** @class */ (function () {\n function SmeManagementSrv($http, sharedConfig) {\n this.$http = $http;\n this.sharedConfig = sharedConfig;\n this.serviceBase = sharedConfig.baseApiUrl;\n }\n SmeManagementSrv.prototype.getActionsToTakeSummary = function () {\n var url = this.serviceBase + \"api/SmeManagement/GetActionsToTakeSummary\";\n return this.$http.get(url).then(function (response) {\n return response.data;\n });\n };\n SmeManagementSrv.$inject = [\"$http\", \"shared.config\"];\n return SmeManagementSrv;\n }());\n Shared.SmeManagementSrv = SmeManagementSrv;\n})(Shared || (Shared = {}));\nangular.module(\"app.shared\").service(\"smeManagementSrv\", Shared.SmeManagementSrv);\n/// \nvar Shared;\n(function (Shared) {\n var WelcomeScreenSrv = /** @class */ (function () {\n function WelcomeScreenSrv($http, sharedConfig) {\n var _this = this;\n this.$http = $http;\n this.sharedConfig = sharedConfig;\n this.getWelcomeScreenMessageHtml = function () {\n var url = _this.serviceBase + \"api/WelcomeScreen/GetContentMessage\";\n return _this.$http.get(url).then(function (response) { return response.data; });\n };\n this.getWelcomeScreen = function (silentMode) {\n return _this.$http.get(\"api/Intro/GetWelcomeScreen\", {}).then(function (response) {\n return response.data;\n });\n };\n this.getWelcomeScreenEnabled = function () {\n var url = _this.serviceBase + \"api/Intro/GetWelcomeScreenEnabled\";\n return _this.$http.get(url).then(function (response) { return response.data; });\n };\n this.GetAccountantVideoId = function () {\n var url = _this.serviceBase + \"api/Intro/GetAccountantVideoId\";\n return _this.$http.get(url).then(function (response) { return response.data; });\n };\n this.getWelcomeVideos = function () {\n var url = _this.serviceBase + \"api/Intro/GetWelcomeVideos\";\n return _this.$http.get(url).then(function (response) {\n return response.data;\n });\n };\n this.setWelcomeScreenSeen = function () {\n return _this.$http.post(\"api/Intro/SetWelcomeScreenSeen\", {}, {}).then(function (response) {\n return response.data;\n });\n };\n this.setHideWelcomeScreen = function () {\n return _this.$http.post(\"api/Intro/HideWelcomeScreen\", {}, {}).then(function (response) {\n return response.data;\n });\n };\n this.serviceBase = sharedConfig.baseApiUrl;\n }\n WelcomeScreenSrv.$inject = [\"$http\", \"shared.config\"];\n return WelcomeScreenSrv;\n }());\n Shared.WelcomeScreenSrv = WelcomeScreenSrv;\n})(Shared || (Shared = {}));\nangular\n .module(\"app.shared\")\n .service(\"welcomeSrv\", Shared.WelcomeScreenSrv);\n/// \n/// \n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var SwapUserServiceLineService = /** @class */ (function () {\n function SwapUserServiceLineService($window, $stateParams, memberSrv, authenticationSrv, brooksonNavigation) {\n var _this = this;\n this.$window = $window;\n this.$stateParams = $stateParams;\n this.memberSrv = memberSrv;\n this.authenticationSrv = authenticationSrv;\n this.brooksonNavigation = brooksonNavigation;\n this.serviceLines = [];\n this.message = \"\";\n this.$onInit = function () {\n _this.member = _this.memberSrv.getMember();\n _this.serviceLines = _this.member.serviceLines;\n };\n this.changeSelectedServiceLine = function (selectedCompanyRef) {\n _this.member = _this.memberSrv.getMember();\n //update the user service active service line\n _this.member.companyRef = selectedCompanyRef;\n _this.memberSrv.setMember(_this.member);\n //this.selectedServiceLine = this.serviceLines.filter(s => s.)\n var line = _.filter(_this.member.serviceLines, function (o) { return o.customerReference === selectedCompanyRef; });\n _this.authenticationSrv.updateAccessTokenServiceLine(_this.member.memberId, line[0], _this.member.refreshToken, _this.member.apiKeySource)\n .then(function (data) {\n if (_this.$stateParams['ReturnUrl']) {\n _this.$window.location.href = _this.$stateParams['ReturnUrl'];\n }\n else {\n _this.brooksonNavigation.dashboard.main();\n }\n }, function (err) {\n _this.message = err.data.error_description;\n })\n .catch(function () { });\n };\n this.changeSelectedServiceLineLocation = function (selectedCompanyRef, href) {\n _this.member = _this.memberSrv.getMember();\n //update the user service active service line\n _this.member.companyRef = selectedCompanyRef;\n _this.memberSrv.setMember(_this.member);\n //this.selectedServiceLine = this.serviceLines.filter(s => s.)\n var line = _.filter(_this.member.serviceLines, function (o) { return o.customerReference === selectedCompanyRef; });\n _this.authenticationSrv.updateAccessTokenServiceLine(_this.member.memberId, line[0], _this.member.refreshToken, _this.member.apiKeySource)\n .then(function (data) {\n if (href) {\n _this.$window.location.href = href;\n }\n else {\n _this.brooksonNavigation.dashboard.main();\n }\n }, function (err) {\n _this.message = err.data.error_description;\n })\n .catch(function () { });\n };\n }\n SwapUserServiceLineService.$inject = ['$window',\n '$stateParams',\n 'memberSrv',\n 'authenticationSrv',\n 'brookson.navigation'];\n return SwapUserServiceLineService;\n }());\n Shared.SwapUserServiceLineService = SwapUserServiceLineService;\n})(Shared || (Shared = {}));\nangular\n .module(\"app.shared\")\n .service(\"swapServiceLineSrv\", Shared.SwapUserServiceLineService);\n/// \nvar Shared;\n(function (Shared) {\n 'use strict';\n var AllocationConfirmationController = /** @class */ (function () {\n function AllocationConfirmationController($uibModalInstance, data, bankLinkEnums) {\n var _this = this;\n this.$uibModalInstance = $uibModalInstance;\n this.data = data;\n this.bankLinkEnums = bankLinkEnums;\n this.splitTransactionsAndTotalUp = function () {\n _.each(_this.data.modifiedTransactions, function (o) {\n if (!_this.data.selectedAssignment || !_this.data.selectedAssignment.dateStarted) {\n o.passes24MonthRule = true;\n }\n else {\n o.passes24MonthRule = !_this.data.check24MonthRuleApplicable(o);\n }\n });\n _this.data.confirmedTransactions = _.filter(_this.data.modifiedTransactions, function (o) { return o.passes24MonthRule; });\n _this.data.warningTransactions = _.filter(_this.data.modifiedTransactions, function (o) { return !o.passes24MonthRule; });\n var runningTotal = 0;\n _.each(_this.data.confirmedTransactions, function (o) {\n runningTotal += o.debitAmount;\n });\n _this.data.confirmedTransactionsTotal = runningTotal;\n };\n this.cancel = function () {\n _this.$uibModalInstance.close();\n };\n // Loop through all the transactions, split out this.data.modifiedTransactions to 'confirmed' and 'warning', add totals up for confirmed\n this.splitTransactionsAndTotalUp();\n }\n AllocationConfirmationController.$inject = ['$uibModalInstance', 'bankLinkFactory', 'bankLink.enums'];\n return AllocationConfirmationController;\n }());\n Shared.AllocationConfirmationController = AllocationConfirmationController;\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .controller('bankAllocationConfirmationCtrl', Shared.AllocationConfirmationController);\n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var BrooksonBankLinkAutoAllocationSettings = /** @class */ (function () {\n function BrooksonBankLinkAutoAllocationSettings() {\n this.controller = BrooksonBankLinkAutoAllocationSettingsController;\n this.templateUrl = \"src/app/shared/views/bank/brookson.banklink.auto.allocation.settings.html\";\n }\n return BrooksonBankLinkAutoAllocationSettings;\n }());\n Shared.BrooksonBankLinkAutoAllocationSettings = BrooksonBankLinkAutoAllocationSettings;\n var BrooksonBankLinkAutoAllocationSettingsController = /** @class */ (function () {\n function BrooksonBankLinkAutoAllocationSettingsController(window, autoAllocationService, bankLinkService, serviceLineSrv, dateUtils, moneyManagerSrv, $sanitize) {\n var _this = this;\n this.window = window;\n this.autoAllocationService = autoAllocationService;\n this.bankLinkService = bankLinkService;\n this.serviceLineSrv = serviceLineSrv;\n this.dateUtils = dateUtils;\n this.moneyManagerSrv = moneyManagerSrv;\n this.$sanitize = $sanitize;\n this.$onInit = function () {\n _this.bankLinkService.getCategories().then(function (categories) {\n _this.autoAllocationService.categoryList = _this.getAllowedCategories(categories);\n _this.serviceLineSrv.getBusinessDetailSummary().then(function (businessSummary) {\n _this.isVatReclaimable = businessSummary.getEffectiveVatSchemeOn(_this.dateUtils.convertToJsDate(moment())) === Shared.VatScheme.nonFlatRate;\n _this.loadAutoAllocationSettings()\n .then(function () {\n _this.moneyManagerSrv.getTransactions().then(function (data) {\n _this.autoAllocationService.transactions = data.transactions;\n _this.loading = false;\n });\n });\n });\n });\n };\n this.getAllowedCategories = function (categories) {\n _.remove(categories, function (category) {\n if (category.code === \"DLA\" || category.code === \"SALARY\") {\n return true;\n }\n });\n _.forEach(categories, function (category) {\n category.transactionTypeLabel = category.transactionType === 0 ? \"Personal\" : \"Business\";\n if (category.code === \"EXP0185\") {\n category.description = \"Subsistence\";\n } // Hack: don't want to change it properly in NAV so SW said to do it in the view\n });\n var nonSoleTraderCategories = _.filter(categories, function (category) {\n return !_.startsWith(category.code, \"ST\");\n });\n var categoriesWithNoCcDiv = _.filter(nonSoleTraderCategories, function (category) { return category.code !== \"CC DIV\"; });\n var creditOrDebitCategories = _.filter(categoriesWithNoCcDiv, function (category) { return category.type === \"Debit\"; });\n return creditOrDebitCategories;\n };\n this.loadAutoAllocationSettings = function () {\n return _this.autoAllocationService.getAutoAllocationSettings().then(function (autoAllocationSettings) {\n _this.autoAllocationService.companyConfig = autoAllocationSettings;\n _this.showDisabledMatches();\n _this.allowAddNewSetting = true;\n return autoAllocationSettings;\n });\n };\n this.showDisabledMatches = function () {\n _this.companyConfigList = _this.autoAllocationService.getSettingsList(_this.showDisabled);\n _this.autoAllocationFrm.$setPristine();\n };\n this.addNew = function () {\n _this.companyConfigList.push(_this.autoAllocationService.createNewAllocationSetting());\n _this.allowAddNewSetting = false;\n };\n this.saveNewAutoSetting = function (newSetting) {\n var uniqueKeywordCheck = _.find(_this.autoAllocationService.companyConfig, function (config) {\n return config.keyword === newSetting.keyword;\n });\n if (!_.isUndefined(uniqueKeywordCheck)) {\n return;\n }\n if (!_.isUndefined(newSetting)) {\n newSetting.categoryCode = newSetting.navCategory.code;\n if (_.isUndefined(newSetting.reclaimVat))\n newSetting.reclaimVat = false;\n _this.autoAllocationService\n .saveNewAutoAllocationSetting(newSetting)\n .then(function (status) {\n if (status) {\n _this.loadAutoAllocationSettings();\n }\n });\n }\n _this.allowAddNewSetting = true;\n };\n this.cancelNewAutoSetting = function () {\n _this.companyConfigList.pop();\n _this.allowAddNewSetting = true;\n };\n this.disableSaveButton = function (newSetting) {\n if (_.isUndefined(newSetting) || _.isUndefined(newSetting.keyword))\n return true;\n if (_this.autoAllocationService.duplicateKeyword(newSetting)) {\n return true;\n }\n if (_.isUndefined(newSetting.navCategory))\n return true;\n return false;\n };\n this.keywordChanged = function (autoSetting) {\n if (_.isUndefined(autoSetting))\n return;\n if (_.isUndefined(autoSetting.keyword)) {\n _this.autoAllocationService.resetTransactionMatches(autoSetting);\n }\n if (autoSetting.id === -1) {\n if (!_this.autoAllocationService.duplicateKeyword(autoSetting)) {\n _this.autoAllocationService.searchTransactions(autoSetting);\n }\n return;\n }\n var originalValue = _.find(_this.autoAllocationService.companyConfig, function (setting) {\n return setting.id === autoSetting.id;\n });\n if (_.isUndefined(originalValue))\n return;\n autoSetting.hasChanged = false;\n if (_.isUndefined(autoSetting.keyword)) {\n autoSetting.hasChanged = true;\n return;\n }\n if (autoSetting.keyword.toLowerCase() !== originalValue.keyword.toLowerCase()) {\n autoSetting.hasChanged = true;\n if (!_this.autoAllocationService.duplicateKeyword(autoSetting)) {\n _this.autoAllocationService.searchTransactions(autoSetting);\n }\n }\n };\n this.finishedKeyword = function (autoSetting) {\n if (_.isUndefined(autoSetting))\n return;\n _this.autoAllocationService.resetTransactionMatches(autoSetting);\n };\n this.settingChanged = function (autoSetting) {\n if (_.isUndefined(autoSetting))\n return;\n if (_.isUndefined(autoSetting.keyword))\n return;\n var originalValue = _.find(_this.autoAllocationService.companyConfig, function (setting) {\n return setting.id === autoSetting.id;\n });\n if (_.isUndefined(originalValue)) {\n if (!_.isUndefined(autoSetting.navCategory) && !autoSetting.navCategory.isVatable)\n autoSetting.reclaimVat = false;\n return;\n }\n autoSetting.hasChanged = false;\n if (autoSetting.keyword.toLowerCase() !== originalValue.keyword.toLowerCase() ||\n !_.isUndefined(autoSetting.navCategory) && autoSetting.navCategory.code !== originalValue.categoryCode ||\n autoSetting.reclaimVat !== originalValue.reclaimVat ||\n autoSetting.enabled !== originalValue.enabled) {\n autoSetting.hasChanged = true;\n if (!_.isUndefined(autoSetting.navCategory) && autoSetting.keyword.toLowerCase() !== originalValue.keyword.toLowerCase()) {\n _this.autoAllocationService.duplicateKeyword(autoSetting);\n }\n if (!autoSetting.navCategory.isVatable) {\n autoSetting.reclaimVat = false;\n }\n }\n };\n this.cancelUpdate = function (autoSetting) {\n var originalValue = _.find(_this.autoAllocationService.companyConfig, function (setting) {\n return setting.id === autoSetting.id;\n });\n if (!_.isUndefined(originalValue)) {\n autoSetting.keyword = originalValue.keyword;\n autoSetting.navCategory = _.find(_this.autoAllocationService.categoryList, function (category) {\n if (!_.isUndefined(originalValue))\n return category.code === originalValue.categoryCode;\n });\n autoSetting.reclaimVat = originalValue.reclaimVat;\n autoSetting.enabled = originalValue.enabled;\n }\n autoSetting.validationMessage = \"\";\n autoSetting.hasChanged = false;\n };\n this.updateAutoSetting = function (autoSetting) {\n var createdBy = \"Customer\";\n if (!_.isNull(_this.autoAllocationService.memberModel.isAdmin)) {\n createdBy = \"Superuser\";\n }\n else if (!_.isNull(_this.autoAllocationService.memberModel.navReferral)) {\n createdBy = _this.autoAllocationService.memberModel.navReferral;\n }\n autoSetting.updatedBy = createdBy;\n autoSetting.categoryCode = autoSetting.navCategory.code;\n _this.autoAllocationService.updateAutoAllocationSetting(autoSetting).then(function () {\n var config = _.find(_this.autoAllocationService.companyConfig, function (config) {\n return config.id === autoSetting.id;\n });\n config.keyword = autoSetting.keyword;\n config.categoryCode = autoSetting.categoryCode;\n config.reclaimVat = autoSetting.reclaimVat;\n config.enabled = autoSetting.enabled;\n config.hasChanged = false;\n if (!_this.showDisabled && !config.enabled) {\n _.remove(_this.companyConfigList, function (c) { return c.id === config.id; });\n }\n _this.settingChanged(autoSetting);\n });\n };\n this.invokeBackButton = function () {\n _this.window.history.back();\n };\n this.showDisabled = false;\n this.loading = true;\n }\n BrooksonBankLinkAutoAllocationSettingsController.$inject = [\"$window\", \"autoAllocationService\", \"bankLinkSrv\", \"serviceLineSrv\", \"brookson.utilities.date\", \"moneyManagerSrv\", \"$sanitize\"];\n return BrooksonBankLinkAutoAllocationSettingsController;\n }());\n})(Shared || (Shared = {}));\nangular.module(\"app.shared\")\n .component(\"brooksonAutoAllocationSettings\", new Shared.BrooksonBankLinkAutoAllocationSettings());\n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var BrooksonBankFileImport = /** @class */ (function () {\n function BrooksonBankFileImport() {\n this.controller = BrooksonBankFileImportController;\n this.templateUrl = \"src/app/shared/views/bank/brookson.banklink.bankfilupload.html\";\n }\n return BrooksonBankFileImport;\n }());\n Shared.BrooksonBankFileImport = BrooksonBankFileImport;\n var BrooksonBankFileImportController = /** @class */ (function () {\n function BrooksonBankFileImportController(window, autoAllocationService, bankLinkService, serviceLineSrv, dateUtils, moneyManagerSrv, $sanitize, $scope, $timeout, flowFactory, data, openbankingWidgetService, $q, authenticationSrv, $window, $sce, $log, growl) {\n var _this = this;\n this.window = window;\n this.autoAllocationService = autoAllocationService;\n this.bankLinkService = bankLinkService;\n this.serviceLineSrv = serviceLineSrv;\n this.dateUtils = dateUtils;\n this.moneyManagerSrv = moneyManagerSrv;\n this.$sanitize = $sanitize;\n this.$scope = $scope;\n this.$timeout = $timeout;\n this.flowFactory = flowFactory;\n this.data = data;\n this.openbankingWidgetService = openbankingWidgetService;\n this.$q = $q;\n this.authenticationSrv = authenticationSrv;\n this.$window = $window;\n this.$sce = $sce;\n this.$log = $log;\n this.growl = growl;\n this.navBankTransactions = {};\n this.$onInit = function () {\n _this.todaysDate = new Date();\n _this.showSpinner = true;\n _this.$q.all([\n _this.openbankingWidgetService.getGetBankStatementData(true)\n ]).then(function (data) {\n _this.bankAccountList = data[0];\n _this.setupAccounts(_this.bankAccountList);\n _this.showSpinner = false;\n }, function () {\n _this.error = true;\n }).then(function () {\n _this.showSpinner = false;\n });\n _this.data.getBankAccounts();\n _this.currentFileId = _this.uuid();\n _this.steps = [\n { title: 'Select Bank Account', isOpen: true },\n { title: 'Upload Bank Statement', isOpen: false },\n // Add Step 3 for column mapping\n { title: 'Review Transactions', isOpen: false },\n { title: 'Submission Summary', isOpen: false },\n ];\n _this.transactions = [];\n _this.progress = 0;\n _this.uploadStatus = '';\n _this.uploadMessage = '';\n _this.selectAll = false;\n _this.submissionSuccess = false;\n };\n this.cancel = function () {\n };\n this.flowFilesSubmitted = function (files, event, flow, path) {\n _this.$log.debug(\"Submitted\");\n // Clear any previous upload errors\n _this.$scope['fileErrors'] = [];\n _this.$scope['sentSuccessfully'] = false;\n _this.$scope['authenticationSrv'].refreshToken().then(function (data) {\n flow.opts.query.dropboxUploadPath = path;\n flow.opts.headers.Authorization = \"Bearer \" + data.access_token;\n flow.opts.headers.BankAccountId = _this.selectedBankAccount.key;\n flow.opts.headers.BankAccountKey = _this.selectedBankAccount.bankAccountKey;\n flow.upload();\n });\n };\n this.flowFileSuccess = function ($file, $message, $flow) {\n if ($message !== \"\") {\n _this.$scope['sentSuccessfully'] = true;\n _this.summary = JSON.parse($message);\n _this.uploadStatus = 'uploaded';\n _this.openNextStep(1);\n }\n else {\n _this.$scope['sentSuccessfully'] = true;\n _this.uploadStatus = 'progress';\n }\n };\n this.showTransactionDate = function () {\n _this.showTransactionDateFrm = true;\n };\n this.hideTransactionDate = function () {\n _this.showTransactionDateFrm = false;\n };\n /**\n * Flowjs event when the the upload has been completed\n *\n * @param {flowjs.IFlow} $flow\n *\n * @memberOf BrooksonExpensesAddReceiptController\n */\n this.flowComplete = function ($flow) {\n _this.$log.debug(\"Complete\");\n _this.$timeout(function (flow) {\n flow.files = [];\n // this.fileTypeValidationErrors = [];\n // this.fileSizeValidationErrors = [];\n }, 4000, true, $flow);\n };\n this.uuid = function () {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n };\n this.setupAccounts = function (bankAccounts) {\n _.each(bankAccounts, function (bankAccount) {\n bankAccount.type = Shared.openbankingWidget.bankType[bankAccount.type].replace('_', ' ');\n bankAccount.accountType = Shared.openbankingWidget.accountType[bankAccount.accountType];\n if (bankAccount.consentStatus === Shared.openbankingWidget.ConsentStatus.AccessTokenReceived && !bankAccount.consentExpired) {\n bankAccount.success = true;\n }\n if (bankAccount.viewAccess === false) {\n bankAccount.className = 'redBox';\n }\n else {\n if (bankAccount.viewAccessDescription.toLowerCase().indexOf('view access') > -1) {\n bankAccount.className = 'orangeBox';\n }\n if (bankAccount.viewAccessDescription.toLowerCase().indexOf('open banking') > -1) {\n bankAccount.className = 'greenBox';\n }\n }\n });\n };\n this.getLastFiveBankTransaction = function () {\n _this.bankLinkService.getLastFiveBankTransaction(_this.selectedBankAccount.bankAccountKey).then(function (navBankTransactions) {\n navBankTransactions = _.sortBy(navBankTransactions, 'entryNo');\n _this.navBankTransactions = navBankTransactions.reverse();\n });\n };\n this.submitTransactions = function () {\n _this.updateTransactions();\n _this.bankLinkService.submitBankStatementBatch(_this.summary.summary.batchId, _this.selectedBankAccount.key, new Date(_this.updatedTransactionDate)).then(function (data) {\n _this.submissionSuccess = data.success;\n _this.isSubmitError = !data.success;\n _this.submitMessage = data.message;\n });\n };\n this.submitTransactionDate = function () {\n _this.bankLinkService.updateBankStatementDate(_this.selectedBankAccount.key, new Date(_this.updatedTransactionDate)).then(function (data) {\n _this.dateTransactionSuccess = data;\n });\n };\n this.addNew = function () {\n _this.companyConfigList.push(_this.autoAllocationService.createNewAllocationSetting());\n _this.allowAddNewSetting = false;\n };\n this.invokeBackButton = function () {\n _this.window.history.back();\n };\n this.showDisabled = false;\n this.loading = true;\n $scope['uploadOptions'] = this.flowFactory.create({\n permanentErrors: ['404', '500', '501'],\n target: '/api/BankLink/UploadStatementFile',\n headers: {\n '__RequestVerificationToken': $window.brookson.antiForgeryToken,\n \"Accept\": \"application/json\"\n },\n testChunks: false,\n chunkSize: 9007199254740991,\n singleFile: true\n });\n $scope['cancel'] = this.cancel;\n $scope['flowFilesSubmitted'] = this.flowFilesSubmitted;\n $scope['flowFileError'] = this.flowFileError;\n $scope['flowFileSuccess'] = this.flowFileSuccess;\n $scope['fileErrors'] = [];\n $scope['sentSuccessfully'] = false;\n $scope['title'] = \"Upload Bank Statement\";\n $scope['successfullMessage'] = \"Uploaded\";\n $scope['uploadMessage'] = \"\";\n $scope['additionalHtml'] = this.$sce.trustAsHtml(\"\");\n $scope['authenticationSrv'] = authenticationSrv;\n }\n BrooksonBankFileImportController.prototype.fileDeletetedClicked = function (flow) {\n flow.cancel();\n };\n BrooksonBankFileImportController.prototype.flowFileError = function ($file, $message, $flow) {\n this.growl.error(\"There was an error uploading this bank file \" + $file.name);\n this.$log.debug(\"Error\");\n this.uploadStatus = 'error';\n this.$scope['fileErrors'].push($file);\n this.error = true;\n };\n BrooksonBankFileImportController.prototype.selectBankAccount = function (account, $flow) {\n if ($flow) {\n $flow.cancel();\n }\n if ($flow && $flow.files) {\n $flow.removeFile($flow.files[0]);\n $flow.files = [];\n }\n this.$scope['sentSuccessfully'] = false;\n this.selectedPendingStatement = false;\n if (account.hasPendingBankStatement) {\n this.selectedPendingStatement = true;\n }\n else {\n this.selectedPendingStatement = false;\n }\n this.selectedBankAccount = account;\n this.getLastFiveBankTransaction();\n this.openNextStep(0);\n };\n BrooksonBankFileImportController.prototype.openNextStep = function (stepIndex) {\n this.steps[stepIndex].isOpen = false;\n this.steps[stepIndex + 1].isOpen = true;\n };\n BrooksonBankFileImportController.prototype.openBackStep = function (stepIndex) {\n this.steps[stepIndex].isOpen = false;\n this.steps[stepIndex - 1].isOpen = true;\n };\n BrooksonBankFileImportController.prototype.fileUploaded = function (flow, file, message) {\n var _this = this;\n this.uploadStatus = '';\n this.uploadMessage = 'Uploading file...';\n this.progress = 0;\n flow.upload();\n flow.on('progress', function (flowProgress) {\n _this.$timeout(function () {\n _this.progress = Math.floor(flowProgress * 100);\n });\n });\n flow.on('fileSuccess', function (file, message) {\n _this.$timeout(function () {\n _this.fileContent = message;\n _this.uploadStatus = 'Success';\n _this.uploadMessage = 'File uploaded successfully!';\n });\n });\n flow.on('fileError', function (file, message) {\n _this.growl.error(\"There was an error uploading this bank file \" + file.name);\n _this.$timeout(function () {\n _this.uploadStatus = 'Error';\n _this.uploadMessage = 'File upload error: ' + message;\n _this.error = true;\n });\n });\n };\n BrooksonBankFileImportController.prototype.toggleAll = function () {\n var _this = this;\n this.summary.summary.bankStatementRows.forEach(function (transaction) {\n transaction.selected = _this.selectAll;\n });\n };\n BrooksonBankFileImportController.prototype.toggleRow = function (transaction) {\n transaction.selected = !transaction.selected;\n this.selectAll = this.summary.summary.bankStatementRows.every(function (t) { return t.selected; });\n };\n BrooksonBankFileImportController.prototype.numberOfSelectedRows = function () {\n return this.summary.summary.bankStatementRows.filter(function (t) { return t.selected; }).length;\n };\n BrooksonBankFileImportController.prototype.totalAmountOfSelectedRows = function () {\n return this.summary.summary.bankStatementRows.reduce(function (sum, t) {\n return t.selected ? sum + t.amount : sum;\n }, 0);\n };\n BrooksonBankFileImportController.prototype.newBalanceAmount = function () {\n this.updatedTransactionDate = this.summary !== undefined && this.summary.summary.postingDate;\n return this.summary !== undefined && this.summary.summary.totalAmount + this.selectedBankAccount.availableBalance;\n };\n BrooksonBankFileImportController.prototype.hasSelectedTransactions = function () {\n return this.summary !== undefined && this.summary.summary.totalCount > 0;\n };\n BrooksonBankFileImportController.prototype.updateTransactions = function () {\n this.submittedRowCount = this.numberOfSelectedRows();\n this.submittedTotalAmount = this.totalAmountOfSelectedRows();\n var selectedTransactions = this.summary.summary.bankStatementRows.filter(function (t) { return t.selected; });\n var minDate = Math.min.apply(Math, selectedTransactions.map(function (t) { return new Date(t.date).getTime(); }));\n var maxDate = Math.max.apply(Math, selectedTransactions.map(function (t) { return new Date(t.date).getTime(); }));\n this.submittedDateRange = new Date(minDate).toLocaleDateString() + ' - ' + new Date(maxDate).toLocaleDateString();\n //API Submit\n };\n BrooksonBankFileImportController.prototype.cancelBatch = function () {\n this.bankLinkService.cancelBankStatementBatch(this.selectedBankAccount.batchId);\n };\n BrooksonBankFileImportController.prototype.clearBatch = function (batchId) {\n var _this = this;\n this.showSpinner = true;\n this.$q.all([this.bankLinkService.clearBankStatementBatch(batchId)\n ]).then(function (data) {\n _this.$window.location.href = \"\".concat(_this.$window.location.origin, \"/banklink/bank-file\");\n }, function () {\n _this.error = true;\n }).then(function () {\n _this.showSpinner = false;\n });\n this.data.getBankAccounts();\n };\n BrooksonBankFileImportController.$inject = [\"$window\", \"autoAllocationService\", \"bankLinkSrv\", \"serviceLineSrv\", \"brookson.utilities.date\", \"moneyManagerSrv\", \"$sanitize\", \"$scope\", \"$timeout\", \"flowFactory\", \"bankLinkFactory\", 'openbankingWidgetService', '$q', 'authenticationSrv', '$window', '$sce', '$log', \"growl\"];\n return BrooksonBankFileImportController;\n }());\n})(Shared || (Shared = {}));\nangular.module(\"app.shared\")\n .component(\"brooksonBankFileImport\", new Shared.BrooksonBankFileImport());\n/// \nvar Shared;\n(function (Shared) {\n var BrooksonBankLinkTransactionsMobile = /** @class */ (function () {\n function BrooksonBankLinkTransactionsMobile() {\n this.controller = BrooksonBankLinkTransactionsMobileController;\n this.templateUrl = 'src/app/shared/views/bank/brookson.bankLink.transactions.mobile.html';\n this.bindings = {\n getData: '@',\n hideAside: '@'\n };\n }\n return BrooksonBankLinkTransactionsMobile;\n }());\n Shared.BrooksonBankLinkTransactionsMobile = BrooksonBankLinkTransactionsMobile;\n var BrooksonBankLinkTransactionsMobileController = /** @class */ (function () {\n function BrooksonBankLinkTransactionsMobileController(data, bankLinkEnums, assignmentSrv, dateUtils, $location, orderByFilter, $state) {\n var _this = this;\n this.data = data;\n this.bankLinkEnums = bankLinkEnums;\n this.assignmentSrv = assignmentSrv;\n this.dateUtils = dateUtils;\n this.$location = $location;\n this.orderByFilter = orderByFilter;\n this.$state = $state;\n this.$onInit = function () {\n if (_this.getData && _this.data.transactionTypes.length === 0) {\n _this.data.getTransactionTypes();\n _this.data.getBankAccounts();\n _this.data.getTransactions(true);\n _this.data.getCategories();\n _this.data.getReceipts();\n _this.data.getMoneyManagerData();\n }\n _this.data.getAllVatRatesConfig().then(function (result) {\n _this.vatRateConfig = _this.orderByFilter(result, \"-effectiveDate\");\n });\n _this.getAssignments();\n };\n this.vatChanged = function (transaction) {\n if (transaction.vat > 0) {\n transaction.vat = -transaction.vat;\n }\n transaction.net = (-transaction.gross || 0) - (transaction.vat || 0);\n };\n this.viewAutoAllocationSettings = function (expense) {\n _this.$state.go(\"brookson.banklink-auto-allocation-settings\");\n };\n this.viewBankFileUpload = function (expense) {\n _this.$state.go(\"brookson.bank-file-upload\");\n };\n this.clearVat = function (transaction) {\n transaction.vat = 0;\n _this.vatChanged(transaction);\n transaction.maxVat = 0;\n transaction.maxVatMessage = \"VAT must be 0\";\n };\n this.getVatAmount = function (transaction) {\n var vatRate = _this.getApplicableVatRate(transaction);\n return -Math.floor((vatRate * (transaction.gross || 0)) / (100 + vatRate) * 100) / 100;\n };\n this.setMaxVat = function (transaction) {\n var vat = _this.getVatAmount(transaction);\n var vatRate = _this.getApplicableVatRate(transaction);\n var vat20precent = -Math.floor((20 * (transaction.gross || 0)) / (100 + 20) * 100) / 100;\n transaction.maxVat = vatRate > 0 && vatRate < 20 ? vat20precent : vat;\n transaction.maxVatMessage = \"VAT must be less than or equal to \".concat(-transaction.maxVat);\n };\n this.grossChanged = function (transaction) {\n if (transaction.hasValidVatReceipt) {\n transaction.vat = _this.getVatAmount(transaction);\n _this.setMaxVat(transaction);\n _this.vatChanged(transaction);\n }\n else {\n _this.clearVat(transaction);\n }\n };\n this.hasValidVatReceiptChanged = function (transaction) {\n if (!transaction.hasValidVatReceipt) {\n _this.clearVat(transaction);\n }\n else if (transaction.gross) {\n _this.grossChanged(transaction);\n }\n };\n this.getApplicableVatRate = function (transaction) {\n var transactionDate = transaction.transactionDate ? _this.dateUtils.convertToJsDate(transaction.transactionDate) : new Date();\n var applicableRateConfig = _this.vatRateConfig ? _.find(_this.vatRateConfig, function (rateConfig) {\n if (transaction) {\n return transactionDate >= rateConfig.effectiveDate && transactionDate <= rateConfig.endDate && rateConfig.expenseCode === transaction.transactionCategory.code;\n }\n }) : new Shared.VatRateConfig();\n var applicableRate = transaction.vatRates ? _.find(transaction.vatRates, function (rate) {\n return rate.startDate <= transactionDate;\n }).amount : 20;\n if (applicableRateConfig && applicableRateConfig.vatRate) {\n return applicableRateConfig.vatRate;\n }\n return applicableRate;\n };\n this.getAssignments = function () {\n return _this.assignmentSrv.getAssignments()\n .then(function (data) {\n if (data.length === 0 && _this.$location.path().indexOf(\"Business\")) {\n var blankAssignment = new Shared.InvoicingAssignment();\n blankAssignment.fullAssignmentName = 'No Active Assignments';\n data.push(blankAssignment);\n _this.data.selectedAssignment = data[0];\n }\n //supply the assignments in reverse date order\n var orderAssignmentsByDateStarted = _.sortBy(data, [function (o) { return _this.toDate(o); }]);\n _this.data.assignments = orderAssignmentsByDateStarted.reverse();\n // If the year is 1753 or the top assignment is still current, then assign it in the dropdown as the selected assignment\n if ((orderAssignmentsByDateStarted.length !== 0) &&\n (orderAssignmentsByDateStarted[0].dateEnded !== undefined)) {\n if ((_this.dateUtils.isSame(orderAssignmentsByDateStarted[0].dateEnded, '1753-01-01') || _this.dateUtils.isAfter(orderAssignmentsByDateStarted[0].dateEnded, moment().startOf('day'))) && orderAssignmentsByDateStarted.length === 1) {\n _this.data.selectedAssignment = orderAssignmentsByDateStarted[0];\n }\n }\n return data;\n });\n };\n this.toDate = function (item) {\n return _this.dateUtils.convertToJsDate(item.dateStarted);\n };\n }\n BrooksonBankLinkTransactionsMobileController.$inject = ['bankLinkFactory', 'bankLink.enums', 'AssignmentSrv', 'brookson.utilities.date', \"$location\", \"orderByFilter\", \"$state\"];\n return BrooksonBankLinkTransactionsMobileController;\n }());\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .component('brooksonBankLinkTransactionsMobile', new Shared.BrooksonBankLinkTransactionsMobile());\n/// \nvar Shared;\n(function (Shared) {\n var BrooksonBankLinkTransactionsPagination = /** @class */ (function () {\n function BrooksonBankLinkTransactionsPagination() {\n this.controller = BrooksonBankLinkTransactionsPaginationController;\n this.templateUrl = 'src/app/shared/views/bank/brookson.bankLink.transactions.pagination.html';\n this.bindings = {\n bankAccounts: '='\n };\n }\n return BrooksonBankLinkTransactionsPagination;\n }());\n Shared.BrooksonBankLinkTransactionsPagination = BrooksonBankLinkTransactionsPagination;\n var BrooksonBankLinkTransactionsPaginationController = /** @class */ (function () {\n function BrooksonBankLinkTransactionsPaginationController(data) {\n this.data = data;\n }\n BrooksonBankLinkTransactionsPaginationController.$inject = ['bankLinkFactory'];\n return BrooksonBankLinkTransactionsPaginationController;\n }());\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .component('brooksonBankLinkTransactionsPagination', new Shared.BrooksonBankLinkTransactionsPagination());\n/// \n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var BrooksonBankLinkTransactions = /** @class */ (function () {\n function BrooksonBankLinkTransactions() {\n this.controller = BrooksonBankLinkTransactionsController;\n this.templateUrl = 'src/app/shared/views/bank/brookson.bankLink.transactions.html';\n this.bindings = {\n getData: '@',\n businessOnly: '@'\n };\n }\n return BrooksonBankLinkTransactions;\n }());\n Shared.BrooksonBankLinkTransactions = BrooksonBankLinkTransactions;\n var BrooksonBankLinkTransactionsController = /** @class */ (function () {\n function BrooksonBankLinkTransactionsController(data, bankLinkEnums, assignmentSrv, dateUtils, $location, $state, orderByFilter) {\n var _this = this;\n this.data = data;\n this.bankLinkEnums = bankLinkEnums;\n this.assignmentSrv = assignmentSrv;\n this.dateUtils = dateUtils;\n this.$location = $location;\n this.$state = $state;\n this.orderByFilter = orderByFilter;\n this.$onInit = function () {\n if (_this.getData && _this.data.transactionTypes.length === 0) {\n _this.data.getTransactionTypes();\n _this.data.getBankAccounts();\n _this.data.isCsvUploadRequired();\n _this.data.getTransactions(true);\n _this.data.getCategories();\n _this.data.getReceipts();\n _this.data.getMoneyManagerData();\n }\n _this.data.getAllVatRatesConfig().then(function (result) {\n _this.vatRateConfig = _this.orderByFilter(result, \"-effectiveDate\");\n });\n _this.getAssignments().then(function () { });\n _this.data.businessOnly = _this.businessOnly;\n };\n this.viewAutoAllocationSettings = function (expense) {\n _this.$state.go(\"brookson.banklink-auto-allocation-settings\");\n };\n this.viewBankFileUpload = function (expense) {\n _this.$state.go(\"brookson.bank-file-upload\");\n };\n this.vatChanged = function (transaction) {\n if (!transaction.vat) {\n transaction.vat = 0;\n }\n if (transaction.vat > 0) {\n transaction.vat = -transaction.vat;\n }\n transaction.net = (-transaction.gross || 0) - (transaction.vat || 0);\n };\n this.clearVat = function (transaction) {\n transaction.vat = 0;\n _this.vatChanged(transaction);\n transaction.maxVat = 0;\n transaction.maxVatMessage = \"VAT must be 0\";\n };\n this.getVatAmount = function (transaction) {\n var vatRate = _this.getApplicableVatRate(transaction);\n return -Math.floor((vatRate * (transaction.gross || 0)) / (100 + vatRate) * 100) / 100;\n };\n this.setMaxVat = function (transaction) {\n var vat = _this.getVatAmount(transaction);\n var vatRate = _this.getApplicableVatRate(transaction);\n var vat20precent = -Math.floor((20 * (transaction.gross || 0)) / (100 + 20) * 100) / 100;\n transaction.maxVat = vatRate > 0 && vatRate < 20 ? vat20precent : vat;\n transaction.maxVatMessage = \"VAT must be less than or equal to \".concat(-transaction.maxVat);\n };\n this.grossChanged = function (transaction) {\n if (transaction.hasValidVatReceipt) {\n transaction.vat = _this.getVatAmount(transaction);\n _this.setMaxVat(transaction);\n _this.vatChanged(transaction);\n }\n else {\n _this.clearVat(transaction);\n }\n };\n this.hasValidVatReceiptChanged = function (transaction) {\n if (!transaction.hasValidVatReceipt) {\n _this.clearVat(transaction);\n }\n else if (transaction.gross) {\n _this.grossChanged(transaction);\n }\n };\n this.getApplicableVatRate = function (transaction) {\n var transactionDate = transaction.transactionDate ? _this.dateUtils.convertToJsDate(transaction.transactionDate) : new Date();\n var applicableRateConfig = _this.vatRateConfig ? _.find(_this.vatRateConfig, function (rateConfig) {\n if (transaction) {\n return transactionDate >= rateConfig.effectiveDate && transactionDate <= rateConfig.endDate && rateConfig.expenseCode === transaction.transactionCategory.code;\n }\n }) : new Shared.VatRateConfig();\n var applicableRate = transaction.vatRates ? _.find(transaction.vatRates, function (rate) {\n return rate.startDate <= transactionDate;\n }).amount : 20;\n if (applicableRateConfig && applicableRateConfig.vatRate) {\n return applicableRateConfig.vatRate;\n }\n return applicableRate;\n };\n this.getAssignments = function () {\n return _this.assignmentSrv.getAssignments()\n .then(function (data) {\n if (data.length === 0 && _this.$location.path().indexOf(\"Business\")) {\n var blankAssignment = new Shared.InvoicingAssignment();\n blankAssignment.fullAssignmentName = 'No Active Assignments';\n data.push(blankAssignment);\n _this.data.selectedAssignment = data[0];\n }\n //supply the assignments in reverse date order\n var orderAssignmentsByDateStarted = _.sortBy(data, [function (o) { return _this.toDate(o); }]);\n _this.data.assignments = orderAssignmentsByDateStarted.reverse();\n // If the year is 1753 or the top assignment is still current, then assign it in the dropdown as the selected assignment\n if ((orderAssignmentsByDateStarted.length !== 0) &&\n (orderAssignmentsByDateStarted[0].dateEnded !== undefined)) {\n if ((_this.dateUtils.isSame(orderAssignmentsByDateStarted[0].dateEnded, '1753-01-01') || _this.dateUtils.isAfter(orderAssignmentsByDateStarted[0].dateEnded, moment().startOf('day'))) && orderAssignmentsByDateStarted.length === 1) {\n _this.data.selectedAssignment = orderAssignmentsByDateStarted[0];\n }\n }\n return data;\n });\n };\n this.toDate = function (item) {\n return _this.dateUtils.convertToJsDate(item.dateStarted);\n };\n }\n BrooksonBankLinkTransactionsController.$inject = ['bankLinkFactory', 'bankLink.enums', 'AssignmentSrv', 'brookson.utilities.date', \"$location\", '$state', 'orderByFilter'];\n return BrooksonBankLinkTransactionsController;\n }());\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .component('brooksonBankLinkTransactions', new Shared.BrooksonBankLinkTransactions());\n/// \nvar Shared;\n(function (Shared) {\n 'use strict';\n var BrooksonInputJobIndustry = /** @class */ (function () {\n function BrooksonInputJobIndustry() {\n this.bindings = {\n ngModel: '=',\n isRequired: '=',\n label: '@',\n field: '@',\n ngDisabled: '='\n };\n this.require = {\n form: '^form'\n };\n this.controller = BrooksonInputJobIndustryController;\n this.templateUrl = 'src/app/shared/views/inputs/brookson.input.job-industry.html';\n }\n return BrooksonInputJobIndustry;\n }());\n Shared.BrooksonInputJobIndustry = BrooksonInputJobIndustry;\n var BrooksonInputJobIndustryController = /** @class */ (function () {\n function BrooksonInputJobIndustryController(sdcFactory) {\n var _this = this;\n this.sdcFactory = sdcFactory;\n this.$onInit = function () {\n _this.industryList = Shared.IndustryList.getArray();\n };\n }\n BrooksonInputJobIndustryController.$inject = ['sdcFactory'];\n return BrooksonInputJobIndustryController;\n }());\n Shared.BrooksonInputJobIndustryController = BrooksonInputJobIndustryController;\n})(Shared || (Shared = {}));\nangular.module('app.shared')\n .component('brooksonInputJobIndustry', new Shared.BrooksonInputJobIndustry());\n/// \nvar Shared;\n(function (Shared) {\n var BrooksonExpensesInputSelectAssignment = /** @class */ (function () {\n function BrooksonExpensesInputSelectAssignment() {\n this.bindings = {\n ngModel: '=',\n ngChange: '=',\n ngDisabled: '=',\n optionsData: '=',\n classes: '@'\n };\n this.templateUrl = 'src/app/shared/views/inputs/expenses.input.select-assignment.html';\n }\n return BrooksonExpensesInputSelectAssignment;\n }());\n Shared.BrooksonExpensesInputSelectAssignment = BrooksonExpensesInputSelectAssignment;\n})(Shared || (Shared = {}));\nangular.module('app.shared')\n .component('brooksonExpensesInputSelectAssignment', new Shared.BrooksonExpensesInputSelectAssignment());\nvar Shared;\n(function (Shared) {\n \"use strict\";\n var BrooksonInputExpenseAmount = /** @class */ (function () {\n function BrooksonInputExpenseAmount() {\n this.bindings = {\n expense: \"=\",\n index: \"=\"\n };\n this.require = {};\n this.controller = BrooksonInputExpenseAmountController;\n this.templateUrl = \"src/app/shared/views/inputs/brookson.input.expense-amount.html\";\n }\n return BrooksonInputExpenseAmount;\n }());\n Shared.BrooksonInputExpenseAmount = BrooksonInputExpenseAmount;\n var BrooksonInputExpenseAmountController = /** @class */ (function () {\n function BrooksonInputExpenseAmountController($scope, orderByFilter, dateUtils, expensesFactory, expensesEnums) {\n var _this = this;\n this.$scope = $scope;\n this.orderByFilter = orderByFilter;\n this.dateUtils = dateUtils;\n this.expensesFactory = expensesFactory;\n this.expensesEnums = expensesEnums;\n this.maxVat = 0;\n this.$onInit = function () {\n _this.$scope.$watch(\"$ctrl.expense.isVatReclaimable\", function (newValue, oldValue) {\n if (oldValue && !newValue) {\n _this.expense.hasValidVatReceipt = false;\n _this.clearVat();\n }\n });\n _this.expensesFactory.getAllVatRates(true).then(function (result) {\n _this.vatRates = _this.orderByFilter(result, \"-startDate\");\n _this.setMaxVat();\n });\n _this.expensesFactory.getAllVatRatesConfig(true).then(function (result) {\n _this.vatRateConfig = _this.orderByFilter(result, \"-effectiveDate\");\n });\n };\n this.vatChanged = function () {\n _this.expense.net = (_this.expense.gross || 0) - (_this.expense.vat || 0);\n };\n this.clearVat = function () {\n _this.expense.vat = 0;\n _this.vatChanged();\n _this.maxVat = 0;\n };\n this.getVatAmount = function () {\n var vatRate = _this.getApplicableVatRate();\n return Math.floor((vatRate * (_this.expense.gross || 0)) / (100 + vatRate) * 100) / 100;\n };\n this.setMaxVat = function () {\n var vat = _this.getVatAmount();\n var vatRate = _this.getApplicableVatRate();\n var vat20precent = Math.floor((20 * (_this.expense.gross || 0)) / (100 + 20) * 100) / 100;\n _this.maxVat = vatRate > 0 && vatRate < 20 ? vat20precent : vat;\n };\n this.grossChanged = function () {\n if (_this.expense.hasValidVatReceipt) {\n _this.expense.vat = _this.getVatAmount();\n _this.setMaxVat();\n _this.vatChanged();\n }\n else {\n _this.clearVat();\n }\n };\n this.checkForExpenseWarning = function (index) {\n var expenseLine = _this.expensesFactory.regularExpenses[index];\n if (expenseLine && expenseLine.typeObject && expenseLine.expenseWarning) {\n var expenseWarning = _this.expensesFactory.getExpenseWarning(expenseLine.typeObject);\n if (expenseWarning) {\n if (expenseLine.expenseWarning && expenseLine.expenseWarning.warning && !expenseLine.expenseWarning.warning.highRisk) {\n if (expenseLine.net) {\n _this.expensesFactory.addExpenseWarningMessage(expenseWarning, expenseLine);\n if (expenseLine.expenseWarning.showWarningAmount) {\n _this.expensesFactory.removeExpenseWarnings(expenseWarning, expenseLine);\n }\n else {\n var exp = _.find(_this.expensesFactory.regularExpenses, function (e) { return !e.expenseWarning.warning && e.typeObject.paymentCode === expenseLine.typeObject.paymentCode; });\n if (exp) {\n _this.expensesFactory.addExpenseWarningMessage(expenseWarning, expenseLine);\n }\n }\n }\n }\n }\n }\n };\n this.hasValidVatReceiptChanged = function () {\n if (!_this.expense.hasValidVatReceipt) {\n _this.clearVat();\n }\n else if (_this.expense.gross) {\n _this.grossChanged();\n }\n };\n this.getApplicableVatRate = function () {\n var expenseDate = _this.expense.date ? _this.dateUtils.convertToJsDate(_this.expense.date) : new Date();\n var applicableRateConfig = _this.vatRateConfig ? _.find(_this.vatRateConfig, function (rateConfig) {\n if (_this.expense.typeObject && _this.expense.typeObject) {\n return expenseDate >= rateConfig.effectiveDate && expenseDate <= rateConfig.endDate && rateConfig.expenseCode === _this.expense.typeObject.paymentCode;\n }\n }) : new Shared.VatRateConfig();\n var applicableRateAmount = _this.vatRates ? _.find(_this.vatRates, function (rate) {\n return rate.startDate <= expenseDate;\n }).amount : 20;\n if (applicableRateConfig && applicableRateConfig.vatRate) {\n return applicableRateConfig.vatRate;\n }\n return applicableRateAmount;\n };\n }\n BrooksonInputExpenseAmountController.$inject = [\"$scope\", \"orderByFilter\", \"brookson.utilities.date\", \"brooksonFactoriesExpenses\"];\n return BrooksonInputExpenseAmountController;\n }());\n Shared.BrooksonInputExpenseAmountController = BrooksonInputExpenseAmountController;\n})(Shared || (Shared = {}));\nangular.module(\"app.shared\")\n .component(\"brooksonInputExpenseAmount\", new Shared.BrooksonInputExpenseAmount());\nvar Shared;\n(function (Shared) {\n \"use strict\";\n var BrooksonInputExpenseAttach = /** @class */ (function () {\n function BrooksonInputExpenseAttach() {\n this.bindings = {\n flow: '=',\n expense: \"=\",\n index: \"=\",\n parentController: \"=\",\n listener: \"=\",\n };\n this.require = {};\n this.controller = BrooksonInputExpenseAttachController;\n this.templateUrl = \"src/app/shared/views/inputs/brookson.input.expense-attach.html\";\n }\n return BrooksonInputExpenseAttach;\n }());\n Shared.BrooksonInputExpenseAttach = BrooksonInputExpenseAttach;\n var BrooksonInputExpenseAttachController = /** @class */ (function () {\n function BrooksonInputExpenseAttachController($scope, orderByFilter, dateUtils, expensesFactory) {\n this.$scope = $scope;\n this.orderByFilter = orderByFilter;\n this.dateUtils = dateUtils;\n this.expensesFactory = expensesFactory;\n }\n BrooksonInputExpenseAttachController.$inject = [\"$scope\", \"orderByFilter\", \"brookson.utilities.date\", \"brooksonFactoriesExpenses\"];\n return BrooksonInputExpenseAttachController;\n }());\n Shared.BrooksonInputExpenseAttachController = BrooksonInputExpenseAttachController;\n})(Shared || (Shared = {}));\nangular.module(\"app.shared\")\n .component(\"brooksonInputExpenseAttach\", new Shared.BrooksonInputExpenseAttach());\nvar Shared;\n(function (Shared) {\n 'use strict';\n var BrooksonInputJobTitle = /** @class */ (function () {\n function BrooksonInputJobTitle() {\n this.bindings = {\n ngModel: '=',\n isRequired: '=',\n label: '@',\n field: '@',\n ngReadonly: '=',\n ngDisabled: '=',\n placeholder: '@',\n ngPattern: '=',\n ngPatternMessage: '@',\n viewOnly: '='\n };\n this.require = {\n form: '^form'\n };\n this.controller = BrooksonInputJobTitleController;\n this.templateUrl = 'src/app/shared/views/inputs/brookson.input.job-title.html';\n }\n return BrooksonInputJobTitle;\n }());\n Shared.BrooksonInputJobTitle = BrooksonInputJobTitle;\n var BrooksonInputJobTitleController = /** @class */ (function () {\n function BrooksonInputJobTitleController(sdcFactory) {\n var _this = this;\n this.sdcFactory = sdcFactory;\n this.showSpinner = false;\n // Job Title Search\n this.searchJobTitle = function (query) {\n if (query) {\n _this.showSpinner = true;\n _this.sdcFactory.searchJobTitle(query, true).then(function (data) {\n _this.showSpinner = false;\n _this.listOfJobTitles = data;\n });\n }\n else {\n _this.listOfJobTitles = [];\n }\n };\n }\n BrooksonInputJobTitleController.$inject = ['sdcFactory'];\n return BrooksonInputJobTitleController;\n }());\n Shared.BrooksonInputJobTitleController = BrooksonInputJobTitleController;\n})(Shared || (Shared = {}));\nangular.module('app.shared')\n .component('brooksonInputJobTitle', new Shared.BrooksonInputJobTitle());\n/// \nvar Shared;\n(function (Shared) {\n var BrooksonPaymentCreatePayment = /** @class */ (function () {\n function BrooksonPaymentCreatePayment() {\n this.controller = BrooksonPaymentCreatePaymentController;\n this.templateUrl = 'src/app/shared/views/bank/brookson.bankLink.transactions.html';\n }\n return BrooksonPaymentCreatePayment;\n }());\n Shared.BrooksonPaymentCreatePayment = BrooksonPaymentCreatePayment;\n var BrooksonPaymentCreatePaymentController = /** @class */ (function () {\n function BrooksonPaymentCreatePaymentController(window, $location, $state) {\n var _this = this;\n this.window = window;\n this.$location = $location;\n this.$state = $state;\n this.$onInit = function () {\n };\n this.invokeBackButton = function () {\n _this.window.history.back();\n };\n }\n BrooksonPaymentCreatePaymentController.$inject = [\"$window\", \"$location\", '$state'];\n return BrooksonPaymentCreatePaymentController;\n }());\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .component('brooksonPaymentCreatePayment', new Shared.BrooksonPaymentCreatePayment());\n/// \nvar Shared;\n(function (Shared) {\n 'use strict';\n var BrooksonAuthCodeInput = {\n bindings: {},\n controller: 'BrooksonAuthCodeInputController',\n templateUrl: 'src/app/shared/views/ui/brookson.ui.auth-code.input.html',\n transclude: true\n };\n angular\n .module('app.shared')\n .component('brooksonAuthCodeInput', BrooksonAuthCodeInput);\n})(Shared || (Shared = {}));\n(function (Shared) {\n 'use strict';\n var BrooksonAuthCodeInputController = /** @class */ (function () {\n function BrooksonAuthCodeInputController(taskPlannerSrv, growl) {\n var _this = this;\n this.taskPlannerSrv = taskPlannerSrv;\n this.growl = growl;\n this.authCodePattern = /^SA\\d{8}$/i;\n this.updateAuthCode = function () {\n if (!_this.authCodePattern.test(_this.authCode)) {\n var config = { title: \"Task Planner\" };\n _this.growl.error(\"Authorisation code must be 10 digits\", config);\n return;\n }\n _this.taskPlannerSrv.updateAuthCode(_this.authCode);\n };\n }\n BrooksonAuthCodeInputController.$inject = ['taskPlannerSrv', 'growl'];\n return BrooksonAuthCodeInputController;\n }());\n Shared.BrooksonAuthCodeInputController = BrooksonAuthCodeInputController;\n angular\n .module('app.shared')\n .controller('BrooksonAuthCodeInputController', BrooksonAuthCodeInputController);\n})(Shared || (Shared = {}));\n/// \n/// \nvar Shared;\n(function (Shared) {\n 'use strict';\n var BrooksonConfirmAcccountsController = /** @class */ (function () {\n function BrooksonConfirmAcccountsController($location, data, navigation, brooksonFileDownload) {\n var _this = this;\n this.$location = $location;\n this.data = data;\n this.navigation = navigation;\n this.brooksonFileDownload = brooksonFileDownload;\n this.yearEndStage = new Shared.MemberCurrentStage();\n this.confirmStep = function (step) {\n _this.data.confirmAccountsStep(step).then(function (result) {\n if (result) {\n _this.data.getYearEndStatus().then(function (status) {\n _this.yearEndStatus = status;\n });\n }\n });\n };\n data.getYearEndStatus().then(function (status) {\n _this.yearEndStatus = status;\n });\n data.getYearEndStage().then(function (data) {\n _this.yearEndStage = data;\n });\n }\n Object.defineProperty(BrooksonConfirmAcccountsController.prototype, \"step1Confirmed\", {\n get: function () {\n return this.yearEndStatus >= 2;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrooksonConfirmAcccountsController.prototype, \"step2Confirmed\", {\n get: function () {\n return this.yearEndStatus >= 3;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Takes the user to the IR35 section\n *\n *\n * @memberOf BrooksonConfirmAcccountsController\n */\n BrooksonConfirmAcccountsController.prototype.goToIR35 = function () {\n this.navigation.employmentStatus.main(this.$location.url(), 'Back to Task Planner');\n };\n BrooksonConfirmAcccountsController.prototype.downloadDocuments = function () {\n var url = \"api/DocumentStorage/GetZipDocuments\";\n var expectedMediaType = \"application/zip\";\n var requestData = this.action.documents;\n this.brooksonFileDownload.downloadAndSave(url, requestData, \"Brookson.Documents.zip\", expectedMediaType);\n };\n BrooksonConfirmAcccountsController.$inject = ['$location', 'taskPlannerSrv', 'brookson.navigation', 'brookson.file.download'];\n return BrooksonConfirmAcccountsController;\n }());\n Shared.BrooksonConfirmAcccountsController = BrooksonConfirmAcccountsController;\n Shared.BrooksonConfirmAccounts = {\n bindings: {\n action: '='\n },\n controller: BrooksonConfirmAcccountsController,\n templateUrl: 'src/app/shared/views/ui/brookson.ui.confirm.accounts.html',\n transclude: true\n };\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .component('brooksonConfirmAccounts', Shared.BrooksonConfirmAccounts);\n/// \n/// \nvar Shared;\n(function (Shared) {\n 'use strict';\n var BrooksonConfirmSelfAssessmentController = /** @class */ (function () {\n function BrooksonConfirmSelfAssessmentController(data, brooksonNavigation, $window) {\n var _this = this;\n this.data = data;\n this.brooksonNavigation = brooksonNavigation;\n this.$window = $window;\n this.approved = false;\n this.payBeforeApproval = false;\n this.utrNumberUpdated = true;\n this.disableWorldPay = false;\n this.confirmTax = function () {\n _this.data.updatePackStatus().then(function () {\n _this.approved = true;\n });\n };\n this.confirmStep = function (step) {\n _this.data.confirmAccountsStep(step).then(function (result) {\n if (result) {\n _this.data.getTaxPackStatus().then(function (status) {\n _this.taxPackStatus = status;\n });\n }\n });\n };\n this.showUtrSection = function () {\n if (!_this.taxPackFiled) {\n if (_this.showAwaitingUtrNumber() || _this.showInvalidUtrNumber())\n return true;\n }\n return false;\n };\n this.showAwaitingUtrNumber = function () {\n if (!_this.utrNumber)\n return false;\n return !_this.utrNumber.utrNumber;\n };\n this.showInvalidUtrNumber = function () {\n if (!_this.utrNumber)\n return false;\n return !new RegExp(\"^[0-9]{10}$\").test(_this.utrNumber.utrNumber);\n };\n this.gotoSelfAssessment = function () {\n _this.brooksonNavigation.personalTax.selfAssessment();\n };\n this.gotoComfirmAndPay = function () {\n _this.brooksonNavigation.personalTax.selfAssessmentTAndCs();\n };\n this.disableWorldPay = this.$window.appSettings.disableWorldPay;\n data.getTaxPackStatus().then(function (status) {\n _this.taxPackStatus = status;\n });\n data.getIsPayBeforeSubmit().then(function (result) {\n _this.payBeforeApproval = result;\n });\n data.getUtrNumber().then(function (result) {\n _this.utrNumber = result;\n });\n }\n Object.defineProperty(BrooksonConfirmSelfAssessmentController.prototype, \"taxPackAvailableToComplete\", {\n get: function () {\n return this.taxPackStatus === -1 || this.taxPackStatus === 0 || this.taxPackStatus === -3;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrooksonConfirmSelfAssessmentController.prototype, \"taxPackAvailableToConfirm\", {\n get: function () {\n return this.taxPackStatus === 3;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrooksonConfirmSelfAssessmentController.prototype, \"taxPackConfirmed\", {\n get: function () {\n return this.taxPackStatus === 1;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrooksonConfirmSelfAssessmentController.prototype, \"taxPackFiled\", {\n get: function () {\n return this.taxPackStatus === 99;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(BrooksonConfirmSelfAssessmentController.prototype, \"hasApproved\", {\n get: function () {\n return this.taxPackStatus === 2;\n },\n enumerable: false,\n configurable: true\n });\n BrooksonConfirmSelfAssessmentController.$inject = ['taskPlannerSrv', 'brookson.navigation', '$window'];\n return BrooksonConfirmSelfAssessmentController;\n }());\n Shared.BrooksonConfirmSelfAssessmentController = BrooksonConfirmSelfAssessmentController;\n Shared.BrooksonConfirmSelfAssessment = {\n bindings: {\n action: '='\n },\n controller: BrooksonConfirmSelfAssessmentController,\n templateUrl: 'src/app/shared/views/ui/brookson.ui.confirm.self.assessment.html',\n transclude: true\n };\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .component('brooksonConfirmSelfAssessment', Shared.BrooksonConfirmSelfAssessment);\nvar Shared;\n(function (Shared) {\n var BrooksonConfirmFinancialHealthCheckController = /** @class */ (function () {\n function BrooksonConfirmFinancialHealthCheckController($sce, calendlySrv, welcomeSrv, dateUtils) {\n var _this = this;\n this.$sce = $sce;\n this.calendlySrv = calendlySrv;\n this.welcomeSrv = welcomeSrv;\n this.dateUtils = dateUtils;\n //default to false otherwise will show on load.\n this.showCalendarScreen = false;\n this.$onInit = function () {\n var financialCalendarUrl = _this.welcomeScreenData.calendars.some(function (f) { return f.eventType === \"Financial Health Check\"; }) ? _this.welcomeScreenData.calendars.filter(function (f) { return f.eventType === \"Financial Health Check\"; })[0].calendarUrl : null;\n var financialHealthCheckUrl = !financialCalendarUrl ? null : _this.$sce.trustAsResourceUrl(financialCalendarUrl);\n if (financialHealthCheckUrl) {\n _this.calendlySrv.getCalendlyFinancialHealthCheckBooking().then(function (data) {\n if (data) {\n var financialHealthCheckCalendlyBooking = data;\n var endDate = _this.dateUtils.convertToJsDate(data.endDate);\n var todaysDate = new Date();\n var minimumPreviousDate = new Date();\n minimumPreviousDate.setDate(minimumPreviousDate.getDate() - 30);\n if (financialHealthCheckCalendlyBooking.uuid && endDate >= todaysDate) {\n _this.welcomeSrv.financialHealthCheckCalendlyBooking = financialHealthCheckCalendlyBooking;\n _this.financialHealthCheckUrl = _this.$sce.trustAsResourceUrl('https://calendly.com/reschedulings/' + financialHealthCheckCalendlyBooking.uuid);\n }\n if (endDate <= minimumPreviousDate) {\n _this.welcomeSrv.financialHealthCheckCalendlyBooking = financialHealthCheckCalendlyBooking;\n _this.financialHealthCheckUrl = financialHealthCheckUrl;\n _this.welcomeSrv.financialHealthCheckCalendlyBooking.uuid = null;\n }\n }\n });\n }\n };\n }\n BrooksonConfirmFinancialHealthCheckController.prototype.openBookingScreen = function () {\n this.showCalendarScreen = true;\n };\n BrooksonConfirmFinancialHealthCheckController.$inject = ['$sce', 'calendlySrv', 'welcomeSrv', 'brookson.utilities.date'];\n return BrooksonConfirmFinancialHealthCheckController;\n }());\n Shared.BrooksonConfirmFinancialHealthCheckController = BrooksonConfirmFinancialHealthCheckController;\n Shared.BrooksonConfirmFinancialHealthCheck = {\n bindings: {\n action: '=',\n welcomeScreenData: '='\n },\n controller: BrooksonConfirmFinancialHealthCheckController,\n templateUrl: 'src/app/shared/views/ui/brookson.ui.confirm.financial-health-check.html',\n transclude: true\n };\n})(Shared || (Shared = {}));\nangular.module('app.shared')\n .component('brooksonConfirmFinancialHealthCheck', Shared.BrooksonConfirmFinancialHealthCheck);\n/// \n/// \nvar Shared;\n(function (Shared) {\n var HeaderController = /** @class */ (function () {\n function HeaderController($window, memberSrv, authenticationSrv, brooksonNotificationsManager, taskPlannerEnums, brooksonNavigation, notificationEnums, sdcModalService, ir35DetailCaptureModalService, appSettings, ir35DetailCaptureService, sdcService, umbrellaTrustModalService, memberEnums, publicSectorAssignmentCheckModalService, publicSectorAssignmentCheckService, $sce, calendlyFactory, welcomeSrv, calendlySrv, dateUtils, swapServiceLineSrv) {\n var _this = this;\n this.$window = $window;\n this.memberSrv = memberSrv;\n this.authenticationSrv = authenticationSrv;\n this.brooksonNotificationsManager = brooksonNotificationsManager;\n this.taskPlannerEnums = taskPlannerEnums;\n this.brooksonNavigation = brooksonNavigation;\n this.notificationEnums = notificationEnums;\n this.sdcModalService = sdcModalService;\n this.ir35DetailCaptureModalService = ir35DetailCaptureModalService;\n this.appSettings = appSettings;\n this.ir35DetailCaptureService = ir35DetailCaptureService;\n this.sdcService = sdcService;\n this.umbrellaTrustModalService = umbrellaTrustModalService;\n this.memberEnums = memberEnums;\n this.publicSectorAssignmentCheckModalService = publicSectorAssignmentCheckModalService;\n this.publicSectorAssignmentCheckService = publicSectorAssignmentCheckService;\n this.$sce = $sce;\n this.calendlyFactory = calendlyFactory;\n this.welcomeSrv = welcomeSrv;\n this.calendlySrv = calendlySrv;\n this.dateUtils = dateUtils;\n this.swapServiceLineSrv = swapServiceLineSrv;\n this.$onInit = function () {\n _this.todaysDate = new Date();\n _this.brooksonNotificationsManager.getNotifications();\n _this.member = _this.memberSrv.getMember();\n _this.memberSrv.getMemberDetails(true, false).then(function (data) {\n _this.memberDetails = data;\n // Check whether the user needs to see the 'umbrella only don't show this to your trust' splash screen enabled\n _this.checkUmbrellaTrustOutcome();\n });\n _this.checkSdcModal();\n _this.checkIR35DetailCapture();\n _this.checkPublicSectorAssignmentCheck();\n _this.checkWelcomeScreen();\n };\n /**\n * BEGIN: SDC\n */\n // Returns whether the SDC modal should be displayed for this member\n this.shouldDisplaySdcModal = function () {\n return _this.appSettings.displaySdcQuestionnaireCompletionPopup === true && !_.startsWith(window.location.pathname, \"/Assignments\");\n };\n // Opens the SDC modal - Disabled UMBR-30\n //private displaySdcModal = (): void => {\n // this.sdcModalService.show();\n //}\n // Checks whether the SDC modal should be displayed for this member and displays it if applicable\n this.checkSdcModal = function () {\n if (_this.shouldDisplaySdcModal()) {\n _this.getAssignmentOutcomes();\n }\n };\n // Returns a list of assignment outcomes from the API\n this.getAssignmentOutcomes = function () {\n return _this.sdcService.getAssignmentOutcomes().then(_this.handleGetAssignmentOutcomesResponse);\n };\n // Sets the appropiate properties when the reponse has returned from the API GetAssignnmentOutcome response\n this.handleGetAssignmentOutcomesResponse = function (data) {\n _this.assignmentOutcomes = data.filter(function (x) { return x.outcome === Shared.SdcOutcomeType.NotAssessed; });\n // Disable SDC (UMBR-30)\n //if (this.assignmentOutcomes.length) {\n // this.displaySdcModal();\n //}\n return _this.assignmentOutcomes;\n };\n /**\n * END: SDC\n */\n /**\n * BEGIN: IR35 detail capture\n *\n * Methods:\n * - enableIR35DetailCaptureModal\n * - displayIR35DetailCaptureModal\n * - checkIR35DetailCaptureModal\n */\n // Returns whether the IR35 Detail Capture modal is set to be displayed via web.config\n this.ir35DetailCaptureModalEnabled = function () {\n return _this.appSettings.displayIR35DetailCapturePopup === true;\n };\n // Opens the IR35 Detail Capture modal\n this.displayIR35DetailCaptureModal = function () {\n _this.ir35DetailCaptureModalService.show();\n };\n // Checks whether the IR35 detail capture modal needs triggering\n this.checkIR35DetailCapture = function () {\n _this.getIR35DetailCaptureOutcome();\n };\n this.checkWelcomeScreen = function () {\n _this.getWelcomeScreenDetails();\n };\n this.getWelcomeScreenDetails = function () {\n {\n _this.welcomeSrv.getWelcomeScreen().then(function (welcomeScreen) {\n _this.showCalenderLink = false;\n if (welcomeScreen.hasWelcomeScreen) {\n _this.accountantName = welcomeScreen.accountantFirstName;\n var accountantIntroductionCalendarUrl = welcomeScreen.calendars.some(function (f) { return f.eventType === \"Introduction call\"; }) ? welcomeScreen.calendars.filter(function (f) { return f.eventType === \"Introduction call\"; })[0].calendarUrl : null;\n _this.accountantIntroductionUrl = !accountantIntroductionCalendarUrl ? null : _this.$sce.trustAsResourceUrl(accountantIntroductionCalendarUrl);\n if (_this.accountantIntroductionUrl) {\n _this.calendlySrv.getCalendlyIntroductionBooking().then(function (data) {\n if (data) {\n var microCalendlyBooking = data;\n var endDate = _this.dateUtils.convertToJsDate(microCalendlyBooking.endDate);\n var date = new Date();\n date.setDate(date.getDate());\n if (microCalendlyBooking.uuid && endDate >= date) {\n _this.welcomeSrv.microCalendlyBooking = microCalendlyBooking;\n _this.accountantIntroductionUrl = _this.$sce.trustAsResourceUrl('https://calendly.com/reschedulings/' + microCalendlyBooking.uuid);\n _this.showCalenderLink = true;\n }\n else if (microCalendlyBooking.uuid && endDate < date) {\n _this.showCalenderLink = false;\n _this.accountantIntroductionUrl = null;\n }\n else {\n _this.welcomeSrv.microCalendlyBooking = microCalendlyBooking;\n _this.showCalenderLink = true;\n }\n }\n });\n }\n }\n var advisoryDocCalendarUrl = welcomeScreen.calendars.some(function (f) { return f.eventType === \"Advisory Doc\"; }) ? welcomeScreen.calendars.filter(function (f) { return f.eventType === \"Advisory Doc\"; })[0].calendarUrl : null;\n var advisoryDocUrl = !advisoryDocCalendarUrl ? null : _this.$sce.trustAsResourceUrl(advisoryDocCalendarUrl);\n if (advisoryDocUrl) {\n _this.calendlySrv.getCalendlyAdvisoryBooking().then(function (advisoryDocumentCalendlyBooking) {\n if (advisoryDocumentCalendlyBooking) {\n var endDate = _this.dateUtils.convertToJsDate(advisoryDocumentCalendlyBooking.endDate);\n var date = new Date();\n date.setDate(date.getDate());\n var minimumPreviousDate = new Date();\n minimumPreviousDate.setDate(minimumPreviousDate.getDate() - 30);\n if (advisoryDocumentCalendlyBooking.uuid && endDate >= date) {\n _this.welcomeSrv.advisoryDocumentCalendlyBooking = advisoryDocumentCalendlyBooking;\n _this.advisoryDocUrl = _this.$sce.trustAsResourceUrl('https://calendly.com/reschedulings/' + advisoryDocumentCalendlyBooking.uuid);\n _this.showCalenderLink = true;\n }\n if (endDate <= minimumPreviousDate) {\n _this.welcomeSrv.advisoryDocumentCalendlyBooking = advisoryDocumentCalendlyBooking;\n _this.advisoryDocUrl = advisoryDocUrl;\n _this.showCalenderLink = true;\n _this.welcomeSrv.advisoryDocumentCalendlyBooking.uuid = null;\n }\n }\n });\n }\n var financialCalendarUrl = welcomeScreen.calendars.some(function (f) { return f.eventType === \"Financial Health Check\"; }) ? welcomeScreen.calendars.filter(function (f) { return f.eventType === \"Financial Health Check\"; })[0].calendarUrl : null;\n var financialHealthCheckUrl = !financialCalendarUrl ? null : _this.$sce.trustAsResourceUrl(financialCalendarUrl);\n if (financialHealthCheckUrl) {\n _this.calendlySrv.getCalendlyFinancialHealthCheckBooking().then(function (financialHealthCheckCalendlyBooking) {\n if (financialHealthCheckCalendlyBooking) {\n var endDate = _this.dateUtils.convertToJsDate(financialHealthCheckCalendlyBooking.endDate);\n var todaysDate = new Date();\n var minimumPreviousDate = new Date();\n minimumPreviousDate.setDate(minimumPreviousDate.getDate() - 30);\n if (financialHealthCheckCalendlyBooking.uuid && endDate >= todaysDate) {\n _this.welcomeSrv.financialHealthCheckCalendlyBooking = financialHealthCheckCalendlyBooking;\n _this.financialHealthCheckUrl = _this.$sce.trustAsResourceUrl('https://calendly.com/reschedulings/' + financialHealthCheckCalendlyBooking.uuid);\n _this.showCalenderLink = true;\n }\n if (endDate <= minimumPreviousDate) {\n _this.welcomeSrv.financialHealthCheckCalendlyBooking = financialHealthCheckCalendlyBooking;\n _this.showCalenderLink = true;\n _this.financialHealthCheckUrl = financialHealthCheckUrl;\n _this.welcomeSrv.financialHealthCheckCalendlyBooking.uuid = null;\n }\n }\n });\n }\n });\n }\n };\n this.displayIntroductionCalenderScreen = function () {\n _this.showCalenderScreen = true;\n _this.displaySourceUrl = _this.accountantIntroductionUrl;\n };\n this.displayFinancialHealthCheckScreen = function () {\n _this.showCalenderScreen = true;\n _this.displaySourceUrl = _this.financialHealthCheckUrl;\n };\n this.displayAdvisoryDocScreen = function () {\n _this.showCalenderScreen = true;\n _this.displaySourceUrl = _this.advisoryDocUrl;\n };\n this.hideCalenderScreen = function () {\n _this.showCalenderScreen = false;\n };\n // Returns a list of assignment outcomes from the API\n this.getIR35DetailCaptureOutcome = function () {\n return _this.ir35DetailCaptureService.getIR35DetailCaptureOutcome().then(_this.handleRequiresCompletionResponse);\n };\n // Sets the appropiate properties when the reponse has returned from the API GetAssignnmentOutcome response\n this.handleRequiresCompletionResponse = function (data) {\n if (_this.ir35DetailCaptureModalEnabled() && data.requiresCompletion) {\n _this.displayIR35DetailCaptureModal();\n }\n return data;\n };\n /**\n * END: IR35 detail capture\n */\n /**\n * BEGIN: UmbrellaTrustTimesheetModal\n */\n // Returns true if the member's company ref is UM1004U\n this.isMemberCompanyRefUM1004U = function () {\n return _this.memberDetails.companyRef === \"UM1004U\";\n };\n this.isUmbrellaTrustModalConfigEnabled = function () {\n return _this.appSettings.displayUmbrellaTrustModal === true;\n };\n this.getUmbrellaTrustModalOutcome = function () {\n return _this.isMemberCompanyRefUM1004U() && _this.isUmbrellaTrustModalConfigEnabled();\n };\n this.checkUmbrellaTrustOutcome = function () {\n // if getUmbrellaTrustModalOutcome === true, display the modal\n if (_this.getUmbrellaTrustModalOutcome()) {\n _this.displayUmbrellaTrustOutcome();\n }\n };\n this.displayUmbrellaTrustOutcome = function () {\n _this.umbrellaTrustModalService.show();\n };\n /**\n * END: UmbrellaTrustTimesheetModal\n */\n // Returns whether the assignemnts check modal is set to be displayed or not via web.config\n this.publicSectorAssignmentCheckModalEnabled = function () {\n return _this.appSettings.displayPublicSectorAssignmentCheckPopup === true;\n };\n // Opens the assignment check modal\n this.displayPublicSectorAssignmentCheckModal = function () {\n _this.publicSectorAssignmentCheckModalService.show();\n };\n // Checks whether the assignment check modal needs triggering\n this.checkPublicSectorAssignmentCheck = function () {\n _this.getPublicSectorAssignmentCheckOutcome();\n };\n // Returns a list of flagged assignments from the API\n this.getPublicSectorAssignmentCheckOutcome = function () {\n return _this.publicSectorAssignmentCheckService.getPublicSectorAssignmentCheckOutcome().then(_this.handlePublicSectorAssignmentCheckCompletionResponse);\n };\n // Sets the appropriate properties when the response has return from the API GetAllOpenUnknownSectorAssignments response\n this.handlePublicSectorAssignmentCheckCompletionResponse = function (data) {\n if (_this.publicSectorAssignmentCheckModalEnabled() && data.length) {\n _this.displayPublicSectorAssignmentCheckModal();\n }\n return data;\n };\n }\n HeaderController.prototype.logout = function () {\n this.authenticationSrv.logout();\n };\n // Account Details Methods\n HeaderController.prototype.goToAccountDetails = function () {\n this.brooksonNavigation.account.main();\n };\n // Task Planner Methods\n HeaderController.prototype.containsOverdueTasks = function () {\n return _.some(this.brooksonNotificationsManager.notifications.planner, { 'status': this.taskPlannerEnums.TaskStatus.OVERDUE });\n };\n // Notifications Methods\n HeaderController.prototype.closeAlerts = function () {\n this.brooksonNotificationsManager.closeAlerts();\n };\n /**\n * Returns whether or not the connect 2 button should be shown based\n * on whether the user joined after 03/10/2016\n *\n * @returns {boolean}\n *\n * @memberOf HeaderController\n */\n HeaderController.prototype.showConnect2Button = function () {\n if (!this.memberDetails)\n return false;\n return this.memberDetails.connect2Enabled;\n };\n HeaderController.$inject = ['$window', 'memberSrv', 'authenticationSrv', 'brookson.notifications.manager',\n 'taskPlanner.enums', 'brookson.navigation', 'notification.enums', 'brookson.modal.sdc',\n 'brookson.modal.ir35DetailCapture', 'appSettings', 'ir35DetailCaptureService', 'sdcService',\n 'umbrellaTrustModalService', \"member.enums\",\n 'publicSectorAssignmentCheckModalService', 'publicSectorAssignmentCheckService',\n '$sce', 'brooksonFactoriesCalendly', 'welcomeSrv', 'calendlySrv', 'brookson.utilities.date',\n 'swapServiceLineSrv'];\n return HeaderController;\n }());\n Shared.HeaderController = HeaderController;\n})(Shared || (Shared = {}));\nangular.module('app.shared').component('brooksonSharedHeader', {\n controller: Shared.HeaderController,\n templateUrl: 'src/app/shared/views/header.html'\n});\n/// \n/// \nvar Shared;\n(function (Shared) {\n var BrooksonSharedNavigation = /** @class */ (function () {\n function BrooksonSharedNavigation() {\n this.controller = BrooksonSharedNavigationController;\n this.templateUrl = \"src/app/shared/views/navigation.html\";\n }\n return BrooksonSharedNavigation;\n }());\n Shared.BrooksonSharedNavigation = BrooksonSharedNavigation;\n var BrooksonSharedNavigationController = /** @class */ (function () {\n function BrooksonSharedNavigationController($window, $state, $rootScope, $location, stateParams, memberSrv, dashboardService, privacyFactory, introFactory, screenSize, appSettings, memberEnums, swapServiceLineSrv, serviceLineSrv) {\n var _this = this;\n this.$window = $window;\n this.$state = $state;\n this.$rootScope = $rootScope;\n this.$location = $location;\n this.stateParams = stateParams;\n this.memberSrv = memberSrv;\n this.dashboardService = dashboardService;\n this.privacyFactory = privacyFactory;\n this.introFactory = introFactory;\n this.screenSize = screenSize;\n this.appSettings = appSettings;\n this.memberEnums = memberEnums;\n this.swapServiceLineSrv = swapServiceLineSrv;\n this.serviceLineSrv = serviceLineSrv;\n this.pscOpen = false;\n this.pfOpen = false;\n this.ptOpen = false;\n this.managerZoneOpen = false;\n this.employeeZoneOpen = false;\n this.$onInit = function () {\n _this.checkNavigationDropdowns();\n _this.$rootScope.$on(\"$stateChangeSuccess\", function () { _this.checkNavigationDropdowns(); });\n };\n this.getMemberBusinessTypes = function () {\n _this.member.ltdCustomerReference = _this.$window.appSettings.ltdCustomerReference;\n _this.member.hasLtdBusinessType = _this.$window.appSettings.hasLtdBusinessType;\n _this.member.umbCustomerReference = _this.$window.appSettings.umbCustomerReference;\n _this.member.hasUmbBusinessType = _this.$window.appSettings.hasUmbBusinessType;\n _this.member.hasMulipleLtdCompanies = _this.$window.appSettings.hasMulipleLtdCompanies;\n };\n this.showHamburger = function () {\n return _this.screenSize.is('xs');\n };\n this.changeUserServiceLine = function () {\n _this.swapServiceLineSrv.changeSelectedServiceLine(_this.member.umbCustomerReference);\n };\n this.showDashboardButtons = function () {\n return _this.$state.includes(\"*.dashboard\");\n };\n this.deleteDashboards = function () {\n _this.dashboardService.showDelete().then(function (dashboards) {\n if (dashboards.length) {\n _this.dashboardService.deleteDashboards(dashboards);\n }\n });\n };\n this.setCustomiseOn = function (value) {\n _this.dashboardService.customiseOn = value;\n };\n this.getCustomiseOn = function () {\n return _this.dashboardService.customiseOn;\n };\n this.deleteEnabled = function () {\n return _.some(_this.dashboardService.userDashboards, { 'isBrookson': false });\n };\n this.getMember = function () {\n return _this.memberSrv.getMember();\n };\n this.checkNavigationDropdowns = function () {\n _this.checkNavigationDropdown(\"personalTax\");\n _this.checkNavigationDropdown(\"personalFinance\");\n _this.checkNavigationDropdown(\"psc\");\n _this.checkNavigationDropdown(\"financialCenter\");\n _this.checkNavigationDropdown(\"sme\");\n _this.checkNavigationDropdown(\"employeeSme\");\n _this.checkNavigationDropdown(\"smePersonalTax\");\n _this.checkNavigationDropdown(\"advisory\");\n /*this.checkNavigationDropdown(\"jobsboard\");*/\n // this.checkNavigationDropdown(\"knowledgeBase\");\n _this.checkNavigationDropdown(\"flexUmbrella\");\n _this.checkNavigationDropdown(\"flexCompany\");\n _this.checkNavigationDropdown(\"financialServices\");\n };\n this.togglePSC = function (value) {\n if (!_this.showHamburger())\n _this.pscOpen = value;\n };\n this.togglePF = function (value) {\n if (!_this.showHamburger())\n _this.pfOpen = value;\n };\n this.togglePT = function (value) {\n if (!_this.showHamburger())\n _this.ptOpen = value;\n };\n this.toggleManagerZone = function (value) {\n _this.managerZoneOpen = value;\n };\n this.toggleEmployeeZone = function (value) {\n _this.employeeZoneOpen = value;\n };\n this.checkNavigationDropdown = function (id) {\n var dropdown = angular.element(\"#\".concat(id));\n var dropdownLinks = dropdown.find(\".dropdownmenu a\");\n dropdownLinks = dropdownLinks.length ? dropdownLinks : dropdown.find(\"a\");\n dropdown.removeClass(\"current\");\n dropdownLinks.removeClass(\"active\");\n //Remove\n dropdown.removeClass(\"active\");\n if (_this.$location.path().indexOf(\"StarterZone/WorkFlex\") === 1 && id === \"flexCompany\") {\n dropdown.addClass(\"current\");\n //Remove\n dropdown.addClass(\"active\");\n }\n // Ensure that the document storage link is highlighted if any of the document storage states are activated\n if (_this.$location.path().indexOf(\"DocumentStorage\") !== -1 &&\n _this.$location.path().indexOf(\"DocumentStorage/4\") !== 1 &&\n id === \"psc\") {\n dropdown.addClass(\"current\");\n dropdown.find('a[href*=\"/DocumentStorage/RecentlyAdded\"]').addClass(\"current\");\n //Remove\n dropdown.addClass(\"active\");\n dropdown.find('a[href*=\"/DocumentStorage/RecentlyAdded\"]').addClass(\"active\");\n }\n else {\n _.forEach(dropdownLinks, function (link) {\n var angularLink = angular.element(link);\n var ignorePathsAttribute = link.attributes[\"ignore-paths\"];\n var ignorePaths = ignorePathsAttribute ? _.split(ignorePathsAttribute.value, \",\") : [];\n var pathShouldBeIgnored = _.some(ignorePaths, function (value) { return _.startsWith(_this.$location.path(), value); });\n if (_.startsWith(_this.$location.path(), link.pathname) && !pathShouldBeIgnored) {\n angularLink.addClass(\"active\");\n dropdown.addClass(\"current\");\n //Remove\n dropdown.addClass(\"active\");\n }\n });\n }\n };\n this.hideBreadcrumb = function () {\n return (_this.stateParams.hideBreadcrumb && _this.stateParams.hideBreadcrumb === true);\n };\n this.isActive = function (location, explicit) {\n var activeClass = \"current\";\n if (explicit) {\n return location === _this.$location.path() ? activeClass : \"\";\n }\n return _.startsWith(_this.$location.path(), location) ? \"active\" : \"\";\n };\n this.isActivePsc = function () {\n return \"current\";\n };\n this.window = $window;\n this.member = this.getMember();\n this.togglePrivacy = this.privacyFactory.togglePrivacy;\n this.memberBusinessType = this.memberSrv.getMemberBusinessType();\n var umbrellaAssignmentSdcStatusChangeListener = this.$rootScope.$on(\"UmbrellaAssignmentSDCStatusChange\", function (event, memberSdcStatus) {\n if (_this.window.appSettings.pscExpensesEnabledGlobally) {\n if (!_this.member.serviceLines[0].isEligible) { // Do not add expenses if the customer is a leaver\n if (memberSdcStatus.SDCStatus === 4) { // If an assignment has passed SDC checks then enable the expenses menu option.\n _this.window.appSettings.pscExpensesEnabled = true;\n return;\n }\n }\n _this.window.appSettings.pscExpensesEnabled = false;\n }\n });\n this.$rootScope.$on(\"$destroy\", function () {\n umbrellaAssignmentSdcStatusChangeListener(); // Deregister umbrellaAssignmentSDCStatusChangeListener on destroy\n });\n this.getMemberBusinessTypes();\n memberSrv.getHasAdvisoryKeyInformation().then(function (response) {\n _this.hasAdvisorySection = response;\n });\n memberSrv.getHasAdvisoryKeyInformationUmbrella().then(function (response) {\n _this.hasAdvisorySectionUmb = response;\n });\n }\n BrooksonSharedNavigationController.$inject = [\n \"$window\", \"$state\", \"$rootScope\", \"$location\", \"$stateParams\",\n \"memberSrv\", \"dashboardService\", \"brookson.factory.privacy\",\n \"brooksonFactoriesIntro\", \"screenSize\", \"appSettings\", \"member.enums\",\n \"swapServiceLineSrv\", \"serviceLineSrv\"\n ];\n return BrooksonSharedNavigationController;\n }());\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .component('brooksonSharedNavigation', new Shared.BrooksonSharedNavigation());\nvar Shared;\n(function (Shared) {\n 'use strict';\n var BrooksonUmbrellaFlexFormController = /** @class */ (function () {\n function BrooksonUmbrellaFlexFormController() {\n }\n return BrooksonUmbrellaFlexFormController;\n }());\n Shared.BrooksonUmbrellaFlexFormController = BrooksonUmbrellaFlexFormController;\n Shared.BrooksonUmbrellaFlexForm = {\n bindings: {\n actionTile: '='\n },\n controller: BrooksonUmbrellaFlexFormController,\n templateUrl: 'src/app/shared/views/ui/brookson.ui.flex.form.html',\n transclude: true\n };\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .component('brooksonUmbrellaFlexForm', Shared.BrooksonUmbrellaFlexForm);\n/// \nvar Shared;\n(function (Shared) {\n 'use strict';\n var BrooksonUtrInput = {\n bindings: {},\n controller: 'BrooksonUtrInputController',\n templateUrl: 'src/app/shared/views/ui/brookson.ui.utr.input.html',\n transclude: true\n };\n angular\n .module('app.shared')\n .component('brooksonUtrInput', BrooksonUtrInput);\n})(Shared || (Shared = {}));\n(function (Shared) {\n 'use strict';\n var BrooksonUtrInputController = /** @class */ (function () {\n function BrooksonUtrInputController(taskPlannerSrv) {\n var _this = this;\n this.taskPlannerSrv = taskPlannerSrv;\n this.utrPattern = /^\\d{10}$/;\n this.branchPattern = /^\\d{3}$/;\n this.updateUTR = function () {\n _this.taskPlannerSrv.updateUTR(_this.utrNumber, _this.branchId);\n };\n }\n BrooksonUtrInputController.$inject = ['taskPlannerSrv'];\n return BrooksonUtrInputController;\n }());\n Shared.BrooksonUtrInputController = BrooksonUtrInputController;\n angular\n .module('app.shared')\n .controller('BrooksonUtrInputController', BrooksonUtrInputController);\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n 'use strict';\n var BrooksonYearEndTileController = /** @class */ (function () {\n function BrooksonYearEndTileController(data) {\n var _this = this;\n this.data = data;\n this.setAsConfirming = function (value) {\n _this.isConfirming = value;\n _this.confirmationError = false;\n };\n this.setAccountsConfirmed = function () {\n _this.data.setDraftAccountsConfirmed(_this.yearEndTileDetails.currentYearEnd, \"\").then(function (result) {\n if (result) {\n _this.yearEndTileDetails.draftAccountsConfirmed = true;\n _this.confirmationError = false;\n _this.isConfirming = false;\n }\n else {\n _this.confirmationError = true;\n _this.isConfirming = false;\n }\n });\n };\n data.getCompanyYearEndTileDetails().then(function (result) {\n _this.yearEndTileDetails = result;\n });\n }\n BrooksonYearEndTileController.$inject = ['brooksonServicesCompanyYearEnd'];\n return BrooksonYearEndTileController;\n }());\n Shared.BrooksonYearEndTileController = BrooksonYearEndTileController;\n Shared.BrooksonYearEndTile = {\n bindings: {\n actionTile: '='\n },\n controller: BrooksonYearEndTileController,\n templateUrl: 'src/app/shared/views/ui/brookson.ui.confirm.year.end.html',\n transclude: true\n };\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .component('brooksonYearEndTile', Shared.BrooksonYearEndTile);\n/// \nvar Shared;\n(function (Shared) {\n var AcceptCheckbox = /** @class */ (function () {\n function AcceptCheckbox() {\n this.bindings = {\n ngModel: '=',\n acceptText: '@'\n };\n this.templateUrl = 'src/app/shared/views/ui/brookson.ui.accept-checkbox.html';\n this.controller = ['$scope', AcceptCheckboxController];\n }\n return AcceptCheckbox;\n }());\n Shared.AcceptCheckbox = AcceptCheckbox;\n var AcceptCheckboxController = /** @class */ (function () {\n function AcceptCheckboxController($scope) {\n this.$scope = $scope;\n }\n return AcceptCheckboxController;\n }());\n Shared.AcceptCheckboxController = AcceptCheckboxController;\n})(Shared || (Shared = {}));\nangular.module('app.shared')\n .component(\"brooksonUiAcceptCheckbox\", new Shared.AcceptCheckbox());\n/// \nvar Shared;\n(function (Shared) {\n var AcceptTermsAndConditions = /** @class */ (function () {\n function AcceptTermsAndConditions() {\n this.bindings = {\n ngModel: '=',\n headingText: '@',\n acceptText: '@'\n };\n this.templateUrl = 'src/app/shared/views/ui/brookson.ui.accept-terms-and-conditions.html';\n this.controller = ['$scope', AcceptTermsAndConditionsController];\n this.transclude = true;\n }\n return AcceptTermsAndConditions;\n }());\n Shared.AcceptTermsAndConditions = AcceptTermsAndConditions;\n var AcceptTermsAndConditionsController = /** @class */ (function () {\n function AcceptTermsAndConditionsController($scope) {\n this.$scope = $scope;\n }\n return AcceptTermsAndConditionsController;\n }());\n Shared.AcceptTermsAndConditionsController = AcceptTermsAndConditionsController;\n})(Shared || (Shared = {}));\nangular.module('app.shared')\n .component(\"brooksonUiAcceptTermsAndConditions\", new Shared.AcceptTermsAndConditions());\n/// \n/// \nvar Shared;\n(function (Shared) {\n var BrooksonUiAccountDetailsContactInformation = /** @class */ (function () {\n function BrooksonUiAccountDetailsContactInformation() {\n this.bindings = {\n personalInformation: '='\n };\n this.controller = BrooksonUiAccountDetailsContactInformationController;\n this.templateUrl = 'src/app/shared/views/ui/brookson.ui.account-details.contact-information.html';\n }\n return BrooksonUiAccountDetailsContactInformation;\n }());\n Shared.BrooksonUiAccountDetailsContactInformation = BrooksonUiAccountDetailsContactInformation;\n var BrooksonUiAccountDetailsContactInformationController = /** @class */ (function () {\n function BrooksonUiAccountDetailsContactInformationController() {\n }\n return BrooksonUiAccountDetailsContactInformationController;\n }());\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .component('brooksonUiAccountDetailsContactInformation', new Shared.BrooksonUiAccountDetailsContactInformation());\n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var BrooksonUiAccountDetailsPersonalInformation = /** @class */ (function () {\n function BrooksonUiAccountDetailsPersonalInformation() {\n this.bindings = {\n personalInformation: '='\n };\n this.controller = BrooksonUiAccountDetailsPersonalInformationController;\n this.templateUrl = 'src/app/shared/views/ui/brookson.ui.account-details.personal-information.html';\n }\n return BrooksonUiAccountDetailsPersonalInformation;\n }());\n Shared.BrooksonUiAccountDetailsPersonalInformation = BrooksonUiAccountDetailsPersonalInformation;\n var BrooksonUiAccountDetailsPersonalInformationController = /** @class */ (function () {\n function BrooksonUiAccountDetailsPersonalInformationController($scope, accountSrv, $window, memberSrv) {\n var _this = this;\n this.$scope = $scope;\n this.accountSrv = accountSrv;\n this.$window = $window;\n this.memberSrv = memberSrv;\n this.$onInit = function () {\n _this.showNationalitySpinner = true;\n _this.accountSrv.getNationalities(true).then(function (data) {\n _this.showNationalitySpinner = false;\n _this.nationalities = data;\n _this.findNationality();\n });\n _this.$scope.$watch('$ctrl.personalInformation.nationality', function (newValue, oldValue) {\n if (!oldValue) {\n _this.findNationality();\n }\n }, true);\n };\n this.findNationality = function () {\n if (_this.personalInformation && _this.personalInformation.nationality) {\n _this.personalInformation.nationalityOption = _.find(_this.nationalities, function (nationality) { return nationality.code === _this.personalInformation.nationality; });\n }\n };\n this.showTfa = function () {\n if (_this.$window.appSettings.enable2FAForAllMembers === 'True' && (_this.memberSrv.member.isAdmin || _this.memberSrv.member.apiKeySource === 'D365' || _this.memberSrv.member.apiKeySource === 'Nav')) {\n return true;\n }\n return false;\n };\n this.tfaTemporaryDisabled = function () {\n if (_this.personalInformation !== undefined) {\n return _this.personalInformation.twoFactorDisabledExpiryDate !== null;\n }\n return false;\n };\n this.tfaPermanentlyDisabled = function () {\n if (_this.personalInformation !== undefined) {\n return _this.personalInformation.twoFactorOverrideDate !== null;\n }\n return false;\n };\n this.tfaNotYetEnabled = function () {\n if (_this.personalInformation !== undefined) {\n return _this.personalInformation.tfaEnabled === false &&\n _this.personalInformation.twoFactorDisabledExpiryDate === null &&\n _this.personalInformation.twoFactorOverrideDate === null;\n }\n return false;\n };\n this.twoFactorDisabledExpiryDate = function () {\n if (_this.personalInformation !== undefined) {\n return moment(_this.personalInformation.twoFactorDisabledExpiryDate).format('Do MMMM YYYY hh:mm a');\n }\n return null;\n };\n this.twoFactorOverrideDate = function () {\n if (_this.personalInformation !== undefined) {\n return moment(_this.personalInformation.twoFactorOverrideDate).format('Do MMMM YYYY hh:mm a');\n }\n return null;\n };\n this.tfaEnabledChanged = function () {\n _this.personalInformation.tfaEnabledAmended = true;\n };\n }\n BrooksonUiAccountDetailsPersonalInformationController.$inject = ['$scope', 'accountSrv', '$window', 'memberSrv'];\n return BrooksonUiAccountDetailsPersonalInformationController;\n }());\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .component('brooksonUiAccountDetailsPersonalInformation', new Shared.BrooksonUiAccountDetailsPersonalInformation());\n/// \n(function () {\n 'use strict';\n angular.module('app.shared').component('brooksonUiAttachReceipt', {\n templateUrl: 'src/app/shared/views/ui/brookson.ui.attach-receipt.html',\n bindings: {\n flow: '=',\n receiptId: '=',\n receiptThumbnail: '=',\n showReceiptBank: '=',\n receiptAttached: '&',\n receiptDeleted: '&',\n dropupClass: '@?',\n isReadonly: '@?'\n },\n controller: brooksonUiAttachReceipt\n });\n brooksonUiAttachReceipt.$inject = ['$scope', '$uibModal', 'brooksonFactoriesExpenses', 'brookson.modal.receipt-bank', 'brookson.modal.receipt-preview', 'receiptSrv', 'brookson.ui.popup'];\n function brooksonUiAttachReceipt($scope, $uibModal, expensesSrv, brooksonModalReceiptBank, brooksonModalReceiptPreview, receiptSrv, brooksonUiPopup) {\n var vm = this;\n // Data\n var $ctrl = $scope.$ctrl;\n $scope.$flow = $ctrl.flow; // Needs to be $scope so the $flow directive can access it correctly\n vm.receipts = [];\n // Methods\n vm.showAttachReceiptModal = showAttachReceiptModal;\n vm.previewReceipt = previewReceipt;\n vm.deleteReceipt = deleteReceipt;\n // Attach receipt\n function showAttachReceiptModal() {\n if (!vm.receipts.length) {\n expensesSrv.getReceipts().then(function (data) {\n vm.receipts = data;\n _.forEach(vm.receipts, function (n) {\n n.isSelected = false;\n });\n openAttachReceiptModal(vm.receipts);\n });\n }\n else {\n _.map(vm.receipts, function (n) {\n n.isSelected = false;\n });\n openAttachReceiptModal(vm.receipts);\n }\n }\n function openAttachReceiptModal(receipts) {\n brooksonModalReceiptBank.attachReceipt(receipts, $ctrl.receiptId).then(function (receipt) {\n if ($ctrl.receiptAttached) {\n $ctrl.receiptAttached()(receipt);\n }\n });\n }\n // Preview receipt\n function previewReceipt() {\n brooksonModalReceiptPreview.show($ctrl.receiptId);\n }\n function deleteReceipt() {\n $scope.$flow.files = [];\n if ($ctrl.receiptDeleted) {\n $ctrl.receiptDeleted();\n }\n }\n }\n})();\nvar Shared;\n(function (Shared) {\n var CalendarOverlayController = /** @class */ (function () {\n function CalendarOverlayController() {\n var _this = this;\n this.hideCalendarScreen = function () {\n _this.showCalendarScreen = false;\n };\n }\n return CalendarOverlayController;\n }());\n Shared.CalendarOverlayController = CalendarOverlayController;\n Shared.BrooksonCalendarOverlay = {\n bindings: {\n calendarUrl: '=',\n showCalendarScreen: '='\n },\n controller: CalendarOverlayController,\n templateUrl: 'src/app/shared/views/ui/brookson.ui.calendar-overlay.html'\n };\n})(Shared || (Shared = {}));\nangular.module('app.shared')\n .component('brooksonCalendarOverlay', Shared.BrooksonCalendarOverlay);\n/// \n/// \nvar Shared;\n(function (Shared) {\n var BrooksonUiFeedback = /** @class */ (function () {\n function BrooksonUiFeedback() {\n this.controller = [\"brooksonUiFeedbackFactory\", BrooksonUiFeedbackController];\n this.templateUrl = 'src/app/shared/views/ui/brookson.ui.feedback.html';\n }\n return BrooksonUiFeedback;\n }());\n Shared.BrooksonUiFeedback = BrooksonUiFeedback;\n var BrooksonUiFeedbackController = /** @class */ (function () {\n function BrooksonUiFeedbackController(factory, $window) {\n this.factory = factory;\n this.$window = $window;\n }\n BrooksonUiFeedbackController.prototype.openModal = function () {\n this.factory.openModal();\n };\n BrooksonUiFeedbackController.prototype.cancelScreenshotPressed = function () {\n this.factory.isScreenshotMode = false;\n this.factory.showModal();\n this.factory.destroyCanvas();\n };\n BrooksonUiFeedbackController.prototype.takeScreenshotPressed = function () {\n this.factory.takeScreenshot();\n };\n BrooksonUiFeedbackController.$inject = ['$window'];\n return BrooksonUiFeedbackController;\n }());\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .component('brooksonUiFeedback', new Shared.BrooksonUiFeedback());\n/// \nvar Shared;\n(function (Shared) {\n /**\n *\n * The privacy button component for disabling privacy mode.\n * This button is used when privacy mode is enabled\n * @export\n * @class BrooksonUiPrivacyButton\n * @implements {ng.IComponentOptions}\n */\n var BrooksonUiPrivacyButton = /** @class */ (function () {\n /**\n * Creates an instance of BrooksonUiPrivacyButton.\n *\n */\n function BrooksonUiPrivacyButton() {\n this.controller = BrooksonUiPrivacyButtonController;\n this.templateUrl = \"src/app/shared/views/ui/brookson.ui.privacy.button.html\";\n }\n return BrooksonUiPrivacyButton;\n }());\n Shared.BrooksonUiPrivacyButton = BrooksonUiPrivacyButton;\n /**\n *\n * The controller for the privacy button\n * @class BrooksonUiPrivacyButtonController\n */\n var BrooksonUiPrivacyButtonController = /** @class */ (function () {\n /**\n * Creates an instance of BrooksonUiPrivacyButtonController.\n *\n * @param {Shared.IBrooksonFactoryPrivacy} privacyFactory\n */\n function BrooksonUiPrivacyButtonController(privacyFactory) {\n this.privacyFactory = privacyFactory;\n }\n /**\n *\n *\n * @static\n */\n BrooksonUiPrivacyButtonController.$inject = ['brookson.factory.privacy'];\n return BrooksonUiPrivacyButtonController;\n }());\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .component('brooksonUiPrivacyButton', new Shared.BrooksonUiPrivacyButton());\n/// \n(function () {\n 'use strict';\n angular.module('app.shared').component('brooksonUiProgressBar', {\n templateUrl: 'src/app/shared/views/ui/brookson.ui.progress-bar.html',\n bindings: {\n file: '='\n }\n });\n})();\n/// \n(function () {\n 'use strict';\n angular.module('app.shared').component('brooksonUiReceiptPanel', {\n templateUrl: 'src/app/shared/views/ui/brookson.ui.receipt-panel.html',\n bindings: {\n ngModel: '=',\n checkable: '=',\n hideCheckbox: '=',\n receipt: '=',\n checkboxSelected: '=',\n receiptClick: '='\n },\n controller: brooksonUiReceiptPanel\n });\n brooksonUiReceiptPanel.$inject = ['expenses.enums'];\n function brooksonUiReceiptPanel(enums) {\n var vm = this;\n // Data\n vm.status = enums.ReceiptStatus;\n }\n})();\n/// \nvar Shared;\n(function (Shared) {\n var BrooksonExpensesInputValidVatReceipt = /** @class */ (function () {\n function BrooksonExpensesInputValidVatReceipt() {\n this.bindings = {\n ngModel: '=',\n inputName: '=',\n ngChange: '&',\n ngDisabled: '=',\n showLabel: '='\n };\n this.templateUrl = 'src/app/shared/views/inputs/expenses.input.valid-vat-receipt.html';\n this.controller = BrooksonExpensesInputValidVatReceiptController;\n }\n return BrooksonExpensesInputValidVatReceipt;\n }());\n Shared.BrooksonExpensesInputValidVatReceipt = BrooksonExpensesInputValidVatReceipt;\n var BrooksonExpensesInputValidVatReceiptController = /** @class */ (function () {\n function BrooksonExpensesInputValidVatReceiptController($timeout) {\n var _this = this;\n this.$timeout = $timeout;\n this.changeInternal = function () {\n if (_this.ngChange) {\n _this.$timeout(function () {\n _this.ngChange();\n });\n }\n };\n }\n BrooksonExpensesInputValidVatReceiptController.$inject = ['$timeout'];\n return BrooksonExpensesInputValidVatReceiptController;\n }());\n Shared.BrooksonExpensesInputValidVatReceiptController = BrooksonExpensesInputValidVatReceiptController;\n})(Shared || (Shared = {}));\nangular.module('app.shared')\n .component(\"brooksonExpensesInputValidVatReceipt\", new Shared.BrooksonExpensesInputValidVatReceipt());\n/// \nvar Shared;\n(function (Shared) {\n 'use strict';\n var BrooksonWidgetActions = /** @class */ (function () {\n function BrooksonWidgetActions() {\n this.bindings = {\n onComplete: '&'\n };\n this.controller = WidgetActionsCtrl;\n this.templateUrl = 'src/app/shared/views/widgets/brookson.widgets.actions.html';\n }\n return BrooksonWidgetActions;\n }());\n Shared.BrooksonWidgetActions = BrooksonWidgetActions;\n var WidgetActionsCtrl = /** @class */ (function () {\n function WidgetActionsCtrl(bankLinkEnums, $q, $timeout, $scope, taskPlannerSrv, brooksonNavigation, enums, _dashboardService, bankLinkFactory) {\n var _this = this;\n this.bankLinkEnums = bankLinkEnums;\n this.$q = $q;\n this.$timeout = $timeout;\n this.$scope = $scope;\n this.taskPlannerSrv = taskPlannerSrv;\n this.brooksonNavigation = brooksonNavigation;\n this.enums = enums;\n this._dashboardService = _dashboardService;\n this.bankLinkFactory = bankLinkFactory;\n this.tasks = [];\n this.showSpinner = true;\n this.widgetName = \"brookson-widget-actions\";\n this.panelDisplayed = 0;\n this.transactionsToAllocate = 0;\n this.error = false;\n this.transactionsList = [];\n this.dashboardService = this._dashboardService;\n this.gotoTask = function (task) {\n _this.brooksonNavigation.taskPlanner.selectedActionTask(task.camelCase, task.actionId);\n };\n $q.all([\n taskPlannerSrv.buildMonths(),\n bankLinkFactory.getBankAccounts(),\n bankLinkFactory.getTransactions(false)\n ]).then(function (data) {\n // TASKS\n _this.tasks = _.chain(taskPlannerSrv.flatActions)\n .filter(function (action) {\n return (action.status === 1 || action.status === 3) &&\n action.responsibility === _this.enums.TaskResponsibility.ME;\n })\n .orderBy('dueDate', 'asc')\n .take(5)\n .map(function (n) {\n n.camelCase = _.camelCase(n.taskGroup);\n return n;\n })\n .value();\n // /TASKS\n // BANK\n if (bankLinkFactory.transactions && bankLinkFactory.transactions.length > 0) {\n var transactions = bankLinkFactory.transactions;\n var transactionType = { value: 2 };\n _this.transactionsToAllocate = _.filter(transactions, {\n transactionType: bankLinkEnums.TransactionType.UNALLOCATED\n }).length;\n bankLinkFactory.selectedBankAccount = { bankAccountId: \"*\" };\n bankLinkFactory.selectedTransactionTypeChanged(transactionType);\n _this.transactionsList = _.take(bankLinkFactory.transactionsList, 5);\n }\n // /BANK\n }, function () {\n _this.error = true;\n }).then(function () {\n _this.showSpinner = false;\n _this.$timeout(function () { _this.onComplete(); });\n });\n }\n WidgetActionsCtrl.$inject = ['bankLink.enums', '$q', '$timeout', '$scope', 'taskPlannerSrv', 'brookson.navigation', 'taskPlanner.enums', 'dashboardService', 'bankLinkFactory'];\n return WidgetActionsCtrl;\n }());\n Shared.WidgetActionsCtrl = WidgetActionsCtrl;\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .component('brooksonWidgetActions', new Shared.BrooksonWidgetActions());\n/// \n/// \n/// \nvar Shared;\n(function (Shared) {\n var BrooksonWidgetsAssignment = /** @class */ (function () {\n function BrooksonWidgetsAssignment() {\n this.bindings = {\n onComplete: \"&\"\n };\n this.controller = [\"$filter\", \"$timeout\", \"AssignmentSrv\", \"brookson.navigation\", \"invoicing.enums\", \"brookson.utilities.date\", \"dashboardService\", BrooksonWidgetsAssignmentController];\n this.templateUrl = \"src/app/shared/views/widgets/brookson.widgets.assignments.html\";\n }\n return BrooksonWidgetsAssignment;\n }());\n Shared.BrooksonWidgetsAssignment = BrooksonWidgetsAssignment;\n var BrooksonWidgetsAssignmentController = /** @class */ (function () {\n function BrooksonWidgetsAssignmentController($filter, $timeout, assignmentSrv, brooksonNavigation, invoicingEnums, dateUtils, _dashboardService) {\n this.$filter = $filter;\n this.$timeout = $timeout;\n this.assignmentSrv = assignmentSrv;\n this.brooksonNavigation = brooksonNavigation;\n this.invoicingEnums = invoicingEnums;\n this.dateUtils = dateUtils;\n this._dashboardService = _dashboardService;\n this.widgetName = \"brookson-widgets-assignments\";\n this.dashboardService = this._dashboardService;\n }\n BrooksonWidgetsAssignmentController.prototype.$onInit = function () {\n this.getAssignments();\n };\n BrooksonWidgetsAssignmentController.prototype.currentAssignmentPressed = function () {\n this.brooksonNavigation.invoicing.raiseInvoice();\n };\n BrooksonWidgetsAssignmentController.prototype.goToIR35 = function (assignment) {\n this.brooksonNavigation.employmentStatus.ir35Assignment(assignment.assignmentID);\n };\n BrooksonWidgetsAssignmentController.prototype.goToAssignments = function () {\n this.brooksonNavigation.assignments.main();\n };\n BrooksonWidgetsAssignmentController.prototype.goToAssignmentDetails = function (assignment) {\n if (assignment)\n this.brooksonNavigation.assignments.summary(assignment.assignmentID);\n else\n this.goToAddAssignment();\n };\n BrooksonWidgetsAssignmentController.prototype.goToAddAssignment = function () {\n this.brooksonNavigation.assignments.addAssignment();\n };\n BrooksonWidgetsAssignmentController.prototype.getAssignments = function () {\n var _this = this;\n this.showSpinner = true;\n this.assignmentSrv.getAllAssignments(true).then(function (data) {\n var assignments = _.flatten(_.map(data, function (assignment) {\n return assignment.assignments;\n }));\n _this.assignments = _.filter(assignments, function (assignment) {\n var dateIsAfterToday = _this.dateUtils.isAfter(assignment.dateEnded, moment().toDate());\n return _this.$filter(\"bkShortDate\")(assignment.dateEnded, \"DD/MM/YYYY\") === \"\" || dateIsAfterToday;\n });\n _this.assignments = _.orderBy(_this.assignments, function (assignment) {\n return new Date(assignment.dateStarted.toString());\n }, \"desc\");\n }, function () {\n _this.error = true;\n }).then(function () {\n _this.showSpinner = false;\n _this.$timeout(function () { _this.onComplete(); });\n });\n };\n return BrooksonWidgetsAssignmentController;\n }());\n Shared.BrooksonWidgetsAssignmentController = BrooksonWidgetsAssignmentController;\n})(Shared || (Shared = {}));\nangular\n .module(\"app.shared\")\n .component(\"brooksonWidgetsAssignments\", new Shared.BrooksonWidgetsAssignment());\n/// \nvar Shared;\n(function (Shared) {\n var BrooksonWidgetsBankLink = /** @class */ (function () {\n function BrooksonWidgetsBankLink() {\n this.controller = BrooksonWidgetsBankLinkController;\n this.templateUrl = \"src/app/shared/views/widgets/brookson.widgets.bank-link.html\";\n this.bindings = {\n onComplete: '&'\n };\n }\n return BrooksonWidgetsBankLink;\n }());\n Shared.BrooksonWidgetsBankLink = BrooksonWidgetsBankLink;\n var BrooksonWidgetsBankLinkController = /** @class */ (function () {\n function BrooksonWidgetsBankLinkController($q, $timeout, growl, moneyManagerSrv, bankLinkSrv, bankLinkEnums, brooksonNavigation, dateUtils, dashboardService, data) {\n var _this = this;\n this.$q = $q;\n this.$timeout = $timeout;\n this.growl = growl;\n this.moneyManagerSrv = moneyManagerSrv;\n this.bankLinkSrv = bankLinkSrv;\n this.bankLinkEnums = bankLinkEnums;\n this.brooksonNavigation = brooksonNavigation;\n this.dateUtils = dateUtils;\n this.dashboardService = dashboardService;\n this.data = data;\n this.transactionsToAllocate = 0;\n this.error = false;\n this.showSpinner = false;\n this.isBankLinkActionRequired = false;\n this.showNewSetupText = false;\n this.widgetName = \"brookson-widgets-bank-link\";\n this.lastReconciledDate = null;\n this.$onInit = function () {\n _this.$q.all([\n _this.data.getBankAccounts(),\n _this.data.getTransactions(false),\n _this.data.getCategories(),\n _this.data.getTransactionTypes(),\n _this.data.getMoneyManagerData()\n ]).then(function (data) {\n if (_this.data.transactions && _this.data.transactions.length > 0) {\n var transactions = angular.copy(_this.data.transactions);\n _this.transactionsToAllocate = _.filter(transactions, {\n transactionType: _this.bankLinkEnums.TransactionType.UNALLOCATED\n }).length;\n var xAxisPoints_1 = ['x'];\n for (var i = 11; i >= 0; i--) {\n xAxisPoints_1.push(moment().add(-i, 'months').startOf('month').format('MM-YYYY'));\n }\n _.forEach(transactions, function (transaction) {\n transaction.period = _this.dateUtils.convertToMoment(transaction.transactionDate).format('MM-YYYY');\n });\n var groupedTransactionByBankAccount = _.groupBy(transactions, 'bankKey');\n var accounts_1 = [];\n var chartData_1 = _.map(groupedTransactionByBankAccount, function (group, key) {\n var data;\n // Account not already indexed\n if (accounts_1.indexOf(group[0].bankName) === -1) {\n data = [group[0].bankName];\n accounts_1.push(group[0].bankName);\n }\n else {\n // Account already indexed, get a count and increment\n var count = _.countBy(accounts_1)[group[0].bankName];\n data = [group[0].bankName + ' ' + (count + 1)];\n }\n var transactionsGroupedByPeriod = _.groupBy(group, 'period');\n _.forEach(xAxisPoints_1, function (period) {\n if (period === \"x\") {\n return;\n }\n var periodGrouping = _.find(transactionsGroupedByPeriod, function (g, key) { return key === period; });\n if (periodGrouping === undefined) {\n if (data.length > 1) {\n data.push(_.last(data));\n }\n else {\n data.push('0.00');\n }\n }\n else {\n data.push(_.first(periodGrouping).balance.toFixed(2));\n }\n });\n return data;\n });\n _this.$timeout(function () {\n _this.chart = c3.generate({\n bindto: '#bankLinkChart',\n point: {\n r: 6\n },\n data: {\n columns: chartData_1\n },\n padding: {\n right: 30\n },\n axis: {\n x: {\n type: 'category',\n categories: xAxisPoints_1.splice(1, xAxisPoints_1.length),\n tick: {\n fit: true,\n rotate: 40,\n multiline: false\n }\n },\n y: {\n tick: {\n format: function (d) { return '£' + d; }\n }\n }\n },\n onrendered: function () { _this.onComplete(); }\n });\n }, 10);\n }\n }, function () {\n _this.error = true;\n }).then(function () {\n _this.showSpinner = false;\n _this.$timeout(function () { _this.onComplete(); });\n });\n };\n }\n BrooksonWidgetsBankLinkController.$inject = ['$q', '$timeout', 'growl', 'moneyManagerSrv', 'bankLinkSrv', 'bankLink.enums', 'brookson.navigation', 'brookson.utilities.date', 'dashboardService', 'bankLinkFactory'];\n return BrooksonWidgetsBankLinkController;\n }());\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .component('brooksonWidgetsBankLink', new Shared.BrooksonWidgetsBankLink());\n/// \n(function () {\n 'use strict';\n angular.module('app.shared').component('brooksonWidgetDocumentStorageRecentDocuments', {\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.document-storage.recent-documents.html',\n bindings: {\n onComplete: '&'\n },\n controller: brooksonWidgetDocumentStorageRecentDocuments\n });\n brooksonWidgetDocumentStorageRecentDocuments.$inject = ['$timeout', 'documentStorageSrv', 'brooksonDocumentPreview', 'brookson.navigation', 'dashboardService'];\n function brooksonWidgetDocumentStorageRecentDocuments($timeout, documentStorageSrv, brooksonDocumentPreview, brooksonNavigation, _dashboardService) {\n var vm = this;\n vm.data = documentStorageSrv;\n vm.brooksonNavigation = brooksonNavigation;\n vm.showSpinner = true;\n vm.previewDocument = brooksonDocumentPreview.previewDoc;\n vm.error = false;\n vm.dashboardService = _dashboardService;\n vm.widgetName = \"brookson-widget-document-storage-recent-documents\";\n function getRecentDocuments() {\n documentStorageSrv.getDocumentStorageWidgetData(true).then(function (data) {\n vm.showSpinner = false;\n if (data.recentDocuments) {\n vm.data.recentDocuments = _.take(data.recentDocuments, 10);\n }\n }, function (error) {\n vm.error = true;\n }).then(function () {\n vm.showSpinner = false;\n $timeout(function () { vm.onComplete(); });\n });\n }\n function activate() {\n getRecentDocuments();\n }\n activate();\n }\n})();\n/// \n(function () {\n 'use strict';\n angular.module('app.shared').component('brooksonWidgetDocumentStorageUmbrellaRecentDocuments', {\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.document-storage.umbrella-recent-documents.html',\n bindings: {\n onComplete: '&'\n },\n controller: brooksonWidgetDocumentStorageUmbrellaRecentDocuments\n });\n brooksonWidgetDocumentStorageUmbrellaRecentDocuments.$inject = ['$timeout', 'documentStorageSrv', 'brooksonDocumentPreview', 'brookson.navigation', 'dashboardService', 'accountSrv'];\n function brooksonWidgetDocumentStorageUmbrellaRecentDocuments($timeout, documentStorageSrv, brooksonDocumentPreview, brooksonNavigation, _dashboardService, accountSrv) {\n var vm = this;\n vm.data = documentStorageSrv;\n vm.brooksonNavigation = brooksonNavigation;\n vm.showSpinner = true;\n vm.previewDocument = brooksonDocumentPreview.previewDoc;\n vm.error = false;\n vm.dashboardService = _dashboardService;\n vm.widgetName = \"brookson-widget-document-storage-umbrella-recent-documents\";\n vm.panelDisplayed = 0;\n vm.openContract = function (documentType) {\n if (documentType === undefined) {\n accountSrv.getAccountDetailsForUser().then(function (data) {\n documentType = data.personalInformation.contractFileName;\n documentStorageSrv.downloadEmploymentFile(documentType);\n });\n }\n else {\n documentStorageSrv.downloadEmploymentFile(documentType);\n }\n };\n function getRecentDocuments() {\n documentStorageSrv.getDocumentStorageWidgetData(true).then(function (data) {\n vm.showSpinner = false;\n if (data.recentDocuments) {\n vm.data.recentDocuments = _.take(data.recentDocuments, 5);\n }\n else {\n vm.panelDisplayed = 1;\n }\n }, function (error) {\n vm.error = true;\n }).then(function () {\n vm.showSpinner = false;\n $timeout(function () { vm.onComplete(); });\n });\n }\n function activate() {\n getRecentDocuments();\n }\n activate();\n }\n})();\n/// \nvar Shared;\n(function (Shared) {\n 'use strict';\n var BrooksonWidgetEmploymentRecord = /** @class */ (function () {\n function BrooksonWidgetEmploymentRecord() {\n this.bindings = {\n onComplete: '&'\n };\n this.controller = WidgetEmploymentRecordCtrl;\n this.templateUrl = 'src/app/shared/views/widgets/brookson.widgets.employment-record.html';\n }\n return BrooksonWidgetEmploymentRecord;\n }());\n Shared.BrooksonWidgetEmploymentRecord = BrooksonWidgetEmploymentRecord;\n var WidgetEmploymentRecordCtrl = /** @class */ (function () {\n function WidgetEmploymentRecordCtrl($timeout, $scope, brooksonNavigation, accountSrv, _dashboardService) {\n var _this = this;\n this.$timeout = $timeout;\n this.$scope = $scope;\n this.brooksonNavigation = brooksonNavigation;\n this.accountSrv = accountSrv;\n this._dashboardService = _dashboardService;\n this.tasks = [];\n this.showSpinner = true;\n this.widgetName = \"brookson-widget-employment-record\";\n this.dashboardService = this._dashboardService;\n accountSrv.getAccountDetailsForUser().then(function (data) {\n console.log(data.personalInformation);\n _this.showSpinner = false;\n accountSrv.getNationalities().then(function (data) {\n _this.nationalities = data;\n });\n }, function (ex) {\n _this.error = true;\n })\n .then(function () {\n _this.showSpinner = false;\n _this.$timeout(function () { _this.onComplete(); }, 0);\n });\n }\n WidgetEmploymentRecordCtrl.prototype.openContract = function (documentType) {\n this._dashboardService.downloadFile(documentType);\n };\n WidgetEmploymentRecordCtrl.$inject = ['$timeout', '$scope', 'brookson.navigation', 'accountSrv', 'dashboardService'];\n return WidgetEmploymentRecordCtrl;\n }());\n Shared.WidgetEmploymentRecordCtrl = WidgetEmploymentRecordCtrl;\n angular\n .module('app.shared')\n .component('brooksonWidgetEmploymentRecord', new Shared.BrooksonWidgetEmploymentRecord());\n})(Shared || (Shared = {}));\n/// \n(function () {\n 'use strict';\n angular.module('app.shared').component('brooksonWidgetExpensesOverview', {\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.expenses.overview.html',\n bindings: {\n onComplete: '&'\n },\n controller: brooksonWidgetExpensesOverview\n });\n brooksonWidgetExpensesOverview.$inject = ['$timeout', 'expensesSrv', 'brookson.navigation', 'dashboardService'];\n function brooksonWidgetExpensesOverview($timeout, expensesSrv, brooksonNavigation, dashboardService) {\n var vm = this;\n vm.showSpinner = true;\n vm.brooksonNavigation = brooksonNavigation;\n vm.dashboardService = dashboardService;\n vm.widgetName = \"brookson-widget-expenses-overview\";\n this.$onInit = function () {\n getExpenseOverview();\n };\n function getExpenseOverview() {\n expensesSrv.getExpenseOverView(true).then(function (response) {\n $timeout(function () {\n var chart = c3.generate({\n bindto: '#expensesOverview',\n point: {\n r: 6\n },\n data: {\n x: 'x',\n columns: [],\n types: {\n Allowances: 'area-spline',\n Receipted: 'area-spline',\n Mileage: 'area-spline'\n },\n colors: {\n Allowances: '#FFD132',\n Receipted: '#449d44',\n Mileage: '#33ADFF'\n },\n names: {\n Allowances: 'Allowances',\n Receipted: 'Receipted',\n Mileage: 'Mileage'\n }\n },\n axis: {\n x: {\n tick: {\n fit: true,\n rotate: 40,\n multiline: false\n },\n type: 'category',\n label: {\n text: 'Weeks',\n position: 'inner-right'\n }\n },\n y: {\n label: {\n text: 'Amount',\n position: 'inner-top'\n },\n tick: {\n format: function (d) { return '£' + d; }\n }\n }\n },\n tooltip: {\n format: {\n value: function (value) {\n return \"£\" + d3.format(\",.2f\")(value);\n }\n }\n },\n transition: {\n duration: 1200\n },\n padding: {\n right: 30\n }\n });\n var data = response.chartData;\n var columns = [];\n if (data) {\n var xAxis = ['x'];\n xAxis = _(xAxis).concat(_.keys(data).map(function (n) {\n return moment(n).format('DD/MM').toString();\n })).value();\n var mileage = ['Mileage'];\n var mileageValues = _.map(data, 'mileageExpensesSum');\n mileage = _(mileage).concat(mileageValues).value();\n var receipted = ['Receipted'];\n var receiptedValues = _.map(data, 'regularExpensesSum');\n receipted = _(receipted).concat(receiptedValues).value();\n var allowances = ['Allowances'];\n var allowancesValues = _.map(data, 'allowancesExpensesSum');\n allowances = _(allowances).concat(allowancesValues).value();\n columns.push(xAxis, mileage, receipted, allowances);\n if (_.sum([_.sum(mileageValues), _.sum(receiptedValues), _.sum(allowancesValues)]) > 0) {\n chart.load({\n columns: columns\n });\n }\n else {\n vm.noData = true;\n }\n }\n else {\n vm.noData = true;\n }\n }, 10);\n }, function (error) {\n vm.error = true;\n }).then(function () {\n vm.showSpinner = false;\n $timeout(function () { vm.onComplete(); });\n });\n }\n function activate() {\n // getExpenseOverview();\n }\n activate();\n }\n})();\n/// \n(function () {\n 'use strict';\n angular.module('app.shared').component('brooksonWidgetInvoicingOverview', {\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.invoicing.overview.html',\n bindings: {\n onComplete: '&'\n },\n controller: brooksonWidgetInvoicingOverview\n });\n brooksonWidgetInvoicingOverview.$inject = ['$timeout', 'invoicingSrv', 'brookson.navigation', 'dashboardService', 'appSettings', 'memberSrv'];\n function brooksonWidgetInvoicingOverview($timeout, invoicingSrv, brooksonNavigation, dashboardService, appSettings, memberSrv) {\n var vm = this;\n vm.latestInvoices = {};\n vm.latestPayments = {};\n vm.showSpinner = true;\n vm.brooksonNavigation = brooksonNavigation;\n vm.memberSrv = memberSrv;\n vm.showNewSetupText = false;\n vm.dashboardService = dashboardService;\n vm.widgetName = \"brookson-widget-invoicing-overview\";\n vm.appSettings = appSettings;\n vm.memberBusinessType = '';\n function activate() {\n invoicingSrv.getInvoicingOverview().then(function (data) {\n vm.latestInvoices = data.latestInvoices;\n vm.latestPayments = data.latestPayments;\n vm.showNewSetupText = vm.latestInvoices.length === 0 && vm.latestPayments.length === 0 && false;\n }, function (error) {\n vm.error = true;\n }).then(function () {\n vm.showSpinner = false;\n $timeout(function () { vm.onComplete(); });\n });\n vm.memberBusinessType = memberSrv.getMemberBusinessType();\n }\n activate();\n }\n})();\n/// \n(function () {\n 'use strict';\n angular.module('app.shared').component('brooksonWidgetInvoicingUmbrella', {\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.invoicing.umb.detail.html',\n bindings: {\n onComplete: '&'\n },\n controller: brooksonWidgetInvoicingUmbrella\n });\n brooksonWidgetInvoicingUmbrella.$inject = ['$timeout', 'invoicingSrv', 'brookson.navigation', 'dashboardService', 'appSettings', 'memberSrv'];\n function brooksonWidgetInvoicingUmbrella($timeout, invoicingSrv, brooksonNavigation, dashboardService, appSettings, memberSrv) {\n var vm = this;\n vm.latestTimesheets = {};\n vm.latestInvoices = {};\n vm.latestPayments = {};\n vm.latestPayslips = {};\n vm.showSpinner = true;\n vm.brooksonNavigation = brooksonNavigation;\n vm.memberSrv = memberSrv;\n vm.showNewSetupText = false;\n vm.dashboardService = dashboardService;\n vm.widgetName = \"brookson-widget-invoicing-umbrella\";\n vm.appSettings = appSettings;\n vm.memberBusinessType = '';\n function activate() {\n invoicingSrv.getTimesheetUmbreallaOverview().then(function (data) {\n vm.latestTimesheets = data;\n }, function (error) {\n vm.error = true;\n }).then(function () {\n vm.showSpinner = false;\n $timeout(function () { vm.onComplete(); });\n });\n invoicingSrv.getInvoicingUmbrellaOverview().then(function (data) {\n vm.latestInvoices = data.latestInvoices;\n vm.latestPayments = data.latestPayments;\n vm.latestPayslips = data.latestPayslips;\n vm.showNewSetupText = vm.latestInvoices.length === 0 && vm.latestPayments.length === 0 && false;\n }, function (error) {\n vm.error = true;\n }).then(function () {\n //vm.showSpinner = false;\n $timeout(function () { vm.onComplete(); });\n });\n vm.memberBusinessType = memberSrv.getMemberBusinessType();\n }\n activate();\n }\n})();\n/// \nvar Shared;\n(function (Shared) {\n var BrooksonWidgetsKeyDates = /** @class */ (function () {\n function BrooksonWidgetsKeyDates() {\n this.bindings = {\n onComplete: '&'\n };\n this.controller = ['$timeout', 'taskPlannerSrv', 'brookson.navigation', 'brookson.utilities.date', 'taskPlanner.enums', 'dashboardService', BrooksonWidgetsKeyDatesController];\n this.templateUrl = 'src/app/shared/views/widgets/brookson.widgets.key-dates.html';\n }\n return BrooksonWidgetsKeyDates;\n }());\n Shared.BrooksonWidgetsKeyDates = BrooksonWidgetsKeyDates;\n var BrooksonWidgetsKeyDatesController = /** @class */ (function () {\n function BrooksonWidgetsKeyDatesController($timeout, taskPlannerSrv, brooksonNavigation, dateUtils, taskPlannerEnums, _dashboardService) {\n this.$timeout = $timeout;\n this.taskPlannerSrv = taskPlannerSrv;\n this.brooksonNavigation = brooksonNavigation;\n this.dateUtils = dateUtils;\n this.taskPlannerEnums = taskPlannerEnums;\n this._dashboardService = _dashboardService;\n this.widgetName = \"brookson-widgets-key-dates\";\n this.dashboardService = this._dashboardService;\n }\n BrooksonWidgetsKeyDatesController.prototype.$onInit = function () {\n this.getTasks();\n };\n BrooksonWidgetsKeyDatesController.prototype.goToTaskPlanner = function () {\n this.brooksonNavigation.taskPlanner.calendar();\n };\n BrooksonWidgetsKeyDatesController.prototype.keyDatesWidgetPressed = function () {\n this.brooksonNavigation.taskPlanner.calendar();\n };\n BrooksonWidgetsKeyDatesController.prototype.getTasks = function () {\n var _this = this;\n this.showSpinner = true;\n this.taskPlannerSrv.getTaskActions(true).then(function (data) {\n if (data) {\n _this.tasksActions = data;\n _this.tasksActions = _.filter(_this.tasksActions, function (task) {\n return task.status === _this.taskPlannerEnums.TaskStatus.OVERDUE || _this.dateUtils.isAfter(task.deadline, moment().toDate());\n });\n _this.tasksActions = _.orderBy(_this.tasksActions, function (task) {\n return new Date(task.dueDate.toString());\n }, 'asc');\n }\n }, function () {\n _this.error = true;\n }).then(function () {\n _this.showSpinner = false;\n _this.$timeout(function () { _this.onComplete(); });\n });\n };\n return BrooksonWidgetsKeyDatesController;\n }());\n Shared.BrooksonWidgetsKeyDatesController = BrooksonWidgetsKeyDatesController;\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .component('brooksonWidgetsKeyDates', new Shared.BrooksonWidgetsKeyDates());\n/// \n(function () {\n 'use strict';\n angular.module('app.shared').component('brooksonWidgetMoneyManagerMoneyAvailable', {\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.money-manager.money-available.html',\n bindings: {\n onComplete: '&'\n },\n controller: brooksonWidgetMoneyManagerMoneyAvailable\n });\n brooksonWidgetMoneyManagerMoneyAvailable.$inject = ['$uibModal', '$timeout', '$q', 'moneyManagerSrv', 'brookson.navigation', 'dashboardService'];\n function brooksonWidgetMoneyManagerMoneyAvailable($uibModal, $timeout, $q, moneyManagerSrv, brooksonNavigation, dashboardService) {\n var vm = this;\n vm.data = moneyManagerSrv;\n vm.showSpinner = true;\n vm.error = false;\n vm.showNewSetupText = false;\n vm.dashboardService = dashboardService;\n vm.widgetName = \"brookson-widget-money-manager-money-available\";\n vm.brooksonNavigation = brooksonNavigation;\n vm.showUnpaidInvoicesModal = showUnpaidInvoicesModal;\n function activate() {\n var moneyManagerFinancialData = moneyManagerSrv.getMoneyManagerFinancialData(true);\n $q.all([moneyManagerFinancialData]).then(function (data) {\n vm.showSpinner = false;\n moneyManagerSrv.getLastReconciledDate = '';\n moneyManagerSrv.moneyManagerFinancialData = data[0];\n }, function (error) {\n vm.error = true;\n }).then(function () {\n vm.showSpinner = false;\n $timeout(function () { vm.onComplete(); }, 0);\n });\n }\n function showUnpaidInvoicesModal() {\n $uibModal.open({\n animation: true,\n templateUrl: 'src/app/shared/views/modals/brookson.modals.unpaidInvoices.html',\n size: 'md',\n controller: ['$scope', '$uibModalInstance', function ($scope, $uibModalInstance) {\n $scope.cancel = cancel;\n function cancel() {\n $uibModalInstance.dismiss('cancel');\n }\n }]\n });\n }\n activate();\n }\n})();\n/// \n/// \nvar Shared;\n(function (Shared) {\n var BrooksonWidgetsOpenBanking = /** @class */ (function () {\n function BrooksonWidgetsOpenBanking() {\n this.controller = BrooksonWidgetsOpenBankingController;\n this.templateUrl = \"src/app/shared/views/widgets/brookson.widgets.open-banking.html\";\n this.bindings = {\n onComplete: '&'\n };\n }\n return BrooksonWidgetsOpenBanking;\n }());\n Shared.BrooksonWidgetsOpenBanking = BrooksonWidgetsOpenBanking;\n var BrooksonWidgetsOpenBankingController = /** @class */ (function () {\n function BrooksonWidgetsOpenBankingController($q, $timeout, openbankingWidgetService, $window, $scope, fileDownloadSrv, memberSrv, growl, dashboardService, localStorageService, $state) {\n var _this = this;\n this.$q = $q;\n this.$timeout = $timeout;\n this.openbankingWidgetService = openbankingWidgetService;\n this.$window = $window;\n this.$scope = $scope;\n this.fileDownloadSrv = fileDownloadSrv;\n this.memberSrv = memberSrv;\n this.growl = growl;\n this.dashboardService = dashboardService;\n this.localStorageService = localStorageService;\n this.$state = $state;\n this.widgetName = \"brookson-widgets-open-banking\";\n this.disableButtons = false;\n this.$onInit = function () {\n _this.showSpinner = true;\n _this.$q.all([\n _this.openbankingWidgetService.getOpenBankingWidgetData(true)\n ]).then(function (data) {\n _this.bankAccountList = data[0];\n _this.setupAccounts(_this.bankAccountList);\n _this.showSpinner = false;\n }, function () {\n _this.error = true;\n }).then(function () {\n _this.showSpinner = false;\n _this.$timeout(function () { _this.onComplete(); });\n _this.$timeout(function () { _this.onComplete(); }, 5000);\n });\n _this.$scope.$on(\"OPENBANKING_WIDGET_POPUP_WINDOW_EVENT_CHANGE\", _this.trueLayerPopupWindowEventChange);\n _this.$scope.$on(\"OPENBANKING_WIDGET_TOKEN_EXCHANGE_RESPONSE\", _this.WidgetTokenExchangeResponse);\n };\n this.setupAccounts = function (bankAccounts) {\n _.each(bankAccounts, function (bankAccount) {\n bankAccount.type = Shared.openbankingWidget.bankType[bankAccount.type].replace('_', ' ');\n bankAccount.accountType = Shared.openbankingWidget.accountType[bankAccount.accountType];\n if (bankAccount.consentStatus === Shared.openbankingWidget.ConsentStatus.AccessTokenReceived && !bankAccount.consentExpired) {\n bankAccount.success = true;\n }\n if (bankAccount.viewAccess === false) {\n bankAccount.className = 'redBox';\n }\n else {\n if (bankAccount.viewAccessDescription.toLowerCase().indexOf('view access') > -1) {\n bankAccount.className = 'orangeBox';\n }\n if (bankAccount.viewAccessDescription.toLowerCase().indexOf('open banking') > -1) {\n bankAccount.className = 'greenBox';\n }\n }\n });\n _this.hasCsvUpload = bankAccounts.some(function (x) { return x.csvUploadEnabled; });\n };\n this.openTrueLayerBankPopup = function (event, authLink) {\n if (_this.disableButtons) {\n event.preventDefault();\n return;\n }\n _this.openbankingWidgetService.disableWidgetButtons(true);\n var title = \"Open Banking\";\n var w = 814;\n var h = 778;\n var dualScreenLeft = _this.$window.screenLeft;\n var dualScreenTop = _this.$window.screenTop;\n var width = _this.$window.innerWidth ? _this.$window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : _this.$window.screen.width;\n var height = _this.$window.innerHeight ? _this.$window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : _this.$window.screen.height;\n var left = dualScreenLeft < 0 ? ((width / 2) - (w / 2)) - dualScreenLeft : ((width / 2) - (w / 2)) + dualScreenLeft;\n var top = dualScreenTop < 0 ? ((height / 2) - (h / 2)) - dualScreenTop : ((height / 2) - (h / 2)) + dualScreenTop;\n var newWindow = _this.$window.open(authLink, title, 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);\n var timer = setInterval(function () {\n if (newWindow.closed) {\n clearInterval(timer);\n _this.openbankingWidgetService.disableWidgetButtons(false);\n }\n }, 1000);\n if (_this.$window.focus) {\n newWindow.focus();\n }\n };\n this.openExendingConnection = function (event, bankaccount) {\n if (_this.disableButtons) {\n event.preventDefault();\n return;\n }\n _this.localStorageService.set(\"OpenBankingReconsent\", bankaccount.key);\n _this.openbankingWidgetService.disableWidgetButtons(true);\n var title = \"Open Banking - Reconfirm Consent\";\n var w = 814;\n var h = 778;\n var dualScreenLeft = _this.$window.screenLeft;\n var dualScreenTop = _this.$window.screenTop;\n var width = _this.$window.innerWidth ? _this.$window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : _this.$window.screen.width;\n var height = _this.$window.innerHeight ? _this.$window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : _this.$window.screen.height;\n var left = dualScreenLeft < 0 ? ((width / 2) - (w / 2)) - dualScreenLeft : ((width / 2) - (w / 2)) + dualScreenLeft;\n var top = dualScreenTop < 0 ? ((height / 2) - (h / 2)) - dualScreenTop : ((height / 2) - (h / 2)) + dualScreenTop;\n var newWindow = _this.$window.open(bankaccount.authLink, title, 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);\n var timer = setInterval(function () {\n if (newWindow.closed) {\n clearInterval(timer);\n _this.openbankingWidgetService.disableWidgetButtons(false);\n }\n }, 1000);\n if (_this.$window.focus) {\n newWindow.focus();\n }\n };\n this.trueLayerPopupWindowEventChange = function (event, notification) {\n _this.disableButtons = Boolean(notification.DisableButtons);\n };\n this.viewBankFileUpload = function (expense) {\n _this.$state.go(\"brookson.bank-file-upload\");\n };\n this.WidgetTokenExchangeResponse = function (event, notification) {\n var bankAccount = _.find(_this.bankAccountList, function (bankAccount) {\n return bankAccount.key === notification.State;\n });\n if (bankAccount !== undefined) {\n if (Number(notification.OpenBankingStatus) === Shared.openbankingWidget.ConsentStatus.AccessTokenReceived &&\n bankAccount.consentStatus !== Shared.openbankingWidget.ConsentStatus.AccessTokenReceived) {\n // The following timeout functions are to render a smooth transition when the widget messages are changed.\n _this.$timeout(function () {\n bankAccount.pendingStatus = false;\n bankAccount.consentStatus = Number(notification.OpenBankingStatus);\n bankAccount.consentDateDue = notification.ReConsentDate;\n bankAccount.consentExpired = false;\n bankAccount.consentReminder = false;\n bankAccount.hasAccessToken = true;\n if (!bankAccount.success) {\n _this.$timeout(function () {\n if (bankAccount.viewAccessDescription !== 'Open Banking Access' || bankAccount.className !== 'greenBox') {\n bankAccount.viewAccessDescription = 'Open Banking Access';\n bankAccount.className = 'greenBox';\n }\n bankAccount.success = true;\n _this.$timeout(function () { _this.onComplete(); }, 500);\n }, 1000);\n }\n }, 4000);\n }\n if (Number(notification.OpenBankingStatus) === Shared.openbankingWidget.ConsentStatus.AccessTokenError) {\n _this.$timeout(function () {\n bankAccount.pendingStatus = false;\n bankAccount.hasAccessToken = false;\n bankAccount.consentExpired = false;\n if (!bankAccount.success) {\n _this.$timeout(function () {\n bankAccount.consentStatus = Number(notification.OpenBankingStatus);\n _this.$timeout(function () { _this.onComplete(); }, 500);\n }, 1000);\n }\n }, 4000);\n }\n if (Number(notification.OpenBankingStatus) === Shared.openbankingWidget.ConsentStatus.AccessTokenPending) {\n _this.$timeout(function () {\n bankAccount.consentStatus = Number(notification.OpenBankingStatus);\n if (!bankAccount.success) {\n _this.$timeout(function () {\n bankAccount.pendingStatus = true;\n _this.$timeout(function () { _this.onComplete(); }, 1000);\n }, 1000);\n }\n }, 1000);\n }\n if (Number(notification.OpenBankingStatus) === Shared.openbankingWidget.ConsentStatus.NotConsented) {\n _this.$timeout(function () {\n bankAccount.consentStatus = Number(notification.OpenBankingStatus);\n if (!bankAccount.success) {\n _this.$timeout(function () {\n bankAccount.consentExpired = false;\n bankAccount.pendingStatus = false;\n bankAccount.hasAccessToken = false;\n bankAccount.consentStatus = Shared.openbankingWidget.ConsentStatus.NotConsented;\n bankAccount.viewAccessDescription = 'View Access';\n bankAccount.className = 'orangeBox';\n _this.$timeout(function () { _this.onComplete(); }, 1000);\n }, 1000);\n }\n }, 1000);\n }\n }\n };\n this.switchToOpenBanking = function (bankAccount) {\n if (!bankAccount.authorisedProvider)\n return false;\n if (bankAccount.consentStatus === Shared.openbankingWidget.ConsentStatus.NotConsented ||\n bankAccount.consentStatus === Shared.openbankingWidget.ConsentStatus.AccessTokenError ||\n bankAccount.consentStatus === Shared.openbankingWidget.ConsentStatus.ConsentError && !bankAccount.hasAccessToken) {\n return true;\n }\n return false;\n };\n this.reconsentOpenBanking = function (bankAccount) {\n if (!bankAccount.authorisedProvider)\n return false;\n if (bankAccount.consentStatus === Shared.openbankingWidget.ConsentStatus.ConsentError && bankAccount.hasAccessToken ||\n (bankAccount.consentExpired && bankAccount.consentStatus !== Shared.openbankingWidget.ConsentStatus.AccessTokenPending)) {\n return true;\n }\n return false;\n };\n this.maskedBankAccountNumber = function (bankAccount) {\n return '****' + bankAccount.accountNumber.substr(bankAccount.accountNumber.length - 4);\n };\n this.showReconsentMessage = function (bankAccount) {\n return bankAccount.consentStatus === Shared.openbankingWidget.ConsentStatus.ConsentError && bankAccount.hasAccessToken ||\n (bankAccount.consentExpired && bankAccount.consentStatus !== Shared.openbankingWidget.ConsentStatus.AccessTokenPending);\n };\n this.showTechIssueMessage = function (bankAccount) {\n return bankAccount.authorisedProvider && bankAccount.consentStatus === Shared.openbankingWidget.ConsentStatus.ConsentError\n && !bankAccount.hasAccessToken;\n };\n this.showAccessTokenErrorMessage = function (bankAccount) {\n return bankAccount.authorisedProvider && (!bankAccount.success && bankAccount.consentStatus === Shared.openbankingWidget.ConsentStatus.AccessTokenError);\n };\n this.showNotConsentMessage = function (bankAccount) {\n return bankAccount.authorisedProvider && bankAccount.consentStatus === Shared.openbankingWidget.ConsentStatus.NotConsented;\n };\n this.showAccessTokenPendingMessage = function (bankAccount) {\n return bankAccount.authorisedProvider && bankAccount.pendingStatus && bankAccount.consentStatus === Shared.openbankingWidget.ConsentStatus.AccessTokenPending;\n };\n this.showReconsentDueMessage = function (bankAccount) {\n return bankAccount.authorisedProvider && bankAccount.hasAccessToken\n && bankAccount.consentStatus !== Shared.openbankingWidget.ConsentStatus.AccessTokenPending\n && bankAccount.success && moment(bankAccount.consentDateDue).isAfter(moment());\n };\n this.downloadMandateForm = function (bankName) {\n if (bankName.toLowerCase() === 'metro') {\n bankName = 'Metro Bank';\n }\n if (bankName.toLowerCase() === 'cashplus' || bankName.toLowerCase() === 'Cashplus') {\n bankName = 'Zempler';\n }\n var url = \"api/BankLink/DownloadMandateForm?id=\" + bankName;\n var expectedMediaType = \"application/octet-stream\";\n var memberId = _this.memberSrv.getMember().memberId;\n _this.fileDownloadSrv.downloadAndSave(url, null, 'Mandate - ' + bankName + ' - ' + memberId + '.pdf', expectedMediaType);\n };\n }\n BrooksonWidgetsOpenBankingController.$inject = ['$q', '$timeout', 'openbankingWidgetService', '$window', '$scope', 'brookson.file.download', 'memberSrv', 'growl', 'dashboardService', 'localStorageService', '$state'];\n return BrooksonWidgetsOpenBankingController;\n }());\n})(Shared || (Shared = {}));\nangular\n .module(\"app.shared\")\n .component(\"brooksonWidgetsOpenBanking\", new Shared.BrooksonWidgetsOpenBanking());\n/// \nvar Shared;\n(function (Shared) {\n var BrooksonWidgetsReceiptBank = /** @class */ (function () {\n function BrooksonWidgetsReceiptBank() {\n this.bindings = {\n onComplete: '&'\n };\n this.controller = [\"$timeout\", \"brooksonFactoriesExpenses\", 'brookson.navigation', 'expenses.enums', 'dashboardService', BrooksonWidgetsReceiptBankController];\n this.templateUrl = 'src/app/shared/views/widgets/brookson.widgets.receipt-bank.html';\n }\n return BrooksonWidgetsReceiptBank;\n }());\n Shared.BrooksonWidgetsReceiptBank = BrooksonWidgetsReceiptBank;\n var BrooksonWidgetsReceiptBankController = /** @class */ (function () {\n function BrooksonWidgetsReceiptBankController($timeout, expensesSrv, brooksonNavigation, expensesEnums, _dashboardService) {\n this.$timeout = $timeout;\n this.expensesSrv = expensesSrv;\n this.brooksonNavigation = brooksonNavigation;\n this.expensesEnums = expensesEnums;\n this._dashboardService = _dashboardService;\n this.widgetName = \"brookson-widgets-receipt-bank\";\n this.dashboardService = this._dashboardService;\n }\n BrooksonWidgetsReceiptBankController.prototype.$onInit = function () {\n this.getReceipts();\n };\n BrooksonWidgetsReceiptBankController.prototype.goToReceiptBankPressed = function () {\n this.brooksonNavigation.expenses.expensesReceiptBank();\n };\n BrooksonWidgetsReceiptBankController.prototype.getReceipts = function () {\n var _this = this;\n this.showSpinner = true;\n this.expensesSrv.getReceipts(true).then(function (data) {\n if (data) {\n _this.numberOfReceipts = _.filter(data, function (receipt) {\n return receipt.status === _this.expensesEnums.ReceiptStatus.UNATTACHED;\n }).length;\n }\n }, function () {\n _this.error = true;\n }).then(function () {\n _this.showSpinner = false;\n _this.$timeout(function () { _this.onComplete(); });\n });\n };\n return BrooksonWidgetsReceiptBankController;\n }());\n Shared.BrooksonWidgetsReceiptBankController = BrooksonWidgetsReceiptBankController;\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .component('brooksonWidgetsReceiptBank', new Shared.BrooksonWidgetsReceiptBank());\n/// \n(function () {\n 'use strict';\n angular.module('app.shared').component('brooksonWidgetRemusRewardsButton', {\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.remus-rewards-button.html',\n bindings: {\n onComplete: '&'\n },\n controller: brooksonWidgetRemusRewardsButton\n });\n brooksonWidgetRemusRewardsButton.$inject = ['remusRewardSrv', '$timeout', 'brookson.navigation', 'dashboardService'];\n function brooksonWidgetRemusRewardsButton(remusRewardSrv, $timeout, brooksonNavigation, _dashboardService) {\n var vm = this;\n vm.brooksonNavigation = brooksonNavigation;\n vm.showSpinner = true;\n vm.error = false;\n vm.dashboardService = _dashboardService;\n vm.cidValue = '';\n vm.dataValue = '';\n vm.isUmbrellaPlus = false;\n vm.widgetName = \"brookson-widget-remus-rewards\";\n vm.submitRemusRewardForm = function () {\n var form = angular.element('#remusRewardForm');\n form.submit();\n };\n function getRemusRewards() {\n vm.showSpinner = false;\n remusRewardSrv.getRemusRewardsUrlParameters().then(function (data) {\n vm.showSpinner = false;\n vm.cidValue = data.cidValue;\n vm.dataValue = data.dataValue;\n }, function () {\n vm.error = true;\n }).then(function () {\n vm.showSpinner = false;\n $timeout(function () { vm.onComplete(); });\n });\n }\n function isUserUmbrellaPlus() {\n console.log('isUserUmbrellaPlus');\n remusRewardSrv.isUserUmbrellaPlus().then(function (data) {\n vm.isUmbrellaPlus = data;\n });\n }\n function activate() {\n getRemusRewards();\n isUserUmbrellaPlus();\n }\n activate();\n }\n})();\n/// \n(function () {\n 'use strict';\n angular.module('app.shared').component('brooksonWidgetRemusRewards', {\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.remus-rewards.html',\n bindings: {\n onComplete: '&'\n },\n controller: brooksonWidgetRemusRewards\n });\n brooksonWidgetRemusRewards.$inject = ['remusRewardSrv', '$timeout', 'brookson.navigation', 'dashboardService'];\n function brooksonWidgetRemusRewards(remusRewardSrv, $timeout, brooksonNavigation, _dashboardService) {\n var vm = this;\n vm.brooksonNavigation = brooksonNavigation;\n vm.showSpinner = true;\n vm.error = false;\n vm.dashboardService = _dashboardService;\n vm.cidValue = '';\n vm.dataValue = '';\n vm.isUmbrellaPlus = false;\n vm.widgetName = \"brookson-widget-remus-rewards\";\n vm.submitRemusRewardForm = function () {\n var form = angular.element('#remusRewardForm');\n form.submit();\n };\n function getRemusRewards() {\n vm.showSpinner = false;\n remusRewardSrv.getRemusRewardsUrlParameters().then(function (data) {\n vm.showSpinner = false;\n vm.cidValue = data.cidValue;\n vm.dataValue = data.dataValue;\n }, function () {\n vm.error = true;\n }).then(function () {\n vm.showSpinner = false;\n $timeout(function () { vm.onComplete(); });\n });\n }\n function isUserUmbrellaPlus() {\n console.log('isUserUmbrellaPlus');\n remusRewardSrv.isUserUmbrellaPlus().then(function (data) {\n vm.isUmbrellaPlus = data;\n });\n }\n function activate() {\n getRemusRewards();\n isUserUmbrellaPlus();\n }\n activate();\n }\n})();\n/// \nvar Shared;\n(function (Shared) {\n var BrooksonWidgetSmeActionsToTake = /** @class */ (function () {\n function BrooksonWidgetSmeActionsToTake() {\n this.bindings = {\n onComplete: \"&\"\n };\n this.controller = [\"$timeout\", \"$window\", \"$q\", \"smeManagementSrv\", \"brookson.navigation\", \"brookson.utilities.date\", \"dashboardService\", BrooksonWidgetsSmeActionsToTakeController];\n this.templateUrl = \"src/app/shared/views/widgets/brookson.widgets.sme.actions-to-take.html\";\n }\n return BrooksonWidgetSmeActionsToTake;\n }());\n Shared.BrooksonWidgetSmeActionsToTake = BrooksonWidgetSmeActionsToTake;\n var BrooksonWidgetsSmeActionsToTakeController = /** @class */ (function () {\n function BrooksonWidgetsSmeActionsToTakeController($timeout, $window, $q, smeManagementSrv, brooksonNavigation, dateUtils, dashboardService) {\n this.$timeout = $timeout;\n this.$window = $window;\n this.$q = $q;\n this.smeManagementSrv = smeManagementSrv;\n this.brooksonNavigation = brooksonNavigation;\n this.dateUtils = dateUtils;\n this.dashboardService = dashboardService;\n this.showSpinner = true;\n this.hasActionsToTake = false;\n this.widgetName = \"brookson-widget-sme-actions-to-take\";\n }\n BrooksonWidgetsSmeActionsToTakeController.prototype.$onInit = function () {\n this.getActionsToTakeSummary();\n };\n BrooksonWidgetsSmeActionsToTakeController.prototype.getActionsToTakeSummary = function () {\n var _this = this;\n return this.smeManagementSrv.getActionsToTakeSummary()\n .then(function (data) {\n _this.actionsToTakeSummary = data;\n _this.hasActionsToTake = _this.actionsToTakeSummary.expensesToAuthorize + _this.actionsToTakeSummary.holidaysToAuthorize + _this.actionsToTakeSummary.overtimeToAuthorize > 0;\n return data;\n }, function (ex) {\n _this.error = true;\n })\n .then(function () {\n _this.showSpinner = false;\n _this.$timeout(function () { _this.onComplete(); }, 0);\n });\n };\n return BrooksonWidgetsSmeActionsToTakeController;\n }());\n Shared.BrooksonWidgetsSmeActionsToTakeController = BrooksonWidgetsSmeActionsToTakeController;\n})(Shared || (Shared = {}));\nangular\n .module(\"app.shared\")\n .component(\"brooksonWidgetSmeActionsToTake\", new Shared.BrooksonWidgetSmeActionsToTake());\n/// \nvar Shared;\n(function (Shared) {\n var BrooksonWidgetSmeEmployeesOnHoliday = /** @class */ (function () {\n function BrooksonWidgetSmeEmployeesOnHoliday() {\n this.bindings = {\n onComplete: \"&\"\n };\n this.controller = [\"$timeout\", \"$window\", \"$q\", \"holidaysSrv\", \"brookson.navigation\", \"brookson.utilities.date\", \"dashboardService\", BrooksonWidgetSmeEmployeesOnHolidayController];\n this.templateUrl = \"src/app/shared/views/widgets/brookson.widgets.sme.employees-on-holiday.html\";\n }\n return BrooksonWidgetSmeEmployeesOnHoliday;\n }());\n Shared.BrooksonWidgetSmeEmployeesOnHoliday = BrooksonWidgetSmeEmployeesOnHoliday;\n var BrooksonWidgetSmeEmployeesOnHolidayController = /** @class */ (function () {\n function BrooksonWidgetSmeEmployeesOnHolidayController($timeout, $window, $q, holidaySrv, brooksonNavigation, dateUtils, _dashboardService) {\n this.$timeout = $timeout;\n this.$window = $window;\n this.$q = $q;\n this.holidaySrv = holidaySrv;\n this.brooksonNavigation = brooksonNavigation;\n this.dateUtils = dateUtils;\n this._dashboardService = _dashboardService;\n this.showSpinner = true;\n this.widgetName = \"brookson-widget-sme-employees-on-holiday\";\n this.dashboardService = this._dashboardService;\n }\n BrooksonWidgetSmeEmployeesOnHolidayController.prototype.$onInit = function () {\n this.getActiveHolidayRequests();\n };\n BrooksonWidgetSmeEmployeesOnHolidayController.prototype.getActiveHolidayRequests = function () {\n var _this = this;\n return this.holidaySrv.getCompanyActiveHolidayRequests()\n .then(function (data) {\n _this.holidayRequests = data;\n return data;\n }, function (ex) {\n _this.error = true;\n })\n .then(function () {\n _this.showSpinner = false;\n _this.$timeout(function () { _this.onComplete(); }, 0);\n });\n };\n return BrooksonWidgetSmeEmployeesOnHolidayController;\n }());\n Shared.BrooksonWidgetSmeEmployeesOnHolidayController = BrooksonWidgetSmeEmployeesOnHolidayController;\n})(Shared || (Shared = {}));\nangular\n .module(\"app.shared\")\n .component(\"brooksonWidgetSmeEmployeesOnHoliday\", new Shared.BrooksonWidgetSmeEmployeesOnHoliday());\n/// \nvar Shared;\n(function (Shared) {\n var BrooksonWidgetsSmeLastPayslip = /** @class */ (function () {\n function BrooksonWidgetsSmeLastPayslip() {\n this.bindings = {\n onComplete: \"&\"\n };\n this.controller = [\"$timeout\", \"$q\", \"brookson.navigation\", \"brookson.utilities.date\", \"dashboardService\", BrooksonWidgetsSmeLastPayslipController];\n this.templateUrl = \"src/app/shared/views/widgets/brookson.widgets.sme.last-payslip.html\";\n }\n return BrooksonWidgetsSmeLastPayslip;\n }());\n Shared.BrooksonWidgetsSmeLastPayslip = BrooksonWidgetsSmeLastPayslip;\n var BrooksonWidgetsSmeLastPayslipController = /** @class */ (function () {\n function BrooksonWidgetsSmeLastPayslipController($timeout, $q, brooksonNavigation, dateUtils, _dashboardService) {\n this.$timeout = $timeout;\n this.$q = $q;\n this.brooksonNavigation = brooksonNavigation;\n this.dateUtils = dateUtils;\n this._dashboardService = _dashboardService;\n this.error = false;\n this.showSpinner = true;\n this.widgetName = \"brookson-widget-sme-last-payslip\";\n this.dashboardService = this._dashboardService;\n }\n BrooksonWidgetsSmeLastPayslipController.prototype.$onInit = function () {\n this.onComplete();\n this.showSpinner = false;\n };\n return BrooksonWidgetsSmeLastPayslipController;\n }());\n Shared.BrooksonWidgetsSmeLastPayslipController = BrooksonWidgetsSmeLastPayslipController;\n})(Shared || (Shared = {}));\nangular\n .module(\"app.shared\")\n .component(\"brooksonWidgetSmeLastPayslip\", new Shared.BrooksonWidgetsSmeLastPayslip());\n/// \nvar Shared;\n(function (Shared) {\n var BrooksonWidgetSmeNextHoliday = /** @class */ (function () {\n function BrooksonWidgetSmeNextHoliday() {\n this.bindings = {\n onComplete: \"&\"\n };\n this.controller = [\"$timeout\", \"$q\", \"$window\", \"holidaysSrv\", \"brookson.navigation\", \"brookson.utilities.date\", \"dashboardService\", \"memberSrv\", BrooksonWidgetsSmeNextHolidayController];\n this.templateUrl = \"src/app/shared/views/widgets/brookson.widgets.sme.next-holiday.html\";\n }\n return BrooksonWidgetSmeNextHoliday;\n }());\n Shared.BrooksonWidgetSmeNextHoliday = BrooksonWidgetSmeNextHoliday;\n var BrooksonWidgetsSmeNextHolidayController = /** @class */ (function () {\n function BrooksonWidgetsSmeNextHolidayController($timeout, $q, $window, holidaysSrv, brooksonNavigation, dateUtils, _dashboardService, memberSrv) {\n this.$timeout = $timeout;\n this.$q = $q;\n this.$window = $window;\n this.holidaysSrv = holidaysSrv;\n this.brooksonNavigation = brooksonNavigation;\n this.dateUtils = dateUtils;\n this._dashboardService = _dashboardService;\n this.memberSrv = memberSrv;\n this.error = false;\n this.showSpinner = true;\n this.widgetName = \"brookson-widget-sme-next-holiday\";\n this.dashboardService = this._dashboardService;\n }\n BrooksonWidgetsSmeNextHolidayController.prototype.$onInit = function () {\n this.getNextHoliday();\n this.getRemainingHolidayAllowance();\n };\n BrooksonWidgetsSmeNextHolidayController.prototype.goToHolidays = function () {\n var member = this.getMember();\n if (member.businessType === \"SME\" && member.role === \"EMPLOYEE\") {\n this.$window.location.href = \"/EmployeeZone/EmployeeHolidays\";\n }\n else if (member.businessType === \"SME\" && member.role === \"DIRECTOR\") {\n this.$window.location.href = \"/Sme/Holidays\";\n }\n };\n BrooksonWidgetsSmeNextHolidayController.prototype.getNextHoliday = function () {\n var _this = this;\n this.holidaysSrv.getNextHoliday()\n .then(function (data) {\n _this.nextHoliday = data;\n }, function (ex) {\n _this.error = true;\n })\n .then(function () {\n _this.showSpinner = false;\n _this.$timeout(function () { _this.onComplete(); }, 0);\n });\n };\n BrooksonWidgetsSmeNextHolidayController.prototype.getRemainingHolidayAllowance = function () {\n var _this = this;\n this.holidaysSrv.getRemainingHolidayAllowance()\n .then(function (data) {\n var stringData = data.toString();\n stringData = stringData.split(\":\")[0];\n var days = stringData.split(\".\")[0];\n var hours = stringData.split(\".\")[1];\n _this.remainingHolidayAllowance = days + \" days\" + (hours !== '00' ? \", \" + hours + \" hours\" : \"\");\n });\n };\n BrooksonWidgetsSmeNextHolidayController.prototype.getMember = function () {\n return this.memberSrv.getMember();\n };\n return BrooksonWidgetsSmeNextHolidayController;\n }());\n Shared.BrooksonWidgetsSmeNextHolidayController = BrooksonWidgetsSmeNextHolidayController;\n})(Shared || (Shared = {}));\nangular\n .module(\"app.shared\")\n .component(\"brooksonWidgetSmeNextHoliday\", new Shared.BrooksonWidgetSmeNextHoliday());\n/// \nvar Shared;\n(function (Shared) {\n var BrooksonWidgetsSmeProfitAndLoss = /** @class */ (function () {\n function BrooksonWidgetsSmeProfitAndLoss() {\n this.bindings = {\n onComplete: \"&\"\n };\n this.controller = [\"$timeout\", \"$q\", \"financialCenterSrv\", \"brookson.navigation\", \"brookson.utilities.date\", \"dashboardService\", BrooksonWidgetsSmeProfitAndLossController];\n this.templateUrl = \"src/app/shared/views/widgets/brookson.widgets.sme.profit-loss.html\";\n }\n return BrooksonWidgetsSmeProfitAndLoss;\n }());\n Shared.BrooksonWidgetsSmeProfitAndLoss = BrooksonWidgetsSmeProfitAndLoss;\n var BrooksonWidgetsSmeProfitAndLossController = /** @class */ (function () {\n function BrooksonWidgetsSmeProfitAndLossController($timeout, $q, financialCenterSrv, brooksonNavigation, dateUtils, _dashboardService) {\n this.$timeout = $timeout;\n this.$q = $q;\n this.financialCenterSrv = financialCenterSrv;\n this.brooksonNavigation = brooksonNavigation;\n this.dateUtils = dateUtils;\n this._dashboardService = _dashboardService;\n this.showSpinner = true;\n this.widgetName = \"brookson-widget-sme-profit-loss\";\n this.dashboardService = this._dashboardService;\n }\n BrooksonWidgetsSmeProfitAndLossController.prototype.$onInit = function () {\n this.getSummary();\n };\n BrooksonWidgetsSmeProfitAndLossController.prototype.getSummary = function () {\n var _this = this;\n var endOfCurrentPeriod = moment().add(1, 'months').set('date', 1).add(-1, 'days');\n var startOfCurrentPeriod = moment().set('date', 1).add(-3, 'months');\n var startOfPreviousPeriods = moment().set('date', 1).add(-12, 'months');\n var endOfPreviousPeriods = moment().add(1, 'months').set('date', 1).add(-1, 'days');\n this.startOfCurrentPeriod = this.dateUtils.convertToViewString(startOfCurrentPeriod);\n this.startOfPreviousPeriods = this.dateUtils.convertToViewString(startOfPreviousPeriods);\n this.endOfPreviousPeriods = this.dateUtils.convertToViewString(endOfPreviousPeriods);\n this.endOfPeriod = this.dateUtils.convertToViewString(endOfCurrentPeriod);\n var getPreviousMonthSummary = this.financialCenterSrv.getProfitAndLossSummary(startOfPreviousPeriods.toDate(), endOfPreviousPeriods.toDate());\n var getCurrentMonthSummary = this.financialCenterSrv.getProfitAndLossSummary(startOfCurrentPeriod.toDate(), endOfCurrentPeriod.toDate());\n this.$q.all([getPreviousMonthSummary, getCurrentMonthSummary])\n .then(function (data) {\n _this.previousMonth = data[0];\n _this.currentMonth = data[1];\n }, function (ex) {\n _this.error = true;\n })\n .then(function () {\n _this.showSpinner = false;\n _this.$timeout(function () { _this.onComplete(); }, 0);\n });\n };\n return BrooksonWidgetsSmeProfitAndLossController;\n }());\n Shared.BrooksonWidgetsSmeProfitAndLossController = BrooksonWidgetsSmeProfitAndLossController;\n})(Shared || (Shared = {}));\nangular\n .module(\"app.shared\")\n .component(\"brooksonWidgetSmeProfitLoss\", new Shared.BrooksonWidgetsSmeProfitAndLoss());\n/// \nvar Shared;\n(function (Shared) {\n 'use strict';\n var BrooksonWidgetTaskPlanner = /** @class */ (function () {\n function BrooksonWidgetTaskPlanner() {\n this.bindings = {\n onComplete: '&'\n };\n this.controller = WidgetTaskPlannerCtrl;\n this.templateUrl = 'src/app/shared/views/widgets/brookson.widgets.task-planner.html';\n }\n return BrooksonWidgetTaskPlanner;\n }());\n Shared.BrooksonWidgetTaskPlanner = BrooksonWidgetTaskPlanner;\n var WidgetTaskPlannerCtrl = /** @class */ (function () {\n function WidgetTaskPlannerCtrl($timeout, $scope, taskPlannerSrv, brooksonNavigation, enums, _dashboardService) {\n var _this = this;\n this.$timeout = $timeout;\n this.$scope = $scope;\n this.taskPlannerSrv = taskPlannerSrv;\n this.brooksonNavigation = brooksonNavigation;\n this.enums = enums;\n this._dashboardService = _dashboardService;\n this.tasks = [];\n this.showSpinner = true;\n this.widgetName = \"brookson-widget-task-planner\";\n this.dashboardService = this._dashboardService;\n this.gotoTask = function (task) {\n _this.brooksonNavigation.taskPlanner.selectedActionTask(task.camelCase, task.actionId);\n };\n taskPlannerSrv.buildMonths()\n .then(function () {\n _this.tasks = _.chain(taskPlannerSrv.flatActions)\n .filter(function (action) {\n return (action.status === 1 || action.status === 3) &&\n action.responsibility === _this.enums.TaskResponsibility.ME;\n })\n .orderBy('dueDate', 'asc')\n .take(5)\n .map(function (n) {\n n.camelCase = _.camelCase(n.taskGroup);\n return n;\n })\n .value();\n _this.showSpinner = false;\n _this.$timeout(function () { _this.onComplete(); });\n }, function (ex) {\n _this.showSpinner = false;\n _this.$timeout(function () { _this.onComplete(); });\n });\n }\n WidgetTaskPlannerCtrl.$inject = ['$timeout', '$scope', 'taskPlannerSrv', 'brookson.navigation', 'taskPlanner.enums', 'dashboardService'];\n return WidgetTaskPlannerCtrl;\n }());\n Shared.WidgetTaskPlannerCtrl = WidgetTaskPlannerCtrl;\n})(Shared || (Shared = {}));\nangular\n .module('app.shared')\n .component('brooksonWidgetTaskPlanner', new Shared.BrooksonWidgetTaskPlanner());\n/// \nvar Shared;\n(function (Shared) {\n 'use strict';\n var BrooksonWidgetsPersonalTaxTracker = /** @class */ (function () {\n function BrooksonWidgetsPersonalTaxTracker() {\n this.controller = BrooksonWidgetsPersonalTaxTrackerController;\n this.templateUrl = \"src/app/shared/views/widgets/brookson.widgets.personal-tax.tracker.html\";\n this.bindings = {\n onComplete: \"&\"\n };\n }\n return BrooksonWidgetsPersonalTaxTracker;\n }());\n Shared.BrooksonWidgetsPersonalTaxTracker = BrooksonWidgetsPersonalTaxTracker;\n var BrooksonWidgetsPersonalTaxTrackerController = /** @class */ (function () {\n function BrooksonWidgetsPersonalTaxTrackerController($timeout, personalTaxSrv, brooksonNavigation, dashboardService) {\n var _this = this;\n this.$timeout = $timeout;\n this.personalTaxSrv = personalTaxSrv;\n this.brooksonNavigation = brooksonNavigation;\n this.dashboardService = dashboardService;\n this.showSpinner = true;\n this.showNewSetupText = false;\n this.error = false;\n this.widgetName = \"brookson-widget-personal-tax-tracker\";\n this.$onInit = function () {\n _this.personalTaxSrv.selectedTaxYearChanged(\"Previous Tax Year\")\n .then(function (data) {\n _this.showNewSetupText = _.sum([\n data.forecastCalculations.confirmedAsDividends,\n data.forecastCalculations.pscEmployment,\n data.forecastCalculations.taxDeductedFromPSCIncome,\n data.forecastCalculations.transactionsBeingProcessed,\n data.forecastCalculations.unconfirmedTransactions\n ]) === 0 && false;\n }, function (error) {\n _this.error = true;\n })\n .then(function () {\n _this.showSpinner = false;\n _this.$timeout(function () { _this.onComplete(); });\n });\n };\n }\n BrooksonWidgetsPersonalTaxTrackerController.$inject = [\"$timeout\", \"personalTaxTrackerSrv\", \"brookson.navigation\", \"dashboardService\"];\n return BrooksonWidgetsPersonalTaxTrackerController;\n }());\n})(Shared || (Shared = {}));\nangular\n .module(\"app.shared\")\n .component(\"brooksonWidgetPersonalTaxTracker\", new Shared.BrooksonWidgetsPersonalTaxTracker());\n/// \n/// \n(function () {\n 'use strict';\n angular.module('app.shared').component('brooksonWidgetUmbrellaBrooksonAdverts', {\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.umbrella-brookson-adverts.html',\n bindings: {\n onComplete: '&'\n },\n controller: brooksonWidgetUmbrellaBrooksonAdverts\n });\n brooksonWidgetUmbrellaBrooksonAdverts.$inject = ['$timeout', 'brookson.navigation', 'dashboardService', 'brookson.ui.popup', 'remusRewardSrv'];\n function brooksonWidgetUmbrellaBrooksonAdverts($timeout, brooksonNavigation, _dashboardService, _brooksonUiPopup, remusRewardSrv) {\n var vm = this;\n vm.brooksonUiPopup = _brooksonUiPopup;\n vm.brooksonNavigation = brooksonNavigation;\n vm.widgetName = \"brookson-widget-umbrella-brookson-adverts\";\n vm.isUmbrellaPlus = false;\n vm.isUmbrellaPlusSelected = false;\n vm.agencyMargin = Shared.Models.AgencyMarginCompact;\n vm.selectUmbrellaProtect = function () {\n // pop confirm modal\n vm.brooksonUiPopup.showConfirmationPopup('CHOOSE YOUR PACKAGE', '

    If you wish to downgrade your package in the future, please contact customer services.

    Upgrade my service to Umbrella Protect?

    ', 'Confirm', 'Dismiss').then(function () {\n remusRewardSrv.setPackageNavUmbrellaProtect();\n vm.selectedPackage = Shared.SelectedPackageEnum.umbrellaProtect;\n vm.isUmbrellaPlusSelected = true;\n }, function () { });\n };\n function isUserUmbrellaPlus() {\n console.log('isUserUmbrellaPlus');\n remusRewardSrv.isUserUmbrellaPlus().then(function (data) {\n vm.isUmbrellaPlus = data;\n });\n }\n function getAgencyMargin() {\n remusRewardSrv.getAgencyMargin().then(function (data) {\n vm.agencyMargin = data;\n });\n }\n function activate() {\n isUserUmbrellaPlus();\n getAgencyMargin();\n }\n activate();\n }\n})();\n/// \n(function () {\n 'use strict';\n angular.module('app.shared').component('brooksonWidgetUmbrellaFinancialAdverts', {\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.umbrella-financial-adverts.html',\n bindings: {\n onComplete: '&'\n },\n controller: brooksonWidgetUmbrellaFinancialAdverts\n });\n brooksonWidgetUmbrellaFinancialAdverts.$inject = ['$timeout', 'brookson.navigation', 'dashboardService'];\n function brooksonWidgetUmbrellaFinancialAdverts($timeout, brooksonNavigation, _dashboardService) {\n var vm = this;\n vm.brooksonNavigation = brooksonNavigation;\n vm.widgetName = \"brookson-widget-umbrella-financial-adverts\";\n }\n})();\n/// \n(function () {\n 'use strict';\n angular.module('app.shared').component('brooksonWidgetUmbrellaWhatsApp', {\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.umbrella-whats-app.html',\n bindings: {\n onComplete: '&'\n },\n controller: brooksonWidgetUmbrellaWhatsApp\n });\n brooksonWidgetUmbrellaWhatsApp.$inject = ['$timeout', 'brookson.navigation', 'dashboardService'];\n function brooksonWidgetUmbrellaWhatsApp($timeout, brooksonNavigation, _dashboardService) {\n var vm = this;\n vm.brooksonNavigation = brooksonNavigation;\n vm.widgetName = \"brookson-widget-umbrella-whats-app\";\n }\n})();\n/// \n(function () {\n 'use strict';\n angular.module('app.shared').component('brooksonWidgetUmbrellaFaq', {\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.umbrella.faq.html',\n bindings: {\n onComplete: '&'\n },\n controller: brooksonWidgetUmbrellaFaq\n });\n brooksonWidgetUmbrellaFaq.$inject = ['$timeout', 'invoicingSrv', 'brookson.navigation', 'appSettings', 'memberSrv'];\n function brooksonWidgetUmbrellaFaq($timeout, invoicingSrv, brooksonNavigation, dashboardService, appSettings, memberSrv) {\n var vm = this;\n vm.latestInvoices = {};\n vm.latestPayments = {};\n vm.showSpinner = false;\n vm.brooksonNavigation = brooksonNavigation;\n vm.memberSrv = memberSrv;\n vm.showNewSetupText = false;\n vm.dashboardService = dashboardService;\n vm.widgetName = \"brookson-widget-umbrella-faq\";\n vm.appSettings = appSettings;\n vm.memberBusinessType = '';\n }\n})();\n/// \n(function () {\n 'use strict';\n angular.module('app.shared').component('brooksonWidgetUmbrellaPayalerts', {\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.umbrella.payalerts.html',\n bindings: {\n onComplete: '&'\n },\n controller: brooksonWidgetUmbrellaPayalerts\n });\n brooksonWidgetUmbrellaPayalerts.$inject = ['$timeout', 'invoicingSrv', 'brookson.navigation', 'dashboardService', 'appSettings', 'memberSrv'];\n function brooksonWidgetUmbrellaPayalerts($timeout, invoicingSrv, brooksonNavigation, dashboardService, appSettings, memberSrv) {\n var vm = this;\n vm.latestInvoices = {};\n vm.latestPayments = {};\n vm.showSpinner = false;\n vm.brooksonNavigation = brooksonNavigation;\n vm.memberSrv = memberSrv;\n vm.showNewSetupText = false;\n vm.dashboardService = dashboardService;\n vm.widgetName = \"brookson-widget-umbrella-payalerts\";\n vm.appSettings = appSettings;\n vm.memberBusinessType = '';\n }\n})();\nvar Shared;\n(function (Shared) {\n var AccountsTable = /** @class */ (function () {\n function AccountsTable() {\n }\n return AccountsTable;\n }());\n Shared.AccountsTable = AccountsTable;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var AdviceTable = /** @class */ (function () {\n function AdviceTable() {\n }\n return AdviceTable;\n }());\n Shared.AdviceTable = AdviceTable;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var AdvisoryAdvice = /** @class */ (function () {\n function AdvisoryAdvice() {\n }\n return AdvisoryAdvice;\n }());\n Shared.AdvisoryAdvice = AdvisoryAdvice;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var AmountAvailableTable = /** @class */ (function () {\n function AmountAvailableTable() {\n }\n return AmountAvailableTable;\n }());\n Shared.AmountAvailableTable = AmountAvailableTable;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var BankTable = /** @class */ (function () {\n function BankTable() {\n }\n return BankTable;\n }());\n Shared.BankTable = BankTable;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var DividendsTable = /** @class */ (function () {\n function DividendsTable() {\n }\n return DividendsTable;\n }());\n Shared.DividendsTable = DividendsTable;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var ExpensesTable = /** @class */ (function () {\n function ExpensesTable() {\n }\n return ExpensesTable;\n }());\n Shared.ExpensesTable = ExpensesTable;\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n var ExpenseTableDetail = /** @class */ (function () {\n function ExpenseTableDetail() {\n }\n return ExpenseTableDetail;\n }());\n Shared.ExpenseTableDetail = ExpenseTableDetail;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var HRTThresholdTable = /** @class */ (function () {\n function HRTThresholdTable() {\n }\n return HRTThresholdTable;\n }());\n Shared.HRTThresholdTable = HRTThresholdTable;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var IntroductionSection = /** @class */ (function () {\n function IntroductionSection() {\n }\n return IntroductionSection;\n }());\n Shared.IntroductionSection = IntroductionSection;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var KeyInformation = /** @class */ (function () {\n function KeyInformation() {\n }\n return KeyInformation;\n }());\n Shared.KeyInformation = KeyInformation;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var PersonalTaxCalcTable = /** @class */ (function () {\n function PersonalTaxCalcTable() {\n }\n return PersonalTaxCalcTable;\n }());\n Shared.PersonalTaxCalcTable = PersonalTaxCalcTable;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var ProfitTable = /** @class */ (function () {\n function ProfitTable() {\n }\n return ProfitTable;\n }());\n Shared.ProfitTable = ProfitTable;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var PscPayeTable = /** @class */ (function () {\n function PscPayeTable() {\n }\n return PscPayeTable;\n }());\n Shared.PscPayeTable = PscPayeTable;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var SectionHeader = /** @class */ (function () {\n function SectionHeader() {\n }\n return SectionHeader;\n }());\n Shared.SectionHeader = SectionHeader;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var SectionMenuItem = /** @class */ (function () {\n function SectionMenuItem() {\n }\n return SectionMenuItem;\n }());\n Shared.SectionMenuItem = SectionMenuItem;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var UmbPayslipTable = /** @class */ (function () {\n function UmbPayslipTable() {\n }\n return UmbPayslipTable;\n }());\n Shared.UmbPayslipTable = UmbPayslipTable;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var UnconfirmedTable = /** @class */ (function () {\n function UnconfirmedTable() {\n }\n return UnconfirmedTable;\n }());\n Shared.UnconfirmedTable = UnconfirmedTable;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var Agency = /** @class */ (function () {\n function Agency() {\n this.billingAddressAddressLine1 = null;\n this.billingAddressAddressLine2 = null;\n this.billingAddressAddressLine3 = null;\n this.billingAddressPostcode = null;\n this.billingAddressTown = null;\n this.billingAddressCounty = null;\n this.billingAddressCountry = null;\n this.customerAddressAddressLine1 = null;\n this.customerAddressAddressLine2 = null;\n this.customerAddressAddressLine3 = null;\n this.customerAddressPostcode = null;\n this.customerAddressTown = null;\n this.customerAddressCounty = null;\n this.customerAddressCountry = null;\n this.agencyReference = null;\n this.isSelfBilling = false;\n this.selfBillingMethod = null;\n this.customerNumber = null;\n this.crmAgencyId = null;\n this.isDirectEngagement = false;\n }\n return Agency;\n }());\n Shared.Agency = Agency;\n})(Shared || (Shared = {}));\n/// \n/// \nvar Shared;\n(function (Shared) {\n var SaveAssignmentRequest = /** @class */ (function () {\n function SaveAssignmentRequest() {\n }\n return SaveAssignmentRequest;\n }());\n Shared.SaveAssignmentRequest = SaveAssignmentRequest;\n // Brookson.Connect3.Web.Models.Requests.Assignment.Assignment\n var SaveAssignment = /** @class */ (function () {\n function SaveAssignment() {\n var _this = this;\n this.fromAssignmentCompact = function (data) {\n if (!data)\n return _this;\n _this.assignmentId = data.assignmentID;\n _this.agencyReference = data.agencyReference;\n _this.assignmentName = data.assignmentName;\n _this.dateStarted = data.dateStarted;\n _this.dateEnded = data.dateEnded;\n _this.uniqueId = data.uniqueIdentifierNumber;\n _this.preferredEmailAddresses = data.preferredEmailAddresses;\n _this.isSelfBilling = data.isSelfBilling;\n _this.publicSector = data.publicSector;\n _this.publicSectorFromDate = data.publicSectorFromDate;\n _this.jobTitle = data.jobTitleOption ? data.jobTitleOption.titleText : '';\n _this.industry = data.industry;\n _this.ir35Capture = data.ir35Capture;\n _this.ir35AssignmentStatus = data.ir35AssessmentCaptured;\n _this.timesheetFrequencySelector = data.timesheetFrequency === 0 ? null : data.timesheetFrequency;\n return _this;\n };\n }\n return SaveAssignment;\n }());\n Shared.SaveAssignment = SaveAssignment;\n})(Shared || (Shared = {}));\n/// \nvar Shared;\n(function (Shared) {\n var SaveUmbrellaAssignmentRequest = /** @class */ (function (_super) {\n __extends(SaveUmbrellaAssignmentRequest, _super);\n function SaveUmbrellaAssignmentRequest() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return SaveUmbrellaAssignmentRequest;\n }(Shared.SaveAssignmentRequest));\n Shared.SaveUmbrellaAssignmentRequest = SaveUmbrellaAssignmentRequest;\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var Invoicing;\n (function (Invoicing) {\n var InvoiceLine = /** @class */ (function () {\n function InvoiceLine() {\n }\n return InvoiceLine;\n }());\n Invoicing.InvoiceLine = InvoiceLine;\n })(Invoicing = Shared.Invoicing || (Shared.Invoicing = {}));\n})(Shared || (Shared = {}));\nvar Shared;\n(function (Shared) {\n var IR35DetailCaptureButtonPressed;\n (function (IR35DetailCaptureButtonPressed) {\n IR35DetailCaptureButtonPressed[IR35DetailCaptureButtonPressed[\"public\"] = 0] = \"public\";\n IR35DetailCaptureButtonPressed[IR35DetailCaptureButtonPressed[\"private\"] = 1] = \"private\";\n IR35DetailCaptureButtonPressed[IR35DetailCaptureButtonPressed[\"both\"] = 2] = \"both\";\n })(IR35DetailCaptureButtonPressed = Shared.IR35DetailCaptureButtonPressed || (Shared.IR35DetailCaptureButtonPressed = {}));\n})(Shared || (Shared = {}));\n","/// \r\n/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n var appShared = angular.module(\"app.shared\");\r\n\r\n appShared.directive('brooksonInputText', () => {\r\n return {\r\n restrict: 'AE',\r\n require: '^form',\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text.html',\r\n scope: {\r\n ngModel: '=',\r\n label: '@',\r\n field: '@',\r\n isRequired: '@',\r\n ngReadonly: '=',\r\n ngChange: '=',\r\n ngMinlength: '=',\r\n ngMaxlength: '=',\r\n ngDisabled: '=',\r\n placeholder: '@',\r\n ngPattern: '=',\r\n ngPatternMessage: '@',\r\n viewOnly: '='\r\n },\r\n link: (scope: any, el, attrs, formCtrl) => {\r\n scope.form = formCtrl;\r\n },\r\n controller: [\r\n \"$scope\", ($scope) => {\r\n $scope.inputType = 'text';\r\n // $scope.expression = /^\\d{2}$/;\r\n // $scope.expression = $scope.ngPattern;\r\n }\r\n ]\r\n };\r\n });\r\n\r\n appShared.directive('brooksonInputEmail', () => {\r\n return {\r\n restrict: 'AE',\r\n require: '^form',\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text.html',\r\n scope: {\r\n ngModel: '=',\r\n label: '@',\r\n field: '@',\r\n isRequired: '@',\r\n ngReadonly: '=',\r\n ngChange: '=',\r\n ngDisabled: '=',\r\n ngMinlength: '=',\r\n placeholder: '@',\r\n viewOnly: '='\r\n },\r\n link: (scope: any, el, attrs, formCtrl) => {\r\n scope.form = formCtrl;\r\n },\r\n controller: [\r\n \"$scope\", ($scope) => {\r\n $scope.inputType = 'email';\r\n }\r\n ]\r\n };\r\n });\r\n\r\n appShared.directive('brooksonInputPasswords', () => {\r\n return {\r\n restrict: 'AE',\r\n require: '^form',\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text.html',\r\n scope: {\r\n ngModel: '=',\r\n label: '@',\r\n field: '@',\r\n isRequired: '@',\r\n ngReadonly: '=',\r\n ngChange: '=',\r\n ngDisabled: '=',\r\n placeholder: '@',\r\n viewOnly: '='\r\n },\r\n link: (scope: any, el, attrs, formCtrl) => {\r\n scope.form = formCtrl;\r\n },\r\n controller: [\r\n \"$scope\", ($scope) => {\r\n $scope.inputType = 'password';\r\n $scope.ngMinlength = 8;\r\n }\r\n ]\r\n };\r\n });\r\n\r\n\r\n appShared.directive('brooksonInputPasswordStrength', () => {\r\n return {\r\n restrict: 'AE',\r\n require: '^form',\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text.password.html',\r\n scope: {\r\n ngModel: '=',\r\n label: '@',\r\n field: '@',\r\n isRequired: '@',\r\n ngReadonly: '=',\r\n ngChange: '=',\r\n ngDisabled: '=',\r\n placeholder: '@',\r\n viewOnly: '='\r\n },\r\n link: (scope: any, el, attrs, formCtrl) => {\r\n scope.form = formCtrl;\r\n \r\n let commonPasswords: string[] = [];\r\n \r\n scope.accountSrv.getCommonPasswords(true).then((data) => {\r\n commonPasswords = data;\r\n });\r\n \r\n const ngModelController = el.controller('ngModel');\r\n \r\n // Watch the password input field\r\n scope.$watch('ngModel', (password: string) => {\r\n password = password ? password.toString() : '';\r\n \r\n // Reset validity and messages for empty password\r\n if (!password) {\r\n scope.vm.strengthMessage = '';\r\n scope.vm.strengthClass = '';\r\n scope.vm.isWeakPassword = true;\r\n scope.vm.hasTyped = false;\r\n scope.vm.isCommonPassword = false;\r\n ngModelController.$setValidity('brooksonInputPasswordStrength', true); // Reset to valid\r\n return;\r\n }\r\n \r\n scope.vm.hasTyped = true;\r\n let strength = 0;\r\n \r\n // Check if the password is common\r\n if (commonPasswords.indexOf(password.trim()) !== -1) {\r\n ngModelController.$setValidity('brooksonInputPasswordStrength', false);\r\n scope.vm.strengthMessage = 'Weak (Common Password)';\r\n scope.vm.strengthClass = 'strength-weak';\r\n scope.vm.isWeakPassword = true;\r\n return;\r\n }\r\n \r\n scope.vm.isCommonPassword = false;\r\n \r\n // Check password strength criteria\r\n if (password.length >= 8) strength++;\r\n if (/[A-Z]/.test(password)) strength++;\r\n if (/[a-z]/.test(password)) strength++;\r\n if (/[0-9]/.test(password)) strength++;\r\n if (/[\\W]/.test(password)) strength++;\r\n \r\n // Set validity and strength messages based on criteria\r\n if (strength <= 2) {\r\n ngModelController.$setValidity('brooksonInputPasswordStrength', false);\r\n \r\n scope.vm.strengthMessage = 'Weak';\r\n scope.vm.strengthClass = 'strength-weak';\r\n scope.vm.isWeakPassword = true;\r\n } else if (strength === 3) {\r\n ngModelController.$setValidity('brooksonInputPasswordStrength', true);\r\n scope.vm.strengthMessage = 'Medium';\r\n scope.vm.strengthClass = 'strength-medium';\r\n scope.vm.isWeakPassword = false;\r\n } else if (strength > 3) {\r\n ngModelController.$setValidity('brooksonInputPasswordStrength', true);\r\n scope.vm.strengthMessage = 'Strong';\r\n scope.vm.strengthClass = 'strength-strong';\r\n scope.vm.isWeakPassword = false;\r\n }\r\n });\r\n },\r\n controller: [\r\n \"$scope\", \"accountSrv\", ($scope, accountSrv: Shared.IAccountService) => {\r\n $scope.vm = {\r\n strengthMessage: '',\r\n strengthClass: '',\r\n isWeakPassword: true,\r\n hasTyped: false,\r\n isCommonPassword: false\r\n };\r\n \r\n $scope.inputType = 'password';\r\n $scope.ngMinlength = 8;\r\n $scope.accountSrv = accountSrv;\r\n }\r\n ]\r\n };\r\n });\r\n appShared.directive('brooksonInputPasswordStrength2', () => {\r\n return {\r\n restrict: 'AE',\r\n require: '^form',\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text.password.html', // Assuming you have a template for the password strength indicator\r\n scope: {\r\n ngModel: '=',\r\n label: '@',\r\n field: '@',\r\n isRequired: '@',\r\n ngReadonly: '=',\r\n ngChange: '=',\r\n ngDisabled: '=',\r\n placeholder: '@',\r\n viewOnly: '='\r\n },\r\n link: (scope: any, el, attrs, formCtrl) => {\r\n scope.form = formCtrl;\r\n \r\n let commonPasswords: string[] = [];\r\n\r\n scope.accountSrv.getCommonPasswords(true).then((data) => {\r\n commonPasswords = data;\r\n });\r\n\r\n const ngModelController = el.controller('ngModel');\r\n \r\n // Watch the password input field\r\n scope.$watch('ngModel', (password: string) => {\r\n password = password ? password.toString() : '';\r\n \r\n if (!password) {\r\n scope.vm.strengthMessage = '';\r\n scope.vm.strengthClass = '';\r\n scope.vm.isWeakPassword = true;\r\n scope.vm.hasTyped = false;\r\n scope.vm.isCommonPassword = false;\r\n return;\r\n }\r\n \r\n scope.vm.hasTyped = true;\r\n let strength = 0;\r\n\r\n if (commonPasswords.indexOf(password.trim()) !== -1) {\r\n //ngModelController.$setValidity('brooksonInputPasswordStrength', false);\r\n scope.form.$setValidity('brooksonInputPasswordStrength', false);\r\n scope.vm.strengthMessage = 'Very Weak (Common Password)';\r\n scope.vm.strengthClass = 'strength-weak';\r\n scope.vm.isWeakPassword = true;\r\n scope.vm.isCommonPassword = true;\r\n return;\r\n }\r\n \r\n scope.vm.isCommonPassword = false;\r\n \r\n if (password.length >= 8) strength++;\r\n if (/[A-Z]/.test(password)) strength++;\r\n if (/[a-z]/.test(password)) strength++;\r\n if (/[0-9]/.test(password)) strength++;\r\n if (/[\\W]/.test(password)) strength++;\r\n \r\n if (strength <= 2) {\r\n ngModelController.$setValidity('brooksonInputPasswordStrength', false);\r\n //scope.form.$setValidity('brooksonInputPasswordStrength', false);\r\n scope.vm.strengthMessage = 'Weak';\r\n scope.vm.strengthClass = 'strength-weak';\r\n scope.vm.isWeakPassword = true;\r\n } else if (strength === 3) {\r\n ngModelController.$setValidity('brooksonInputPasswordStrength', true);\r\n scope.vm.strengthMessage = 'Medium';\r\n scope.vm.strengthClass = 'strength-medium';\r\n scope.vm.isWeakPassword = false;\r\n } else if (strength > 3) {\r\n ngModelController.$setValidity('brooksonInputPasswordStrength', true);\r\n scope.vm.strengthMessage = 'Strong';\r\n scope.vm.strengthClass = 'strength-strong';\r\n scope.vm.isWeakPassword = false;\r\n }\r\n });\r\n ngModelController.$parsers.push(ngModelController);\r\n },\r\n controller: [\r\n \"$scope\", \"accountSrv\", ($scope, accountSrv: Shared.IAccountService) => {\r\n $scope.vm = {\r\n strengthMessage: '',\r\n strengthClass: '',\r\n isWeakPassword: true,\r\n hasTyped: false,\r\n isCommonPassword: false\r\n };\r\n \r\n $scope.inputType = 'password';\r\n $scope.ngMinlength = 8;\r\n $scope.accountSrv = accountSrv;\r\n }\r\n ]\r\n };\r\n });\r\n \r\n appShared.directive('brooksonInputPassword', () => {\r\n return {\r\n restrict: 'AE',\r\n require: '^form',\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text.password.html',\r\n scope: {\r\n ngModel: '=',\r\n label: '@',\r\n field: '@',\r\n isRequired: '@',\r\n ngReadonly: '=',\r\n ngChange: '=',\r\n ngDisabled: '=',\r\n placeholder: '@',\r\n viewOnly: '='\r\n },\r\n link: (scope: any, el, attrs, formCtrl) => {\r\n scope.form = formCtrl;\r\n },\r\n controller: [\r\n \"$scope\", ($scope) => {\r\n $scope.inputType = 'password';\r\n $scope.ngMinlength = 8;\r\n }\r\n ]\r\n };\r\n });\r\n\r\n appShared.directive('brooksonInputSelect', () => {\r\n return {\r\n restrict: 'AE',\r\n require: '^form',\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.select.html',\r\n scope: {\r\n ngModel: '=',\r\n ngChange: '=',\r\n ngDisabled: '=',\r\n optionsData: '=',\r\n optionsExpression: '@',\r\n field: '@',\r\n isRequired: '@',\r\n label: '@',\r\n ngRepeat: '@',\r\n defaultOption: '@',\r\n additionalData: '=',\r\n noDefault: '=',\r\n showSpinner: '=',\r\n viewOnly: '=',\r\n viewOnlyProperty: '@'\r\n },\r\n link: (scope: any, el, attrs, formCtrl) => {\r\n scope.form = formCtrl;\r\n scope.ngModelIsAnObject = false;\r\n\r\n if (!scope.defaultOption) {\r\n scope.defaultOption = \"-- Please Select --\";\r\n }\r\n\r\n scope.$watch(\"ngModel\", (newValue, oldValue) => {\r\n if (scope.viewOnly) {\r\n scope.ngModelIsAnObject = _.isObject(newValue);\r\n }\r\n });\r\n }\r\n };\r\n });\r\n\r\n appShared.directive('brooksonInputSelectSearch', () => {\r\n return {\r\n restrict: 'AE',\r\n require: '^form',\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.select-search.html',\r\n scope: {\r\n ngModel: '=',\r\n ngChange: '=',\r\n ngDisabled: '=',\r\n optionsData: '=',\r\n optionsExpression: '@',\r\n field: '@',\r\n isRequired: '@',\r\n label: '@',\r\n ngRepeat: '@',\r\n defaultOption: '@',\r\n additionalData: '=',\r\n noDefault: '=',\r\n showSpinner: '=',\r\n viewOnly: '=',\r\n viewOnlyProperty: '@',\r\n typeaheadValue : '@'\r\n },\r\n link: (scope: any, el, attrs, formCtrl) => {\r\n scope.form = formCtrl; \r\n }\r\n };\r\n });\r\n\r\n appShared.directive('brooksonNumber', () => {\r\n return {\r\n restrict: 'A',\r\n require: 'ngModel',\r\n link: (scope, element, attrs: any, ngModel: any) => {\r\n\r\n //format text going to user (model to view)\r\n ngModel.$formatters.push((value) => {\r\n if (value === 0) {\r\n if (attrs.showZero) {\r\n return 0;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n if (!value || isNaN(value)) return value;\r\n //return _.round(value, 2);\r\n\r\n return value;\r\n });\r\n\r\n //format text from the user (view to model)\r\n ngModel.$parsers.push((value) => {\r\n if (!value || isNaN(value)) return value;\r\n //return _.round(value, 2);\r\n\r\n return value;\r\n });\r\n\r\n element.bind('mousewheel', () => {\r\n element.blur();\r\n });\r\n }\r\n };\r\n });\r\n\r\n appShared.directive('brooksonInputNumber', ['$timeout', ($timeout) => {\r\n return {\r\n restrict: 'AE',\r\n require: ['^form', '^ngModel'],\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.number.html',\r\n scope: {\r\n ngModel: '=',\r\n label: '@',\r\n currencyCode: '=',\r\n field: '@',\r\n isRequired: '=',\r\n ngReadonly: '=',\r\n ngChange: '&',\r\n ngMin: '=',\r\n ngDisabled: '=',\r\n placeholder: '@',\r\n step: '=?',\r\n wholeNumber: '=',\r\n showZero: '=',\r\n max: '=',\r\n viewOnly: '=',\r\n minCustomMessage: '@?',\r\n maxCustomMessage: '@?'\r\n },\r\n link: (scope: any, el, attrs, require) => {\r\n scope.form = require[0];\r\n\r\n el.bind('change', () => {\r\n scope.ngModel = _.round(scope.ngModel, 2);\r\n\r\n $timeout(() => {\r\n scope.$apply();\r\n });\r\n });\r\n\r\n var changeInternal = () => {\r\n if (scope.ngChange) {\r\n $timeout(() => {\r\n scope.ngChange();\r\n });\r\n }\r\n };\r\n\r\n scope.changeInternal = changeInternal;\r\n },\r\n controller: [\r\n \"$scope\", '$filter', \"currency.enums\", ($scope, $filter, currencyEnums) => {\r\n $scope.currencyEnums = currencyEnums;\r\n $scope.step = $scope.step ? $scope.step : 0.01;\r\n\r\n activate();\r\n\r\n function activate() {\r\n $scope.$watch('wholeNumber', () => {\r\n $scope.ngPattern = $scope.wholeNumber ? /^[0-9]{1,7}$/ : '';\r\n }, true);\r\n }\r\n }\r\n ]\r\n };\r\n }]);\r\n\r\n var brooksonInlineController = [\"$scope\", ($scope) => {\r\n $scope.isEditMode = false;\r\n $scope.defaultValue = null;\r\n $scope.$watch(\"isEditMode\", (newValue, oldValue) => {\r\n if (newValue === false) {\r\n $scope.ngModel = $scope.defaultValue;\r\n }\r\n });\r\n\r\n $scope.$watch(\"ngModel\", (newValue, oldValue) => {\r\n if ((oldValue === \"\" || oldValue === null) && $scope.defaultValue === null) {\r\n $scope.defaultValue = newValue;\r\n } else if ($scope.defaultValue === null) {\r\n $scope.defaultValue = \"\";\r\n }\r\n });\r\n }];\r\n\r\n appShared.directive('brooksonInlineEdit', () => {\r\n return {\r\n restrict: 'AE',\r\n require: '^form',\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.inline-edit.input.html',\r\n scope: {\r\n ngModel: '=',\r\n ngMaxlength: '=',\r\n field: '@',\r\n isRequired: '@',\r\n ngReadonly: '=',\r\n ngDisabled: '=',\r\n placeholder: '@',\r\n viewOnly: '='\r\n },\r\n link: (scope: any, el, attrs, formCtrl) => {\r\n scope.form = formCtrl;\r\n },\r\n controller: brooksonInlineController\r\n };\r\n });\r\n\r\n appShared.directive('brooksonInlineEditTextarea', () => {\r\n return {\r\n restrict: 'AE',\r\n require: '^form',\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.inline-edit.textarea.html',\r\n scope: {\r\n ngModel: '=',\r\n field: '@',\r\n isRequired: '@',\r\n ngReadonly: '=',\r\n ngDisabled: '=',\r\n placeholder: '@',\r\n ngMaxlength: '=',\r\n viewOnly: '='\r\n },\r\n link: (scope: any, el, attrs, formCtrl) => {\r\n scope.form = formCtrl;\r\n },\r\n controller: brooksonInlineController\r\n };\r\n });\r\n\r\n appShared.directive('brooksonInputBoolean', () => {\r\n return {\r\n restrict: 'AE',\r\n require: '^form',\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.boolean.html',\r\n scope: {\r\n ngModel: '=',\r\n label: '@',\r\n field: '@',\r\n isRequired: '@',\r\n ngReadonly: '=',\r\n ngChange: '=',\r\n ngDisabled: '=',\r\n viewOnly: '=',\r\n isSelfAssessment: '='\r\n },\r\n link: (scope: any, el, attrs, formCtrl) => {\r\n scope.form = formCtrl;\r\n\r\n },\r\n controller: [\r\n \"$scope\", ($scope) => {\r\n this.$onInit = () => { };\r\n }\r\n ]\r\n };\r\n });\r\n\r\n appShared.directive('brooksonInputCheckbox', () => {\r\n return {\r\n restrict: 'AE',\r\n require: '^form',\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.checkbox.html',\r\n scope: {\r\n ngModel: '=',\r\n label: '@',\r\n field: '@',\r\n isRequired: '@',\r\n ngReadonly: '=',\r\n ngChange: '=',\r\n ngDisabled: '=',\r\n viewOnly: '=',\r\n ngChecked: '='\r\n },\r\n link: (scope: any, el, attrs, formCtrl) => {\r\n scope.form = formCtrl;\r\n },\r\n controller: [\r\n \"$scope\", ($scope) => {\r\n this.$onInit = () => { };\r\n }\r\n ]\r\n };\r\n });\r\n\r\n appShared.directive('brooksonInputCheckButtons', () => {\r\n return {\r\n restrict: 'AE',\r\n require: '^form',\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.check-buttons.html',\r\n scope: {\r\n buttons: '=',\r\n ngModel: '=',\r\n label: '@',\r\n field: '@',\r\n isRequired: '@',\r\n ngReadonly: '=',\r\n ngChange: '=',\r\n ngMinlength: '=',\r\n ngMaxlength: '=',\r\n ngDisabled: '=',\r\n placeholder: '@',\r\n multiselect: '=',\r\n viewOnly: '=',\r\n additionalStyling: '@',\r\n isSelfAssessment: '='\r\n },\r\n link: (scope: any, el, attrs, formCtrl) => {\r\n scope.form = formCtrl;\r\n },\r\n controller: [\r\n \"$scope\", ($scope) => {\r\n this.$onInit = () => { };\r\n\r\n $scope.changed = (value) => {\r\n if ($scope.multiselect) {\r\n if (!$scope.ngModel || !Array.isArray($scope.ngModel)) $scope.ngModel = [];\r\n\r\n if (_.includes($scope.ngModel, value)) {\r\n _.remove($scope.ngModel, (item) => {\r\n return item === value;\r\n });\r\n } else {\r\n $scope.ngModel.push(value);\r\n }\r\n } else {\r\n $scope.ngModel = value;\r\n }\r\n };\r\n\r\n $scope.isSelected = (value) => {\r\n if ($scope.multiselect) {\r\n return _.includes($scope.ngModel, value);\r\n } else {\r\n return $scope.ngModel === value;\r\n }\r\n };\r\n\r\n $scope.viewValue = (): string => {\r\n var button = _.find($scope.buttons, (button) => {\r\n return button.id === $scope.ngModel;\r\n });\r\n\r\n return button ? button.name : '';\r\n };\r\n }\r\n ]\r\n };\r\n });\r\n\r\n appShared.directive('brooksonInputPercentage', ['$timeout', ($timeout) => {\r\n return {\r\n restrict: 'AE',\r\n require: ['^form', '^ngModel'],\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.percentage.html',\r\n scope: {\r\n ngModel: '=',\r\n label: '@',\r\n field: '@',\r\n isRequired: '@',\r\n ngReadonly: '=',\r\n ngChange: '=',\r\n ngMin: '=',\r\n ngDisabled: '=',\r\n placeholder: '@',\r\n step: '=?',\r\n wholeNumber: '=',\r\n showZero: '=',\r\n viewOnly: '=',\r\n max: '='\r\n },\r\n link: (scope: any, el, attrs, require) => {\r\n scope.form = require[0];\r\n\r\n el.bind('change', () => {\r\n scope.ngModel = _.round(scope.ngModel, 2);\r\n\r\n $timeout(() => {\r\n scope.$apply();\r\n });\r\n });\r\n },\r\n controller: [\r\n \"$scope\", '$filter', ($scope, $filter) => {\r\n $scope.step = $scope.step ? $scope.step : 0.01;\r\n $scope.ngPattern = $scope.wholeNumber ? /^[0-9]{1,7}$/ : '';\r\n }\r\n ]\r\n };\r\n }]);\r\n\r\n appShared.directive('brooksonInputTextarea', () => {\r\n return {\r\n restrict: 'AE',\r\n require: '^form',\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.textarea.html',\r\n scope: {\r\n ngModel: '=',\r\n field: '@',\r\n label: '@',\r\n isRequired: '@',\r\n ngReadonly: '=',\r\n ngDisabled: '=',\r\n placeholder: '@',\r\n ngMaxlength: '=',\r\n textboxStyle: '=',\r\n hideRemainingCharacters: '=',\r\n viewOnly: '=',\r\n blockTypingBeyondLimit: '@',\r\n ngChange: '='\r\n },\r\n link: (scope: any, el, attrs, formCtrl) => {\r\n scope.form = formCtrl;\r\n },\r\n controller: [\r\n \"$scope\", ($scope) => {\r\n if ($scope.blockTypingBeyondLimit === \"true\") {\r\n $scope.$watch(\"ngModel\", (newValue, oldValue) => {\r\n if (_.isUndefined(newValue) && oldValue) {\r\n $scope.ngModel = oldValue;\r\n }\r\n });\r\n }\r\n }\r\n ]\r\n };\r\n });\r\n\r\n appShared.directive('brooksonInputPhone', () => {\r\n return {\r\n restrict: 'AE',\r\n require: '^form',\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text.html',\r\n scope: {\r\n ngModel: '=',\r\n label: '@',\r\n field: '@',\r\n isRequired: '@',\r\n ngReadonly: '=',\r\n ngChange: '=',\r\n ngDisabled: '=',\r\n placeholder: '@',\r\n viewOnly: '='\r\n },\r\n link: (scope: any, el, attrs, formCtrl) => {\r\n scope.form = formCtrl;\r\n },\r\n controller: [\r\n \"$scope\", ($scope) => {\r\n $scope.ngPattern = /^(?:(?:\\(?(?:0(?:0|11)\\)?[\\s-]?\\(?|\\+)44\\)?[\\s-]?(?:\\(?0\\)?[\\s-]?)?)|(?:\\(?0))(?:(?:\\d{5}\\)?[\\s-]?\\d{4,5})|(?:\\d{4}\\)?[\\s-]?(?:\\d{5}|\\d{3}[\\s-]?\\d{3}))|(?:\\d{3}\\)?[\\s-]?\\d{3}[\\s-]?\\d{3,4})|(?:\\d{2}\\)?[\\s-]?\\d{4}[\\s-]?\\d{4}))(?:[\\s-]?(?:x|ext\\.?|\\#)\\d{3,4})?$/;\r\n $scope.ngPatternMessage = \"Not a valid phone number\";\r\n }\r\n ]\r\n };\r\n });\r\n\r\n appShared.directive('brooksonInputTradingName', () => {\r\n return {\r\n restrict: 'AE',\r\n require: '^form',\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text.html',\r\n scope: {\r\n ngModel: '=',\r\n label: '@',\r\n field: '@',\r\n isRequired: '@',\r\n ngReadonly: '=',\r\n ngChange: '=',\r\n ngDisabled: '=',\r\n placeholder: '@',\r\n viewOnly: '='\r\n },\r\n link: (scope: any, el, attrs, formCtrl) => {\r\n scope.form = formCtrl;\r\n },\r\n controller: [\r\n \"$scope\", ($scope) => {\r\n $scope.isLimitedCompany = (() => {\r\n var regEx = /\\w*(limited|ltd)\\b/i;\r\n return {\r\n test: (value) => {\r\n return !regEx.test(value);\r\n }\r\n };\r\n })();\r\n\r\n $scope.ngPattern = $scope.isLimitedCompany;\r\n $scope.ngPatternMessage = \"Limited company income should not be input in self employment section\";\r\n }\r\n ]\r\n };\r\n });\r\n\r\n\r\n appShared.directive('brooksonInputBankName', () => {\r\n return {\r\n restrict: 'AE',\r\n require: '^form',\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text.html',\r\n scope: {\r\n ngModel: '=',\r\n label: '@',\r\n field: '@',\r\n isRequired: '@',\r\n ngReadonly: '=',\r\n ngChange: '=',\r\n ngDisabled: '=',\r\n placeholder: '@',\r\n viewOnly: '='\r\n },\r\n link: (scope: any, el, attrs, formCtrl) => {\r\n scope.form = formCtrl;\r\n },\r\n controller: [\r\n \"$scope\", ($scope) => {\r\n $scope.isLimitedCompany = (() => {\r\n var regEx = /\\w*(limited|ltd)\\b/i;\r\n return {\r\n test: (value) => {\r\n return !regEx.test(value);\r\n }\r\n };\r\n })();\r\n\r\n $scope.ngPattern = $scope.isLimitedCompany;\r\n $scope.ngPatternMessage = \"You appear to have entered ‘Limited’ or ‘Ltd’ in the Account Name please ensure this is your personal bank account not your company’s.\";\r\n }\r\n ]\r\n };\r\n });\r\n\r\n appShared.directive('brooksonInputUtrNumber', () => {\r\n return {\r\n restrict: 'AE',\r\n require: '^form',\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text.html',\r\n scope: {\r\n ngModel: '=',\r\n label: '@',\r\n field: '@',\r\n isRequired: '@',\r\n ngChange: '=',\r\n ngDisabled: '=',\r\n placeholder: '@',\r\n viewOnly: '='\r\n },\r\n link: (scope: any, el, attrs, formCtrl) => {\r\n scope.form = formCtrl;\r\n\r\n var valueWatch = scope.$watch(`form.${scope.field}.$viewValue`, (newValue, oldValue) => {\r\n if (oldValue) valueWatch();\r\n\r\n setNgReadonly();\r\n }, true);\r\n\r\n function setNgReadonly() {\r\n scope.ngReadonly = new RegExp(scope.ngPattern).test(scope.ngModel);\r\n }\r\n },\r\n controller: [\r\n \"$scope\", ($scope) => {\r\n $scope.ngPattern = /^[0-9]{10}$/;\r\n $scope.ngPatternMessage = \"Not a valid UTR number\";\r\n }\r\n ]\r\n };\r\n });\r\n\r\n appShared.directive('brooksonMaskedInput', () => {\r\n return {\r\n restrict: 'AE',\r\n require: '^form',\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.mask.html',\r\n scope: {\r\n ngModel: '=',\r\n label: '@',\r\n field: '@',\r\n isRequired: '@',\r\n ngReadonly: '=',\r\n ngChange: '=',\r\n ngMinlength: '=',\r\n ngMaxlength: '=',\r\n ngDisabled: '=',\r\n placeholder: '@',\r\n ngPattern: '=',\r\n ngPatternMessage: '@',\r\n viewOnly: '=',\r\n uiMask: '@',\r\n uiMaskplaceholder: '@'\r\n },\r\n link: (scope: any, el, attrs, formCtrl) => {\r\n scope.form = formCtrl;\r\n },\r\n controller: [\r\n \"$scope\", ($scope) => {\r\n $scope.inputType = 'text';\r\n }\r\n ]\r\n };\r\n });\r\n\r\n appShared.directive('brooksonInputTextOnly', () => {\r\n return {\r\n restrict: 'A',\r\n require: 'ngModel',\r\n link: (scope, elem, attrs, ngModel: any) =>{\r\n ngModel.$parsers.push((viewValue) => {\r\n var reg = /^[ a-zA-Z0-9]*$/;\r\n // if view values matches regexp, update model value\r\n if (viewValue.match(reg)) {\r\n return viewValue;\r\n }\r\n // keep the model value as it is\r\n var transformedValue = ngModel.$modelValue;\r\n ngModel.$setViewValue(transformedValue);\r\n ngModel.$render();\r\n return transformedValue;\r\n });\r\n }\r\n }; \r\n });\r\n \r\n appShared.directive('brooksonInputTextRestrict', () => {\r\n return {\r\n restrict: 'AE',\r\n require: '^form',\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text.restrict.html',\r\n scope: {\r\n ngModel: '=',\r\n label: '@',\r\n field: '@',\r\n isRequired: '@',\r\n ngReadonly: '=',\r\n ngChange: '=',\r\n ngMinlength: '=',\r\n ngMaxlength: '=',\r\n ngDisabled: '=',\r\n placeholder: '@',\r\n ngPattern: '=',\r\n ngPatternMessage: '@',\r\n viewOnly: '='\r\n },\r\n link: (scope: any, el, attrs, formCtrl) => {\r\n scope.form = formCtrl;\r\n },\r\n controller: [\r\n \"$scope\", ($scope) => {\r\n $scope.inputType = 'text';\r\n // $scope.expression = /^\\d{2}$/;\r\n // $scope.expression = $scope.ngPattern;\r\n }\r\n ]\r\n };\r\n });\r\n\r\n appShared.directive('brooksonInputTextAddon', () => {\r\n return {\r\n restrict: 'AE',\r\n require: '^form',\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.text-addon.html',\r\n scope: {\r\n ngModel: '=',\r\n label: '@',\r\n field: '@',\r\n isRequired: '@',\r\n ngReadonly: '=',\r\n ngChange: '=',\r\n ngMinlength: '=',\r\n maxlength: '=',\r\n ngMaxlength: '=',\r\n ngDisabled: '=',\r\n placeholder: '@',\r\n ngPattern: '=',\r\n ngPatternMessage: '@',\r\n viewOnly: '=',\r\n uiMask: '@',\r\n uiMaskplaceholder: '@',\r\n addontext: '@',\r\n inputType: '@'\r\n },\r\n link: (scope: any, el, attrs, formCtrl) => {\r\n scope.form = formCtrl;\r\n },\r\n controller: [\r\n \"$scope\", ($scope) => {\r\n $scope.inputType = 'text';\r\n }\r\n ]\r\n };\r\n });\r\n\r\n})();\r\n","/// \r\n\r\n(() => {\r\n \"use strict\";\r\n\r\n var appSettings = {};\r\n\r\n if (window) {\r\n // Object.assign(appSettings, window.appSettings);\r\n appSettings = window.appSettings;\r\n }\r\n\r\n angular.module(\"app.shared\", [\r\n // Angular modules\r\n \"ui.router\",\r\n 'ui.bootstrap',\r\n 'ngSanitize',\r\n 'ngMessages',\r\n 'ngAnimate',\r\n 'angular.filter',\r\n // Custom modules\r\n\r\n // 3rd Party Modules\r\n \"LocalStorageModule\",\r\n 'ngFileSaver',\r\n 'flow',\r\n 'matchMedia',\r\n 'ngFileSaver',\r\n 'angular-growl',\r\n 'angular-google-analytics',\r\n 'adaptive.detection',\r\n 'ngUaParser',\r\n 'cfp.hotkeys',\r\n 'ui.select'\r\n ])\r\n .config([\r\n \"$httpProvider\", \"$locationProvider\", ($httpProvider, $locationProvider) => {\r\n $httpProvider.interceptors.push(\"authInterceptorSrv\");\r\n $locationProvider.html5Mode({\r\n enabled: true,\r\n requireBase: true\r\n });\r\n }\r\n ])\r\n .run([\r\n \"$rootScope\", \"$state\", \"Analytics\", \"$templateCache\",\r\n ($rootScope, $state, Analytics, $templateCache) => {\r\n\r\n $rootScope.$on(\"$stateChangeStart\", (evt, to, params) => {\r\n if (to.redirectTo) {\r\n evt.preventDefault();\r\n $state.go(to.redirectTo, params);\r\n }\r\n }\r\n );\r\n\r\n Analytics.pageView();\r\n\r\n $templateCache.remove('templates/growl/growl.html');\r\n $templateCache.put('templates/growl/growl.html',\r\n '
    ' +\r\n '
    ' +\r\n '' +\r\n '' +\r\n '

    ' +\r\n '
    ' +\r\n '
    ' +\r\n '
    ');\r\n }\r\n ])\r\n .value(\"shared.config\", {\r\n baseApiUrl: location.protocol + \"//\" + location.hostname + (location.port && \":\" + location.port) + '/',\r\n authSettings: { clientId: 'ngConnect3', useRefreshToken: true }\r\n })\r\n .config(['growlProvider', growlProvider => {\r\n growlProvider.onlyUniqueMessages(false);\r\n growlProvider.globalReversedOrder(true);\r\n }])\r\n .config(['AnalyticsProvider', (AnalyticsProvider) => {\r\n if (window.appSettings) {\r\n var trackingCode = window.appSettings.googleAnalyticsTrackingCode;\r\n\r\n AnalyticsProvider.setAccount(trackingCode)\r\n .trackPages(true)\r\n .trackUrlParams(true)\r\n .setPageEvent(\"$stateChangeSuccess\");\r\n }\r\n }])\r\n .constant('appSettings', appSettings)\r\n .factory('$exceptionHandler', ['$injector', 'brookson.logger', 'appSettings', ($injector, logger, appSettings) => (exception, cause) => {\r\n if (appSettings && appSettings.environment) {\r\n logger.error(\"Uncaught Exception - \" + exception.message, exception.stack, cause);\r\n }\r\n }]);\r\n})();","/// \r\n\r\n(() => {\r\n \"use strict\";\r\n\r\n var app = angular.module(\"app.shared\");\r\n\r\n // Collect the routes\r\n app.config([\r\n \"$stateProvider\", \"$urlRouterProvider\", ($stateProvider, $urlRouterProvider) => {\r\n $stateProvider\r\n .state(\"brookson\",\r\n {\r\n views: {\r\n 'navigation': {\r\n template: \"\"\r\n },\r\n 'header': {\r\n template: \"\"\r\n },\r\n 'footer': {\r\n templateUrl: \"src/app/shared/views/footer.html\"\r\n },\r\n 'main': {\r\n template: \"
    \"\r\n }\r\n }\r\n });\r\n $stateProvider.state(\"brookson.banklink-auto-allocation-settings\",\r\n {\r\n url: \"/banklink/auto-allocation/settings\",\r\n views: {\r\n '': {\r\n template: \"\"\r\n }\r\n },\r\n sticky: false\r\n } as ng.ui.IState);\r\n $stateProvider.state(\"brookson.bank-file-upload\",\r\n {\r\n url: \"/banklink/bank-file/upload\",\r\n views: {\r\n '': {\r\n template: \"\"\r\n }\r\n },\r\n sticky: false\r\n } as ng.ui.IState);\r\n }\r\n ]);\r\n})();","angular.module('app.shared').run(['$templateCache', function($templateCache) {$templateCache.put('src/app/shared/views/footer.html','\\r\\n\\r\\n\\r\\n\\r\\n\\r\\n
    \\r\\n');\n$templateCache.put('src/app/shared/views/header.html','
    \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n

    {{$ctrl.memberSrv.companyName()}} \\r\\n
    1\" ng-click=\"$ctrl.brooksonNavigation.login.serviceline()\">

    \\r\\n\\r\\n
    \\r\\n
      \\r\\n
    • \\r\\n \\r\\n
    • \\r\\n\\r\\n
    • \\r\\n \\r\\n Book an appointment \\r\\n \\r\\n \\r\\n
        \\r\\n
      • \\r\\n

        \\r\\n Reschedule Introduction Appointment\\r\\n

        \\r\\n
      • \\r\\n
      • \\r\\n

        \\r\\n Accountant Introduction Appointment\\r\\n

        \\r\\n
      • \\r\\n
      • \\r\\n

        \\r\\n Advisory Document Appointment\\r\\n

        \\r\\n
      • \\r\\n
      • \\r\\n

        \\r\\n Reschedule Advisory Appointment\\r\\n

        \\r\\n
      • \\r\\n
      • \\r\\n

        \\r\\n Financial Health Check Appointment\\r\\n

        \\r\\n
      • \\r\\n
      • \\r\\n

        \\r\\n Reschedule Health Check Appointment\\r\\n

        \\r\\n
      • \\r\\n
      \\r\\n
    • \\r\\n \\r\\n
    • \\r\\n Book a call \\r\\n
    • \\r\\n
    • \\r\\n Book a call \\r\\n
    • \\r\\n
    • \\r\\n Refer a Friend \\r\\n Refer a Friend \\r\\n
    • \\r\\n\\r\\n\\r\\n
    • \\r\\n \\r\\n \\r\\n \\r\\n
        \\r\\n
      • \\r\\n
        \\r\\n \\r\\n
        \\r\\n
      • \\r\\n\\r\\n
      • \\r\\n
        1\">\\r\\n \\r\\n
        \\r\\n
      • \\r\\n
      \\r\\n
    • \\r\\n\\r\\n
    • \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n {{$ctrl.brooksonNotificationsManager.notifications.notifications.length}}\\r\\n\\r\\n
        \\r\\n
      • \\r\\n

        \\r\\n You have no new alerts.\\r\\n

        \\r\\n
      • \\r\\n\\r\\n
      • \\r\\n

        \\r\\n \\t\\t\\t\\t\\t\\t\\t{{notification.metaDescription}}\\r\\n \\r\\n \\r\\n {{notification.title}}\\r\\n \\r\\n \\r\\n

        \\r\\n
      • \\r\\n\\r\\n
      • 0\">\\r\\n
        \\r\\n \\r\\n
        \\r\\n
      • \\r\\n
      \\r\\n
    • \\r\\n\\r\\n
    • \\r\\n \\r\\n \\r\\n {{$ctrl.brooksonNotificationsManager.notifications.planner.length}}\\r\\n \\r\\n\\r\\n
        \\r\\n
      • \\r\\n
        \\r\\n
        \\r\\n \\r\\n
        \\r\\n
        \\r\\n {{task.actionTitle}}\\r\\n
        \\r\\n
        \\r\\n \\r\\n \\r\\n {{task.dueDate | bkShortDate: \\'DD/MM/YYYY\\'}}\\r\\n \\r\\n \\r\\n
        \\r\\n
        \\r\\n
      • \\r\\n
      \\r\\n\\r\\n
        \\r\\n
      • \\r\\n

        \\r\\n \\r\\n

        \\r\\n

        Looks like you are all caught up! Have a coffee.

        \\r\\n
      • \\r\\n
      \\r\\n
    • \\r\\n\\r\\n
    • \\r\\n
      \\r\\n
      \\r\\n \\r\\n {{$ctrl.memberDetails.firstname}}\\r\\n {{$ctrl.memberDetails.lastname}}\\r\\n \\r\\n
      \\r\\n
      \\r\\n\\r\\n
        \\r\\n
      • \\r\\n
        \\r\\n {{$ctrl.member.memberId}}\\r\\n {{$ctrl.member.companyRef}}\\r\\n
        \\r\\n
      • \\r\\n
      • \\r\\n

        Account Settings

        \\r\\n
      • \\r\\n
      • \\r\\n

        \\r\\n Logout\\r\\n

        \\r\\n
      • \\r\\n
      \\r\\n
    • \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n ×\\r\\n
    \\r\\n
     
    brooksonone.co.uk
    \\r\\n

    \\r\\n Welcome to Brookson One\\r\\n

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    ');\n$templateCache.put('src/app/shared/views/navigation.html','
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    Your account has been suspended due to outstanding fees. Please contact us on 01925 232526 to discuss this further and bring your account up to date to reinstate your access.
    ');\n$templateCache.put('src/app/shared/views/bank/brookson.banklink.auto.allocation.settings.html','
    \\r\\n \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n

    Auto Allocation Rules

    \\r\\n
    \\r\\n\\r\\n\\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n

    If you have transactions that occur on a regular basis (eg monthly phone contract), an Auto Allocation Keyword can be set up to identify, and allocate, the transactions accordingly.

    \\r\\n

    Any transactions which contain your Keyword will be allocated to the selected Category at the end of each day. Please ensure the keyword is specific enough to recognise the transactions.

    \\r\\n

    Transactions will be processed in your accounts gross (without VAT), if you operate under the Standard Rate VAT scheme and would like to reclaim VAT, please allocate the transaction and reclaim VAT as normal.

    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n

    \\r\\n \\r\\n
    \\r\\n Loading ....\\r\\n

    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n \\r\\n \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n 0\" ng-repeat=\"autoMatchConfig in $ctrl.companyConfigList\">\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    KeywordCategoryEnabled
    There are currently no enabled Auto Allocation Rules.
    \\r\\n \\r\\n
    {{autoMatchConfig.validationMessage}}
    \\r\\n
    0\">\\r\\n
    Unallocated & allocated business paid transactions containing text: \\'{{autoMatchConfig.keyword.toUpperCase()}}\\'
    \\r\\n
    10\">\\r\\n {{autoMatchConfig.transactionMatches.count}} results, showing latest 10 transactions\\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    DescriptionDateAmount
    {{wordMatch.transactionDate | date: \"dd/MMM/yyyy\"}}{{wordMatch.debitAmount | currency:\"\\xA3\"}}
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n \\r\\n\\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    ');\n$templateCache.put('src/app/shared/views/bank/brookson.banklink.bankfilupload.html','
    \\r\\n \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Cancel\\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n

    Upload Bank Statement File

    \\r\\n

    Update Bank Transaction Date

    \\r\\n
    \\r\\n\\r\\n
    \\r\\n Need some help? Click here for our FAQ\\'s\\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n 1{{$ctrl.steps[0].title}}\\r\\n \\r\\n
    \\r\\n

    \\r\\n Choose the relevant bank account for the statement you intend to upload or update the bank statement date.\\r\\n

    \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Last 5 transactions \\r\\n

    Account number: {{$ctrl.selectedBankAccount.accountNumber}} Sort Code: {{$ctrl.selectedBankAccount.sortCode}}

    \\r\\n

    {{$ctrl.selectedBankAccount.bankName}}

    \\r\\n Balance date {{$ctrl.selectedBankAccount.reconciliationDate | date: \\'dd MMM yyyy\\'}}\\r\\n\\r\\n\\r\\n
    \\r\\n
    \\r\\n
    0\">\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    DateDescriptionIn (£)Out (£)Balance (£)
    {{line.transactionDate | date:\\'dd/MM/yyyy\\'}}{{line.transactionCategory.description}}
    {{line.description}}
    {{line.creditAmount == 0 ? \\' \\' : (line.creditAmount | number:2)}}{{line.debitAmount == 0 ? \\' \\' : (line.debitAmount | number:2)}}{{line.balance | number:2}}
    No reconcilled results for this period
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n\\r\\n\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n 2{{$ctrl.steps[1].title}}\\r\\n \\r\\n
    \\r\\n

    \\r\\n Upload statements as CSV files (2MB maximum). For assistance with file format, click here to refer to our FAQs.\\r\\n

    \\r\\n

    You should upload bank statement transactions dated between {{$ctrl.selectedBankAccount.reconciliationDate | date: \\'dd MMM yyyy\\'}} and today

    \\r\\n
    \\r\\n\\r\\n \\r\\n
    \\r\\n \\r\\n {{successfullMessage}}\\r\\n
    \\r\\n\\r\\n \\r\\n
    \\r\\n \\r\\n Warning! We were unable to upload files:\\r\\n
    \\r\\n {{file.name}}\\r\\n
    \\r\\n
    \\r\\n\\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n\\r\\n \\r\\n

    \\r\\n {{uploadMessage}}\\r\\n \\r\\n \\r\\n or if transactions\\r\\n \\r\\n Update Statement date\\r\\n \\r\\n

    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n Warning! We were unable to upload files:\\r\\n
    \\r\\n {{file.name}}\\r\\n
    \\r\\n
    \\r\\n\\r\\n\\r\\n \\r\\n
    \\r\\n\\r\\n
    \\r\\n
    \\r\\n \\r\\n 3{{$ctrl.steps[2].title}}\\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n \\r\\n We were unable to upload file due to issues in the file\\r\\n
    \\r\\n {{file.name}}\\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    SelectedDateDescriptionAmountBalance
    \\r\\n Skipped\\r\\n \\r\\n {{transaction.date | bkShortDate:\\'DD, MMMM, YYYY\\'}}{{ transaction.dateError }}{{transaction.description}}{{transaction.amount | currency : \\'\\'}}{{transaction.balance | currency : \\'\\'}}
    \\r\\n
    \\r\\n

    Note: No transactions found for submission. Please ensure the file format is correct and has not been uploaded previously.

    \\r\\n
    \\r\\n
    \\r\\n

    Note: All transactions are in before Balance Date {{$ctrl.selectedBankAccount.reconciliationDate | date: \\'dd MMM yyyy\\'}}

    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n 4{{$ctrl.steps[3].title}}\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    DateDescriptionAmount InAmount OutBalance
    {{transaction.date | bkShortDate:\\'DD/MM/YYYY\\'}}{{ transaction.dateError }}{{transaction.description}}{{transaction.paidIn | currency : \\'\\'}}{{transaction.paidOut | currency : \\'\\'}}{{transaction.balance | currency : \\'\\'}}
    \\r\\n
    0\">\\r\\n

    Note: The uploaded statement is missing a balance column, or we were unable to find a valid column header. Please ensure that the calculated balance corresponds with your bank statement before proceeding.

    \\r\\n

    Calculated Balace: {{$ctrl.newBalanceAmount() | currency : \\'\\'}}

    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n \\r\\n\\r\\n
    \\r\\n
    An error occurred submitting Bank Statement Transactions.
    We were unable to submit your transactions contact us for more guidance.
    \\r\\n
    \\r\\n Cancel\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Transaction Date\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n {{transaction.date | bkShortDate:\\'DD/MM/YYYY\\'}}\\r\\n {{$ctrl.selectedBankAccount.reconciliationDate | bkShortDate:\\'DD/MM/YYYY\\'}}\\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n

    Statement date successfully submitted!

    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n Bank statement submitted\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n

    \\r\\n Thank you, your bank statement has been validated and balances.\\r\\n

    \\r\\n

    Transactions successfully submitted!

    \\r\\n
      \\r\\n

      Transactions amount: {{$ctrl.summary.summary.totalAmount | currency : \\'\\'}}

      \\r\\n

      Number of transactions: {{$ctrl.summary.summary.totalCount}}

      \\r\\n

      New balance: {{$ctrl.newBalanceAmount() | currency : \\'\\'}}

      \\r\\n

      Statement date: {{$ctrl.updatedTransactionDate | date: \\'dd MMM yyyy\\'}}

      \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    An error occurred submitting Bank Statement File.
    \\r\\n
    \\r\\n
    \\r\\n
    ');\n$templateCache.put('src/app/shared/views/bank/brookson.bankLink.transactions.html','
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\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t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tDirectors Fees\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tExpenses\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tShareholder 1 Dividends\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tShareholder 2 Dividends\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t Balance\\r\\n\\t\\t\\t\\t
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t{{::transaction.transactionDate|bkShortDate:\"DD/MM/YYYY\"}}{{::transaction.transactionCategory.description}}\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{::transaction.debitAmount + transaction.creditAmount | currency:\"\\xA3\"}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{transaction.net | currency:\"\\xA3\"}}\\r\\n\\t\\t\\t\\t\\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n\\t\\t\\t\\t\\t{{::transaction.debitAmount + transaction.creditAmount | currency:\"\\xA3\"}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{::transaction.personalSalaryAmount | currency:\"\\xA3\"}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{::transaction.personalExpensesAmount | currency:\"\\xA3\"}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{::transaction.personalDiv1Amount | currency:\"\\xA3\"}}\\r\\n\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t{{::transaction.personalDiv2Amount | currency:\"\\xA3\"}}\\r\\n\\t\\t\\t\\t{{::transaction.balance | currency:\"\\xA3\"}}
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    No transactions recorded yet
    \\r\\n\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t
    \\r\\n
    ');\n$templateCache.put('src/app/shared/views/bank/brookson.bankLink.transactions.mobile.html','
    \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n\\r\\n

    {{$ctrl.data.selectedBankAccount.bankName}}

    \\r\\n
    \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n {{::transaction.transactionDate|bkShortDate:\"DD/MM/YYYY\"}}\\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n {{::transaction.debitAmount + transaction.creditAmount | currency:\"\\xA3\"}}\\r\\n
    \\r\\n\\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n {{::transaction.transactionCategory.description}}\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n Valid VAT receipt: \\r\\n \\r\\n \\r\\n \\r\\n Total: {{::transaction.debitAmount + transaction.creditAmount | currency:\"\\xA3\"}}\\r\\n \\r\\n \\r\\n VAT: \\r\\n \\r\\n \\r\\n Net: {{transaction.net | currency:\"\\xA3\"}}\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n\\r\\n \\r\\n
    ');\n$templateCache.put('src/app/shared/views/bank/brookson.bankLink.transactions.pagination.html','
    \\r\\n \\r\\n
    ');\n$templateCache.put('src/app/shared/views/inputs/brookson.input.boolean.html','
    \\r\\n \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    {{label}} is required
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n {{ngModel | boolean}}\\r\\n
    \\r\\n\\r\\n
    \\r\\n {{ngModel | boolean}}\\r\\n
    \\r\\n\\r\\n\\r\\n\\r\\n');\n$templateCache.put('src/app/shared/views/inputs/brookson.input.check-buttons.html','
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    {{label}} is required
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n {{viewValue()}}\\r\\n
    \\r\\n\\r\\n\\r\\n\\r\\n');\n$templateCache.put('src/app/shared/views/inputs/brookson.input.checkbox.html','
    \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    {{label}} is required
    \\r\\n
    \\r\\n
    \\r\\n\\r\\n
    \\r\\n \\r\\n
    \\r\\n\\r\\n\\r\\n\\r\\n\\r\\n');\n$templateCache.put('src/app/shared/views/inputs/brookson.input.datepicker.html','
    \\r\\n\\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n\\r\\n \\r\\n
    \\r\\n
    \\r\\n
    {{ label }} is required
    \\r\\n
    {{ label }} is not a date
    \\r\\n \\r\\n
    {{ minCustomMessage }}
    \\r\\n
    {{ maxCustomMessage }}
    \\r\\n
    \\r\\n\\r\\n between {{minDate | bkShortDate: \\'DD/MM/YYYY\\' }} and {{maxDate | bkShortDate: \\'DD/MM/YYYY\\' }}\\r\\n\\r\\n before {{maxDate | bkShortDate: \\'DD/MM/YYYY\\' }}\\r\\n\\r\\n after {{maxDate | bkShortDate: \\'DD/MM/YYYY\\' }}\\r\\n
    \\r\\n {{ngModel | bkShortDate: \\'DD/MM/YYYY\\' }}\\r\\n
    \\r\\n\\r\\n\\r\\n');\n$templateCache.put('src/app/shared/views/inputs/brookson.input.expense-amount.html','
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n
    \\r\\n
    ');\n$templateCache.put('src/app/shared/views/inputs/brookson.input.expense-attach.html','
    \\r\\n
    \\r\\n \\r\\n
    \\r\\n \\r\\n \\r\\n
    \\r\\n \\r\\n
    \\r\\n
    \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/inputs/brookson.input.inline-edit.date.html','\\r\\n\\r\\n\\r\\n\\r\\n');\n$templateCache.put('src/app/shared/views/inputs/brookson.input.inline-edit.input.html','
      \\r\\n \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      {{label}} is required
      \\r\\n
      Max length is {{ngMaxlength}}
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/inputs/brookson.input.inline-edit.textarea.html','
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n \\r\\n Cancel\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      {{label}} is required
      \\r\\n
      Max length is {{ngMaxlength}}
      \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/inputs/brookson.input.job-industry.html','');\n$templateCache.put('src/app/shared/views/inputs/brookson.input.job-title.html','
      \\r\\n \\r\\n {{$ctrl.ngModel.titleText}}\\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      {{$ctrl.label}} is required
      \\r\\n
      {{$ctrl.label}} is required
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n {{$ctrl.ngModel}}\\r\\n
      \\r\\n\\r\\n\\r\\n');\n$templateCache.put('src/app/shared/views/inputs/brookson.input.mask.html','
      \\r\\n \\r\\n
      \\r\\n
      {{label}} is required
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n {{ngModel}}\\r\\n
      \\r\\n\\r\\n\\r\\n');\n$templateCache.put('src/app/shared/views/inputs/brookson.input.number.html','
      \\r\\n\\r\\n
      {{ currencyEnums.CurrencyCodes.properties[currencyCode].code || \\'£\\' }}
      \\r\\n\\r\\n \\r\\n
      \\r\\n
      \\r\\n
      {{label}} is required
      \\r\\n
      {{ minCustomMessage || (label + \\' must be greater than or equal to \\' + ngMin) }}
      \\r\\n
      {{label}} must be a whole number
      \\r\\n
      {{ maxCustomMessage || (label + \\' must be less than or equal to \\' + max) }}
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n {{ngModel}}\\r\\n {{ngModel | brooksonCurrency: currencyCode}}\\r\\n
      \\r\\n\\r\\n\\r\\n\\r\\n\\r\\n');\n$templateCache.put('src/app/shared/views/inputs/brookson.input.percentage.html','
      \\r\\n\\r\\n \\r\\n
      %
      \\r\\n
      \\r\\n
      \\r\\n
      {{label}} is required
      \\r\\n
      {{label}} must be greater than 0
      \\r\\n
      {{label}} must be a whole number
      \\r\\n
      {{label}} must be less than or equal to {{max}}
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n {{ngModel}}\\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/inputs/brookson.input.select-search.html','
      \\r\\n \\r\\n\\r\\n \\r\\n
      \\r\\n
      \\r\\n
      {{label}} is required
      \\r\\n
      Please choose a {{label}} from the list provided
      \\r\\n
      \\r\\n\\r\\n\\r\\n\\r\\n
      \\r\\n {{ngModel[viewOnlyProperty]}}\\r\\n {{ngModel}}\\r\\n
      \\r\\n\\r\\n\\r\\n\\r\\n');\n$templateCache.put('src/app/shared/views/inputs/brookson.input.select.html','
      \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      {{label}} is required
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n {{ngModel[viewOnlyProperty]}}\\r\\n {{ngModel}}\\r\\n
      \\r\\n\\r\\n\\r\\n \\r\\n');\n$templateCache.put('src/app/shared/views/inputs/brookson.input.text-addon.html','
      \\r\\n
      \\r\\n {{addontext}}\\r\\n \\r\\n
      \\r\\n
      \\r\\n
      {{label}} is required
      \\r\\n
      Max length is {{ngMaxlength}}
      \\r\\n
      Min length is {{ngMinlength}}
      \\r\\n
      {{ngPatternMessage}}
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n {{ngModel}}\\r\\n
      \\r\\n\\r\\n\\r\\n \\r\\n');\n$templateCache.put('src/app/shared/views/inputs/brookson.input.text.html','
      \\r\\n \\r\\n
      \\r\\n
      {{label}} is required
      \\r\\n
      Max length is {{ngMaxlength}}
      \\r\\n
      Min length is {{ngMinlength}}
      \\r\\n
      Not a valid email address
      \\r\\n
      {{ngPatternMessage}}
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n {{ngModel}}\\r\\n
      \\r\\n\\r\\n\\r\\n\\r\\n');\n$templateCache.put('src/app/shared/views/inputs/brookson.input.text.password.html','\\r\\n\\r\\n
      \\r\\n \\r\\n
      \\r\\n
      {{label}} is required
      \\r\\n
      Password is too long, should be less than {{ngMinlength}} characters long
      \\r\\n
      Password must be at least {{ngMinlength}} characters long
      \\r\\n
      Not a valid email address
      \\r\\n
      {{ngPatternMessage}}
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n {{ngModel}}\\r\\n
      \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n

      \\r\\n Password must contain a combination of letters, numbers, and/or symbols\\r\\n

      \\r\\n

      \\r\\n The password is too common or easy to guess. Please choose a stronger one\\r\\n

      \\r\\n
      \\r\\n

      Why is this a problem?

      \\r\\n

      This password is one of the most commonly used passwords, which makes it easy for hackers to guess.

      \\r\\n

      What to do:

      \\r\\n
        \\r\\n
      • Use a combination of uppercase, lowercase letters, numbers, and symbols.
      • \\r\\n
      • Avoid using dictionary words or names.
      • \\r\\n
      • Make your password at least 12 characters long.
      • \\r\\n
      \\r\\n
      \\r\\n\\r\\n');\n$templateCache.put('src/app/shared/views/inputs/brookson.input.text.restrict.html','
      \\r\\n \\r\\n
      \\r\\n
      {{label}} is required
      \\r\\n
      Max length is {{ngMaxlength}}
      \\r\\n
      Min length is {{ngMinlength}}
      \\r\\n
      Not a valid email address
      \\r\\n
      {{ngPatternMessage}}
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n {{ngModel}}\\r\\n
      \\r\\n\\r\\n\\r\\n\\r\\n');\n$templateCache.put('src/app/shared/views/inputs/brookson.input.textarea.html','
      \\n\\n \\n\\n Remaining characters: {{ngMaxlength - ngModel.length}}\\n\\n
      \\n
      {{label}} is required
      \\n
      Max length is {{ngMaxlength}}
      \\n
      \\n
      \\n\\n
      \\n {{ngModel}}\\n
      \\n\\n\\n\\n\\n');\n$templateCache.put('src/app/shared/views/inputs/expenses.input.select-assignment.html','\\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/inputs/expenses.input.valid-vat-receipt.html','
      \\r\\n \\r\\n \\r\\n
      \\r\\n\\r\\n');\n$templateCache.put('src/app/shared/views/modals/brookson.modals.feedback.html','
      \\r\\n
      \\r\\n

      Feedback

      \\r\\n \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n {{category.note}}\\r\\n
      \\r\\n\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/modals/brookson.modals.gl-entries.html','
      \\r\\n

      General Ledger Entries

      \\r\\n \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n

      {{title}} Breakdown

      \\r\\n
      \\r\\n
      \\r\\n

      {{reportType === \"BS\" ? \\'Balance\\' : \\'Total\\'}}: {{ total | brooksonCurrency }}

      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      Posting DateDocument DateDescription\\xA3 Debit\\xA3 Credit{{reportType === \"BS\" ? \\'Balance\\' : \\'Total\\'}}
      {{ entry.postingDate | date:\\'dd/MM/yyyy\\' }}{{ entry.documentDate | date:\\'dd/MM/yyyy\\' }}{{ entry.description }}{{ entry.amount > 0 ? (entry.amount | number:2) : \\' \\' }}{{ entry.amount < 0 ? (entry.amount | number:2) : \\' \\' }}{{ reportType == \"BS\" ? (entry.balance | number:2) : (entry.amount | number:2) }}
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/modals/brookson.modals.gl-entries.mobile.html','
      \\r\\n

      GL Entries

      \\r\\n \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      Posting Date
      {{entry.postingDate | date:\\'dd/MM/yyyy\\'}}
      \\r\\n
      Doc Date
      {{entry.documentDate | date:\\'dd/MM/yyyy\\'}}
      \\r\\n
      Total
      {{entry.amount | number:2}} {{ entry.amount > 0 ? \\'CR\\' : \\'DR\\'}}
      \\r\\n
      Description
      {{entry.description}}
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/modals/brookson.modals.ir35DetailCapture.html','
      \\r\\n
      \\r\\n

      IR35 Detail Capture

      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n

      As you may be aware, the IR35 rules for contractors working on an assignment for the public sector are changing from 6 April 2017 (there will be no changes if you work for a private sector end client). Please let us know by using the buttons below whether your current assignment(s) is for a public sector or private sector end client.

      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n

      More information on the changes can be found here: http://www.brookson.co.uk/blog/ir35-reform/

      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/modals/brookson.modals.pdf-modal.html','
      \\r\\n

      \\r\\n \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/modals/brookson.modals.publicSectorAssignmentCheck.html','
      \\r\\n
      \\r\\n

      Public Sector Assignments

      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n

      As you are aware, the IR35 rules for contractors working on assignments in the public sector changed from 6th April 2017- please note, however, there are currently no changes if you work for a private sector end client. Please indicate, using the buttons below, which sector is appropriate to your current assignment(s):

      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n

      {{assignment.fullAssignmentName}}

      \\r\\n
      \\r\\n\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n\\r\\n
      \\r\\n \\r\\n
        \\r\\n
      • \\r\\n \\r\\n Public\\r\\n
      • \\r\\n
      • \\r\\n \\r\\n Private\\r\\n
      • \\r\\n
      • \\r\\n \\r\\n No longer in use\\r\\n
      • \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
        \\r\\n
      • \\r\\n \\r\\n Yes\\r\\n
      • \\r\\n
      • \\r\\n \\r\\n No\\r\\n
      • \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n

      As a director it is important that you review the IR35 status of your contract(s) on a regular basis, to help you with this we are delighted to offer in partnership with Brookson Legal Services, unlimited reviews as part of our all-inclusive service. To take advantage of this service please go to \\'My Company / IR35 Employment Status\\' and complete the required forms.

      \\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n

      More information on the changes can be found here: http://www.brookson.co.uk/blog/ir35-reform/\\r\\n

      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/modals/brookson.modals.receipt-bank.attach-receipt.html','
      \\r\\n

      Attach Receipt

      \\r\\n \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/modals/brookson.modals.receipt-preview.html','
      \\r\\n

      Preview Receipt

      \\r\\n \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n\\r\\n \\r\\n View Receipt Image\\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/modals/brookson.modals.sdc.html','
      \\r\\n
      \\r\\n

      Unassessed Assignments

      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n

      You have an assignment that has not been reviewed for eligibility to claim expenses.

      \\r\\n

      Do you intend to claim expenses on the assignments listed below?

      \\r\\n

      You are not able to navigate around Connect until an SDC questionnaire has been completed for the following assignments.

      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n

      {{assignment.agencyName}} | {{assignment.clientName}}

      \\r\\n
      {{assignment.dateStarted | bkShortDate: \"DD/MM/YYYY\"}}
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/modals/brookson.modals.select.html','
      \\r\\n

      {{title}}

      \\r\\n \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n
      ');\n$templateCache.put('src/app/shared/views/modals/brookson.modals.unpaidInvoices.html','
      \\r\\n

      Less: Unpaid Invoices

      \\r\\n \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n

      The value of unpaid invoices is the amount of the invoice that could be taken out as a dividend. This is the \\r\\n unpaid invoice amount (trade debtors) x 100/120 (if VAT registered) x 81/100 (to take out Corporation tax).

      \\r\\n

      This is a prudent approach and is most appropriate for customers with businesses in their first few months of trading.

      \\r\\n

      If you are an established business it may be better for you to consider including the value of unpaid invoices. This \\r\\n will advise you to take out the additional value of unpaid invoices before they are paid. This can be the right option \\r\\n for certain circumstances so please call us on 0345 058 1200 to discuss this option.

      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      ');\n$templateCache.put('src/app/shared/views/payment/brookson.payment.payment-view.html','
      \\r\\n \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n

      Auto Allocation Rules

      \\r\\n
      \\r\\n\\r\\n\\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n\\r\\n\\r\\n \\r\\n \\r\\n
      \\r\\n\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n\\r\\n \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.accept-checkbox.html','
      \\r\\n \\r\\n \\r\\n
      ');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.accept-terms-and-conditions.html','
      \\r\\n
      \\r\\n
      \\r\\n

      {{$ctrl.headingText}}

      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.account-details.contact-information.html','
      \\r\\n

      \\r\\n Contact Details\\r\\n

      \\r\\n\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.account-details.personal-information.html','
      \\r\\n

      \\r\\n Personal Details\\r\\n

      \\r\\n\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n

      Two Factor Authentication is currently disabled

      \\r\\n

      Two Factor Authentication Enabled. If you disable this then it will be re-enabled in 24 hours time.

      \\r\\n

      Two Factor Authentication has been disabled until {{$ctrl.twoFactorDisabledExpiryDate()}}

      \\r\\n

      Two Factor Authentication was permanently disabled on {{$ctrl.twoFactorOverrideDate()}}

      \\r\\n
      \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.attach-receipt.html','
      \\r\\n 0\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" id=\"attachReceiptDropup\" aria-haspopup=\"true\"\\r\\n aria-expanded=\"false\">\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
        \\r\\n
      • 0\">\\r\\n Preview\\r\\n
      • \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.auth-code.input.html','
      \\r\\n
      \\r\\n

      Please enter your HMRC Authorisation code below

      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.back-top.html','');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.calendar-overlay.html','
      \\r\\n\\t
      \\r\\n\\t\\t
      \\r\\n\\t\\t\\t
      \\r\\n\\t\\t\\t\\t×\\r\\n\\t\\t\\t\\t
      \\r\\n\\t\\t\\t\\t\\t
       
      brooksonone.co.uk
      \\r\\n\\t\\t\\t\\t\\t

      \\r\\n\\t\\t\\t\\t\\t\\tWelcome to Brookson One\\r\\n\\t\\t\\t\\t\\t

      \\r\\n\\t\\t\\t\\t
      \\r\\n\\t\\t\\t\\t
      \\r\\n\\t\\t\\t\\t\\t
      \\r\\n\\t\\t\\t\\t\\t\\t
      \\r\\n\\t\\t\\t\\t\\t\\t\\t
      \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
      \\r\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\r\\n\\t\\t\\t\\t\\t\\t\\t\\t
      \\r\\n\\t\\t\\t\\t\\t\\t\\t
      \\r\\n\\t\\t\\t\\t\\t\\t
      \\r\\n\\t\\t\\t\\t\\t
      \\r\\n\\t\\t\\t\\t
      \\r\\n\\t\\t\\t
      \\r\\n\\t\\t
      \\r\\n\\t
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.confirm.accounts.html','
      \\r\\n \\r\\n Done\\r\\n Current\\r\\n Future\\r\\n Overdue {{$ctrl.action.dueDate | bkShortDate:\"DD/MM/YYYY\"}}\\r\\n \\r\\n

      {{$ctrl.action.actionTitle}}

      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n

      \\r\\n Draft accounts have been confirmed.\\r\\n

      \\r\\n\\r\\n
      \\r\\n

      \\r\\n Please review the draft accounts we have published. If you are happy with the content then please confirm the accounts\\r\\n below.\\r\\n

      \\r\\n
      Step 1
      \\r\\n

      \\r\\n Please review and confirm that any assignment caught by IR35(disguised employment) is correctly showing on the assignment\\r\\n page and that there are no other assignments which you believe should be subject to PAYE.\\r\\n

      \\r\\n

      \\r\\n \\r\\n \\r\\n

      \\r\\n
      \\r\\n
      \\r\\n
      Step 2
      \\r\\n

      \\r\\n We need you to review the approved draft acounts and representation letter. Once you have reviewed the documents please confirm your approval of the\\r\\n draft accounts and representation letter by clicking the confirm button below. Please be aware that we cannot issue your formal year end accounts pack\\r\\n until you have approved your draft accounts.\\r\\n

      \\r\\n
      Related documents
      \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      No docs
      {{doc.name}}View Document
      Download All
      \\r\\n

      \\r\\n

      \\r\\n

      If you have any queries relating to you accounts then please contact the customer services team for further assistance on 0345 058 1200 or 01925 232526

      \\r\\n
      \\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.confirm.financial-health-check.html','
      \\r\\n

      Our team of experts are here to help you make the most of your money. Book your appointment today.

      \\r\\n Book Appointment\\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.confirm.self.assessment.html','
      \\r\\n
      \\r\\n

      Your Self Assessment Tax Pack is now available to complete.

      \\r\\n Tax Pack\\r\\n
      \\r\\n\\r\\n
      \\r\\n

      Thank you for completing your Tax Pack.

      \\r\\n Tax Pack\\r\\n
      \\r\\n\\r\\n
      \\r\\n

      Your tax return has been filed at the HMRC.

      \\r\\n
      \\r\\n\\r\\n
      Thank you for approving your Tax Return. We will submit this to HMRC in due course and send you a notification once submitted.
      \\r\\n\\r\\n

      Your Personal Tax Return will show here when it has been prepared ready to be reviewed.

      \\r\\n\\r\\n
      \\r\\n \\r\\n

      Your Tax Return is ready to be reviewed and approved by you.

      \\r\\n\\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      We are busy preparing your Tax Return
      {{doc.name}}View Document
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n

      I confirm that I am in agreement with the content of my Tax Return

      \\r\\n\\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n

      I confirm that I am in agreement with the content of my Tax Return

      \\r\\n\\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n

      Thank you for completing your Tax Pack.

      \\r\\n Tax Pack\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n

      We do not have your UTR number (Unique Taxpayer Reference) issued to you by HMRC.
      Enter this on your Tax Pack and Add UTR.\\r\\n

      \\r\\n

      The UTR number we have on record is not in the correct format.
      Update this on your Tax Pack and click Update UTR.\\r\\n

      \\r\\n
      \\r\\n\\r\\n
      ');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.confirm.year.end.html','
      \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n
      \\r\\n

      Your draft Year End Accounts have been produced for you to view and confirm. When confirmed we will start the process of submitting the Year End Accounts to Companies House and HMRC.

      \\r\\n
      \\r\\n
      There was an issue updating your Year End status, please try again later.
      \\r\\n \\r\\n
      \\r\\n\\r\\n
      \\r\\n I confirm that I am happy with the content of the {{$ctrl.yearEndTileDetails.currentYearEndName}} Year End Accounts.\\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n\\r\\n \\r\\n
      \\r\\n

      Thank you for confirming your Year End Accounts, we will now arrange for these to be submitted to Companies House and HMRC.

      \\r\\n
      \\r\\n \\r\\n View Accounts\\r\\n \\r\\n
      \\r\\n Confirmed\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n\\r\\n \\r\\n
      \\r\\n

      Your Company Year End Accounts have been submitted to Companies House and HMRC.

      \\r\\n
      \\r\\n \\r\\n View Accounts\\r\\n \\r\\n
      \\r\\n Confirmed\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.feedback.html','\\uFEFF\\r\\n
      \\r\\n How are we doing?\\r\\n
      \\r\\n\\r\\n
      \\r\\n \\r\\n
      \\r\\n Options\\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.flex.form.html','
      \\r\\n

      You have provided the required information to join Brookson\\u2019s umbrella solution. We will be in contact with further information.

      \\r\\n
      \\r\\n

      \\r\\n Introducing Flex! The IR35 Solution for Contractors to easily switch between Limited and Umbrella working as and when needed.\\r\\n

      \\r\\n

      \\r\\n Want to know more about Flex, click here\\r\\n

      \\r\\n

      \\r\\n Join Brookson Umbrella\\r\\n

      \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.image-not-found.html','
      \\r\\n

      \\r\\n\\r\\n

      Image not found

      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.image-preview.modal.html','
      \\r\\n

      \\r\\n \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.pdf-view.html','
      \\r\\n\\t
      \\r\\n\\t\\t\\r\\n\\t
      \\r\\n
      \\r\\n\\r\\n\\r\\n');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.popup.html','
      \\r\\n

      {{title}}

      \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.popup.input.html','
      \\r\\n

      {{title}}

      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n
      ');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.privacy.button.html','
      \\r\\n \\r\\n
      \\r\\n Use {{$ctrl.privacyFactory.hotKeyToEnablePrivacyMode}} to enable/disable\\r\\n
      ');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.progress-bar.html','
      \\r\\n
      \\r\\n Uploaded {{$ctrl.file.sizeUploaded() | bytes }} of {{ $ctrl.file.size | bytes }} | {{ $ctrl.file.sizeUploaded() / $ctrl.file.size * 100 | number:0 }} %\\r\\n\\r\\n
      \\n \\n Pending...\\n \\n
      ');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.receipt-panel.html','
      \\r\\n \\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.templated-confirmation-popup.html','
      \\r\\n

      {{title}}

      \\r\\n \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n
      ');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.templated-help-popup.html','
      \\r\\n

      {{title}}

      \\r\\n \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      ');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.templated-info-popup.html','
      \\n

      {{title}}

      \\r\\n \\r\\n \\r\\n \\n
      \\n
      \\n \\n
      ');\n$templateCache.put('src/app/shared/views/ui/brookson.ui.utr.input.html','
      \\r\\n
      \\r\\n

      Please enter your UTR and Branch ID Number below

      \\r\\n
      \\r\\n\\r\\n
      \\r\\n The Unique Taxpayer Reference (UTR) is issued by HMRC when you have registered for Self Assessment. It is made up of 10 numbers\\r\\n and can be found on documentation issued by HMRC such as the Tax Return (SA100), a \\'Notice to complete a Tax Return\\'\\r\\n (SA316) or a Statement of Account.\\r\\n
      The Branch ID is the digit branch code found on documentation issued by HMRC.\\r\\n\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n /\\r\\n
      \\r\\n \\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.actions.html','
      \\r\\n
      \\r\\n
      \\r\\n Actions\\r\\n
      \\r\\n \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      TypeDescriptionStatusDue Date
      {{::task.taskGroup}}{{::task.actionTitle}}{{::$ctrl.enums.TaskStatus.properties[task.status].description}}{{::task.dueDate|date:\\'dd/MM/yyyy\\'}}
      \\r\\n No tasks to be displayed.\\r\\n
      \\r\\n
      \\r\\n You have {{::$ctrl.transactionsToAllocate}} transactions to allocate\\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      There was a problem loading your data.
      \\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.assignments.html','
      \\r\\n
      \\r\\n
      \\r\\n Assignments\\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n {{$ctrl.assignments[0].assignmentName}}\\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      Rate(s)
      \\r\\n\\r\\n
      \\r\\n \\r\\n {{rate.amount}} {{rate.currency}} per {{rate.period | lowercase}}\\r\\n \\r\\n
      \\r\\n
      \\r\\n\\r\\n \\r\\n
      \\r\\n Start Date\\r\\n
      \\r\\n \\r\\n {{assignment.dateStarted | bkShortDate: \\'DD/MM/YYYY\\' : \\'No Start Date Specified\\'}}\\r\\n \\r\\n
      \\r\\n
      \\r\\n\\r\\n \\r\\n
      \\r\\n Expected End Date\\r\\n
      \\r\\n \\r\\n {{assignment.dateEnded | bkShortDate: \\'DD/MM/YYYY\\' : \\'No End Date Specified\\'}}\\r\\n \\r\\n
      \\r\\n
      \\r\\n\\r\\n \\r\\n
      \\r\\n IR35 Status\\r\\n
      \\r\\n \\r\\n Take Assessment\\r\\n \\r\\n {{assignment.overallStatusText}}\\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n

      You currently have no assignments

      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      There was a problem loading your data.
      \\r\\n
      \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.bank-link.html','
      \\r\\n
      \\r\\n
      \\r\\n Bank\\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n Balance Trends\\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n Your Bank Status:\\r\\n
      \\r\\n Action required\\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n\\r\\n
      \\r\\n Transactions to confirm: {{$ctrl.transactionsToAllocate}}\\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      There was a problem loading your data.
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n This feature is automatically activated when view access is enabled on your business bank account and will display a list of transactions, which you will need to categorise and allocate. If the transaction is a business expense, you will need to attach a receipt.\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.document-storage.recent-documents.html','
      \\r\\n
      \\r\\n
      \\r\\n Document Storage\\r\\n
      \\r\\n \\r\\n\\r\\n \\r\\n Recent Documents\\r\\n \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n

      \\r\\n {{document.name}} View Document\\r\\n

      \\r\\n
      \\r\\n
      \\r\\n No recently added documents.\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      There was a problem loading your data.
      \\r\\n
      \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.document-storage.umbrella-recent-documents.html','
      \\r\\n
      \\r\\n
      \\r\\n Documents\\r\\n
      \\r\\n \\r\\n\\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n

      4}\">\\r\\n {{document.name}} View Document\\r\\n

      \\r\\n
      \\r\\n
      \\r\\n No recently added documents.\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      There was a problem loading your data.
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      A/CDateDescriptionAmount
      {{::transaction.bankName}}{{::transaction.transactionDate | bkShortDate:\"DD/MM/YYYY\"}}{{::transaction.debitAmount + transaction.creditAmount | currency:\"\\xA3\"}}
      \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      Important documents
      \\r\\n Contract of Employment\\r\\n \\r\\n Download\\r\\n
      \\r\\n Employee Handbook\\r\\n \\r\\n Download\\r\\n
      \\r\\n Health Safety Assessment\\r\\n \\r\\n Download\\r\\n
      \\r\\n Health Safety Assessment Guidelines\\r\\n \\r\\n Download\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.employment-record.html','
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n Employment Record\\r\\n
      \\r\\n \\r\\n\\r\\n \\r\\n Overview\\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      Personal Details
      \\r\\n First name\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.firstName !== \\'\\' ? $ctrl.accountSrv.personalInformation.firstName : \\'--\\'}}\\r\\n
      \\r\\n Middle name\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.middleName !== \\'\\' ? $ctrl.accountSrv.personalInformation.middleName : \\'--\\'}}\\r\\n
      \\r\\n Last name\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.surname !== \\'\\' ? $ctrl.accountSrv.personalInformation.surname : \\'--\\'}}\\r\\n\\r\\n
      \\r\\n Nationality\\r\\n \\r\\n {{($ctrl.nationalities | filter: {code: $ctrl.accountSrv.personalInformation.nationality })[0].nationality }}\\r\\n
      \\r\\n NI Number\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.niNumber !== \\'\\' ? $ctrl.accountSrv.personalInformation.niNumber : \\'--\\'}}\\r\\n
      \\r\\n Address 1\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.address !== \\'\\' ? $ctrl.accountSrv.personalInformation.address : \\'--\\'}}\\r\\n
      \\r\\n Address 2\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.address2 !== \\'\\' ? $ctrl.accountSrv.personalInformation.address2 : \\'--\\'}}\\r\\n
      \\r\\n Town\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.city !== \\'\\' ? $ctrl.accountSrv.personalInformation.city : \\'--\\'}}\\r\\n
      \\r\\n County\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.county !== \\'\\' ? $ctrl.accountSrv.personalInformation.county : \\'--\\'}}\\r\\n
      \\r\\n Postcode\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.postcode !== \\'\\' ? $ctrl.accountSrv.personalInformation.postcode : \\'--\\'}}\\r\\n
      \\r\\n UTR number\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.utrNumber !== \\'\\' ? $ctrl.accountSrv.personalInformation.utrNumber : \\'--\\'}}\\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      Contact Details
      \\r\\n Home number\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.mobilePhoneNo !== \\'\\' ? $ctrl.accountSrv.personalInformation.mobilePhoneNo : \\'--\\'}}\\r\\n
      \\r\\n Work number\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.workPhoneNo !== \\'\\' ? $ctrl.accountSrv.personalInformation.workPhoneNo : \\'--\\'}}\\r\\n
      \\r\\n Email\\r\\n \\r\\n {{$ctrl.accountSrv.personalInformation.eMail !== \\'\\' ? $ctrl.accountSrv.personalInformation.eMail : \\'--\\'}}\\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      Documents
      \\r\\n Contract of Employment\\r\\n \\r\\n Download Document\\r\\n
      \\r\\n Employee Handbook\\r\\n \\r\\n Download Document\\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      There was a problem loading your data.
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n Any invoices raised or remittances submitted will be displayed, along with any payments against them. The default view displays all unmatched invoices and payments, giving you an overview of what is outstanding. To raise an invoice, click the \\u2018Raise Invoice\\u2019 button.\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.expenses.overview.html','
      \\r\\n
      \\r\\n
      \\r\\n Personally Paid Expenses & Mileage\\r\\n
      \\r\\n\\r\\n \\r\\n \\r\\n\\r\\n \\r\\n Monthly Analysis\\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n You have no expenses to display\\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      There was a problem loading your data.
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.invoicing.overview.html','
      \\r\\n
      \\r\\n
      \\r\\n {{$ctrl.appSettings.invoiceTitle}}\\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n Overview\\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      Latest {{$ctrl.appSettings.invoiceTitle}}
      \\r\\n {{latestInvoice.date | bkShortDate:\"DD/MM/YYYY\"}}\\r\\n \\r\\n \\r\\n {{latestInvoice.description}}\\r\\n \\r\\n \\r\\n {{latestInvoice.status}}\\r\\n \\r\\n {{latestInvoice.gross | currency: \"\"}}\\r\\n
      \\r\\n No latest invoices.\\r\\n
      \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      \\r\\n Latest Payments\\r\\n
      \\r\\n {{latestPayment.date | bkShortDate:\"DD/MM/YYYY\"}}\\r\\n \\r\\n \\r\\n {{latestPayment.description}}\\r\\n \\r\\n \\r\\n {{latestPayment.gross | currency: \"\"}}\\r\\n
      \\r\\n No latest payments.\\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      There was a problem loading your data.
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n Any invoices raised or remittances submitted will be displayed, along with any payments against them. The default view displays all unmatched invoices and payments, giving you an overview of what is outstanding. To raise an invoice, click the \\u2018Raise Invoice\\u2019 button.\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.invoicing.umb.detail.html','
      \\r\\n\\r\\n
      \\r\\n View Payslips\\r\\n Raise Timesheet \\r\\n
      \\r\\n Pay tracker\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      Timesheet IDWeek EndingAgencyTotalPayslip Period
      \\r\\n {{latestTimesheet.timesheetID}}\\r\\n \\r\\n {{latestTimesheet.timesheetEndDate | bkShortDate:\"DD MMM YYYY\"}}\\r\\n \\r\\n \\r\\n {{latestTimesheet.agencyName}}\\r\\n \\r\\n \\r\\n {{latestTimesheet.timesheetValue | currency: \"\"}}\\r\\n \\r\\n {{latestTimesheet.payYear}}-{{latestTimesheet.payPeriod}}\\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n\\r\\n
      \\r\\n No latest Timesheets.\\r\\n
      \\r\\n \\r\\n You currently have no Timesheets Raise Timesheet\\r\\n\\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      There was a problem loading your data.
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n Any invoices raised or remittances submitted will be displayed, along with any payments against them. The default view displays all unmatched invoices and payments, giving you an overview of what is outstanding. To raise an invoice, click the \\u2018Raise Invoice\\u2019 button.\\r\\n
      \\r\\n
      \\r\\n\\r\\n\\r\\n');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.key-dates.html','
      \\r\\n
      \\r\\n
      \\r\\n Key Dates\\r\\n
      \\r\\n \\r\\n \\r\\n Key Dates\\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
        \\r\\n
      • \\r\\n
        \\r\\n {{taskAction.deadline | bkShortDate: \\'DD/MM/YYYY\\'}}\\r\\n
        {{taskAction.taskTitle}}
        \\r\\n

        {{taskAction.actionTitle}}

        \\r\\n
        \\r\\n
      • \\r\\n
      • \\r\\n No key dates to be displayed\\r\\n
      • \\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      There was a problem loading your data.
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.money-manager.money-available.html','
      \\r\\n
      \\r\\n
      \\r\\n Money Available\\r\\n
      \\r\\n \\r\\n \\r\\n {{::$ctrl.data.getLastReconciledDate | date:\\'dd/MM/yyyy\\'}}\\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      Available funds balance statement£ Balance
      Money in Bank{{($ctrl.data.moneyManagerFinancialData.moneyInBank | number:2) || \\'0\\'}}
      Unpaid Invoices / Unmatched cash{{($ctrl.data.moneyManagerFinancialData.unpaidInvoicesCashUnmatched | number:2) || \\'0\\'}}
      PAYE / NICs{{($ctrl.data.moneyManagerFinancialData.paye | number:2) || \\'0\\'}}
      Corporation Tax Previous Year{{($ctrl.data.moneyManagerFinancialData.corporationTaxPreviousYear | number:2) || \\'0\\'}}
      Corporation Tax Current Year{{($ctrl.data.moneyManagerFinancialData.corporationTax | number:2) || \\'0\\'}}
      VAT{{($ctrl.data.moneyManagerFinancialData.vat | number:2) || \\'0\\'}}
      Other Total {{($ctrl.data.moneyManagerFinancialData.otherBreakdownTotal | number:2) || \\'0\\'}}
      \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      Funds Including Unpaid Invoices{{($ctrl.data.moneyManagerFinancialData.fundsIncludingUnpaidInvoices | number:2) || \\'0\\'}}
      Less: unpaid invoices\\r\\n \\r\\n {{($ctrl.data.moneyManagerFinancialData.lessUnpaidInvoices | number:2) || \\'0\\'}}\\r\\n \\r\\n
      Total Money Available{{($ctrl.data.moneyManagerFinancialData.totalMoneyAvailable | currency:\"\\xA3\":2) || \\'0\\'}}
      \\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      Other Breakdown£
      Employee Wages{{($ctrl.data.moneyManagerFinancialData.employeeWages | number:2) || \\'0\\'}}
      Bank Loans & Finance{{($ctrl.data.moneyManagerFinancialData.bankLoansFinance | number:2) || \\'0\\'}}
      Pension Provider{{($ctrl.data.moneyManagerFinancialData.pensionProvider | number:2) || \\'0\\'}}
      Accountancy Fees{{($ctrl.data.moneyManagerFinancialData.accountancyFees | number:2) || \\'0\\'}}
      CIS Provision{{($ctrl.data.moneyManagerFinancialData.cisProvision | number:2) || \\'0\\'}}
      Other Amounts{{($ctrl.data.moneyManagerFinancialData.otherAmounts | number:2) || \\'0\\'}}
      Other Breakdown Total{{($ctrl.data.moneyManagerFinancialData.otherBreakdownTotal | currency:\"\\xA3\":2) ||\\r\\n \\'0\\'}}
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      There was a problem loading your data.
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.open-banking.html','
      \\r\\n
      \\r\\n
      \\r\\n Banking\\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n Bank Accounts\\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n Help\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \"{{::bank}}\"\\r\\n\\r\\n \\r\\n
      {{::accounts[0].bankName}}
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n {{::bankAccount.accountType}} {{::bankAccount.type}} Account - {{$ctrl.maskedBankAccountNumber(bankAccount)}}\\r\\n
      \\r\\n
      \\r\\n {{::bankAccount.availableBalance | currency : \\'\\xA3\\'}}\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n Amount as of {{::bankAccount.reconciliationDate | date: \\'dd MMM yyyy\\'}}\\r\\n
      \\r\\n
      \\r\\n \\r\\n {{bankAccount.viewAccessDescription}}\\r\\n \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n Bank Statement Pending\\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n Your access has expired, use the link below to complete the validation process\\r\\n
      \\r\\n\\r\\n
      \\r\\n Due to a technical issue, your authorisation will need to be completed. Please access using the link below\\r\\n
      \\r\\n\\r\\n
      \\r\\n Registration for Open Banking has not been successful on this occasion. Please try again & if you continue to experience this issue, email our Business Advisory Team on businessadvisors@brookson.co.uk\\r\\n
      \\r\\n\\r\\n
      \\r\\n To ensure your authorisation remains up to date you will be required to re-authenticate your details every 90 days\\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n Pending Update\\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n Re-Consent Due : {{::bankAccount.consentDateDue | date: \\'dd MMM yyyy\\'}}\\r\\n
      \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n

      You currently have no Bank Accounts

      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      There was a problem retrieving your bank accounts.
      \\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.personal-tax.tracker.html','
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n Personal Tax Tracker\\r\\n
      \\r\\n \\r\\n \\r\\n Forecast\\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      Total income{{$ctrl.personalTaxSrv.incomeSummaryWidgetData.totalIncome() | number : 0}}
      Payment due 31st January {{$ctrl.personalTaxSrv.brooksonUtilitiesDate.taxYearEndByOffset($ctrl.personalTaxSrv.taxYearOffset + 1).year()}}{{$ctrl.personalTaxSrv.taxLiabilityDueWidgetData.paymentOnAccountDueJan() | number: 0}}
      Payment due 31st July {{$ctrl.personalTaxSrv.brooksonUtilitiesDate.taxYearEndByOffset($ctrl.personalTaxSrv.taxYearOffset + 1).year()}}{{$ctrl.personalTaxSrv.taxLiabilityDueWidgetData.paymentOnAccountDueJuly() | number: 0}}
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n We were unable to gather your personal tax data.\\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      There was a problem loading your data.
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n This features is automatically activated when sufficient information exists within Money Manager and will display an estimate of your persona tax bill, as personal tax is payable on dividends that you withdraw from your business.\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.receipt-bank.html','
      \\r\\n
      \\r\\n
      \\r\\n Receipt Bank\\r\\n
      \\r\\n \\r\\n \\r\\n Unassigned\\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n You have {{$ctrl.numberOfReceipts}} unassigned receipts\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      There was a problem loading your data.
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.remus-rewards-button.html','\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n Brookson Rewards\\r\\n
      \\r\\n
      \\r\\n Error loading Brookson Rewards.\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      There was a problem loading your data.
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.remus-rewards.html','\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n Explore Brookson Rewards\\r\\n
      \\r\\n
      \\r\\n Error loading Brookson Rewards.\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      There was a problem loading your data.
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.sme.actions-to-take.html','
      \\r\\n
      \\r\\n
      \\r\\n Manager Zone\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      Overtime to authorize
      Holidays to authorize
      Expenses to authorize
      \\r\\n
      \\r\\n You have no actions to take.\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      There was a problem loading your data.
      \\r\\n
      \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.sme.employees-on-holiday.html','
      \\r\\n
      \\r\\n
      \\r\\n Employees on Holiday\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      {{holidayRequest.employeeName}}{{holidayRequest.startDate | date: \\'dd-MM-yyyy\\'}}{{holidayRequest.endDate | date: \\'dd-MM-yyyy\\'}}
      \\r\\n\\r\\n
      \\r\\n You have no employees on holiday.\\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      There was a problem loading your data.
      \\r\\n
      \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.sme.last-payslip.html','
      \\r\\n
      \\r\\n
      \\r\\n Last Payslip\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\xA36,000.00
      \\r\\n
      \\xA33,785.99
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n You haven\\'t received a payslip yet.\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      There was a problem loading your data.
      \\r\\n
      \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.sme.next-holiday.html','
      \\r\\n
      \\r\\n
      \\r\\n Holidays\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      Remaining holiday allowance: {{$ctrl.remainingHolidayAllowance}}
      \\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      Next Holiday
      Start Date
      End Date
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n
      Remaining holiday allowance: {{$ctrl.remainingHolidayAllowance}}
      \\r\\n
      \\r\\n You have no holidays coming up.\\r\\n
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      There was a problem loading your data.
      \\r\\n
      \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.sme.profit-loss.html','
      \\r\\n
      \\r\\n
      \\r\\n Profit and Loss\\r\\n
      \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      Description{{$ctrl.startOfPreviousPeriods}} ... {{$ctrl.endOfPreviousPeriods}}{{$ctrl.startOfCurrentPeriod}} ... {{$ctrl.endOfPeriod}}
      TotalRevenue{{$ctrl.previousMonth.totalRevenue | currency: \\'\\xA3\\'}}{{$ctrl.currentMonth.totalRevenue | currency: \\'\\xA3\\'}}
      Total Cost{{$ctrl.previousMonth.totalCost | currency: \\'\\xA3\\'}}{{$ctrl.currentMonth.totalCost | currency: \\'\\xA3\\'}}
      Gross Margin{{$ctrl.previousMonth.grossMargin | currency: \\'\\xA3\\'}}{{$ctrl.currentMonth.grossMargin | currency: \\'\\xA3\\'}}
      Gross Margin %{{$ctrl.previousMonth.grossMarginPercentage | number: 2}}{{$ctrl.currentMonth.grossMarginPercentage | number: 2}}
      Operating Expenses{{$ctrl.previousMonth.operatingExpenses | currency: \\'\\xA3\\'}}{{$ctrl.currentMonth.operatingExpenses | currency: \\'\\xA3\\'}}
      Operating Margin{{$ctrl.previousMonth.operatingExpensesMargin | currency: \\'\\xA3\\'}}{{$ctrl.currentMonth.operatingExpensesMargin | currency: \\'\\xA3\\'}}
      Operating Margin %{{$ctrl.previousMonth.operatingExpensesMarginPercentage | number: 2}}{{$ctrl.currentMonth.operatingExpensesMarginPercentage | number: 2}}
      Other Expenses{{$ctrl.previousMonth.otherExpenses | currency: \\'\\xA3\\'}}{{$ctrl.currentMonth.otherExpenses | currency: \\'\\xA3\\'}}
      Income before Interest and VAT{{$ctrl.previousMonth.incomeBeforeInterestAndVat | currency: \\'\\xA3\\'}}{{$ctrl.currentMonth.incomeBeforeInterestAndVat | currency: \\'\\xA3\\'}}
      \\r\\n\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n
      There was a problem loading your data.
      \\r\\n
      \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.task-planner.html','
      \\r\\n
      \\r\\n
      \\r\\n Planner\\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      TypeDescriptionStatusDue Date
      {{::task.taskGroup}}{{::task.actionTitle}}{{::$ctrl.enums.TaskStatus.properties[task.status].description}}{{::task.dueDate|date:\\'dd/MM/yyyy\\'}}
      \\r\\n No tasks to be displayed.\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      There was a problem loading your data.
      \\r\\n
      \\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.umbrella-brookson-adverts.html','
      \\r\\n
      \\r\\n
      \\r\\n Upgrade\\r\\n Seleted  \\r\\n
      \\r\\n Upgrade to Umbrella Protect Selected\\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      £{{ $ctrl.agencyMargin.umbrellaPlusMargin }}pw all these employee benefits:
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \"\"\\r\\n

      Financial Benefits

      \\r\\n

      \\r\\n

        \\r\\n
      • Unlimited financial well being reviews
      • \\r\\n
      • Access to Brookson Financial for initial discussions concerning Mortgages, Investments, Pensions &\\r\\n Insurance.
      • \\r\\n
      \\r\\n

      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \"\"\\r\\n

      Benefits Platform

      \\r\\n

      Full access to our benefits platform includes: \\r\\n

        \\r\\n
      • Discounted holidays,
      • \\r\\n
      • Discounted entertainment & activities,
      • \\r\\n
      • Discounted gym and online personal trainer,
      • \\r\\n
      • Cash back on fuel, plus so much more!
      • \\r\\n
      \\r\\n

      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \"\"\\r\\n

      Physical Benefits

      \\r\\n

      \\r\\n

        \\r\\n
      • Eye tests & prescriptions
      • \\r\\n
      • Access to private medical care via AXA
      • \\r\\n
      \\r\\n

      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \"\"\\r\\n

      Psychological Benefits

      \\r\\n

      \\r\\n

        \\r\\n
      • Employee Assistance Programme
      • \\r\\n
      • Adult / Menopause / Teenage
      • \\r\\n
      • Mental Health Support
      • \\r\\n
      \\r\\n

      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n\\r\\n\\r\\n\\r\\n \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.umbrella-financial-adverts.html','
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n \"\"\"\"\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n

      Get Access to a World of Financial Benefits!

      Brookson Financial offers a full range of bespoke financial services for umbrella\\r\\n employees, including\\r\\n mortgages, pensions, and protection. Find out more or book a free initial call.\\r\\n

      \\r\\n

      Learn More   \\r\\n

      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n\\r\\n\\r\\n\\r\\n \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.umbrella-whats-app.html','
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \"\"\\r\\n
      \\r\\n \"\"\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n

      Brookson WhatsApp Service

      \\r\\n

      Pay updates and help at your fingertips

      \\r\\n\\r\\n
      \\r\\n
      \\r\\n
      \\r\\n\\r\\n
      \\r\\n

      Get information on your payments and access our FAQ\\'s quickly with our WhatsApp service, just\\r\\n say\\r\\n \"Hi\" to 01202 835 514\\r\\n

      \\r\\n

      Add to Contacts\\r\\n

      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n\\r\\n\\r\\n\\r\\n \\r\\n
      \\r\\n
      ');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.umbrella.faq.html','
      \\r\\n
      \\r\\n
      \\r\\n Frequently Asked Questions\\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      \\r\\n \\r\\n

      How has my payslip been calaculted?

      \\r\\n
      \\r\\n
      \\r\\n \\r\\n

      When will I get paid?

      \\r\\n
      \\r\\n
      \\r\\n \\r\\n

      Why have I not been paid?

      \\r\\n
      \\r\\n
      \\r\\n \\r\\n

      What is pension auto enrolement?

      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/widgets/brookson.widgets.umbrella.payalerts.html','
      \\r\\n
      \\r\\n

      Alerts, updates on pay and requesting a call back

      \\r\\n
      \\r\\n

      We have an automated service whereby you can request updates on your pay, request call backs and submit your timesheet details \\u2013 available through SMS or WhatsApp

      \\r\\n

      Simply reply \\'Hello\\' to +441202835514 by SMS or through WhatsApp to Access the service.

      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n');\n$templateCache.put('src/app/shared/views/bank/modals/brookson.bankLink.modals.allocationConfirmation.html','
      \\r\\n
      \\r\\n

      Confirm your transaction allocations

      \\r\\n \\r\\n \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      A/CDateDescriptionCategoryReceiptTotalVATNet
      {{::transaction.transactionDate|bkShortDate:\"DD/MM/YYYY\"}}\\r\\n
      \\r\\n \\r\\n
      \\r\\n
      {{::transaction.debitAmount === undefined ? \\'0\\' : transaction.debitAmount | currency:\"\\xA3\"}}{{::transaction.vat === undefined ? \\'0\\' : transaction.vat | currency:\"\\xA3\"}}{{::transaction.net === undefined ? \\'0\\' : (transaction.net*-1) | currency:\"\\xA3\"}}
      Total Expenses{{::$ctrl.data.confirmedTransactionsTotal | currency:\"\\xA3\"}}
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n

      Warning

      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n\\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n \\r\\n
      A/CDateDescriptionCategoryReceiptTotalVATNet
      {{::transaction.transactionDate|bkShortDate:\"DD/MM/YYYY\"}}\\r\\n
      \\r\\n \\r\\n
      \\r\\n
      {{::transaction.debitAmount === undefined ? \\'0\\' : transaction.debitAmount | currency:\"\\xA3\"}}{{::transaction.vat === undefined ? \\'0\\' : transaction.vat | currency:\"\\xA3\"}}{{::transaction.net === undefined ? \\'0\\' : (transaction.net*-1) | currency:\"\\xA3\"}}
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n

      According to our records you have been working at your main worksite for over 24 months therefore you are no longer entitled to claim main site travel expenses. This will also apply for any other associated main site costs you incur such as meals and accommodation. Any such expenses paid for from your business account should now be marked as personal withdrawals on money manager when allocating your payments. You should also not continue to claim for any personally paid expenses that relate to attending your main worksite.

      \\r\\n

      If you do not believe that the 24-month rule applies to this work site because you spend less than 40% of your time there and your attendance is not regular, you can confirm the transactions as expenses. If the expenses are relating to your main worksite, you should confirm the transactions as personal withdrawals going forwards. Please select the relevant option below so we can account for the above transactions accordingly for you.

      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n
      \\r\\n \\r\\n
      \\r\\n
      \\r\\n
      ');}]);","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n var appShared = angular.module(\"app.shared\");\r\n\r\n appShared.directive('brooksonBreakpoint', ['ngIfDirective', 'screenSize', (ngIfDirective, screenSize) => {\r\n /*\r\n xs - phones\r\n sm - tables\r\n md - desktops\r\n lg - large desktops\r\n */\r\n var ngIf = ngIfDirective[0];\r\n\r\n return {\r\n transclude: ngIf.transclude,\r\n priority: ngIf.priority,\r\n terminal: ngIf.terminal,\r\n restrict: 'A',\r\n link: (...args) => { // $scope, $element, $attr\r\n var show = screenSize.is(args[2].brooksonBreakpoint);\r\n\r\n screenSize.on(args[2].brooksonBreakpoint, (match) => {\r\n show = match;\r\n });\r\n\r\n args[2].ngIf = () => {\r\n return show;\r\n };\r\n\r\n ngIf.link.apply(ngIf, args);\r\n }\r\n };\r\n }]);\r\n})();\r\n"," (() => {\r\n 'use strict';\r\n\r\n var appShared = angular.module(\"app.shared\");\r\n\r\n appShared.directive('brooksonInputDatepicker', ['$detection', ($detection) => {\r\n return {\r\n restrict: 'AE',\r\n require: ['^form','^ngModel'],\r\n templateUrl: 'src/app/shared/views/inputs/brookson.input.datepicker.html',\r\n scope: {\r\n ngModel: '=',\r\n ngReadonly: '=',\r\n label: '@',\r\n field: '@',\r\n isRequired: '=',\r\n placeholder: '@',\r\n ngDisabled: '=',\r\n minDate: '=',\r\n maxDate: '=',\r\n viewOnly: '=',\r\n ngChange: '=',\r\n maxCustomMessage: '@?',\r\n minCustomMessage: '@?',\r\n max: '=',\r\n showDateHint: '='\r\n },\r\n link: (scope, el, attrs, requires) => {\r\n\r\n scope.form = requires[0];\r\n scope.format = \"dd/MM/yyyy\";\r\n scope.useMobileInput = ($detection.isiOS() || $detection.isAndroid() || $detection.isWindowsPhone());\r\n\r\n scope.datepickerStatus = {\r\n isOpen: false\r\n };\r\n\r\n scope.openDatepicker = ($event) => {\r\n scope.datepickerStatus.isOpen = !scope.datepickerStatus.isOpen;\r\n $event.preventDefault();\r\n };\r\n }\r\n };\r\n }]);\r\n\r\n appShared.directive('brooksonDatepickerAttr', ['brookson.utilities.date', '$detection', (dateUtils, $detection) => {\r\n return {\r\n require: '^ngModel',\r\n link: (scope, element, attrs, ctrl) => {\r\n scope.format = \"dd/MM/yyyy\";\r\n scope.useMobileInput = ($detection.isiOS() || $detection.isAndroid() || $detection.isWindowsPhone());\r\n\r\n attrs.$observe('brooksonDatepickerAttr', (newValue) => {\r\n if (scope.format === newValue || !ctrl.$modelValue) {\r\n return;\r\n }\r\n scope.format = \"dd/MM/yyyy\";\r\n ctrl.$modelValue = new Date(ctrl.$setViewValue);\r\n });\r\n\r\n if (scope.max) {\r\n ctrl.$validators.max = (viewValue) => {\r\n if (viewValue > scope.max) {\r\n scope.form[scope.field].$error.max = scope.maxCustomMessage;\r\n return false;\r\n }\r\n return dateUtils.convertToJsDate(viewValue);\r\n };\r\n }\r\n\r\n if (scope.min) {\r\n ctrl.$validators.min = (viewValue) => {\r\n if (viewValue > scope.min) {\r\n scope.form[scope.field].$error.min = scope.minCustomMessage;\r\n return false;\r\n }\r\n return dateUtils.convertToJsDate(viewValue);\r\n };\r\n }\r\n\r\n ctrl.$formatters.unshift((modelValue) => {\r\n if (!modelValue || modelValue === '' || !dateUtils.isValid(modelValue)) {\r\n return '';\r\n }\r\n\r\n return scope.useMobileInput ? dateUtils.convertToJsDate(modelValue) : dateUtils.convertToViewString(modelValue);\r\n });\r\n\r\n ctrl.$parsers.unshift((viewValue) => {\r\n if (!viewValue || viewValue === '' || !dateUtils.isValid(viewValue)) {\r\n return '';\r\n }\r\n\r\n return dateUtils.convertToJsDate(viewValue);\r\n });\r\n }\r\n };\r\n }]);\r\n })();\r\n","/// \r\n\r\n(() => {\r\n 'use strict';\r\n var appShared = angular.module('app.shared');\r\n\r\n appShared.directive('focusOn', (): any => {\r\n return (scope, elem, attr) => {\r\n return scope.$on('focusOn', (e, name) => {\r\n if (name === attr.focusOn) {\r\n return elem[0].focus();\r\n }\r\n });\r\n };\r\n });\r\n\r\n appShared.factory('focus', [\r\n '$rootScope', '$timeout', (($rootScope, $timeout) => {\r\n return (name) => {\r\n return $timeout(() => {\r\n return $rootScope.$broadcast('focusOn', name);\r\n });\r\n };\r\n })\r\n ]);\r\n})();\r\n","module Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n\r\n export enum SubmitPersonSignificantControl {\r\n NoResponse = 0,\r\n Yes = 1,\r\n No = 2\r\n }\r\n}","/// \r\n\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class NavPersonalInformation {\r\n \r\n // JOBTITLE\r\n public jobTitle: string = null;\r\n // TITLE\r\n public title: string = null;\r\n // FIRSTNAME\r\n public firstName: string = null;\r\n // MIDDLENAME\r\n public middleName: string = null;\r\n // SURNAME\r\n public surname: string = null;\r\n // FILINGCODE\r\n public filingCode: string = null;\r\n // HOMEPHONENO\r\n public homePhoneNo: string = null;\r\n // MOBILEPHONENO\r\n public mobilePhoneNo: string = null;\r\n // WORKPHONENO\r\n public workPhoneNo: string = null;\r\n // EMAIL\r\n public eMail: string = null;\r\n // SMSALERTPREFERENCE\r\n public smsAlertPreference: number = 0;\r\n // EMAILPAYSLIPSPREFERENCE\r\n public emailPayslipsPreference: number = 0;\r\n // PREFERREDMETHODOFCONTACT\r\n public preferredMethodOfContact: string = null;\r\n // ADDRESS\r\n public address: string = null;\r\n // ADDRESS2\r\n public address2: string = null;\r\n // CITY\r\n public city: string = null;\r\n // COUNTY\r\n public county: string = null;\r\n // POSTCODE\r\n public postcode: string = null;\r\n // PASSWORD\r\n public password: string = null;\r\n // CONFIRMPASSWORD\r\n public confirmPassword: string = null;\r\n // DOB\r\n public dob: Date = null;\r\n // NINUMBER\r\n public niNumber: string = null;\r\n // UTRNUMBER\r\n public utrNumber: string = null;\r\n // NATIONALITY\r\n public nationality: string = null;\r\n // NATIONALITYOPTION\r\n public nationalityOption: NAVNationality = null;\r\n //DOSUBMITPSC\r\n public doSubmitPSC: SubmitPersonSignificantControl = null;\r\n // Contact Joining Date\r\n public contactJoiningDate: Date = null;\r\n // Contract File Name\r\n public contractFileName: string = null;\r\n public tfaEnabled: boolean = false;\r\n public tfaEnabledAmended: boolean = false;\r\n public twoFactorDisabledExpiryDate: Date = null;\r\n public twoFactorOverrideDate: Date = null;\r\n }\r\n}\r\n","\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n\r\n export class InvoicingAssignmentRate {\r\n\r\n // RATETYPES\r\n public rateTypes: string[] = [];\r\n // ASSIGNMENTRATEID\r\n public assignmentRateID: number = 0;\r\n // RATE\r\n public rate: number = 0;\r\n // DESCRIPTION\r\n public description: string = null;\r\n // CURRENCY\r\n public currency: Currencies = null;\r\n // RATEPERIOD\r\n public ratePeriod: RatePeriods = null;\r\n // RATETYPE\r\n public rateType: string = null;\r\n // PAYMENTCODE\r\n public paymentCode: string = null;\r\n // STARTDATE\r\n public startDate: Date = null;\r\n // ENDDATE\r\n public endDate: Date = null;\r\n public chargableDays: number = 0;\r\n public chargableTotal: number = 0;\r\n public totalHoursWorked: number = 0;\r\n }\r\n\r\n export enum Currencies {\r\n GBP = 10,\r\n EUR = 20,\r\n USD = 30,\r\n YEN = 60,\r\n AUD = 70,\r\n CAD = 80,\r\n NOK = 90,\r\n ZAR = 100,\r\n SEK = 110,\r\n CHF = 120,\r\n AED = 130\r\n }\r\n\r\n export enum RatePeriods {\r\n Hour,\r\n Day,\r\n Week\r\n }\r\n}\r\n","/// \r\n\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class EmployeeRate {\r\n \r\n // CONTRACTRATEID\r\n public contractRateID: number = 0;\r\n // EMPLOYEEID\r\n public employeeID: number = 0;\r\n // RATEDESCRIPTION\r\n public rateDescription: string = null;\r\n // RATE\r\n public rate: number = 0;\r\n // STAFFID\r\n public staffID: string = null;\r\n // STAFFIDM\r\n public staffIDM: string = null;\r\n // CREATEDDATETIME\r\n public createdDateTime: Date = null;\r\n // YEARKEY\r\n public yearKey: number = 0;\r\n // ISDAYRATE\r\n public isDayRate: boolean = false;\r\n // PAYMENTCODE\r\n public paymentCode: string = null;\r\n // RATEPERIOD\r\n public ratePeriod: RatePeriods = null;\r\n // STARTDATE\r\n public startDate: Date = null;\r\n // ENDDATE\r\n public endDate: Date = null;\r\n // CURRENCY\r\n public currency: string = null;\r\n }\r\n}\r\n","/// \r\n\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class NavBusinessInformation {\r\n \r\n // COMPANIES\r\n public companies: NavCompanyInformation[] = [];\r\n // EMPLOYEERATES\r\n public employeeRates: Shared.EmployeeRate[] = [];\r\n }\r\n}\r\n","/// \r\n/// \r\n\r\n\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class NavContactInformation {\r\n \r\n // PERSONALINFORMATION\r\n public personalInformation: NavPersonalInformation = null;\r\n // BUSINESSINFORMATION\r\n public businessInformation: NavBusinessInformation = null;\r\n\r\n public twoFactorAuthenticationEnabled: boolean = false;\r\n }\r\n}\r\n","module Shared {\r\n export enum AccountType {\r\n unknown = 0,\r\n limitedCompany = 1,\r\n deemed = 99,\r\n soleTrader = 5,\r\n umbrella = 3,\r\n }\r\n\r\n export enum MoleAccountType {\r\n unknown = 0,\r\n limitedCompany = 1,\r\n limitedCompany2 = 2,\r\n umbrella = 3,\r\n cis = 4,\r\n soleTrader = 5,\r\n }\r\n}\r\n","\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class BankAccount {\r\n \r\n // BANKACCOUNTID\r\n public bankAccountID: string = null;\r\n // BANKNAME\r\n public bankName: string = null;\r\n // SORTCODE\r\n public sortCode: string = null;\r\n // ACCOUNTNO\r\n public accountNo: string = null;\r\n }\r\n}\r\n","\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class AssignmentHeader {\r\n \r\n // AGENCY\r\n public agency: string = null;\r\n // DATESTARTED\r\n public dateStarted: Date = null;\r\n // DATEENDED\r\n public dateEnded: Date = null;\r\n // ASSIGNMENTID\r\n public assignmentId: string = null;\r\n // CLIENT\r\n public client: string = null;\r\n // ASSIGNMENTNAME\r\n public assignmentName: string = null;\r\n // INSTRUCTIONTEXT\r\n public instructionText: string = null;\r\n // OVERALLSTATUSTEXT\r\n public overallStatusText: string = null;\r\n // ASSIGNMENTADDRESS\r\n public assignmentAddress: string = null;\r\n // ASSIGNMENTNOTES\r\n public assignmentNotes: string = null;\r\n // AGENCYREFERENCE\r\n public agencyReference: string = null;\r\n\r\n public fullAssignmentName: string = null;\r\n }\r\n}\r\n","/// \r\n\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class Review {\r\n \r\n // REVIEWID\r\n public reviewId: number = 0;\r\n // CONTRACTRECEIVED\r\n public contractReceived: Date = null;\r\n // RESARECEIVED\r\n public resaReceived: Date = null;\r\n // LEGALREVIEWED\r\n public legalReviewed: Date = null;\r\n // REVIEWCOMPLETED\r\n public reviewCompleted: Date = null;\r\n // RESASTATUS\r\n public resaStatus: string = null;\r\n // CONTRACTSTATUS\r\n public contractStatus: string = null;\r\n // FINALOUTCOME\r\n public finalOutcome: string = null;\r\n // RESADOCUMENT\r\n public resaDocument: string = null;\r\n // ATTENDANCENOTEDOCUMENT\r\n public attendanceNoteDocument: string = null;\r\n // CONTRACTDOCUMENT\r\n public contractDocument: string = null;\r\n // ASSIGNMENTID\r\n public assignmentID: string = null;\r\n // ASSIGNMENT\r\n public assignment: Assignment = null;\r\n }\r\n}\r\n","\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class Location {\r\n \r\n // STARTDATE\r\n public startDate: Date = null;\r\n // EXPECTEDENDDATE\r\n public expectedEndDate: Date = null;\r\n // LASTDAYONSITE\r\n public lastDayOnSite: Date = null;\r\n // SITENAME\r\n public siteName: string = null;\r\n // ADDRESS1\r\n public address1: string = null;\r\n // ADDRESS2\r\n public address2: string = null;\r\n // ADDRESS3\r\n public address3: string = null;\r\n // CITY\r\n public city: string = null;\r\n // COUNTY\r\n public county: string = null;\r\n // POSTCODE\r\n public postCode: string = null;\r\n }\r\n}\r\n","module Shared {\r\n export enum PublicSectorAssignmentCheckButtonPressed {\r\n public = 0,\r\n private = 1,\r\n notrequired = 2\r\n }\r\n}","module Shared {\r\n export class JobTitle {\r\n titleText: string;\r\n failsSdc: boolean;\r\n }\r\n}","module Shared {\r\n export class EnumObj {\r\n constructor(public name: string, public id: any)\r\n {\r\n \r\n }\r\n }\r\n}","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n\r\n export class Assignment extends AssignmentHeader {\r\n\r\n // RATETYPES\r\n public rateTypes: string[] = [];\r\n // MEMBERID\r\n public memberId: number = 0;\r\n // HASIR35QUESTIONNAIRE\r\n public hasIR35Questionnaire: boolean = false;\r\n // IR35QUESTIONNAIRECOMPLETE\r\n public iR35QuestionnaireComplete: boolean = false;\r\n // COMPANY\r\n public company: string = null;\r\n // MEMBERADVISEDSTATUSOLD\r\n public memberAdvisedStatusOld: string = null;\r\n // REVIEWS\r\n public reviews: Review[] = [];\r\n // PREFERREDEMAILADDRESSES\r\n public preferredEmailAddresses: string[] = [];\r\n // LOCATIONS\r\n public locations: Location[] = [];\r\n\r\n public isAssignment24MonthRuleReclaimable: boolean = false;\r\n\r\n public sdcStatus: number = 0;\r\n public publicSector: Sectors = null;\r\n\r\n public publicSectorFromDate: Shared.BrooksonDate;\r\n\r\n public ir35Capture: boolean;\r\n\r\n public jobTitleOption: JobTitle = null;\r\n\r\n public jobTitle: string = null;\r\n\r\n public industry: string = null;\r\n\r\n public iR35CapturedFromDate: string = null;\r\n\r\n public iR35CapturedEffectiveDate: string = null;\r\n\r\n public showExpensesPopup: boolean = false;\r\n public timesheetFrequencySelector: Shared.EnumObj;\r\n public timesheetFrequencyStatus: any;\r\n public timesheetFrequency: any;\r\n public timesheetFrequencyOptionsList: Array;\r\n }\r\n\r\n export enum Sectors {\r\n public,\r\n private,\r\n nolongerinuse,\r\n }\r\n}\r\n","/// \r\n\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class Customer {\r\n \r\n // CUSTOMERNUMBER\r\n public customerNumber: string = null;\r\n // CUSTOMERNAME\r\n public customerName: string = null;\r\n // CUSTOMERADDRESS\r\n public customerAddress: string = null;\r\n // CUSTOMERADDRESSOBJ\r\n public customerAddressObj: AddressMole = null;\r\n // CONTACTNAME\r\n public contactName: string = null;\r\n // CONTACTNUMBER\r\n public contactNumber: string = null;\r\n // BILLINGADDRESS\r\n public billingAddress: string = null;\r\n // BILLINGADDRESSOBJ\r\n public billingAddressObj: AddressMole = null;\r\n // ASSIGNMENTS\r\n public assignments: InvoicingAssignment[] = [];\r\n public umbTimesheetDisabled: number = 0;\r\n }\r\n}\r\n","\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class Address {\r\n \r\n public name: string = null;\r\n // ADDRESSLINE1\r\n public addressLine1: string = null;\r\n // ADDRESSLINE2\r\n public addressLine2: string = null;\r\n // ADDRESSLINE3\r\n public addressLine3: string = null;\r\n // TOWN\r\n public town: string = null;\r\n // COUNTY\r\n public county: string = null;\r\n // POSTCODE\r\n public postcode: string = null;\r\n // COUNTRY\r\n public country: string = null;\r\n }\r\n}\r\n","/// \r\n\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class NamedAddress extends Address {\r\n \r\n // NAME\r\n public name: string = null;\r\n }\r\n}\r\n","module Shared {\r\n export enum VatBusinessPostingGroup\r\n {\r\n // \"\"\r\n Blank = 0,\r\n // \"EU\"\r\n EU = 1,\r\n // \"EXEMPT\"\r\n EXEMPT = 2,\r\n // \"UK\"\r\n UK = 3,\r\n // \"NON EU\"\r\n NONEU = 4\r\n }\r\n}","module Shared {\r\n export enum VatProdPostingGroup\r\n {\r\n // \"\"\r\n Blank = 0,\r\n // \"EXEMPT\"\r\n EXEMPT = 1,\r\n // \"VAT10\"\r\n VAT10 = 2,\r\n // \"VAT17\"\r\n VAT17 = 3,\r\n // \"VAT5\"\r\n VAT5 = 4,\r\n // \"ZERO\"\r\n ZERO = 5\r\n }\r\n}","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class InvoicingAssignment extends Assignment {\r\n \r\n // RATES\r\n public rates: InvoicingAssignmentRate[] = [];\r\n // CUSTOMER\r\n public customer: Customer = null;\r\n // CURRENCYCODE\r\n public currencyCode: number = 0;\r\n // ISSELFBILLING\r\n public isSelfBilling: boolean = false;\r\n // NARRATIVE\r\n public narrative: string = null;\r\n // PONUMBER\r\n public poNumber: string = null;\r\n // DEEMED\r\n public deemed: boolean = false;\r\n // REMITTANCEADDRESS\r\n public remittanceAddress: NamedAddress = null;\r\n // COMPANYNO\r\n public companyNo: string = null;\r\n // VATNO\r\n public vatNo: string = null;\r\n // ISRAISEDINERROR\r\n public isRaisedInError: boolean = false;\r\n // VATSTATUS\r\n public vatStatus: Shared.VatProdPostingGroup;\r\n // VATBUSINESSPOSTINGGROUP \r\n public vatBusinessPostingGroup: VatBusinessPostingGroup; \r\n // VATREGSTATUS\r\n public vatRegStatus: number = 0;\r\n\r\n public defaultHours: number = 0;\r\n public invoiceDistributionEnabled: boolean = false;\r\n }\r\n}\r\n","/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class NavCompanyInformation {\r\n \r\n // COMPANYTYPE\r\n public companyType: Shared.AccountType = null;\r\n // COMPANYNAME\r\n public companyName: string = null;\r\n // COMPANYREGISTRATIONNO\r\n public companyRegistrationNo: string = null;\r\n // COMPANYREFERENCE\r\n public companyReference: string = null;\r\n // DIRECTORSNAME\r\n public directorsName: string = null;\r\n // VATREGISTRATIONNO\r\n public vatRegistrationNo: string = null;\r\n // BANKACCOUNTS\r\n public bankAccounts: BankAccount[] = [];\r\n // ASSIGNMENTS\r\n public assignments: Shared.InvoicingAssignment[] = [];\r\n //CORPORATIONTAXREFNO\r\n public corporationTaxRefNo: string = null;\r\n public cisEnabled: boolean;\r\n }\r\n}\r\n","/// \r\n\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n\r\n export class Member {\r\n\r\n // MEMBERID\r\n public memberID: number = 0;\r\n // ALTMEMBERID\r\n public altMemberID: number = 0;\r\n // FIRSTNAME\r\n public firstname: string = null;\r\n // LASTNAME\r\n public lastname: string = null;\r\n // EMAIL\r\n public email: string = null;\r\n // GROUPS\r\n public groups: string = null;\r\n // USERNAME\r\n public username: string = null;\r\n // PERSONALTAXACTIVE\r\n public personalTaxActive: boolean = false;\r\n // COMPANYREF\r\n public companyRef: string = null;\r\n // USERTYPE\r\n public userType: number = 0;\r\n // ACCOUNTTYPE\r\n public accountType: AccountType = null;\r\n // USESTSTYLEINVOICING\r\n public useSTStyleInvoicing: boolean = false;\r\n // ISACTIVE\r\n public isActive: boolean = false;\r\n // DATEOFBIRTH\r\n public dateOfBirth: Date = null;\r\n // CREATEDDATE\r\n public createdDate: Date = null;\r\n\r\n public businessType: string = null;\r\n\r\n public role: string = null;\r\n\r\n public connect2Enabled: boolean = false;\r\n public companyName: string = null;\r\n }\r\n}\r\n","module Shared {\r\n export class StatePensionAge {\r\n birthDate: Date;\r\n pensionDate: Date;\r\n age: number; \r\n }\r\n}","module Shared {\r\n export class IR35AssessmentAnswers {\r\n participate: boolean;\r\n jobTitle: string;\r\n sector: string;\r\n agencyName: string;\r\n clientName: string;\r\n rateOfPay: number;\r\n employeeOfCurrentClientBeforeContract: boolean;\r\n sameTypeOfWork: boolean;\r\n definedProject: string;\r\n assignmentLengthMonths: number;\r\n coveringPermanentEmployee: string;\r\n spokenToHirer: boolean;\r\n viewOnIr35Status: string;\r\n }\r\n}","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n\r\n/// \r\n\r\nmodule Shared {\r\n export class MemberModel {\r\n public userName: string = \"\";\r\n public token: string = \"\";\r\n public refreshToken: string = \"\";\r\n public isAdmin: boolean = false;\r\n public isAuthenticated: boolean = false;\r\n public memberId: string = \"\";\r\n public serviceLines: Array;\r\n public useRefreshToken: boolean = false;\r\n public hasUmbBusinessType: boolean = false;\r\n public hasLtdBusinessType: boolean = false;\r\n public hasMulipleLtdCompanies: boolean = false;\r\n public umbCustomerReference: string = \"\";\r\n public ltdCustomerReference: string = \"\";\r\n public companyRef: string = \"\";\r\n public businessType: string = \"\";\r\n public role: string = \"\";\r\n public expires: string = \"\";\r\n public refreshTokenExpires: string = \"\";\r\n public navReferral: string = \"\";\r\n public companyName: string = \"\";\r\n public apiKeySource: string = \"\";\r\n }\r\n\r\n export interface IMemberService {\r\n member: MemberModel;\r\n\r\n setMember(data: MemberModel): MemberModel;\r\n getMember(): MemberModel;\r\n getMemberBusinessType(): string;\r\n updateMember(data: MemberModel): MemberModel;\r\n clearMember(): void;\r\n getMemberDetails(silentMode?: boolean, cached?: boolean): ng.IPromise;\r\n getPensionAge(silentMode?: boolean, cached?: boolean): ng.IPromise;\r\n showMemberMTD(): ng.IPromise;\r\n insertAuthorsationCode(authorisationCode: number): ng.IPromise; \r\n getHasAdvisoryKeyInformation(): ng.IPromise;\r\n getHasAdvisoryKeyInformationUmbrella(): ng.IPromise;\r\n }\r\n\r\n export class MemberService implements IMemberService {\r\n\r\n static $inject: Array = ['$injector', \"localStorageService\", 'Analytics'];\r\n\r\n public member: MemberModel;\r\n public $http: Shared.IBrooksonHttp;\r\n\r\n constructor(\r\n public $injector: ng.auto.IInjectorService,\r\n public localStorageService: ng.local.storage.ILocalStorageService,\r\n public analytics: any\r\n ) {\r\n this.member = new MemberModel();\r\n }\r\n\r\n public isMiniConnectUser = (): boolean => {\r\n if (this.member.serviceLines) {\r\n let line: ServiceLine[] = _.filter(this.member.serviceLines, (o: ServiceLine): boolean => o.customerReference === this.member.companyRef);\r\n\r\n if (line.length > 0) {\r\n if ((line[0].isSecondShareholder === true) || ((line[0].isEligible === true) && (line[0].isActive === false))) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n public companyName = (): string => {\r\n if (this.member.serviceLines) {\r\n let line: ServiceLine[] = _.filter(this.member.serviceLines, (o: ServiceLine): boolean => o.customerReference === this.member.companyRef);\r\n \r\n if(line[0])\r\n {\r\n return line[0].companyName;\r\n }\r\n if(this.member.companyName)\r\n {\r\n return this.member.companyName;\r\n }\r\n }\r\n }\r\n\r\n\r\n setMember = (data: MemberModel): MemberModel => {\r\n //set in memory values\r\n this.member = _.assign(this.member, data);\r\n this.member.businessType = this.getMemberBusinessType();\r\n\r\n //persist changes\r\n this.localStorageService.set(\"brookson.member\", this.member);\r\n\r\n this.analytics.set(\"dimension1\", this.member.memberId);\r\n this.analytics.set(\"dimension2\", this.member.businessType);\r\n this.analytics.set(\"dimension3\", this.member.companyRef);\r\n this.analytics.set(\"dimension4\", this.member.isAdmin ? \"Y\" : \"N\");\r\n return this.member;\r\n }\r\n\r\n public getMember = (): MemberModel => {\r\n if (!this.member || !this.member.userName) {\r\n let store: MemberModel = this.localStorageService.get(\"brookson.member\");\r\n if (store) {\r\n this.member = store;\r\n }\r\n }\r\n\r\n return this.member;\r\n }\r\n\r\n getMemberBusinessType = (): string => {\r\n let member = this.member;\r\n\r\n // If there's service lines, return the one matching business type from here\r\n if (member.serviceLines) {\r\n let line: ServiceLine[] = _.filter(member.serviceLines, (o: ServiceLine): boolean => o.customerReference === member.companyRef);\r\n if(line[0])\r\n {\r\n return line[0].businessType;\r\n } else \r\n {\r\n return member.businessType;\r\n }\r\n \r\n } else {\r\n return member.businessType;\r\n }\r\n }\r\n\r\n updateMember = (data: MemberModel): MemberModel => {\r\n return this.setMember(data);\r\n }\r\n\r\n clearMember = (): void => {\r\n this.member = null;\r\n this.localStorageService.set(\"brookson.member\", {});\r\n this.localStorageService.set(\"brookson.dashboard\", {});\r\n }\r\n\r\n getMemberDetails = (silentMode?: boolean, cached?: boolean): ng.IPromise => {\r\n this.$http = this.$http || this.$injector.get('$http');\r\n return this.$http.get('api/Member/GetMemberDetails', {\r\n silentMode: silentMode ? silentMode : silentMode,\r\n cache: cached ? cached : false\r\n }).then((response: ng.IHttpPromiseCallbackArg): Member => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getPensionAge = (silentMode?: boolean, cached?: boolean): ng.IPromise => {\r\n const config = {\r\n silentMode: silentMode ? silentMode : false,\r\n cache: cached ? cached : false\r\n };\r\n\r\n return this.$http.get('api/Member/PensionAge', config).then((response: ng.IHttpPromiseCallbackArg): StatePensionAge => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getHasAdvisoryKeyInformation(silentMode?: boolean, cached?: boolean): ng.IPromise {\r\n const config = {\r\n silentMode: silentMode ? silentMode : false,\r\n cache: cached ? cached : false\r\n };\r\n\r\n var hasAdvisor = this.$http.get('api/Advisory/HasAdvisoryKeyInformation', config).then((response: ng.IHttpPromiseCallbackArg): boolean => {\r\n return response.data;\r\n });\r\n\r\n return hasAdvisor;\r\n }\r\n\r\n getHasAdvisoryKeyInformationUmbrella(silentMode?: boolean, cached?: boolean): ng.IPromise {\r\n const config = {\r\n silentMode: silentMode ? silentMode : false,\r\n cache: cached ? cached : false\r\n };\r\n\r\n var hasAdvisor = this.$http.get('api/Advisory/HasAdvisoryKeyInformationUmbrella', config).then((response: ng.IHttpPromiseCallbackArg): boolean => {\r\n return response.data;\r\n });\r\n\r\n return hasAdvisor;\r\n }\r\n\r\n showMemberMTD(): ng.IPromise {\r\n return this.$http.get('api/Member/ShowMemberMTD').then((response: ng.IHttpPromiseCallbackArg): boolean => {\r\n return response.data;\r\n });\r\n }\r\n \r\n insertAuthorsationCode(authorisationCode: number): ng.IPromise {\r\n const requestData = {\r\n authorisationCode: authorisationCode\r\n };\r\n return this.$http.post('api/Member/InsertMTDAuthorisationCode', requestData)\r\n .then((response: ng.IHttpPromiseCallbackArg): boolean => {\r\n return response.data;\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular.module('app.shared').service('memberSrv', Shared.MemberService);","module Shared {\r\n export class NAVNationality {\r\n code: string = null;\r\n nationality: string = null;\r\n }\r\n}","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n export interface IAccountService {\r\n getAccountDetailsForUser(): ng.IPromise;\r\n updateAccountDetailsForUser(personalInformation: NavPersonalInformation, password: string): ng.IPromise;\r\n getNationalities(silentMode?: boolean): ng.IPromise>;\r\n getCommonPasswords(silentMode?: boolean): ng.IPromise>;\r\n\r\n company: NavCompanyInformation;\r\n personalInformation: NavPersonalInformation;\r\n }\r\n\r\n export class AccountService implements IAccountService {\r\n member: Shared.MemberModel;\r\n personalInformation: NavPersonalInformation;\r\n businessInformation: NavBusinessInformation;\r\n company: NavCompanyInformation;\r\n\r\n static $inject = ['$http', 'memberSrv'];\r\n\r\n constructor(private $http: Shared.IBrooksonHttp, private memberSrv: Shared.IMemberService) {\r\n this.member = memberSrv.getMember();\r\n }\r\n\r\n getAccountDetailsForUser = (): ng.IPromise => {\r\n return this.$http.get('api/Account/GetAccountDetailsForUser').then((response: ng.IHttpPromiseCallbackArg) => {\r\n if (response.data) {\r\n this.personalInformation = response.data.personalInformation;\r\n this.businessInformation = response.data.businessInformation;\r\n this.company = _.find(response.data.businessInformation.companies, (company: NavCompanyInformation) => {\r\n return company.companyReference === this.member.companyRef;\r\n });\r\n _.each(this.company.bankAccounts, (bankAccount: Shared.BankAccount) => {\r\n bankAccount.bankName = bankAccount.bankName.toLowerCase();\r\n });\r\n }\r\n\r\n return response.data;\r\n });\r\n }\r\n\r\n updateAccountDetailsForUser = (personalInformation: NavPersonalInformation, password: string): ng.IPromise => {\r\n return this.$http.post('api/Account/UpdateAccountDetailsForUser', {\r\n personalInformation: personalInformation,\r\n password: password\r\n }).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getNationalities = (silentMode?: boolean): ng.IPromise> => {\r\n return this.$http.get('api/Account/GetNationalities', {\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg>) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getCommonPasswords = (silentMode?: boolean): ng.IPromise> => {\r\n return this.$http.get('api/Account/common-passwords', {\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg>) => {\r\n return response.data;\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .service('accountSrv', Shared.AccountService);","/// \r\n\r\nvar shared = angular.module('app.shared');\r\n\r\nshared.directive('brooksonBackTop', () => {\r\n return {\r\n restrict: 'AE',\r\n templateUrl: 'src/app/shared/views/ui/brookson.ui.back-top.html'\r\n };\r\n});\r\n\r\nshared.directive('backTop', ['$window', 'brookson.ui.scroll-top', ($window, brooksonScrollTop) => {\r\n return {\r\n restrict: 'E',\r\n transclude: true,\r\n replace: true,\r\n template: '
      ',\r\n scope: {\r\n icon: \"@buttonIcon\",\r\n speed: \"@scrollSpeed\",\r\n theme: \"@buttonTheme\",\r\n yTrigger: \"@yTrigger\"\r\n },\r\n link: (scope, element) => {\r\n\r\n scope.text = scope.text || 'Scroll top';\r\n scope.speed = parseInt(scope.speed, 10) || 300;\r\n scope.theme = scope.theme || 'light';\r\n scope.button = element.find('button');\r\n\r\n scope.button.on('click', () => {\r\n brooksonScrollTop.smoothScroll(scope.speed);\r\n element.removeClass('show');\r\n });\r\n\r\n $window.addEventListener('scroll', () => {\r\n var top = ($window.scrollY || $window.pageYOffset);\r\n if (top >= (scope.yTrigger)) {\r\n element.addClass('show');\r\n } else {\r\n element.removeClass('show');\r\n }\r\n });\r\n }\r\n };\r\n\r\n}]);\r\n","/// \r\n\r\n(() => {\n 'use strict';\n\n var appShared = angular.module(\"app.shared\");\n\n appShared.directive('brooksonUiSelectRequired', [() => {\r\n return {\r\n restrict: 'A',\r\n require: '^ngModel',\r\n link: (scope, el, attrs, ngModel) => {\r\n var validate = (value) => {\r\n ngModel.$setValidity('brooksonUiSelectRequired', value !== null && value !== undefined && value !== \"\" && value.titleText !== \"\");\r\n };\r\n\r\n if (scope.$eval(attrs.brooksonUiSelectRequired)) {\r\n ngModel.$parsers.unshift((value) => {\r\n validate(value);\r\n return value;\r\n });\r\n\r\n ngModel.$formatters.unshift((value) => {\r\n validate(value);\r\n return value;\r\n });\r\n }\r\n }\r\n };\r\n }]);\n})();","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n var appShared = angular.module(\"app.shared\");\r\n\r\n appShared.directive('brooksonValidateHighlight', () => {\r\n return {\r\n restrict: 'A',\r\n require: '^form',\r\n link: (scope, el, attrs, formCtrl) => {\r\n // find the text box element, which has the 'name' attribute\r\n var inputEl = el[0].querySelector(\"[name]\");\r\n // convert the native text box element to an angular element\r\n var inputNgElement = angular.element(inputEl);\r\n // get the name on the text box so we know the property to check\r\n // on the form controller\r\n\r\n inputNgElement.bind('keyup blur change focus input', () => {\r\n\r\n var inputName = inputNgElement.attr('name');\r\n\r\n if (!inputName) {\r\n return;\r\n }\r\n\r\n if (formCtrl[inputName] && formCtrl[inputName].$invalid && formCtrl[inputName].$touched) {\r\n el.addClass(\"has-error\");\r\n } else {\r\n el.removeClass(\"has-error\");\r\n }\r\n });\r\n }\r\n };\r\n });\r\n})();\r\n","/// \r\n\r\n(() => {\n \"use strict\";\n\n var appShared = angular.module(\"app.shared\");\n\n appShared.directive(\"brooksonWithinSameVatScheme\", [() => {\r\n return {\r\n restrict: \"A\",\r\n require: \"^ngModel\",\r\n link: (scope, el, attrs, ngModel) => {\r\n var validate = (value) => {\r\n var isValid = value === null || value === undefined || value === \"\";\r\n\r\n if (!isValid) {\r\n const vatScheme = scope.$eval(attrs.brooksonWithinSameVatScheme);\r\n isValid = _.every(scope.$eval(attrs.brooksonAllExpenses),\r\n e => {\r\n var expense = e as any;\r\n return expense.markedAsDelete || expense.effectiveVatScheme === vatScheme;\r\n });\r\n }\r\n\r\n ngModel.$setValidity(\"brooksonWithinSameVatScheme\", isValid);\r\n };\r\n\r\n ngModel.$parsers.unshift((value) => {\r\n validate(value);\r\n return value;\r\n });\r\n\r\n ngModel.$formatters.unshift((value) => {\r\n validate(value);\r\n return value;\r\n });\r\n }\r\n };\r\n }]);\n})();","/// \r\n\r\n(() => {\r\n\tangular.module('app.shared')\r\n\r\n.run(['$rootScope', ($rootScope) => {\r\n\t$rootScope.typeOf = (value) => {\r\n\t\treturn typeof value;\r\n\t};\r\n}])\r\n\r\n.directive('stringToNumber', () => {\r\n\treturn {\r\n\t\trequire: 'ngModel',\r\n\t\tlink: (scope, element, attrs, ngModel: any) => {\r\n\t\t\tngModel.$parsers.push((value) => {\r\n\t\t\t\treturn '' + value;\r\n\t\t\t});\r\n\t\t\tngModel.$formatters.push((value) => {\r\n\t\t\t\treturn parseFloat(value);\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n});\r\n})();\r\n","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular\r\n .module('app.shared')\r\n .directive('brooksonInfiniteScroll', brooksonInfiniteScroll);\r\n\r\n brooksonInfiniteScroll.$inject = ['$window'];\r\n function brooksonInfiniteScroll($window) {\r\n // Usage:\r\n //\r\n // Creates:\r\n //\r\n var directive = {\r\n link: link,\r\n restrict: 'A',\r\n scope:{\r\n onScroll:\"&\",\r\n scrollBusy:\"=\"\r\n }\r\n };\r\n return directive;\r\n\r\n function link(scope, elem, attrs) {\r\n $window = angular.element($window);\r\n var scrollDistance = 0;\r\n\r\n angular.element($window).bind('scroll', handler);\r\n scope.$on('$destroy', () => {\r\n return $window.unbind('scroll', handler);\r\n });\r\n function handler() {\r\n if (!scope.scrollBusy) {\r\n var elementBottom, remaining, shouldScroll, windowBottom;\r\n windowBottom = $window.height() + $window.scrollTop();\r\n elementBottom = elem.offset().top + elem.height();\r\n remaining = elementBottom - windowBottom;\r\n shouldScroll = remaining <= $window.height() * scrollDistance;\r\n\r\n if (shouldScroll) {\r\n scope.$apply(scope.onScroll);\r\n }\r\n }\r\n }\r\n }\r\n\r\n\r\n }\r\n\r\n})();\r\n","// $Classes/Enums/Interfaces(filter)[template][separator]\r\n// filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n// template: The template to repeat for each matched item\r\n// separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n// More info: http://frhagn.github.io/Typewriter/\r\n\r\nmodule Shared {\r\n export enum SelfAssessmentSectionStatus {\r\n notStarted = 0,\r\n notRequired = 1,\r\n inProgress = 2,\r\n completed = 3,\r\n submitted = 4,\r\n }\r\n}\r\n","/// \r\n/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular\r\n .module('app.shared')\r\n .directive('brooksonUiAside', brooksonUiAside);\r\n\r\n brooksonUiAside.$inject = ['$q', '$templateRequest', '$compile', '$document', '$injector'];\r\n function brooksonUiAside($q, $templateRequest, $compile, $document, $injector) {\r\n // Usage:\r\n //\r\n // Creates:\r\n //\r\n var directive = {\r\n bindToController: true,\r\n controller: ['$scope', '$rootScope', '$document', '$injector', brooksonAsideController],\r\n controllerAs: 'vm',\r\n link: link,\r\n restrict: 'E',\r\n scope: {\r\n template: '=',\r\n show: '=',\r\n templateUrl:'=',\r\n asideClass:'=',\r\n appSettings: '=',\r\n summaryForms: '=',\r\n colorOverride: '=',\r\n isSelfAssessment: '='\r\n }\r\n };\r\n return directive;\r\n\r\n function link(scope, element, attrs) {\r\n\r\n if (scope.vm.isSelfAssessment) {\r\n var selfAssessmentFactory = $injector.get('selfAssessmentFactory');\r\n selfAssessmentFactory.getSummary();\r\n }\r\n\r\n var opts = {\r\n template: attrs.template,\r\n templateUrl: attrs.templateUrl,\r\n };\r\n\r\n\r\n getTemplatePromise(opts).then((template) => {\r\n var body = $document.find('body').eq(0);\r\n var menu = '
      ' + template + '
      ';\r\n if (scope.vm.colorOverride) { menu = '
      ' + template + '
      '; }\r\n var comp = $compile(menu)(scope);\r\n body.append(comp);\r\n });\r\n\r\n }\r\n\r\n function getTemplatePromise(options) {\r\n return options.template ? $q.when(options.template) :\r\n $templateRequest(angular.isFunction(options.templateUrl) ? (options.templateUrl)() : options.templateUrl);\r\n }\r\n }\r\n /* @ngInject */\r\n function brooksonAsideController($scope, $rootScope, $document, $injector) {\r\n var vm = this;\r\n\r\n if (vm.isSelfAssessment) {\r\n var selfAssessmentFactory = $injector.get('selfAssessmentFactory');\r\n vm.selfAssessment = selfAssessmentFactory;\r\n }\r\n \r\n\r\n vm.sectionStatusEnum = Shared.SelfAssessmentSectionStatus;\r\n\r\n $scope.$watch('vm.show', (newValue, oldValue) => {\r\n\r\n\r\n if (newValue === true) {\r\n vm.showAside();\r\n } else {\r\n vm.hideAside();\r\n }\r\n });\r\n // this will listen for route changes and call the callback\r\n $rootScope.$on('$stateChangeStart', () => {\r\n vm.show = false;\r\n });\r\n\r\n vm.showAside = () => {\r\n $document.find('.aside-container').addClass('in');\r\n $document.find('.aside-container').removeClass('out');\r\n };\r\n\r\n vm.hideAside = () => {\r\n $document.find('.aside-container').addClass('out');\r\n $document.find('.aside-container').removeClass('in');\r\n };\r\n }\r\n})();\r\n","/// \r\n\r\nvar shared = angular.module('app.shared');\r\n\r\nshared.directive('brooksonImageNotFound', () => {\r\n\treturn {\r\n\t\trestrict: 'AE',\r\n\t\ttemplateUrl: 'src/app/shared/views/ui/brookson.ui.image-not-found.html'\r\n\t};\r\n});\r\n","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n var appShared = angular.module('app.shared');\r\n\r\n appShared.directive('hideMobile', ['$compile', '$detection', hideMobileController]);\r\n\r\n function hideMobileController($compile, $detection) {\r\n var directive = {\r\n controller: ['$scope', '$element', '$attrs', '$compile', controller],\r\n restrict: 'A'\r\n };\r\n return directive;\r\n\r\n function controller($scope, $element, $attrs) {\r\n if (!$attrs.ngIf && ($detection.isiOS() || $detection.isAndroid() || $detection.isWindowsPhone())) {\r\n $attrs.$set('ng-if', false);\r\n $compile($element)($scope);\r\n } else if (!$attrs.ngIf) {\r\n $attrs.$set('ng-if', true);\r\n $compile($element)($scope);\r\n }\r\n }\r\n }\r\n\r\n appShared.directive('showMobile', ['$compile', '$detection', showMobileController]);\r\n\r\n function showMobileController($compile, $detection) {\r\n var directive = {\r\n controller: ['$scope', '$element', '$attrs', '$compile', controller],\r\n restrict: 'A'\r\n };\r\n return directive;\r\n\r\n function controller($scope, $element, $attrs) {\r\n if (!$attrs.ngIf && ($detection.isiOS() || $detection.isAndroid() || $detection.isWindowsPhone())) {\r\n $attrs.$set('ng-if', true);\r\n $compile($element)($scope);\r\n } else if (!$attrs.ngIf) {\r\n $attrs.$set('ng-if', false);\r\n $compile($element)($scope);\r\n }\r\n }\r\n }\r\n\r\n appShared.directive('hideIos', ['$compile', '$detection', hideIosController]);\r\n\r\n function hideIosController($compile, $detection) {\r\n var directive = {\r\n controller: ['$scope', '$element', '$attrs', '$compile', controller],\r\n restrict: 'A'\r\n };\r\n return directive;\r\n\r\n function controller($scope, $element, $attrs) {\r\n if (!$attrs.ngHide && $detection.isiOS()) {\r\n $attrs.$set('ng-hide', true);\r\n $compile($element)($scope);\r\n }\r\n }\r\n }\r\n\r\n appShared.directive('showIos', ['$compile', '$detection', showIosController]);\r\n\r\n function showIosController($compile, $detection) {\r\n var directive = {\r\n controller: ['$scope', '$element', '$attrs', '$compile', controller],\r\n restrict: 'A'\r\n };\r\n return directive;\r\n\r\n function controller($scope, $element, $attrs) {\r\n if (!$attrs.ngShow && $detection.isiOS()) {\r\n $attrs.$set('ng-show', true);\r\n $compile($element)($scope);\r\n }\r\n }\r\n }\r\n\r\n appShared.directive('hideAndroid', ['$compile', '$detection', hideAndroidController]);\r\n\r\n function hideAndroidController($compile, $detection) {\r\n var directive = {\r\n controller: ['$scope', '$element', '$attrs', '$compile', controller],\r\n restrict: 'A'\r\n };\r\n return directive;\r\n\r\n function controller($scope, $element, $attrs) {\r\n if (!$attrs.ngHide && $detection.isAndroid()) {\r\n $attrs.$set('ng-hide', true);\r\n $compile($element)($scope);\r\n }\r\n }\r\n }\r\n\r\n appShared.directive('showAndroid', ['$compile', '$detection', showAndroidController]);\r\n\r\n function showAndroidController($compile, $detection) {\r\n var directive = {\r\n controller: ['$scope', '$element', '$attrs', '$compile', controller],\r\n restrict: 'A'\r\n };\r\n return directive;\r\n\r\n function controller($scope, $element, $attrs) {\r\n if (!$attrs.ngShow && $detection.isAndroid()) {\r\n $attrs.$set('ng-show', true);\r\n $compile($element)($scope);\r\n }\r\n }\r\n }\r\n\r\n appShared.directive('hideWindowsPhone', ['$compile', '$detection', hideWindowsPhoneController]);\r\n\r\n function hideWindowsPhoneController($compile, $detection) {\r\n var directive = {\r\n controller: ['$scope', '$element', '$attrs', '$compile', controller],\r\n restrict: 'A'\r\n };\r\n return directive;\r\n\r\n function controller($scope, $element, $attrs) {\r\n if (!$attrs.ngHide && $detection.isWindowsPhone()) {\r\n $attrs.$set('ng-hide', true);\r\n $compile($element)($scope);\r\n }\r\n }\r\n }\r\n\r\n appShared.directive('showWindowsIos', ['$compile', '$detection', showWindowsPhoneController]);\r\n\r\n function showWindowsPhoneController($compile, $detection) {\r\n var directive = {\r\n controller: ['$scope', '$element', '$attrs', '$compile', controller],\r\n restrict: 'A'\r\n };\r\n return directive;\r\n\r\n function controller($scope, $element, $attrs) {\r\n if (!$attrs.ngShow && $detection.isWindowsPhone()) {\r\n $attrs.$set('ng-show', true);\r\n $compile($element)($scope);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * IF\r\n *\r\n */\r\n appShared.directive('ifDesktop', ['$compile', '$detection', ifNotMobileController]);\r\n\r\n function ifNotMobileController($compile, $detection) {\r\n var directive = {\r\n controller: ['$scope', '$element', '$attrs', '$compile', controller],\r\n restrict: 'A'\r\n };\r\n return directive;\r\n\r\n function controller($scope, $element, $attrs) {\r\n if (!$attrs.ngIf && ($detection.isiOS() || $detection.isAndroid() || $detection.isWindowsPhone())) {\r\n $attrs.$set('ng-if', false);\r\n $compile($element)($scope);\r\n } else if (!$attrs.ngIf) {\r\n $attrs.$set('ng-if', true);\r\n $compile($element)($scope);\r\n }\r\n }\r\n }\r\n\r\n appShared.directive('ifMobile', ['$compile', '$detection', ifMobileController]);\r\n\r\n function ifMobileController($compile, $detection) {\r\n var directive = {\r\n controller: ['$scope', '$element', '$attrs', '$compile', controller],\r\n restrict: 'A'\r\n };\r\n return directive;\r\n\r\n function controller($scope, $element, $attrs) {\r\n if (!$attrs.ngIf && ($detection.isiOS() || $detection.isAndroid() || $detection.isWindowsPhone())) {\r\n $attrs.$set('ng-if', true);\r\n $compile($element)($scope);\r\n } else if (!$attrs.ngIf) {\r\n $attrs.$set('ng-if', false);\r\n $compile($element)($scope);\r\n }\r\n }\r\n }\r\n})();\r\n","module app.shared {\r\n 'use strict';\r\n\r\n export interface IUnsavedWarningSharedService {\r\n }\r\n export class UnsavedWarningSharedService implements IUnsavedWarningSharedService {\r\n\r\n\r\n static $inject: Array = ['$rootScope', '$injector', '$location', '$state', 'brookson.ui.popup'];\r\n constructor(private $rootScope, private $injector, private $location, private $state, private brooksonPopup) {\r\n\r\n }\r\n private ignoreEvent: boolean = false;\r\n private allFormsArray = [];\r\n private messages = {\r\n navigate: 'You will lose unsaved changes if you leave this page',\r\n reload: 'You will lose unsaved changes if you reload this page'\r\n };\r\n private removeFunctions: Array = [angular.noop];\r\n private routeEvent = ['$locationChangeStart', '$stateChangeStart'];\r\n public allForms = () => {\r\n return this.allFormsArray;\r\n }\r\n\r\n public allFormsClean = () => {\r\n let cleanFormCount: number = 0;\r\n angular.forEach(this.allFormsArray, (item, idx) => {\r\n if (item.$dirty) {\r\n cleanFormCount++;\r\n }\r\n });\r\n return cleanFormCount === 0; // no dirty forms were found\r\n }\r\n public init = (form) => {\r\n if (this.allFormsArray.length === 0) this.setup();\r\n this.allFormsArray.push(form);\r\n }\r\n\r\n public removeForm = (form) => {\r\n var idx = this.allFormsArray.indexOf(form);\r\n\r\n if (idx === -1) return;\r\n\r\n this.allFormsArray.splice(idx, 1);\r\n\r\n if (this.allFormsArray.length === 0) this.tearDown();\r\n }\r\n\r\n public tearDown = () => {\r\n angular.forEach(this.removeFunctions, (fn: Function) => {\r\n fn();\r\n });\r\n window.onbeforeunload = null;\r\n this.ignoreEvent = false;\r\n }\r\n\r\n public confirmExit = () => {\r\n if (!this.allFormsClean()) return this.messages.reload;\r\n \r\n }\r\n\r\n public setup = (): void => {\r\n\r\n window.onbeforeunload = this.confirmExit;\r\n\r\n var eventsToWatchFor = this.routeEvent;\r\n\r\n angular.forEach(eventsToWatchFor, (aEvent) => {\r\n // calling this function later will unbind this, acting as $off()\r\n var removeFn = this.$rootScope.$on(aEvent, (event, next, current) => {\r\n if (!this.allFormsClean() && !this.ignoreEvent) {\r\n this.ignoreEvent = true;\r\n event.preventDefault();\r\n this.brooksonPopup.showYesNoPopup(\"Unsaved Changes\", this.messages.navigate).then((result) => {\r\n this.completeEvent(event, next);\r\n }).catch((er) => {\r\n this.ignoreEvent = false;\r\n\r\n });\r\n\r\n } else {\r\n }\r\n\r\n });\r\n this.removeFunctions.push(removeFn);\r\n });\r\n }\r\n\r\n public completeEvent = (event, next): void => {\r\n switch (event.name) {\r\n case '$locationChangeStart':\r\n this.$location.path(next);\r\n break;\r\n case '$stateChangeStart':\r\n this.$state.go(next);\r\n break;\r\n default:\r\n break;\r\n }\r\n }\r\n\r\n }\r\n\r\n angular\r\n .module('app.shared')\r\n .service('unsavedWarningSharedService', UnsavedWarningSharedService);\r\n}\r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular.module(\"app.shared\").directive('confirmOnExit', ['unsavedWarningSharedService', (unsavedWarningSharedService) => {\r\n\r\n return {\r\n require: 'form',\r\n link: (scope, formElement, attrs, formCtrl) => {\r\n\r\n // register this form\r\n unsavedWarningSharedService.init(formCtrl);\r\n\r\n // bind to form submit, this makes the typical submit button work\r\n // in addition to the ability to bind to a seperate button which clears warning\r\n formElement.bind('submit', (event) => {\r\n if (formCtrl.$valid) {\r\n formCtrl.$setPristine();\r\n }\r\n });\r\n\r\n // @todo check destroy on clear button too? \r\n scope.$on('$destroy', () => {\r\n unsavedWarningSharedService.removeForm(formCtrl);\r\n });\r\n }\r\n };\r\n }]);\r\n\r\n\r\n})();","module Shared {\r\n export class CommonValues {\r\n static pensionAge: number = 65;\r\n }\r\n}","module Shared {\r\n export enum DocumentDataSource {\r\n MemberWebDocuments = 0,\r\n QueueService = 1,\r\n MoleData = 2,\r\n Dropbox = 3\r\n }\r\n}","module Shared {\r\n export enum ExpenseTypeRef {\r\n EXPENSE = 0,\r\n MILEAGE,\r\n ALLOWANCE\r\n }\r\n}","module Shared {\r\n export enum ExpenseWarningCodeTypes {\r\n HighRisk = 1,\r\n Amount = 2,\r\n TwentyFourMonthRule = 3,\r\n }\r\n}","module Shared {\r\n export enum FileView {\r\n DETAILED,\r\n THUMBNAIL,\r\n }\r\n}","\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export enum FuelType {\r\n notKnown = 0,\r\n petrol = 1,\r\n diesel = 2,\r\n lpg = 3,\r\n }\r\n}","module Shared {\r\n export enum ImageSize {\r\n ORIGINAL,\r\n CUSTOM,\r\n ASPECTRATIO\r\n }\r\n}","module Shared {\r\n export class IndustryList {\r\n static aerospaceAndDefence: string = \"Aerospace and Defence\"; \r\n static automotiveAndMotorsport: string = \"Automotive and Motorsport\"; \r\n static buildingConstructionInfrastructure: string = \"Building, Construction and Infrastructure\"; \r\n static businessServices: string = \"Business Services\"; \r\n static energySectorOfficeBased: string = \"Energy sector (office based)\"; \r\n static energySectorOffshoreSiteBased: string = \"Energy sector (offshore/sitebased)\"; \r\n static financialService: string = \"Financial Services\"; \r\n static informationTechnology: string = \"Information Technology\"; \r\n static lifeSciences: string = \"Life Sciences\"; \r\n static marineAndShipbuilding: string = \"Marine and Shipbuilding\"; \r\n static mediaAndCreative: string = \"Media and Creative\"; \r\n static medicalAndHealthcare: string = \"Medical and Healthcare\"; \r\n static railAndTransportation: string = \"Rail and Transportation\"; \r\n static telecommunications: string = \"Telecommunications\"; \r\n static utilities: string = \"Utilities\"; \r\n static other: string = \"Other\"; \r\n\r\n static getArray() : Array {\r\n return [IndustryList.aerospaceAndDefence, \r\n IndustryList.automotiveAndMotorsport, \r\n IndustryList.buildingConstructionInfrastructure, \r\n IndustryList.businessServices, \r\n IndustryList.energySectorOfficeBased, \r\n IndustryList.energySectorOffshoreSiteBased, \r\n IndustryList.financialService, \r\n IndustryList.informationTechnology, \r\n IndustryList.lifeSciences, \r\n IndustryList.marineAndShipbuilding, \r\n IndustryList.mediaAndCreative, \r\n IndustryList.medicalAndHealthcare, \r\n IndustryList.railAndTransportation, \r\n IndustryList.telecommunications, \r\n IndustryList.utilities, \r\n IndustryList.other];\r\n }\r\n }\r\n}","module Shared {\r\n export enum InvoiceCreationStatus {\r\n Override,\r\n Successful,\r\n Exception\r\n }\r\n}","module Shared {\r\n export enum SdcOutcomeType {\r\n NoChange = -1,\r\n NotAssessed = 0,\r\n Fail = 1,\r\n AwaitingEndClient = 2,\r\n FailedEndClient = 3,\r\n Pass = 4\r\n }\r\n\r\n export class SdcOutcomeTypeParser {\r\n public static getDescription = (value: Shared.SdcOutcomeType): string => {\r\n switch (value) {\r\n case Shared.SdcOutcomeType.NoChange:\r\n return 'No Changes';\r\n case Shared.SdcOutcomeType.NotAssessed:\r\n return 'Not Assessed';\r\n case Shared.SdcOutcomeType.Fail:\r\n return 'Failed';\r\n case Shared.SdcOutcomeType.AwaitingEndClient:\r\n return 'Awaiting End Client';\r\n case Shared.SdcOutcomeType.FailedEndClient:\r\n return 'Failed End Client';\r\n case Shared.SdcOutcomeType.Pass:\r\n return 'Passed';\r\n default:\r\n return '';\r\n }\r\n }\r\n }\r\n}","module Shared {\r\n export enum SelectedPackageEnum {\r\n umbrella,\r\n umbrellaProtect\r\n }\r\n}\r\n","module Shared {\r\n export enum SubmitPersonalSignificantControl {\r\n noResponse,\r\n yes,\r\n no\r\n }\r\n}","module Shared {\r\n export enum TransactionTypes {\r\n Business,\r\n Personal,\r\n Unallocated,\r\n All\r\n }\r\n}","module Shared {\r\n export class VatScheme {\r\n static none: string = \"_blank_\";\r\n static flatRate: string = \"FRV\";\r\n static nonFlatRate: string = \"Non_FRV\";\r\n }\r\n}\r\n","module BankLink {\r\n export class Transaction {\r\n public balance : number = null;\r\n public bankId: string = null;\r\n public bankKey: string = null;\r\n public creditAmount: number = null;\r\n public customerLedgerCategory: number = null;\r\n public customerLedgerDescription: string = null;\r\n public customerLedgerInvoice: boolean = null;\r\n public debitAmount: number = null;\r\n public description: string = null;\r\n public isMobile: boolean = null;\r\n public personalDiv1Amount: number = null;\r\n public personalDiv2Amount: number = null;\r\n public personalExpensesAmount: number = null;\r\n public personalLoanAmount: number = null;\r\n public personalSalaryAmount: number = null;\r\n public receiptID: number = null;\r\n public receiptable: boolean = null;\r\n public serviceResponse: number = null;\r\n public transactionCategory: any = null;\r\n public transactionDate: any = null;\r\n public transactionId: string = null;\r\n public transactionReceiptStatus: number = null;\r\n public transactionStatus: number = null;\r\n public transactionType: number = null;\r\n public unallocatedTransactionSource: number = null;\r\n public flow: any = null;\r\n public flowOptions: any = null;\r\n public receiptThumbnail: any = null;\r\n public category: any = null;\r\n public relatedCategories: any[] = null;\r\n public isVatReclaimable: boolean = false;\r\n public hasValidVatReceipt: boolean = false;\r\n public gross: number = 0;\r\n public vat: number = 0;\r\n public net: number = 0;\r\n public passes24MonthRule: boolean = false;\r\n public accept24MonthRuleRisk: boolean = undefined;\r\n }\r\n}\r\n","/// \r\n\r\n// Please note that most methods can take \"any\" as input parameters because they all get converted to Moment which can convert from any type (string, number, Date, moment.Moment).\r\nmodule Shared {\r\n export interface IBrooksonUtilitiesDate {\r\n taxYearMonth: number;\r\n taxYearDay: number;\r\n\r\n getPreviousDayOfWeek(dayOfWeek: number | string): moment.Moment;\r\n convertToMoment(date: any): moment.Moment;\r\n convertToUtcMoment(date: any): moment.Moment;\r\n stripOutTimezone(date);\r\n convertToJsDate(date: any): Date;\r\n convertToViewString(date: any): string;\r\n convertToViewMonthString(date: any): string;\r\n convertToServerString(date: any): string;\r\n convertDateToMidnightGmt(date: Date): Date;\r\n dateDiff(date1: any, date2: any): number;\r\n isValid(date: any): boolean;\r\n isSame(date1: any, date2: any): boolean;\r\n isBefore(date1: any, date2: any): boolean;\r\n isBeforeOrSame(date1: any, date2: any): boolean;\r\n isAfter(date1: any, date2: any): boolean;\r\n isAfterOrSame(date1: any, date2: any): boolean;\r\n taxYearStart(): moment.Moment;\r\n taxYearEnd(): moment.Moment;\r\n currentTaxYear(): string;\r\n previousTaxYear(): string;\r\n previousTaxYearStart(): any;\r\n previousTaxYearEnd(): any;\r\n nextTaxYearStart(): any;\r\n nextTaxYearEnd(): any;\r\n nextTaxYear(): string;\r\n ageFromDate(date: Date): number;\r\n isMinDate(date: string): boolean;\r\n isOverNMonthsAgo(date: Date, numberOfMonths: number): boolean;\r\n taxYearStartByOffset(offset: number): any;\r\n taxYearEndByOffset(offset: number): any;\r\n taxYearByOffset(offset: number): string;\r\n\r\n }\r\n\r\n export class BrooksonUtilitiesDate implements IBrooksonUtilitiesDate {\r\n\r\n public taxYearMonth: number = 4;\r\n public taxYearDay: number = 5;\r\n\r\n getPreviousDayOfWeek = (dayOfWeek: number): moment.Moment => {\r\n // Get the current week number of the year\r\n var currentNumberOfWeeks = moment().weeks();\r\n\r\n // Minus 1 off the above number\r\n var previousWeekNumber = --currentNumberOfWeeks;\r\n\r\n // Given the above number, find the monday based on that week\r\n var previousWeekOfDay = moment().weeks(previousWeekNumber).day(dayOfWeek);\r\n\r\n return previousWeekOfDay;\r\n }\r\n\r\n convertToMoment = (date) => {\r\n if (moment.isMoment(date)) {\r\n return date;\r\n }\r\n\r\n if ((date instanceof Date)) {\r\n return moment(date);\r\n }\r\n\r\n return moment(date, [moment.ISO_8601, \"YYYY-MM-DD\", \"DD-MM-YYYY\", \"YYYY/MM/DD\", \"DD/MM/YYYY\", 'dddd', 'YYYY-MM-DDThh:mm:ss', \"ddd MMM DD YYYY hh:mm:ss GMTzzz\"], true);\r\n }\r\n\r\n stripOutTimezone = (date) => {\r\n if (!moment.isMoment(date)) {\r\n date = moment(date);\r\n }\r\n\r\n let noTimezone = date.format(\"ddd MMM DD YYYY\").toString();\r\n\r\n return moment.parseZone(noTimezone + \" 00:00:00 GMT+0000\");\r\n }\r\n\r\n convertToUtcMoment = (date) => {\r\n return moment.utc(date);\r\n }\r\n\r\n convertToJsDate = (date) => {\r\n if ((date instanceof Date)) {\r\n return date;\r\n }\r\n\r\n return this.convertToMoment(date).toDate();\r\n }\r\n\r\n convertToViewString = (date) => {\r\n return this.convertToMoment(date).format(\"DD/MM/YYYY\");\r\n }\r\n\r\n convertToViewMonthString = (date) => {\r\n return this.convertToMoment(date).format(\"DD/MMM/YYYY\");\r\n }\r\n\r\n convertToServerString = (date) => {\r\n return this.convertToMoment(date).format(\"YYYY-MM-DD\");\r\n }\r\n\r\n convertDateToMidnightGmt = (date) => {\r\n if (!date) {\r\n return date;\r\n }\r\n return moment.utc([date.getFullYear(), date.getMonth(), date.getDate()]).toDate();\r\n }\r\n\r\n dateDiff = (date1, date2) => {\r\n return this.convertToMoment(date1).diff(this.convertToMoment(date2));\r\n }\r\n\r\n isValid = (date) => {\r\n return this.convertToMoment(date).isValid();\r\n }\r\n\r\n isSame = (date1, date2) => {\r\n if (date1 === date2) {\r\n return true;\r\n }\r\n return this.dateDiff(this.convertToMoment(date1), this.convertToMoment(date2)) === 0;\r\n }\r\n\r\n isBefore = (date1, date2) => {\r\n return (this.dateDiff(this.convertToMoment(date1), this.convertToMoment(date2)) < 0);\r\n }\r\n\r\n isBeforeOrSame = (date1, date2) => {\r\n return (this.dateDiff(this.convertToMoment(date1), this.convertToMoment(date2)) <= 0);\r\n }\r\n\r\n isAfter = (date1, date2) => {\r\n return (this.dateDiff(this.convertToMoment(date1), this.convertToMoment(date2)) > 0);\r\n }\r\n\r\n isAfterOrSame = (date1, date2) => {\r\n return (this.dateDiff(this.convertToMoment(date1), this.convertToMoment(date2)) >= 0);\r\n }\r\n\r\n taxYearStart = () => {\r\n var now = moment();\r\n var startDateString = this.taxYearDay + \"/\" + this.taxYearMonth + \"/\" + now.year();\r\n var startDate = moment(startDateString, 'DD/MM/YYYY').add(1, 'days');\r\n\r\n if (startDate > now) {\r\n startDate.add(-1, 'years');\r\n }\r\n\r\n return startDate;\r\n }\r\n\r\n taxYearEnd = () => {\r\n return this.taxYearStart().add(1, 'years').add(-1, 'days');\r\n }\r\n\r\n currentTaxYear = () => {\r\n return this.taxYearStart().year() + \"/\" + this.taxYearEnd().year();\r\n }\r\n\r\n previousTaxYear = () => {\r\n return this.previousTaxYearStart().year() + \"/\" + this.previousTaxYearEnd().year();\r\n }\r\n\r\n previousTaxYearStart = () => {\r\n return this.taxYearStart().add(-1, 'years');\r\n }\r\n\r\n previousTaxYearEnd = () => {\r\n return this.taxYearEnd().add(-1, 'years');\r\n }\r\n\r\n nextTaxYearStart = () => {\r\n return this.taxYearStart().add(1, 'years');\r\n }\r\n\r\n nextTaxYearEnd = () => {\r\n return this.taxYearEnd().add(1, 'years');\r\n }\r\n\r\n nextTaxYear = () => {\r\n return this.nextTaxYearStart().year() + \"/\" + this.nextTaxYearEnd().year();\r\n }\r\n\r\n ageFromDate = (date) => {\r\n return this.convertToMoment(date).diff(moment(), 'years');\r\n }\r\n\r\n\r\n /**\r\n * Returns whether the date passed in is the C# default date\r\n * ('0001-01-01T00:00:00')\r\n * \r\n * @param {string} date\r\n * @returns {boolean}\r\n */\r\n isMinDate = (date: string): boolean => {\r\n return date === \"0001-01-01T00:00:00\";\r\n }\r\n\r\n isOverNMonthsAgo(date: Date, numberOfMonths: number): boolean {\r\n const nMonthsAgo = moment().subtract(numberOfMonths, 'months');\r\n return moment(date).isBefore(nMonthsAgo);\r\n }\r\n\r\n taxYearStartByOffset = (offset: number): any => {\r\n return this.taxYearStart().add(offset, 'years');\r\n }\r\n\r\n taxYearEndByOffset = (offset: number): any => {\r\n return this.taxYearEnd().add(offset, 'years');\r\n }\r\n\r\n taxYearByOffset = (offset: number): string => {\r\n return this.taxYearStartByOffset(offset).year() + \"/\" + this.taxYearEndByOffset(offset).year();\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .service('brookson.utilities.date', Shared.BrooksonUtilitiesDate);","module Shared {\r\n export class VatRateConfig\r\n {\r\n vatRate: number;\r\n effectiveDate: Date;\r\n endDate: Date;\r\n expenseCode: String;\r\n }\r\n}","/// \r\n/// \r\n\r\nmodule Shared {\r\n\r\n export interface IBankLinkSrv {\r\n getBankAccounts(silentMode?): ng.IPromise;\r\n getCategories(silentMode?, transactionType?): ng.IPromise;\r\n addYodleeAccount(silentMode?): ng.IPromise;\r\n editYodleeAccount(id, silentMode?): ng.IPromise;\r\n refreshYodleeAccount(id, silentMode?): ng.IPromise;\r\n isBankEnabled(silentMode?): ng.IPromise;\r\n isCsvUploadRequired(silentMode?): ng.IPromise;\r\n isBankActionRequired(silentMode?): ng.IPromise;\r\n updateTransactions(transactions, silentMode?): ng.IPromise;\r\n getAllVatRatesConfig(silentMode?: boolean): ng.IPromise>;\r\n cancelBankStatementBatch(id, silentMode?: boolean);\r\n clearBankStatementBatch(id, silentMode?: boolean);\r\n submitBankStatementBatch(id, bankId, reconciliationDate): ng.IPromise;\r\n updateBankStatementDate(bankId, reconciliationDate): ng.IPromise;\r\n getLastFiveBankTransaction(bankId, silentMode?: boolean):ng.IPromise;\r\n }\r\n\r\n export class BankLinkSrv implements IBankLinkSrv {\r\n static $inject = ['$http'];\r\n\r\n constructor (\r\n public $http\r\n ) { }\r\n\r\n public getBankAccounts = (silentMode?: boolean) => {\r\n return this.$http.get(`api/BankLink/GetBankAccounts`, {\r\n silentMode: silentMode ? silentMode : false\r\n }).then(response => response.data);\r\n }\r\n\r\n public getCategories = (silentMode?: boolean, transactionType?: Shared.TransactionTypes) => {\r\n let url = `api/BankLink/GetCategories`;\r\n \r\n if (!_.isUndefined(transactionType)) {\r\n url = `${url}?transactionType=${transactionType}`;\r\n }\r\n\r\n return this.$http.get(url, {\r\n silentMode: silentMode ? silentMode : false\r\n }).then(response => response.data);\r\n }\r\n\r\n public addYodleeAccount = (silentMode?: boolean) => {\r\n return this.$http.get('api/BankLink/AddYodleeAccount', {\r\n silentMode: silentMode ? silentMode : false\r\n }).then(response => response.data);\r\n }\r\n\r\n public editYodleeAccount = (id, silentMode?: boolean) => {\r\n return this.$http.get('api/BankLink/EditYodleeAccount?id=' + id, {\r\n silentMode: silentMode ? silentMode : false\r\n }).then(response => response.data);\r\n }\r\n\r\n public refreshYodleeAccount = (id, silentMode?: boolean) => {\r\n return this.$http.get('api/BankLink/RefreshYodleeAccount?id=' + id, {\r\n silentMode: silentMode ? silentMode : false\r\n }).then(response => response.data);\r\n }\r\n\r\n public isBankEnabled = (silentMode?: boolean) => {\r\n return this.$http.get('api/BankLink/IsBankLinkEnabled', {\r\n silentMode: silentMode ? silentMode : false\r\n }).then(response => response.data);\r\n }\r\n\r\n public isBankActionRequired = (silentMode?: boolean) => {\r\n return this.$http.get('api/BankLink/IsBankLinkActionRequired', {\r\n silentMode: silentMode ? silentMode : false\r\n }).then(response => response.data);\r\n }\r\n \r\n public isCsvUploadRequired = (silentMode?: boolean) => {\r\n return this.$http.get('api/BankLink/IsCsvUploadRequired', {\r\n silentMode: silentMode ? silentMode : false\r\n }).then(response => response.data);\r\n }\r\n \r\n public cancelBankStatementBatch = (id, silentMode?: boolean) => {\r\n return this.$http.get('api/BankLink/CancelBankStatementBatch?id=' + id, {\r\n silentMode: silentMode ? silentMode : false\r\n }).then(response => response.data);\r\n }\r\n\r\n public clearBankStatementBatch = (id, silentMode?: boolean) => {\r\n return this.$http.get('api/BankLink/ClearBankStatementBatch?id=' + id, {\r\n silentMode: silentMode ? silentMode : false\r\n }).then(response => response.data);\r\n }\r\n\r\n public submitBankStatementBatch = (id, bankId, reconciliationDate) => {\r\n var url = \"api/BankLink/SubmitBankStatementBatch\";\r\n\r\n var requestData = {\r\n id: id !== undefined ? id : \"\",\r\n bankId: bankId !== undefined ? bankId : \"\", \r\n reconciliationDate: reconciliationDate !== undefined ? reconciliationDate : \"\", \r\n };\r\n\r\n return this.$http.get(url, {\r\n cache: true,\r\n params: requestData,\r\n }).then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n public updateBankStatementDate = (bankId, reconciliationDate) => {\r\n var url = \"api/BankLink/UpdateBankStatementDate\";\r\n\r\n var requestData = {\r\n bankId: bankId !== undefined ? bankId : \"\", \r\n reconciliationDate: reconciliationDate !== undefined ? reconciliationDate : \"\", \r\n };\r\n\r\n return this.$http.get(url, {\r\n cache: true,\r\n params: requestData,\r\n }).then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n public getLastFiveBankTransaction = (bankAccountKey, silentMode): ng.IPromise> => {\r\n var url = \"api/BankLink/GetLastFiveBankTransaction\";\r\n\r\n var requestData = {\r\n bankAccountKey: bankAccountKey !== undefined ? bankAccountKey : \"\"\r\n };\r\n\r\n return this.$http.get(url, {\r\n cache: true,\r\n params: requestData,\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n public updateTransactions = (transactions, silentMode?: boolean) => {\r\n var config = {\r\n silentMode: silentMode ? silentMode : false\r\n };\r\n\r\n return this.$http.post('api/MoneyManager/UpdateTransactions', transactions, config)\r\n .then(response => {\r\n return response.data;\r\n });\r\n }\r\n\r\n public getAllVatRatesConfig = (silentMode?: boolean): ng.IPromise> => {\r\n const url = \"api/Expenses/GetExpenseVatConfig\";\r\n\r\n return this.$http.get(url, {\r\n cache: \"true\",\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response) => {\r\n return _.map(response.data,\r\n (item: any) => {\r\n let rate = new VatRateConfig();\r\n rate.expenseCode = item.expenseCode;\r\n rate.vatRate = item.vatRate;\r\n rate.effectiveDate = new Date(item.effectiveDate);\r\n rate.endDate = new Date(item.endDate);\r\n return rate;\r\n });\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .service('bankLinkSrv', Shared.BankLinkSrv);","module Shared {\r\n export class ShareholderSplit {\r\n public roleTypeCode: string;\r\n public businessID: string;\r\n public personID: string;\r\n public person: string;\r\n public percentageOfDividend: number;\r\n public AvailableFunds: number;\r\n public directorsFees: number;\r\n public expensesOwed: number;\r\n public dividend: number;\r\n public moneyAvailable: number;\r\n }\r\n}","module Shared {\r\n /**\r\n * IncomeProfit\r\n */\r\n export class IncomeProfit {\r\n constructor(parameters) {\r\n\r\n }\r\n public month: any;\r\n public expenses: any;\r\n public sales: any;\r\n public directorsFee:any;\r\n public profit:any;\r\n\r\n }\r\n}","module Shared {\r\n export class CompanyDividendSplit {\r\n public contactNumber: number;\r\n public customerName: string;\r\n public percentageOfShareholding: number;\r\n public percentageOfDividends: number;\r\n public role: string;\r\n public noOfShares: number;\r\n public glAccountNo: number;\r\n public typeOfShare: string;\r\n }\r\n}","module Shared {\r\n export class CompanyDividendPayments {\r\n public description: string;\r\n public documentDate: Date;\r\n public glAccountNo: number;\r\n public amount: number;\r\n }\r\n}","module Shared {\r\n export class CompanyDividendPaymentSplit {\r\n constructor() { }\r\n public Description: string;\r\n public DocumentDate: Date;\r\n public ContactNumber: number;\r\n public ShareholderName: string;\r\n public DividendPayment: number;\r\n }\r\n}","module Shared {\r\n export class TaxYear {\r\n public StartDate: moment.Moment;\r\n public EndDate: moment.Moment;\r\n }\r\n}","/// \r\nmodule Shared {\r\n export class TaxYearSelection {\r\n constructor() { }\r\n public Order: number;\r\n public TaxYear: Shared.TaxYear;\r\n public Header: string;\r\n public ShortHeader: string;\r\n }\r\n}","module Shared {\r\n export class CompanyDividendPaymentGrouped {\r\n constructor() { }\r\n public DocumentDate: Date;\r\n public ContactNumber: number;\r\n public ShareholderName: string;\r\n public GroupedPayment: number;\r\n }\r\n}","/// \r\n/// \r\n\r\nmodule Shared {\r\n export class TaxYearMonthSummary {\r\n constructor() { }\r\n public Title: string;\r\n public TotalDividendPayment: number;\r\n public StartDate: Date;\r\n public EndDate: Date;\r\n public Transactions: Array;\r\n public EditableTransactions: Array;\r\n }\r\n}","module Shared {\r\n export class ProposedDividend {\r\n public memberId: number;\r\n public companyRef: string;\r\n public yearMonth: string;\r\n public shareholderId: number;\r\n public payment: number;\r\n }\r\n}","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n export interface IMoneyManagerService {\r\n getTransactions(bankId?: string, silentMode?: boolean);\r\n getMoneyManagerStatements(yearStart: moment.Moment, yearEnd: moment.Moment, silentMode?: boolean);\r\n getMoneyManagerStatementsByOffset(offset:number, silentMode?: boolean);\r\n getMoneyManagerFinancialData(silentMode?: boolean);\r\n getMoneyAvailableStatement(silentMode?: boolean);\r\n getYearEndNotification(silentMode?: boolean);\r\n getPersonalTaxCalculations(mmShareholder: string, taxYear: string, silentMode?: boolean);\r\n getWeeklyAccountSummary(startDate: moment.Moment, endDate: moment.Moment, silentMode?: boolean);\r\n getTransactionStatements(startDate: moment.Moment, endDate: moment.Moment, silentMode?: boolean);\r\n getAccountScheduleLastUpdateDate(silentMode?: boolean): ng.IPromise;\r\n getMoneyManagerData(silentMode?: boolean): ng.IPromise;\r\n weeklyAccountSummaryLogic();\r\n moneyAvailablePanelLogic();\r\n weeklyAccountSummary: any;\r\n multiWeeklyAccountSummary: Array;\r\n selectedWeeklyAccountSummary: any;\r\n getNewBusinessStatus();\r\n isNewSetup: boolean;\r\n getShareholderSplit(silentMode?: boolean): ng.IPromise;\r\n getIncomeProfitData(silentMode?: boolean): ng.IPromise>;\r\n getCtUpdateData(silentMode?: boolean): ng.IPromise;\r\n updateCtTime(newTime: string): ng.IPromise;\r\n getCompanyDividendSplit(): ng.IPromise>;\r\n getCompanyDividendPayments(): ng.IPromise>;\r\n saveProposedCompanyDividendPayments(selectedTaxYear: Shared.TaxYearSelection, monthlyTransactions: Array): ng.IPromise;\r\n getProposedDividendPayments(silentMode?: boolean): ng.IPromise>;\r\n }\r\n}\r\n\r\n(() => {\r\n \"use strict\";\r\n\r\n angular\r\n .module(\"app.shared\")\r\n .service(\"moneyManagerSrv\", moneyManagerSrv);\r\n\r\n moneyManagerSrv.$inject = [\"$http\", \"$q\", \"shared.config\", \"brookson.utilities.date\"];\r\n\r\n function moneyManagerSrv($http, $q, sharedConfig, dateUtils, ) {\r\n\r\n var moneyManagerSrvFactory: any = {};\r\n var serviceBase = sharedConfig.baseApiUrl;\r\n\r\n // Data\r\n var myMoneyAvailable: any = {};\r\n var weeklyAccountSummary: any = [];\r\n var selectedWeeklyAccountSummary: any = {};\r\n var startOfWeek = moment().startOf(\"week\").toDate();\r\n var tmp;\r\n // var newBusinessStatus:boolean;\r\n var isNewSetup: boolean = false;\r\n\r\n // Requests\r\n function getTransactions(bankId, silentMode) {\r\n\r\n var url = serviceBase + \"api/MoneyManager/GetTransactions\";\r\n\r\n var requestData = {\r\n bankId: bankId !== undefined ? bankId : \"\"\r\n };\r\n\r\n return $http.get(url, {\r\n cache: true,\r\n params: requestData,\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getMoneyManagerStatements(yearStart, yearEnd, silentMode) {\r\n var url = serviceBase + \"api/MoneyManager/GetMoneyManagerStatements\";\r\n\r\n var requestData = {\r\n yearStart: yearStart.toDate(),\r\n yearEnd: yearEnd.toDate()\r\n };\r\n\r\n return $http.get(url, {\r\n params: requestData,\r\n cache: \"true\",\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response) => {\r\n return response.data;\r\n });\r\n }\r\n \r\n function getMoneyManagerStatementsByOffset(offset, silentMode) {\r\n var url = serviceBase + \"api/MoneyManager/GetMoneyManagerStatementsByOffset\";\r\n\r\n var requestData = {\r\n offset: offset\r\n };\r\n\r\n return $http.get(url, {\r\n params: requestData,\r\n cache: \"false\",\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getMoneyManagerFinancialData(silentMode) {\r\n var url = serviceBase + \"api/MoneyManager/GetMoneyManagerFinancialData\";\r\n\r\n return $http.get(url, {\r\n cache: \"true\",\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getMoneyAvailableStatement(silentMode) {\r\n var url = serviceBase + \"api/MoneyManager/GetMoneyAvailableStatement\";\r\n\r\n return $http.get(url, {\r\n cache: \"true\",\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getYearEndNotification(silentMode) {\r\n var url = serviceBase + \"api/MoneyManager/GetYearEndNotification\";\r\n\r\n return $http.get(url, {\r\n cache: \"true\",\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getPersonalTaxCalculations(mmShareholder, taxYear, silentMode) {\r\n var url = serviceBase + \"api/MoneyManager/GetPersonalTaxCalculations\";\r\n\r\n var requestData = {\r\n request: {\r\n shareholder: mmShareholder,\r\n taxYear: taxYear\r\n }\r\n };\r\n\r\n return $http.post(url, {\r\n params: requestData,\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response) => {\r\n\r\n return response.data;\r\n });\r\n }\r\n\r\n function getWeeklyAccountSummary(startDate, endDate, silentMode) {\r\n var url = serviceBase + \"api/MoneyManager/GetWeeklyAccountSummary\";\r\n\r\n var requestData = {\r\n startDate: startDate.toDate(),\r\n endDate: endDate.toDate()\r\n };\r\n\r\n return $http.get(url, {\r\n params: requestData,\r\n cache: \"true\",\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response) => {\r\n\r\n return response.data;\r\n });\r\n }\r\n\r\n function getTransactionStatements(startDate, endDate, silentMode) {\r\n var url = serviceBase + \"api/MoneyManager/GetTransactionStatements\";\r\n\r\n var requestData = {\r\n startDate: startDate.toDate(),\r\n endDate: endDate.toDate(),\r\n };\r\n\r\n return $http.get(url, {\r\n params: requestData,\r\n cache: \"true\",\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getAccountScheduleLastUpdateDate(silentMode) {\r\n return $http.get(serviceBase + \"api/MoneyManager/GetAccountScheduleLastUpdateDate\", {\r\n cache: \"true\",\r\n silentMode: silentMode ? silentMode : false\r\n })\r\n .then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getMoneyManagerData(silentMode) {\r\n return $http.get(serviceBase + \"api/MoneyManager/GetMoneyManagerData\", {\r\n cache: \"true\",\r\n silentMode: silentMode ? silentMode : false\r\n })\r\n .then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getNewBusinessStatus(silentMode: boolean) {\r\n\r\n return $http.get(serviceBase + \"api/MoneyManager/GetNewBusinessStatus\", {\r\n cache: \"true\",\r\n silentMode: silentMode ? silentMode : false\r\n })\r\n .then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getIncomeProfitData(silentMode: boolean) {\r\n return $http.get(serviceBase + \"api/MoneyManager/GetIncomeProfitChart\", {\r\n cache: \"true\",\r\n silentMode: silentMode ? silentMode : false\r\n })\r\n .then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n // Parse Data\r\n function weeklyAccountSummaryLogic() {\r\n\r\n var deferred = $q.defer();\r\n\r\n moneyManagerSrvFactory.getAccountScheduleLastUpdateDate().then((lastUpdateDateData) => {\r\n\r\n var startDate = moment().subtract(3, \"month\").startOf(\"day\");\r\n var endDate = moment().startOf(\"day\");\r\n\r\n var lastUpdateDate = dateUtils.convertToMoment(lastUpdateDateData);\r\n\r\n if (lastUpdateDate.isBefore(endDate)) {\r\n endDate = lastUpdateDate;\r\n }\r\n\r\n moneyManagerSrvFactory.getWeeklyAccountSummary(startDate, endDate).then((weeklyAccountSummaryData) => {\r\n var weeklyAccountSummary = weeklyAccountSummaryData;\r\n\r\n weeklyAccountSummary.reverse();\r\n\r\n for (var i = 0; i < weeklyAccountSummary.length; i++) {\r\n weeklyAccountSummary[i].businessTotal = 0;\r\n weeklyAccountSummary[i].personalTotal = 0;\r\n\r\n for (var j = 0; j < weeklyAccountSummary[i].businessTransactions.length; j++) {\r\n weeklyAccountSummary[i].businessTotal += weeklyAccountSummary[i].businessTransactions[j].amount;\r\n }\r\n\r\n for (j = 0; j < weeklyAccountSummary[i].personalTransactions.length; j++) {\r\n weeklyAccountSummary[i].personalTotal += weeklyAccountSummary[i].personalTransactions[j].amount;\r\n }\r\n }\r\n\r\n selectedWeeklyAccountSummary = weeklyAccountSummary[0];\r\n\r\n moneyManagerSrvFactory.weeklyAccountSummary = weeklyAccountSummary;\r\n moneyManagerSrvFactory.selectedWeeklyAccountSummary = selectedWeeklyAccountSummary;\r\n\r\n deferred.resolve(weeklyAccountSummary);\r\n }, (er) => {\r\n deferred.reject(er);\r\n });\r\n }, (er) => {\r\n deferred.reject(er);\r\n });\r\n return deferred.promise;\r\n }\r\n\r\n function moneyAvailablePanelLogic(silentMode?: boolean) {\r\n return this.getNewBusinessStatus(silentMode).then((result) => {\r\n\r\n moneyManagerSrvFactory.isNewSetup = false;\r\n\r\n moneyManagerSrvFactory.tmp = _.filter(moneyManagerSrvFactory.myMoneyAvailable.aftStatementChildRows, { rowCode: \"AF1\" });\r\n if (moneyManagerSrvFactory.tmp.length && moneyManagerSrvFactory.tmp[0].yearToDateValue) {\r\n moneyManagerSrvFactory.myMoneyAvailable.bankAccounts = moneyManagerSrvFactory.tmp[0].childMoneyManagerStatementRows;\r\n } \r\n \r\n moneyManagerSrvFactory.myMoneyAvailable.unpaidInvoices = moneyManagerSrvFactory.moneyManagerFinancialData.lessUnpaidInvoices;\r\n moneyManagerSrvFactory.myMoneyAvailable.myMoneyAvailable = moneyManagerSrvFactory.moneyManagerFinancialData.totalMoneyAvailable;\r\n \r\n moneyManagerSrvFactory.myMoneyAvailable.myMoneyAvailableAdjusted =\r\n moneyManagerSrvFactory.myMoneyAvailable.myMoneyAvailable +\r\n moneyManagerSrvFactory.myMoneyAvailable.unpaidInvoices;\r\n });\r\n\r\n }\r\n\r\n function getShareholderSplit(silentMode?: boolean): ng.IPromise> {\r\n var url = serviceBase + \"api/MoneyManager/GetShareholderSplit\";\r\n\r\n return $http.get(url, {\r\n cache: \"true\",\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getCtUpdateData(silentMode?: boolean): ng.IPromise {\r\n const url = serviceBase + \"api/MoneyManager/GetCtUpdateData\";\r\n\r\n return $http.get(url, {\r\n cache: \"true\",\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n function updateCtTime(newTime: string): ng.IPromise {\r\n return $http.post(serviceBase + 'api/MoneyManager/UpdateCtTime', JSON.stringify(newTime))\r\n .then((response) => response.data);\r\n }\r\n\r\n function getCompanyDividendSplit(silentMode?: boolean): ng.IPromise> {\r\n var url = serviceBase + \"api/MoneyManager/getCompanyDividendSplit\";\r\n\r\n return $http.get(url, {\r\n cache: \"true\",\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n function getCompanyDividendPayments(silentMode?: boolean): ng.IPromise> {\r\n var url = serviceBase + \"api/MoneyManager/getCompanyDividendPayments\";\r\n\r\n return $http.get(url, {\r\n cache: \"true\",\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n function saveProposedCompanyDividendPayments(selectedTaxYear: Shared.TaxYearSelection, monthlyTransactions: Array): ng.IPromise {\r\n var requestData = {\r\n selectedTaxYear: selectedTaxYear,\r\n taxMonth: monthlyTransactions\r\n };\r\n\r\n return $http.post(serviceBase + 'api/MoneyManager/SaveProposedCompanyDividendPayments', requestData)\r\n .then((response) => response.data); \r\n }\r\n\r\n function getProposedDividendPayments(silentMode?: boolean): ng.IPromise> {\r\n var url = serviceBase + \"api/MoneyManager/GetProposedDividendShareholderPayments\";\r\n\r\n return $http.get(url, {\r\n cache: \"true\",\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n moneyManagerSrvFactory.getTransactions = getTransactions;\r\n moneyManagerSrvFactory.getMoneyManagerStatements = getMoneyManagerStatements;\r\n moneyManagerSrvFactory.getMoneyManagerStatementsByOffset = getMoneyManagerStatementsByOffset;\r\n moneyManagerSrvFactory.getMoneyAvailableStatement = getMoneyAvailableStatement;\r\n moneyManagerSrvFactory.getYearEndNotification = getYearEndNotification;\r\n moneyManagerSrvFactory.getPersonalTaxCalculations = getPersonalTaxCalculations;\r\n moneyManagerSrvFactory.getMoneyManagerFinancialData = getMoneyManagerFinancialData;\r\n moneyManagerSrvFactory.getWeeklyAccountSummary = getWeeklyAccountSummary;\r\n moneyManagerSrvFactory.getTransactionStatements = getTransactionStatements;\r\n moneyManagerSrvFactory.myMoneyAvailable = myMoneyAvailable;\r\n moneyManagerSrvFactory.weeklyAccountSummary = weeklyAccountSummary;\r\n moneyManagerSrvFactory.selectedWeeklyAccountSummary = selectedWeeklyAccountSummary;\r\n moneyManagerSrvFactory.startOfWeek = startOfWeek;\r\n moneyManagerSrvFactory.tmp = tmp;\r\n moneyManagerSrvFactory.weeklyAccountSummaryLogic = weeklyAccountSummaryLogic;\r\n moneyManagerSrvFactory.moneyAvailablePanelLogic = moneyAvailablePanelLogic;\r\n moneyManagerSrvFactory.getAccountScheduleLastUpdateDate = getAccountScheduleLastUpdateDate;\r\n moneyManagerSrvFactory.getMoneyManagerData = getMoneyManagerData;\r\n moneyManagerSrvFactory.getNewBusinessStatus = getNewBusinessStatus;\r\n moneyManagerSrvFactory.isNewSetup = isNewSetup;\r\n moneyManagerSrvFactory.getShareholderSplit = getShareholderSplit;\r\n moneyManagerSrvFactory.getIncomeProfitData = getIncomeProfitData;\r\n moneyManagerSrvFactory.getCtUpdateData = getCtUpdateData;\r\n moneyManagerSrvFactory.updateCtTime = updateCtTime;\r\n moneyManagerSrvFactory.getCompanyDividendSplit = getCompanyDividendSplit;\r\n moneyManagerSrvFactory.getCompanyDividendPayments = getCompanyDividendPayments;\r\n moneyManagerSrvFactory.saveProposedCompanyDividendPayments = saveProposedCompanyDividendPayments;\r\n moneyManagerSrvFactory.getProposedDividendPayments = getProposedDividendPayments;\r\n\r\n return moneyManagerSrvFactory;\r\n }\r\n})();\r\n","/// \r\n\r\nmodule Shared {\r\n export interface IBrooksonNavigation {\r\n account: IBrooksonNavigationAccount;\r\n bankLink: IBrooksonNavigationBankLink;\r\n dashboard: IBrooksonNavigationDashboard;\r\n documentStorage: IBrooksonNavigationDocumentStorage;\r\n employmentStatus: IBrooksonNavigationEmploymentStatus;\r\n expenses: IBrooksonNavigationEmploymentExpenses;\r\n home: IBrooksonNavigationHome;\r\n assignments: IBrooksonNavigationAssignments;\r\n invoicing: IBrooksonNavigationInvoicing;\r\n knowledgeBase: IBrooksonNavigationKnowledgeBase;\r\n login: IBrooksonNavigationLogin;\r\n moneyManager: IBrooksonNavigationMoneyManager;\r\n personalFinance: IBrooksonNavigationPersonalFinance;\r\n financialServices: IBrooksonNavigationFinancialServices;\r\n personalTax: IBrooksonNavigationPersonalTax;\r\n taskPlanner: IBrooksonNavigationTaskPlanner;\r\n sme: IBrooksonNavigationSme;\r\n employeeZone: IBrooksonNavigationEmployeeZone;\r\n financialCenter: IBrooksonNavigationFinancialCenter;\r\n advisory: IBrooksonNavigationAdvisory;\r\n selectServiceLine: IBrooksonSelectServiceLine;\r\n /*jobsBoard: IBrooksonNavigationJobsBoard;*/\r\n }\r\n\r\n export interface IBrooksonNavigationEmployeeZone {\r\n holidays(): void;\r\n payslips(): void;\r\n }\r\n\r\n export interface IBrooksonNavigationFinancialCenter {\r\n main(): void;\r\n }\r\n\r\n export interface IBrooksonNavigationSme {\r\n holidays(): void;\r\n }\r\n \r\n export interface IBrooksonNavigationAdvisory {\r\n advisory(): void;\r\n }\r\n\r\n //export interface IBrooksonNavigationJobsBoard {\r\n // jobsBoard(): void;\r\n //}\r\n\r\n export interface IBrooksonNavigationWorkFlex {\r\n workFlex(): void;\r\n }\r\n\r\n export interface IBrooksonNavigationAccount {\r\n main(): void;\r\n }\r\n\r\n export interface IBrooksonNavigationBankLink {\r\n main(): void;\r\n }\r\n\r\n export interface IBrooksonSelectServiceLine {\r\n main(): void;\r\n }\r\n\r\n export interface IBrooksonNavigationDashboard {\r\n main(): void;\r\n }\r\n\r\n export interface IBrooksonNavigationDocumentStorage {\r\n main(): void;\r\n recentlyAdded(): void;\r\n favourites(): void;\r\n brooksonSharedDrive(): void;\r\n folder(): void;\r\n }\r\n\r\n export interface IBrooksonNavigationEmploymentStatus {\r\n main(returnUrl?: string, returnText?: string): void;\r\n ir35Assignment(assignmentId: string): void;\r\n }\r\n\r\n export interface IBrooksonNavigationEmploymentExpenses {\r\n main(): void;\r\n business(): void;\r\n expenseDetails(): void;\r\n addExpense(): void;\r\n addMileage(): void;\r\n addReceipt(): void;\r\n addAllowance(): void;\r\n editExpense(): void;\r\n editMileage(): void;\r\n editReceipt(): void;\r\n editAllowance(): void;\r\n expenseReport(): void;\r\n expensesReceiptBank(): void;\r\n }\r\n\r\n export interface IBrooksonNavigationHome {\r\n logout(): void;\r\n }\r\n\r\n export interface IBrooksonNavigationAssignments {\r\n main(): void;\r\n summary(assignmentId?: string): void;\r\n addAssignment(): void;\r\n editAssignment(assignmentId?: string): void;\r\n }\r\n\r\n export interface IBrooksonNavigationInvoicing {\r\n main(): void;\r\n raiseInvoice(id?: number): void;\r\n createInvoice(id?: number): void;\r\n }\r\n\r\n export interface IBrooksonNavigationKnowledgeBase {\r\n main(): void;\r\n }\r\n\r\n export interface IBrooksonNavigationLogin {\r\n main(): void;\r\n superuser(): void;\r\n serviceline(): void;\r\n registration(): void;\r\n passwordReset(): void;\r\n forgottenPassword(): void;\r\n shareholder(): void;\r\n }\r\n\r\n export interface IBrooksonNavigationMoneyManager {\r\n main(): void;\r\n profitLoss(): void;\r\n balanceSheet(): void;\r\n history(): void;\r\n transactions(): void;\r\n }\r\n\r\n export interface IBrooksonNavigationPersonalFinance {\r\n main(): void;\r\n riskProfile(): void;\r\n retirementPlanner(): void;\r\n }\r\n\r\n export interface IBrooksonNavigationFinancialServices {\r\n main(): void;\r\n }\r\n\r\n\r\n export interface IBrooksonNavigationPersonalTax {\r\n main(): void;\r\n planner(): void;\r\n tracker(): void;\r\n hrmcersonalAccountBalance(): void;\r\n selfAssessment(): void;\r\n selfAssessmentTAndCs(): void;\r\n }\r\n\r\n export interface IBrooksonNavigationTaskPlanner {\r\n main(): void;\r\n calendar(): void;\r\n calendarSelectedAction(): void;\r\n selectedAction(actionID: string): void;\r\n selectedActionTask(actionID: string, taskID: string): void;\r\n }\r\n}\r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular\r\n .module('app.shared')\r\n .factory('brookson.navigation', brooksonNavigation);\r\n\r\n brooksonNavigation.$inject = ['$window'];\r\n\r\n function brooksonNavigation($window) {\r\n var account = {\r\n main: () => {\r\n $window.location.href = \"/Account\";\r\n }\r\n };\r\n\r\n var bankLink = {\r\n main: () => {\r\n $window.location.href = \"/BankLink\";\r\n }\r\n };\r\n\r\n var advisory = {\r\n main: () => {\r\n $window.location.href = \"/Advisory\";\r\n }\r\n };\r\n\r\n var selectServiceLine = {\r\n main: () => {\r\n $window.location.href = \"/SelectServiceLine\";\r\n }\r\n };\r\n\r\n //var jobsBoard = {\r\n // main: () => {\r\n // $window.location.href = \"/JobsBoard\";\r\n // }\r\n //};\r\n\r\n var workFlex = {\r\n main: () => {\r\n $window.location.href = \"/WorkFlex\";\r\n },\r\n umbrella: () => {\r\n $window.location.href = \"/WorkFlex/Umbrella\";\r\n },\r\n personalServiceCompany: () => {\r\n $window.location.href = \"/WorkFlex/PersonalServiceCompany\";\r\n }\r\n };\r\n\r\n var dashboard = {\r\n main: () => {\r\n $window.location.href = \"/Dashboard\";\r\n }\r\n };\r\n\r\n var documentStorage = {\r\n main: () => {\r\n $window.location.href = \"/DocumentStorage\";\r\n },\r\n recentlyAdded: () => {\r\n $window.location.href = \"/DocumentStorage/RecentlyAdded\";\r\n },\r\n favourites: () => {\r\n $window.location.href = \"/DocumentStorage/Favourites\";\r\n },\r\n brooksonSharedDrive: (sharedDriveId) => {\r\n $window.location.href = \"/DocumentStorage/BrooksonSharedDrive\" + sharedDriveId;\r\n },\r\n folder: (folderId) => {\r\n $window.location.href = \"DocumentStorage/\" + folderId;\r\n },\r\n paySlipFolder: () => {\r\n $window.location.href = \"DocumentStorage/2/\";\r\n }\r\n };\r\n\r\n var employeeZone = {\r\n holidays: () => {\r\n $window.location.href = \"/EmployeeZone/EmployeeHolidays\";\r\n },\r\n payslips: () => {\r\n $window.location.href = \"/EmployeeZone/Payslips\";\r\n }\r\n };\r\n\r\n var employmentStatus = {\r\n main: (returnUrl?: string, returnText?: string) => {\r\n if (!returnUrl && !returnText) $window.location.href = \"/EmploymentStatus\";\r\n\r\n $window.location.href = `/EmploymentStatus?returnUrl=${returnUrl}&returnText=${returnText}`;\r\n },\r\n ir35Assignment: (assignmentId: string) => {\r\n $window.location.href = \"/EmploymentStatus/\" + assignmentId;\r\n }\r\n };\r\n\r\n var expenses = {\r\n main: () => {\r\n $window.location.href = \"/Expenses/Personal\";\r\n },\r\n business: () => {\r\n $window.location.href = \"/Expenses/Business\";\r\n },\r\n expenseDetails: () => {\r\n $window.location.href = \"/Expenses/ExpenseDetails\";\r\n },\r\n addExpense: () => {\r\n $window.location.href = \"/AddExpense\";\r\n },\r\n addMileage: () => {\r\n $window.location.href = \"/AddMileage\";\r\n },\r\n addReceipt: () => {\r\n $window.location.href = \"/AddReceipt\";\r\n },\r\n addAllowance: () => {\r\n $window.location.href = \"/AddAllowance\";\r\n },\r\n editExpense: () => {\r\n $window.location.href = \"/EditExpense\";\r\n },\r\n editMileage: () => {\r\n $window.location.href = \"/EditMileage\";\r\n },\r\n editReceipt: () => {\r\n $window.location.href = \"/EditReceipt\";\r\n },\r\n editAllowance: () => {\r\n $window.location.href = \"/EditAllowance\";\r\n },\r\n expenseReport: (id) => {\r\n $window.location.href = \"/Expenses/ExpenseReport/\" + id;\r\n },\r\n expensesReceiptBank: () => {\r\n $window.location.href = \"/Expenses/ReceiptBank\";\r\n }\r\n };\r\n\r\n var financialCenter = {\r\n main: () => {\r\n $window.location.href = \"/FinancialCenter\";\r\n }\r\n };\r\n\r\n var home = {\r\n logout: () => {\r\n $window.location.href = \"/Home/LogOut\";\r\n }\r\n };\r\n\r\n var assignments = {\r\n main: () => {\r\n $window.location.href = \"/Assignments\";\r\n },\r\n summary: (assignmentId?: string) => {\r\n let url = \"/Assignments/Summary\";\r\n url += assignmentId ? '/' + assignmentId : '';\r\n $window.location.href = url;\r\n },\r\n addAssignment: () => {\r\n $window.location.href = \"/Assignments/Add-Assignment\";\r\n },\r\n editAssignment: (assignmentId?: string) => {\r\n let url = \"/Assignments/Edit-Assignment\";\r\n url += assignmentId ? '/' + assignmentId : '';\r\n $window.location.href = url;\r\n }\r\n };\r\n\r\n var invoicing = {\r\n main: () => {\r\n $window.location.href = \"/Invoicing\";\r\n },\r\n raiseInvoice: (id?: number) => {\r\n let url = \"/Invoicing/Raise-Invoice\";\r\n url += id ? '/' + id : '';\r\n $window.location.href = url;\r\n },\r\n createInvoice: (id?: number) => {\r\n let url = \"/Invoicing/create-invoice\";\r\n url += id ? '/' + id : '';\r\n $window.location.href = url;\r\n },\r\n newInvoice: () => {\r\n let url = \"/Invoicing/Raise-Invoice/\";\r\n $window.location.href = url;\r\n },\r\n };\r\n\r\n var knowledgeBase = {\r\n main: () => {\r\n $window.location.href = \"/Dashboard/KnowledgeBase\";\r\n }\r\n };\r\n\r\n var login = {\r\n main: () => {\r\n $window.location.href = \"/Login\";\r\n },\r\n superuser: () => {\r\n $window.location.href = \"/Login/Super\";\r\n },\r\n serviceline: () => {\r\n $window.location.href = \"/Login/ServiceLine\";\r\n },\r\n registration: () => {\r\n $window.location.href = \"/Login/Registration\";\r\n },\r\n passwordReset: (id) => {\r\n $window.location.href = \"/Login/PasswordReset/\" + id;\r\n },\r\n forgottenPassword: () => {\r\n $window.location.href = \"/Login/ForgottenPassword\";\r\n },\r\n shareholder: () => {\r\n $window.location.href = \"/login/shareholder\";\r\n }\r\n };\r\n\r\n var moneyManager = {\r\n main: () => {\r\n $window.location.href = \"/MoneyManager\";\r\n },\r\n profitLoss: () => {\r\n $window.location.href = \"/MoneyManager/ProfitLoss\";\r\n },\r\n balanceSheet: () => {\r\n $window.location.href = \"/MoneyManager/BalanceSheet\";\r\n },\r\n history: (week) => {\r\n $window.location.href = \"/MoneyManager/History/\" + week;\r\n },\r\n transactions: () => {\r\n $window.location.href = \"/MoneyManager/Transactions\";\r\n }\r\n };\r\n\r\n var personalFinance = {\r\n main: () => {\r\n $window.location.href = \"/PersonalFinance\";\r\n },\r\n riskProfile: () => {\r\n $window.location.href = \"/PersonalFinance/RiskProfile\";\r\n },\r\n retirementPlanner: () => {\r\n $window.location.href = \"/PersonalFinance/RetirementPlanner\";\r\n }\r\n };\r\n\r\n var financialServices = { \r\n main: () => {\r\n $window.location.href = \"/FinancialServices\";\r\n }\r\n };\r\n\r\n var personalTax = {\r\n main: () => {\r\n $window.location.href = \"/PersonalTax\";\r\n },\r\n planner: () => {\r\n $window.location.href = \"/TaskPlanner/saPersonalTax\";\r\n },\r\n tracker: () => {\r\n $window.location.href = \"/PersonalTax/Tracker\";\r\n },\r\n hrmcersonalAccountBalance: () => {\r\n $window.location.href = \"/PersonalTax/HMRCPersonalAccountBalance\";\r\n },\r\n selfAssessment: () => {\r\n $window.location.href = \"/PersonalTax/SelfAssessment\";\r\n } ,\r\n selfAssessmentTAndCs: () => {\r\n $window.location.href = \"/PersonalTax/SelfAssessment/TermsAndConditions\";\r\n }\r\n };\r\n\r\n var taskPlanner = {\r\n main: () => {\r\n $window.location.href = \"/TaskPlanner\";\r\n },\r\n calendar: () => {\r\n $window.location.href = \"/Calendar/calendar\";\r\n },\r\n calendarSelectedAction: (actionID) => {\r\n $window.location.href = \"/Calendar/calendar/\" + _.camelCase(actionID);\r\n },\r\n selectedAction: (actionID) => {\r\n $window.location.href = \"/TaskPlanner/\" + _.camelCase(actionID);\r\n },\r\n selectedActionTask: (actionID, taskID) => {\r\n $window.location.href = \"/TaskPlanner/\" + _.camelCase(actionID) + \"/\" + taskID;\r\n }\r\n };\r\n\r\n var sme = {\r\n holidays: () => {\r\n $window.location.href = \"/Sme/Holidays\";\r\n }\r\n };\r\n\r\n var openBankingRedirect = {\r\n holidays: () => {\r\n $window.location.href = \"/OpenBankingRedirect\";\r\n }\r\n };\r\n\r\n var service = {\r\n account: account,\r\n bankLink: bankLink,\r\n dashboard: dashboard,\r\n documentStorage: documentStorage,\r\n employmentStatus: employmentStatus,\r\n expenses: expenses,\r\n home: home,\r\n assignments: assignments,\r\n invoicing: invoicing,\r\n knowledgeBase: knowledgeBase,\r\n login: login,\r\n moneyManager: moneyManager,\r\n personalFinance: personalFinance,\r\n financialServices: financialServices,\r\n personalTax: personalTax,\r\n taskPlanner: taskPlanner,\r\n openBankingRedirect: openBankingRedirect,\r\n sme: sme,\r\n employeeZone: employeeZone,\r\n financialCenter: financialCenter,\r\n advisory: advisory,\r\n selectServiceLine: selectServiceLine,\r\n/* jobsBoard: jobsBoard,*/\r\n workFlex: workFlex\r\n };\r\n\r\n return service;\r\n }\r\n})();","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\nmodule Shared {\r\n export interface IAuthenticationService {\r\n login(loginData): ng.IPromise;\r\n updateAccessTokenServiceLine(id, serviceLine, refreshToken, apiKeySource): ng.IPromise;\r\n refreshToken(service_line?);\r\n logout();\r\n activateMember(memberId, registrationId, password): ng.IPromise;\r\n requestPasswordReset(memberId): ng.IPromise;\r\n resetMemberPassword(id, memberId, password): ng.IPromise;\r\n verifyShareholderLogin(memberId, registrationId, password): ng.IPromise;\r\n requestForgottenClientId(firstName: string, surname: string, email: string, dateOfBirth: string): ng.IPromise;\r\n validateLoginRequest(memberId: string, password: string): ng.IPromise;\r\n twoFactorAuthRequest(contactAddressNumber: string, memberId: number): ng.IPromise;\r\n twoFactorAuthValidation(otp: string, memberId: number): ng.IPromise;\r\n getMemberMaskedContactDetails(memberId: number): ng.IPromise;\r\n getMemberContactDetails(memberId: number): ng.IPromise;\r\n saveTwoFactorAuthSetting(memberId: number, enableTfa: boolean): ng.IPromise;\r\n memberTwoFactorAuthStatus(memberId: number): ng.IPromise;\r\n }\r\n\r\n interface ActivationRequest {\r\n memberId: string;\r\n registrationId: string;\r\n password: string;\r\n }\r\n interface ResetPasswordRequest {\r\n id: string;\r\n memberId: string;\r\n password: string;\r\n }\r\n interface TokenResponse {\r\n access_token: string;\r\n }\r\n interface ShareholderVerificationRequest {\r\n username: string;\r\n registrationId: string;\r\n password: string;\r\n }\r\n\r\n interface ForgottenClientIdRequest {\r\n firstName: string;\r\n surname: string;\r\n email: string;\r\n dateOfBirth: string;\r\n }\r\n interface ValidateUserRequest {\r\n memberId: string;\r\n password: string;\r\n }\r\n interface TwoFactorAuthRequest {\r\n contactAddressNumber: string;\r\n memberId: number;\r\n }\r\n\r\n interface TwoFactorAuthValidation {\r\n otp: string;\r\n memberId: number;\r\n }\r\n\r\n interface TfaMemberRequest {\r\n memberId: number;\r\n }\r\n\r\n interface SaveTfaSettingRequest {\r\n memberId: number;\r\n enableTfa: boolean;\r\n }\r\n\r\n export class AuthenticationService implements IAuthenticationService {\r\n static $inject = [\"$injector\", \"$httpParamSerializer\", \"$q\", \"shared.config\", \"memberSrv\", \"brookson.navigation\", 'localStorageService'];\r\n\r\n public serviceBase: string;\r\n public authSettings: any;\r\n public _authentication: any = {\r\n isAuth: false,\r\n userName: \"\",\r\n useRefreshTokens: false\r\n };\r\n public $http: ng.IHttpService;\r\n\r\n constructor(\r\n private $injector: ng.auto.IInjectorService,\r\n private $httpParamSerializer: ng.IHttpParamSerializer,\r\n private $q: ng.IQService,\r\n private sharedConfig: any,\r\n private memberSrv: Shared.IMemberService,\r\n private brooksonNavigation: Shared.IBrooksonNavigation,\r\n private localStorageService: ng.local.storage.ILocalStorageService\r\n ) {\r\n this.serviceBase = sharedConfig.baseApiUrl;\r\n this.authSettings = sharedConfig.authSettings;\r\n }\r\n\r\n validateLoginRequest = (memberId: string, password: string): ng.IPromise => {\r\n this.$http = this.$http || this.$injector.get(\"$http\");\r\n const url: string = this.serviceBase + \"api/TwoFactorAuth/ValidateLoginRequest\";\r\n\r\n const request: ValidateUserRequest = {\r\n memberId: memberId,\r\n password: password\r\n };\r\n\r\n return this.$http.post(url, request)\r\n .then((response: ng.IHttpPromiseCallbackArg): boolean => {\r\n return response.data;\r\n },(err): void => {\r\n console.log(err.data);\r\n })\r\n .catch((err) => {\r\n console.log(err.data);\r\n });\r\n\r\n }\r\n\r\n twoFactorAuthRequest = (contactAddressNumber: string, memberId: number): ng.IPromise => {\r\n this.$http = this.$http || this.$injector.get(\"$http\");\r\n const url: string = this.serviceBase + \"api/TwoFactorAuth/TwoFactorAuthRequest\";\r\n\r\n const request: TwoFactorAuthRequest = {\r\n contactAddressNumber: contactAddressNumber,\r\n memberId: memberId\r\n };\r\n\r\n return this.$http.post(url, request)\r\n .then((response: ng.IHttpPromiseCallbackArg): boolean => {\r\n return response.data;\r\n });\r\n }\r\n\r\n twoFactorAuthValidation = (otp: string, memberId: number): ng.IPromise => {\r\n this.$http = this.$http || this.$injector.get(\"$http\");\r\n const url: string = this.serviceBase + \"api/TwoFactorAuth/TwoFactorAuthValidation\";\r\n\r\n const request: TwoFactorAuthValidation = {\r\n otp: otp,\r\n memberId: memberId\r\n };\r\n\r\n return this.$http.post(url, request)\r\n .then((response: ng.IHttpPromiseCallbackArg): shared.TwoFactorAuthValidationResponse => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getMemberMaskedContactDetails = (memberId: number): ng.IPromise => {\r\n this.$http = this.$http || this.$injector.get(\"$http\");\r\n const url: string = this.serviceBase + \"api/TwoFactorAuth/GetMaskedMemberContactDetails\";\r\n\r\n const request: TfaMemberRequest = {\r\n memberId: memberId\r\n };\r\n\r\n return this.$http.post(url, request)\r\n .then((response: ng.IHttpPromiseCallbackArg): shared.MemberContactDetails => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getMemberContactDetails = (memberId: number): ng.IPromise => {\r\n this.$http = this.$http || this.$injector.get(\"$http\");\r\n const url: string = this.serviceBase + \"api/TwoFactorAuth/GetMemberContactDetails\";\r\n\r\n const request: TfaMemberRequest = {\r\n memberId: memberId\r\n };\r\n\r\n return this.$http.post(url, request)\r\n .then((response: ng.IHttpPromiseCallbackArg): shared.MemberContactDetails => {\r\n return response.data;\r\n });\r\n }\r\n\r\n saveTwoFactorAuthSetting = (memberId: number, enableTfa: boolean): ng.IPromise => {\r\n this.$http = this.$http || this.$injector.get(\"$http\");\r\n const url: string = this.serviceBase + \"api/TwoFactorAuth/SaveTwoFactorAuthSetting\";\r\n\r\n const request: SaveTfaSettingRequest = {\r\n memberId: memberId,\r\n enableTfa: enableTfa\r\n };\r\n\r\n return this.$http.post(url, request)\r\n .then((response: ng.IHttpPromiseCallbackArg): boolean => {\r\n return response.data;\r\n }); \r\n }\r\n\r\n memberTwoFactorAuthStatus = (memberId: number): ng.IPromise => {\r\n this.$http = this.$http || this.$injector.get(\"$http\");\r\n const url: string = this.serviceBase + \"api/TwoFactorAuth/MemberTwoFactorAuthStatus\";\r\n\r\n const request: TfaMemberRequest = {\r\n memberId: memberId\r\n };\r\n\r\n return this.$http.post(url, request)\r\n .then((response: ng.IHttpPromiseCallbackArg): shared.MemberTfaStatus => {\r\n return response.data;\r\n }); \r\n }\r\n\r\n login = (loginData): ng.IPromise => {\r\n let deferred = this.$q.defer();\r\n\r\n const data = {\r\n grant_type: \"password\",\r\n username: loginData.userName,\r\n password: loginData.password,\r\n client_id: \"\",\r\n scope: [loginData.sessionId, loginData.apiKeySource],\r\n };\r\n\r\n if (this.authSettings.useRefreshToken) {\r\n data.client_id = this.authSettings.clientId;\r\n }\r\n\r\n this.$http = this.$http || this.$injector.get(\"$http\");\r\n\r\n this.$http.post(this.serviceBase + \"token\",\r\n this.$httpParamSerializer(data),\r\n {\r\n headers: {\r\n 'Content-Type': \"application/x-www-form-urlencoded\"\r\n }\r\n })\r\n .then(\r\n (response: any): void => {\r\n let refreshToken = \"\";\r\n\r\n if (this.authSettings.useRefreshToken) {\r\n refreshToken = response.data.refresh_token;\r\n }\r\n\r\n if (response.data.access_token) {\r\n this.localStorageService.set(\"brookson.showcs01confirmation\", true);\r\n\r\n const result = {\r\n token: response.data.access_token,\r\n memberId: Number(response.data.userName),\r\n userName: Number(response.data.userName),\r\n isAuthenticated: true,\r\n refreshToken: refreshToken,\r\n useRefreshToken: this.authSettings.useRefreshToken,\r\n isAdmin: response.data.is_admin === 'true' ? true : false,\r\n expires: response.data['.expires'],\r\n refreshTokenExpires: response.data.clientRefreshTokenExpires,\r\n apiKeySource: response.data.apiKeySource\r\n };\r\n\r\n deferred.resolve(result);\r\n } else {\r\n deferred.reject(response.data);\r\n }\r\n },\r\n (err): void => {\r\n deferred.reject(err.data);\r\n }\r\n );\r\n\r\n return deferred.promise;\r\n }\r\n\r\n updateAccessTokenServiceLine = (id, serviceLine, refreshToken, apiKeySource): ng.IPromise => {\r\n let deferred = this.$q.defer();\r\n\r\n const data = {\r\n member_id: id,\r\n company_ref: serviceLine.customerReference,\r\n alt_member_id: serviceLine.altMemberId,\r\n business_type: serviceLine.businessType,\r\n role: serviceLine.role,\r\n navReferral: serviceLine.navReferral,\r\n apiKeySource: apiKeySource\r\n };\r\n\r\n this.refreshToken(data)\r\n .then((response: TokenResponse) => {\r\n if (response.access_token) {\r\n deferred.resolve(response);\r\n } else {\r\n deferred.reject(response);\r\n }\r\n })\r\n .catch((err) => {\r\n deferred.reject(err);\r\n });\r\n\r\n return deferred.promise;\r\n }\r\n\r\n refreshToken = (service_line) => {\r\n var deferred = this.$q.defer();\r\n\r\n const member = this.memberSrv.getMember();\r\n\r\n if (member && member.useRefreshToken) {\r\n\r\n const data = {\r\n grant_type: \"refresh_token\",\r\n refresh_token: member.refreshToken,\r\n client_id: this.authSettings.clientId,\r\n set_service_line: false,\r\n member_id: \"\",\r\n alt_member_id: \"\",\r\n company_ref: \"\",\r\n business_type: \"\",\r\n role: \"\",\r\n navReferral: \"\",\r\n apiKeySource: \"\"\r\n };\r\n\r\n if (service_line) {\r\n data.set_service_line = true;\r\n data.member_id = service_line.member_id;\r\n data.alt_member_id = service_line.alt_member_id;\r\n data.company_ref = service_line.company_ref;\r\n data.business_type = service_line.business_type;\r\n data.role = service_line.role;\r\n data.navReferral = service_line.navReferral;\r\n data.apiKeySource = service_line.apiKeySource;\r\n }\r\n\r\n this.$http = this.$http || this.$injector.get(\"$http\");\r\n console.log('refresh request start');\r\n this.$http.post(this.serviceBase + \"token\",\r\n this.$httpParamSerializer(data),\r\n { headers: { 'Content-Type': \"application/x-www-form-urlencoded\" } })\r\n .then((response: any) => {\r\n var data = response.data;\r\n var result = {\r\n token: data.access_token,\r\n userName: data.userName,\r\n isAuthenticated: true,\r\n refreshToken: data.refresh_token,\r\n useRefreshToken: true,\r\n expires: data['.expires'],\r\n refreshTokenExpires: data.clientRefreshTokenExpires,\r\n apiKeySource: service_line === undefined ? data.apiKeySource : service_line.apiKeySource\r\n };\r\n this.memberSrv.updateMember(result);\r\n console.log('refresh request complete');\r\n deferred.resolve(data);\r\n }).catch(err => deferred.reject(err));\r\n } else {\r\n deferred.reject();\r\n }\r\n\r\n return deferred.promise;\r\n }\r\n\r\n logout = (): void => {\r\n this.localStorageService.remove(\"brookson.showcs01confirmation\");\r\n this.memberSrv.clearMember();\r\n this.brooksonNavigation.home.logout();\r\n }\r\n\r\n activateMember = (memberId: string, registrationId: string, password: string): ng.IPromise => {\r\n this.$http = this.$http || this.$injector.get(\"$http\");\r\n\r\n const url: string = this.serviceBase + \"api/Member/ActivateMember\";\r\n\r\n const request: ActivationRequest = {\r\n memberId: memberId,\r\n registrationId: registrationId,\r\n password: password\r\n };\r\n\r\n return this.$http.post(url, request)\r\n .then((response: ng.IHttpPromiseCallbackArg): boolean => {\r\n return response.data;\r\n });\r\n }\r\n\r\n requestPasswordReset = (memberId: string): ng.IPromise => {\r\n this.$http = this.$http || this.$injector.get(\"$http\");\r\n\r\n const url: string = this.serviceBase + \"api/Member/RequestPasswordResetSms/\" + memberId;\r\n\r\n return this.$http.get(url)\r\n .then((response: ng.IHttpPromiseCallbackArg): boolean => {\r\n return response.data;\r\n });\r\n }\r\n\r\n requestForgottenClientId = (firstName: string, surname: string, email: string, dateOfBirth: string): ng.IPromise => {\r\n\r\n this.$http = this.$http || this.$injector.get(\"$http\");\r\n\r\n const url: string = this.serviceBase + \"api/Member/RequestForgottenClientId\";\r\n\r\n const request: ForgottenClientIdRequest = {\r\n firstName: firstName,\r\n surname: surname,\r\n email: email,\r\n dateOfBirth: dateOfBirth\r\n };\r\n return this.$http.post(url, request)\r\n .then((response: ng.IHttpPromiseCallbackArg): boolean => {\r\n return response.data;\r\n });\r\n }\r\n\r\n resetMemberPassword = (id: string, memberId: string, password: string): ng.IPromise => {\r\n this.$http = this.$http || this.$injector.get(\"$http\");\r\n\r\n const url: string = this.serviceBase + \"api/Member/resetMemberPassword\";\r\n\r\n const request: ResetPasswordRequest = {\r\n id: id,\r\n memberId: memberId,\r\n password: password\r\n };\r\n\r\n return this.$http.post(url, request)\r\n .then((response: ng.IHttpPromiseCallbackArg): boolean => {\r\n return response.data;\r\n });\r\n }\r\n\r\n verifyShareholderLogin = (userName: string, registrationId: string, password: string): ng.IPromise => {\r\n this.$http = this.$http || this.$injector.get(\"$http\");\r\n\r\n const url: string = this.serviceBase + \"api/Member/verifyShareholderLogin\";\r\n\r\n const request: ShareholderVerificationRequest = {\r\n username: userName,\r\n registrationId: registrationId,\r\n password: password\r\n };\r\n\r\n return this.$http.post(url, request)\r\n .then((response: ng.IHttpPromiseCallbackArg): boolean => {\r\n return response.data;\r\n });\r\n }\r\n\r\n }\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .service('authenticationSrv', Shared.AuthenticationService);","/// \n\nmodule Shared {\n export class BusinessDetailSummary {\n companyName: string;\n companyRegistrationNo: string;\n vatNo: string;\n vatScheme: string;\n flatRateVatEffectiveDate: any;\r\n standardRateVatEffectiveDate: any;\n\n getEffectiveVatSchemeOn = (date: Date): string => {\n if (!date || (!this.flatRateVatEffectiveDate && !this.standardRateVatEffectiveDate)) {\n return this.vatScheme;\n }\n\n switch (this.vatScheme) {\r\n case VatScheme.nonFlatRate:\r\n if (this.standardRateVatEffectiveDate) {\n return date < this.standardRateVatEffectiveDate ? VatScheme.flatRate : VatScheme.nonFlatRate;\n }\n\n return date < this.flatRateVatEffectiveDate ? VatScheme.nonFlatRate : VatScheme.flatRate;\r\n case VatScheme.flatRate:\r\n if (this.flatRateVatEffectiveDate) {\n return date < this.flatRateVatEffectiveDate ? VatScheme.nonFlatRate : VatScheme.flatRate;\n }\n\n return date < this.standardRateVatEffectiveDate ? VatScheme.flatRate : VatScheme.nonFlatRate;\r\n default:\r\n if (this.standardRateVatEffectiveDate) {\n return date < this.standardRateVatEffectiveDate ? VatScheme.none : VatScheme.nonFlatRate;\n }\n\n return date < this.flatRateVatEffectiveDate ? VatScheme.none : VatScheme.flatRate;\r\n }\n }\n }\n}","/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n export interface IServiceLineService {\r\n serviceBase: string;\r\n serviceLines: Array;\r\n businessDetailSummary: BusinessDetailSummary;\r\n\r\n getBusinessDetailSummary(): ng.IPromise;\r\n getServiceLines(member: MemberModel): any;\r\n }\r\n\r\n export class ServiceLineService implements IServiceLineService {\r\n static $inject = ['$http', '$q', 'shared.config', 'memberSrv'];\r\n\r\n public serviceBase: string;\r\n public serviceLines: Array = [];\r\n public businessDetailSummary: BusinessDetailSummary;\r\n\r\n constructor(\r\n private $http: ng.IHttpService,\r\n private $q: ng.IQService,\r\n private sharedConfig: any,\r\n private memberSrv: IMemberService\r\n ) {\r\n this.serviceBase = sharedConfig.baseApiUrl;\r\n }\r\n\r\n getBusinessDetailSummary = (): ng.IPromise => {\r\n return this.$http.get(this.serviceBase + 'api/Member/GetBusinessDetailSummary', {\r\n cache: true\r\n })\r\n .then((response: ng.IHttpPromiseCallbackArg) => {\r\n var businessDetailSummary = new BusinessDetailSummary();\r\n businessDetailSummary.companyName = response.data.companyName;\r\n businessDetailSummary.companyRegistrationNo = response.data.companyRegistrationNo;\r\n businessDetailSummary.vatNo = response.data.vatNo;\r\n businessDetailSummary.vatScheme = response.data.vatScheme;\r\n\r\n if (response.data.flatRateVatEffectiveDate) {\r\n businessDetailSummary.flatRateVatEffectiveDate = new Date(response.data.flatRateVatEffectiveDate);\r\n }\r\n\r\n if (response.data.standardRateVatEffectiveDate) {\r\n businessDetailSummary.standardRateVatEffectiveDate = new Date(response.data.standardRateVatEffectiveDate);\r\n }\r\n\r\n this.businessDetailSummary = businessDetailSummary;\r\n \r\n return this.businessDetailSummary;\r\n });\r\n }\r\n\r\n getServiceLines = (member: MemberModel) => {\r\n\r\n var deferred = this.$q.defer();\r\n\r\n if (member.memberId) {\r\n if (this.serviceLines.length > 0) {\r\n deferred.resolve(this.serviceLines);\r\n } else {\r\n this.$http.get(this.serviceBase + 'api/Member/GetServiceLinesDistinct/' + member.memberId)\r\n .success((data: Array) => {\r\n //save in the service;\r\n this.serviceLines = data;\r\n deferred.resolve(data);\r\n }).error((err, status) => {\r\n deferred.reject(err);\r\n });\r\n }\r\n } else {\r\n deferred.reject({ error_description: 'Invalid Member Id.' });\r\n }\r\n\r\n return deferred.promise;\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .service('serviceLineSrv', Shared.ServiceLineService);","module Shared {\r\n\r\n export class SaveExpenseRequest {\r\n expenseSubmissionId: number;\r\n description: string;\r\n assignmentId: string;\r\n assignmentName: string;\r\n mainSiteDateTime: Shared.BrooksonDate;\r\n endDateTime: string;\r\n mileageExpenseItems: MileageExpense[];\r\n expenseItems: RegularExpense[];\r\n allowanceItems: RegularExpense[];\r\n dataSource: number;\r\n isDeleted: boolean;\r\n hideGrowl: boolean;\r\n }\r\n\r\n}\r\n\r\n","module Shared {\r\n export class ExpenseHeader {\r\n startDate: Shared.BrooksonDate;\r\n endDate: Shared.BrooksonDate;\r\n assignmentId: string;\r\n assignment: string;\r\n description: string;\r\n id: number;\r\n status: string;\r\n type: string;\r\n total: number;\r\n dataSource: number;\r\n createdDate: Shared.BrooksonDate;\r\n startDateRange: Shared.BrooksonDate;\r\n endDateRange: Shared.BrooksonDate;\r\n }\r\n}","\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export enum SubmissionType {\r\n unknown = 0,\r\n mileage = 1,\r\n receiptAttached = 2,\r\n receiptPrinted = 3,\r\n miracleManual = 4,\r\n }\r\n}\r\n","/// \r\n/// \r\n\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class ExpenseType {\r\n \r\n // EXPENSETYPEID\r\n public expenseTypeId: string = null;\r\n // EXPENSETYPEDESCRIPTION\r\n public expenseTypeDescription: string = null;\r\n // EXPENSESUBMISSIONTYPE\r\n public expenseSubmissionType: number = 0;\r\n // SUBMISSIONTYPEENUM\r\n public submissionTypeEnum: SubmissionType = null;\r\n // EXPENSERECEIPTATTACHABLE\r\n public expenseReceiptAttachable: boolean = false;\r\n // PAYMENTCODE\r\n public paymentCode: string = null;\r\n // CATEGORY\r\n public category: string = null;\r\n // ACCOUNTTYPE\r\n public accountType: AccountType = null;\r\n // DEFAULTEXPENSERATE\r\n public defaultExpenseRate: number = 0;\r\n // RATES\r\n public rates: Array = null;\r\n\r\n public quantityLabel: string = null;\r\n public isWholeNumber: boolean = false;\r\n public offsite: boolean = false;\r\n public deemed: boolean = false;\r\n public isPublicSector: boolean = false;\r\n public expenseGroup: string = null;\r\n public sdcCheckApplicable: boolean = false;\r\n showWarning: boolean = false;\r\n warningHtml: string = null;\r\n }\r\n}\r\n","module Shared {\r\n export class ExpenseWarning {\r\n showWarningHighRisk: boolean = false;\r\n showWarningAmount: boolean = false;\r\n showWarningMonthRule: boolean = false;\r\n warning: ExpenseWarnings = null;\r\n\r\n warningMessage: string = null;\r\n confirmed: boolean = false;\r\n dateConfirmed: Shared.BrooksonDate = null;\r\n\r\n warningMessageTwentyFour: string = null; \r\n confirmedTwentyFour: boolean = false;\r\n dateConfirmedTwentyFour: Shared.BrooksonDate = null;\r\n\r\n assignment: Assignment;\r\n }\r\n\r\n export class ConfirmedExpenseWarning {\r\n expenseWarningLogId: number;\r\n expenseCodeValue: string;\r\n dateConfirmed: Shared.BrooksonDate;\r\n twentyFourMonthRuleApplied: boolean;\r\n expenseId: string;\r\n }\r\n\r\n export class ExpenseTabWarning {\r\n name: string = null;\r\n presentedWarnings = 0;\r\n constructor(tabName: string) {\r\n this.name = tabName;\r\n }\r\n }\r\n\r\n export class ExpenseTabWarnings {\r\n warningCount: number = 0;\r\n tabWarnings: ExpenseTabWarning[];\r\n constructor() {\r\n this.tabWarnings = new Array();\r\n }\r\n }\r\n}","/// \r\n/// \r\n\r\nmodule Shared {\r\n export class CoreExpenseItem {\r\n date: Shared.BrooksonDate;\r\n isDeleted: boolean;\r\n expenseID: string;\r\n expenseType: Shared.ExpenseType;\r\n expenseMileageVehicle: Shared.ExpenseMileageVehicle;\r\n expenseItemId: number;\r\n description: string;\r\n expenseTypeId: string;\r\n vehicleRegistration: string;\r\n paymentCode: string;\r\n rate: number;\r\n net: number;\r\n vat: number;\r\n gross: number;\r\n total: number;\r\n status: string;\r\n tempID: string;\r\n markedAsDelete: boolean;\r\n typeObject: Shared.ExpenseType;\r\n vehicleObject: Shared.ExpenseMileageVehicle;\r\n type: string;\r\n changeId: number;\r\n hasValidVatReceipt: boolean;\r\n expenseWarning: ExpenseWarning;\r\n constructor() {\r\n this.expenseWarning = new ExpenseWarning();\r\n }\r\n }\r\n}","/// \r\n\r\nmodule Shared {\r\n\r\n export class RegularExpense extends CoreExpenseItem {\r\n receiptId: number;\r\n quantity: number;\r\n receiptImageData: string;\r\n receiptThumbnail: string;\r\n flow: any;\r\n flowOptions: any;\r\n allowedExpenseTypes: any;\r\n }\r\n}","module Shared {\r\n \r\n export class AppliedRate {\r\n rateObj: any;\r\n qty: number;\r\n }\r\n\r\n}","\r\n/// \r\n\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class ExpenseMileageVehicle {\r\n // VEHICLEMAKE\r\n public vehicleMake: string = null;\r\n // VEHICLEMODEL\r\n public vehicleModel: string = null;\r\n // FUELTYPE\r\n public fuelType: string = null;\r\n // ENGINECC\r\n public engineCC: number = null;\r\n // REGISTRATION\r\n public registration: string = null;\r\n // STARTDATE\r\n public startDate: Date = null;\r\n // ENDDATE\r\n public endDate: Date = null;\r\n // isSelected\r\n public isSelected: boolean;\r\n // Personal or business\r\n public privateVehicle: any;\r\n }\r\n}","/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n export class MileageExpense extends CoreExpenseItem {\r\n miles: number;\r\n appliedRates: Array;\r\n workSite: string;\r\n }\r\n}","module Shared {\r\n\r\n export class ExpenseDetails {\r\n expenseHeader: ExpenseHeader;\r\n mileageExpenses: MileageExpense[];\r\n regularExpenses: RegularExpense[];\r\n allowanceExpenses: RegularExpense[];\r\n }\r\n}\r\n\r\n","module Shared {\r\n export enum ExpenseDataSource {\r\n OldExpenses,\r\n Expenses,\r\n MiracleExpenses\r\n }\r\n}","module Shared {\r\n export class ExpensesOverview {\r\n chartData: any;\r\n }\r\n\r\n export class ExpensePlottingData {\r\n mileageExpensesSum: number;\r\n regularExpensesSum: number;\r\n allowancesExpensesSum: number;\r\n }\r\n\r\n}","module Shared {\r\n export class MileageExpenseRateLookup {\r\n paymentCode: string;\r\n mileageFrom: number;\r\n mileageTo: number;\r\n rate: number;\r\n }\r\n}","module Shared {\r\n export class ExpenseTotals {\r\n mileageTotal: number;\r\n mileageTotalCost: number;\r\n receiptedTotal: number;\r\n }\r\n}","module Shared {\r\n export class VatRate {\r\n amount: number;\r\n startDate: Date;\r\n }\r\n}","/// \r\n\r\nmodule Shared {\r\n // contact.enums\r\n export interface IContactEnums {\r\n ContactInformation: IContactInformation;\r\n }\r\n export interface IContactInformation {\r\n CustomerServicesPhone: string;\r\n CustomerServicesEmail: string;\r\n }\r\n\r\n // invoicing.enums\r\n export interface IInvoicingEnums {\r\n RatePeriods: IRatePeriods;\r\n InvoiceCreationStatus: IInvoiceCreationStatus;\r\n InvoiceStatus: IInvoiceStatus;\r\n Sectors: ISectors;\r\n Ir35Captured: IIR35Captured;\r\n TimesheetFrequency: ITimesheetFrequency;\r\n }\r\n export interface IRatePeriods {\r\n HOUR: number;\r\n DAY: number;\r\n WEEK: number;\r\n properties: any;\r\n }\r\n export interface IInvoiceCreationStatus {\r\n OVERRIDE: number;\r\n SUCCESSFUL: number;\r\n EXCEPTION: number;\r\n }\r\n export interface IInvoiceStatus {\r\n NONE: number;\r\n NEW: number;\r\n MODIFIED: number;\r\n DELETED: number;\r\n }\r\n\r\n export interface ISectors {\r\n PUBLIC: number;\r\n PRIVATE: number;\r\n NOLONGERINUSE: number;\r\n NEITHER: number;\r\n properties: any;\r\n }\r\n //IIR35Enums Status\r\n export interface IIR35Captured {\r\n INSIDEIR35: number;\r\n OUTSIDEIR35: number;\r\n NOTASSESSED: number;\r\n properties: any;\r\n }\r\n\r\n export interface ITimesheetFrequency {\r\n WEEKLY: number;\r\n FORTNIGHTLY: number;\r\n MONTHLY: number;\r\n properties: any;\r\n }\r\n\r\n // currency.enums\r\n export interface ICurrencyEnums {\r\n CurrencyCodes: ICurrencyCodes;\r\n }\r\n export interface ICurrencyCodes {\r\n GBP: number;\r\n EUR: number;\r\n USD: number;\r\n YEN: number;\r\n AUD: number;\r\n CAD: number;\r\n NOK: number;\r\n ZAR: number;\r\n SEK: number;\r\n CHF: number;\r\n AED: number;\r\n SGD: number;\r\n properties: any;\r\n }\r\n export interface IEngineSize {\r\n PETROL1_1400: number;\r\n PETROL1401_2000: number;\r\n PETROL2001_9999: number;\r\n LPG1_1400: number;\r\n LPG1401_2000: number;\r\n LPG2001_9999: number;\r\n DIESEL1_1600: number;\r\n DIESEL1601_2000: number;\r\n DIESEL2001_9999: number;\r\n properties: any;\r\n }\r\n export interface IFuelTypes {\r\n PETROL: number;\r\n DIESEL: number;\r\n LPG: number;\r\n properties: any;\r\n }\r\n\r\n // expenses.enums\r\n export interface IExpensesEnums {\r\n ExpenseTypeCategory: IExpenseTypeCategory;\r\n ExpenseSubmissionType: IExpenseSubmissionType;\r\n ReceiptStatus: IReceiptStatus;\r\n EngineSize: IEngineSize;\r\n FuelTypes: IFuelTypes;\r\n PersonalOrCompany: IPersonalOrCompany;\r\n ExpenseWarningCodeTypes: IExpenseWarningCodeTypes;\r\n }\r\n export interface IPersonalOrCompany {\r\n PERSONAL: number;\r\n COMPANY: number;\r\n properties: any;\r\n }\r\n export interface IExpenseTypeCategory {\r\n MILEAGE: string;\r\n }\r\n\r\n export interface IExpenseWarningCodeTypes {\r\n HighRisk: number;\r\n Amount: number;\r\n TwentyFourMonthRule: number;\r\n }\r\n export interface IExpenseSubmissionType {\r\n UNKNOWN: number;\r\n MILEAGE: number;\r\n RECEIPTATTACHED: number;\r\n RECEIPTPRINTED: number;\r\n MIRACLEMANUAL: number;\r\n properties: any;\r\n }\r\n export interface IReceiptStatus {\r\n UNKNOWN: number;\r\n UNATTACHED: number;\r\n UNSUBMITTED: number;\r\n SUBMITTED: number;\r\n }\r\n\r\n // image.enums\r\n export interface IImageEnums {\r\n ImageSize: IImageSize;\r\n }\r\n export interface IImageSize {\r\n ORIGINAL: number;\r\n CUSTOM: number;\r\n ASPECTRATIO: number;\r\n }\r\n\r\n // documentStorage.enums\r\n export interface IDocumentStorageEnums {\r\n FileView: IFileView;\r\n SharedDriveLinkStatus: ISharedDriveLinkStatus;\r\n DocumentCategory: IDocumentCategory;\r\n DocumentDataSource: IDocumentDataSource;\r\n }\r\n export interface IFileView {\r\n DETAILED: number;\r\n THUMBNAIL: number;\r\n }\r\n export interface ISharedDriveLinkStatus {\r\n NONE: number;\r\n SUCCESSFUL: number;\r\n ERROR: number;\r\n }\r\n export interface IDocumentCategory {\r\n FOLDER: string;\r\n RECENTLYADDED: string;\r\n FAVOURITES: string;\r\n SHAREDDRIVE: string;\r\n }\r\n export interface IDocumentDataSource {\r\n MEMBERWEBDOCUMENTS: number;\r\n QUEUESERVICE: number;\r\n MOLEDATA: number;\r\n DROPBOX: number;\r\n }\r\n\r\n // dialogue.enums\r\n export interface IDialogueEnums {\r\n Dialogues: IDialogues;\r\n }\r\n export interface IDialogues {\r\n MILEAGE24MONTHRULE: string;\r\n EXPENSESNOTICE: string;\r\n }\r\n\r\n // personalTax.enums\r\n export interface IPersonalTaxEnums {\r\n Timeframes: IPersonalTaxEnumsTimeframes;\r\n }\r\n export interface IPersonalTaxEnumsTimeframes {\r\n FORECAST: string;\r\n YEARTODATE: string;\r\n properties: any;\r\n }\r\n\r\n // taskPlanner.enums\r\n export interface ITaskPlannerEnums {\r\n TaskStatus: ITaskStatus;\r\n TaskResponsibility: ITaskResponsibility;\r\n }\r\n\r\n export interface ITaskStatus {\r\n COMPLETED: number;\r\n CURRENT: number;\r\n FUTURE: number;\r\n OVERDUE: number;\r\n properties: any;\r\n }\r\n\r\n export interface ITaskResponsibility {\r\n ME: string;\r\n BROOKSON: string;\r\n }\r\n\r\n // logging.enums\r\n export interface ILoggingEnums {\r\n LoggingLevel: ILoggingLevel;\r\n }\r\n\r\n export interface ILoggingLevel {\r\n DEBUG: number;\r\n INFO: number;\r\n WARN: number;\r\n ERROR: number;\r\n FATAL: number;\r\n }\r\n\r\n // bankLink.enums\r\n\r\n\r\n export interface IBankLinkEnums {\r\n BankAccountType: IBankAccountType;\r\n TransactionType: ITransactionType;\r\n TransactionStatuses: ITransactionStatuses;\r\n BankLogos: IBankLogos;\r\n BankIcons: IBankIcons;\r\n }\r\n\r\n export interface IBankAccountType {\r\n CURRENT: number;\r\n DEPOSIT: number;\r\n CREDIT_CARD: number;\r\n DEPOSIT_BOND: number;\r\n }\r\n\r\n export interface ITransactionType {\r\n BUSINESS: number;\r\n PERSONAL: number;\r\n UNALLOCATED: number;\r\n ALL: number;\r\n OUTGOINGS: number;\r\n properties: any;\r\n }\r\n\r\n export interface ITransactionStatuses {\r\n NONE: number;\r\n SAVED: number;\r\n SUBMITTED: number;\r\n PROCESSED: number;\r\n }\r\n export interface IBankLogos {\r\n BARCLAYS: string;\r\n CASHPLUS: string;\r\n HSBC: string;\r\n LLOYDS: string;\r\n RBS: string;\r\n SANTANDER: string;\r\n HALIFAX: string;\r\n }\r\n\r\n export interface IBankIcons {\r\n BARC: string;\r\n CASHPLUS: string;\r\n HSBC: string;\r\n LLOYDS: string;\r\n RBS: string;\r\n SANTANDER: string;\r\n HALIFAX: string;\r\n }\r\n\r\n // notifications.enums\r\n export interface INotificationEnums {\r\n NotificationSymbol: INotificationSymbol;\r\n NotificationColourLabel: INotificationColourLabel;\r\n }\r\n\r\n export interface INotificationSymbol {\r\n money: string;\r\n process: string;\r\n guide: string;\r\n video: string;\r\n document: string;\r\n book: string;\r\n information: string;\r\n }\r\n\r\n export interface INotificationColourLabel {\r\n red: string;\r\n blue: string;\r\n green: string;\r\n yellow: string;\r\n grey: string;\r\n }\r\n\r\n // holidays.enums\r\n export interface IHolidaysEnums {\r\n HolidayRequestStatus: IHolidayRequestStatus;\r\n }\r\n\r\n export interface IHolidayRequestStatus {\r\n ALL: number;\r\n PENDING: number;\r\n APPROVED: number;\r\n REJECTED: number;\r\n properties: any;\r\n }\r\n\r\n // member.enums\r\n export interface IMemberEnums {\r\n ServiceLineBusinessType: IServiceLineBusinessType;\r\n ServiceLineRole: IServiceLineRole;\r\n }\r\n\r\n export interface IServiceLineBusinessType {\r\n UNKNOWN: string;\r\n LTD: string;\r\n UMBRELLA: string;\r\n SME: string;\r\n }\r\n\r\n export interface IServiceLineRole {\r\n UNKNOWN: string;\r\n DIRECTOR: string;\r\n SHAREHOLDER: string;\r\n EMPLOYEE: string;\r\n NONPRINCIPALDIR: string;\r\n }\r\n\r\n //ir35.enums\r\n export interface IIR35Enums {\r\n IR35Status: IIR35Status;\r\n ESAQuestionGroups: IESAQuestionGroups;\r\n }\r\n\r\n export interface IIR35Status {\r\n IR35Status_TaxedAsPAYE: number;\r\n IR35Status_TaxedAsSelfEmployed: number;\r\n IR35Status_Caution: number;\r\n IR35Status_ActionRequired: number;\r\n IR35Status_WithdrawnReview: number;\r\n IR35Status_AssessmentFormSubmit: number;\r\n IR35Status_AssessmentFormStarted: number; \r\n }\r\n\r\n export interface IESAQuestionGroups {\r\n Group1: string;\r\n Group1Dot1: string;\r\n Group1Dot2: string;\r\n Group1Dot3: string;\r\n Group2: string;\r\n Group2Dot1: string;\r\n Group3: string;\r\n Group3Dot1: string;\r\n Group3Dot2: string;\r\n Group4: string;\r\n Group5: string;\r\n Group6: string;\r\n Group7: string;\r\n Group8: string;\r\n Group9: string;\r\n Group10: string;\r\n Group11: string;\r\n Group12: string;\r\n Group13: string;\r\n Group14: string;\r\n Group15: string;\r\n Group16: string;\r\n Group17: string;\r\n Group18: string;\r\n }\r\n\r\n export class ContactEnums implements IContactEnums {\r\n public ContactInformation = {\r\n CustomerServicesPhone: '0345 058 1200 or 01925 232 526',\r\n CustomerServicesEmail: 'businessadvisors@brookson.co.uk'\r\n };\r\n static Default() { return new ContactEnums(); }\r\n }\r\n\r\n export class InvoicingEnums implements IInvoicingEnums {\r\n public RatePeriods = {\r\n HOUR: 0,\r\n DAY: 1,\r\n WEEK: 2,\r\n properties: {\r\n 0: { value: \"Hour\", adjective: \"Hourly\" },\r\n 1: { value: \"Day\", adjective: \"Daily\" },\r\n 2: { value: \"Week\", adjective: \"Weekly\" }\r\n }\r\n };\r\n public InvoiceCreationStatus = {\r\n OVERRIDE: 0,\r\n SUCCESSFUL: 1,\r\n EXCEPTION: 2\r\n };\r\n public InvoiceStatus = {\r\n NONE: 0,\r\n NEW: 1,\r\n MODIFIED: 2,\r\n DELETED: 3\r\n };\r\n\r\n public Sectors = {\r\n PUBLIC: 0,\r\n PRIVATE: 1,\r\n NOLONGERINUSE: 2,\r\n NEITHER: 3,\r\n properties: {\r\n 0: { description: 'Public', id: 0 },\r\n 1: { description: 'Private', id: 1 },\r\n 2: { description: 'NoLongerInUse', id: 2 },\r\n 3: { description: 'Neither', id: 3 }\r\n }\r\n };\r\n\r\n public TimesheetFrequency = {\r\n WEEKLY: 0,\r\n FORTNIGHTLY: 2,\r\n MONTHLY: 3,\r\n properties: {\r\n 0: { description: 'Weekly', id: 0 },\r\n 1: { description: 'Fortnightly', id: 2 },\r\n 2: { description: 'Monthly', id: 3 },\r\n }\r\n };\r\n\r\n \r\n public Ir35Captured = {\r\n NOTASSESSED: 0,\r\n OUTSIDEIR35: 1,\r\n INSIDEIR35: 2,\r\n \r\n properties: {\r\n 0: { description: 'Status not assessed yet', id: 0 },\r\n 1: { description: 'Outside IR35', id: 1 },\r\n 2: { description: 'Inside IR35', id: 2 },\r\n }\r\n };\r\n static Default() { return new InvoicingEnums(); }\r\n\r\n }\r\n\r\n export class CurrencyEnums implements ICurrencyEnums {\r\n public CurrencyCodes = {\r\n GBP: 10,\r\n EUR: 20,\r\n USD: 30,\r\n YEN: 60,\r\n AUD: 70,\r\n CAD: 80,\r\n NOK: 90,\r\n ZAR: 100,\r\n SEK: 110,\r\n CHF: 120,\r\n AED: 130,\r\n QAR: 140,\r\n SGD: 150,\r\n properties: {\r\n 10: { value: \"GBP\", code: \"£\" },\r\n 20: { value: \"EUR\", code: \"€\" },\r\n 30: { value: \"USD\", code: \"$\" },\r\n 60: { value: \"YEN\", code: \"¥\" },\r\n 70: { value: \"AUD\", code: \"$\" },\r\n 80: { value: \"CAD\", code: \"$\" },\r\n 90: { value: \"NOK\", code: \"kr\" },\r\n 100: { value: \"ZAR\", code: \"R\" },\r\n 110: { value: \"SEK\", code: \"kr\" },\r\n 120: { value: \"CHF\", code: \"chf\" },\r\n 130: { value: \"AED\", code: \"aed\" },\r\n 140: { value: \"QAR\", code: \"qar\" },\r\n 150: { value: \"SGD\", code: \"S$\"}\r\n }\r\n };\r\n static Default() { return new CurrencyEnums(); }\r\n }\r\n\r\n export class ExpensesEnums implements IExpensesEnums {\r\n public PersonalOrCompany = {\r\n PERSONAL: 0,\r\n COMPANY: 1,\r\n properties: {\r\n 0: { description: 'Personal' },\r\n 1: { description: 'Company' }\r\n }\r\n };\r\n public ExpenseTypeCategory = {\r\n MILEAGE: 'MILEAGE'\r\n };\r\n public ExpenseWarningCodeTypes = {\r\n HighRisk: 1,\r\n Amount: 2,\r\n TwentyFourMonthRule: 3, \r\n };\r\n public ExpenseSubmissionType = {\r\n UNKNOWN: 0,\r\n MILEAGE: 1,\r\n RECEIPTATTACHED: 2,\r\n RECEIPTPRINTED: 3,\r\n MIRACLEMANUAL: 4,\r\n properties: {\r\n 0: { description: 'Unknown' },\r\n 1: { description: 'Mileage' },\r\n 2: { description: 'Receipt Attached' },\r\n 3: { description: 'Receipt Printed' },\r\n 4: { description: 'Manual' }\r\n }\r\n };\r\n public ReceiptStatus = {\r\n UNKNOWN: 0,\r\n UNATTACHED: 1,\r\n UNSUBMITTED: 2,\r\n SUBMITTED: 3\r\n };\r\n public FuelTypes = {\r\n PETROL: 1,\r\n DIESEL: 2,\r\n LPG: 3,\r\n properties: {\r\n 1: { description: 'Petrol' },\r\n 2: { description: 'Diesel' },\r\n 3: { description: 'LPG' }\r\n }\r\n };\r\n public EngineSize = {\r\n PETROL1_1400: 10,\r\n PETROL1401_2000: 20,\r\n PETROL2001_9999: 30,\r\n LPG1_1400: 40,\r\n LPG1401_2000: 50,\r\n LPG2001_9999: 60,\r\n DIESEL1_1600: 70,\r\n DIESEL1601_2000: 80,\r\n DIESEL2001_9999: 90,\r\n properties: {\r\n 10: { description: \"1-1400cc\", code: \"1400\" },\r\n 20: { description: \"1401-2000cc\", code: \"2000\" },\r\n 30: { description: \"2001-9999cc\", code: \"9999\" },\r\n 40: { description: \"1-1400cc\", code: \"1400\" },\r\n 50: { description: \"1401-2000cc\", code: \"2000\" },\r\n 60: { description: \"2001-9999cc\", code: \"9999\" },\r\n 70: { description: \"1-1600cc\", code: \"1600\" },\r\n 80: { description: \"1601-2000cc\", code: \"2000\" },\r\n 90: { description: \"2001-9999cc\", code: \"9999\" },\r\n }\r\n };\r\n static Default() { return new ExpensesEnums(); }\r\n }\r\n\r\n export class ImageEnums implements IImageEnums {\r\n public ImageSize = {\r\n ORIGINAL: 0,\r\n CUSTOM: 1,\r\n ASPECTRATIO: 2\r\n };\r\n static Default() { return new ImageEnums(); }\r\n }\r\n\r\n export class DocumentStorageEnums implements IDocumentStorageEnums {\r\n public FileView = {\r\n DETAILED: 0,\r\n THUMBNAIL: 1\r\n };\r\n public SharedDriveLinkStatus = {\r\n NONE: 0,\r\n SUCCESSFUL: 1,\r\n ERROR: 2\r\n };\r\n public DocumentCategory = {\r\n FOLDER: \"\",\r\n RECENTLYADDED: \"Recently Added\",\r\n FAVOURITES: \"Favourites\",\r\n SHAREDDRIVE: \"Brookson Shared Drive\"\r\n };\r\n public DocumentDataSource = {\r\n MEMBERWEBDOCUMENTS: 0,\r\n QUEUESERVICE: 1,\r\n MOLEDATA: 2,\r\n DROPBOX: 3\r\n };\r\n static Default() { return new DocumentStorageEnums(); }\r\n }\r\n\r\n export class DialogueEnums implements IDialogueEnums {\r\n public Dialogues = {\r\n MILEAGE24MONTHRULE: \"MILEAGE24MONTHRULE\",\r\n EXPENSESNOTICE: \"EXPENSESNOTICE\"\r\n };\r\n static Default() { return new DialogueEnums(); }\r\n }\r\n\r\n export class PersonalTaxEnums implements IPersonalTaxEnums {\r\n public Timeframes = {\r\n FORECAST: \"FORECAST\",\r\n YEARTODATE: \"YEARTODATE\",\r\n properties: {\r\n \"FORECAST\": { value: \"FORECAST\", description: \"Forecast\" },\r\n \"YEARTODATE\": { value: \"YEARTODATE\", description: \"Year To Date\" }\r\n }\r\n };\r\n static Default() { return new PersonalTaxEnums(); }\r\n }\r\n\r\n export class TaskPlannerEnums implements ITaskPlannerEnums {\r\n public TaskStatus = {\r\n COMPLETED: 0,\r\n CURRENT: 1,\r\n FUTURE: 2,\r\n OVERDUE: 3,\r\n properties: {\r\n 0: { values: 0, description: \"Completed\", css: \"task-completed\" },\r\n 1: { values: 1, description: \"Current\", css: \"task-current\" },\r\n 2: { values: 2, description: \"Future\", css: \"task-future\" },\r\n 3: { values: 3, description: \"Overdue\", css: \"task-overdue\" },\r\n }\r\n };\r\n public TaskResponsibility = {\r\n ME: 'Me',\r\n BROOKSON: 'Brookson'\r\n };\r\n static Default() { return new TaskPlannerEnums(); }\r\n }\r\n\r\n export class LoggingEnums implements ILoggingEnums {\r\n public LoggingLevel = {\r\n DEBUG: 0,\r\n INFO: 1,\r\n WARN: 2,\r\n ERROR: 3,\r\n FATAL: 4\r\n };\r\n static Default() { return new LoggingEnums(); }\r\n }\r\n\r\n export class BankLinkEnums implements IBankLinkEnums {\r\n public BankAccountType = {\r\n CURRENT: 0,\r\n DEPOSIT: 1,\r\n CREDIT_CARD: 2,\r\n DEPOSIT_BOND: 3\r\n };\r\n public TransactionType = {\r\n BUSINESS: 0,\r\n PERSONAL: 1,\r\n UNALLOCATED: 2,\r\n ALL: 3,\r\n OUTGOINGS: 4,\r\n properties: {\r\n 0: { description: 'Business' },\r\n 1: { description: 'Personal' },\r\n 2: { description: 'Unallocated' },\r\n 3: { description: 'All Types' },\r\n 4: { description: 'Outgoings & Balances' }\r\n }\r\n };\r\n public TransactionStatuses = {\r\n NONE: 0,\r\n SAVED: 1,\r\n SUBMITTED: 2,\r\n PROCESSED: 3,\r\n INTOUCHPROCESSED: 4,\r\n };\r\n public BankLogos = {\r\n BARCLAYS: '/Content/img/logos/banklogos/svg/logo_barclays.svg',\r\n CASHPLUS: '/Content/img/logos/banklogos/svg/logo_cashplus.svg',\r\n HSBC: '/Content/img/logos/banklogos/svg/logo_hsbc.svg',\r\n LLOYDS: '/Content/img/logos/banklogos/svg/logo_lloyds.svg',\r\n RBS: '/Content/img/logos/banklogos/svg/logo_rbs.svg',\r\n SANTANDER: '/Content/img/logos/banklogos/svg/logo_santander.png',\r\n HALIFAX: '/Content/img/logos/banklogos/svg/halifax.svg'\r\n };\r\n public BankIcons = {\r\n BARC: '/Content/img/logos/banklogos/svg/icon_barclays.svg',\r\n CASHPLUS: '/Content/img/logos/banklogos/svg/icon_cashplus.svg',\r\n HSBC: '/Content/img/logos/banklogos/svg/icon_hsbc.svg',\r\n LLOYDS: '/Content/img/logos/banklogos/svg/icon_lloydsbank.svg',\r\n RBS: '/Content/img/logos/banklogos/svg/icon_rbs.svg',\r\n SANTANDER: '/Content/img/logos/banklogos/svg/icon_santander.svg',\r\n HALIFAX: '/Content/img/logos/banklogos/svg/halifax.svg'\r\n };\r\n static Default() { return new BankLinkEnums(); }\r\n }\r\n\r\n export class NotificationEnums implements INotificationEnums {\r\n public NotificationSymbol = {\r\n \"money\": 'fa-gbp',\r\n \"process\": 'fa-cog',\r\n \"guide\": 'fa-question-circle',\r\n \"video\": 'fa-play',\r\n \"document\": 'fa-file',\r\n \"book\": 'fa-calendar',\r\n \"information\": 'fa-info-circle'\r\n };\r\n public NotificationColourLabel = {\r\n \"red\": 'label-danger',\r\n \"blue\": 'label-primary',\r\n \"green\": 'label-success',\r\n \"yellow\": 'label-warning',\r\n \"grey\": 'label-default'\r\n };\r\n static Default() { return new NotificationEnums(); }\r\n }\r\n\r\n export class HolidaysEnums implements IHolidaysEnums {\r\n public HolidayRequestStatus = {\r\n ALL: 0,\r\n PENDING: 1,\r\n APPROVED: 2,\r\n REJECTED: 3,\r\n properties: {\r\n 0: { description: \"All\" },\r\n 1: { description: \"Pending\" },\r\n 2: { description: \"Approved\" },\r\n 3: { description: \"Rejected\" }\r\n }\r\n };\r\n static Default() { return new HolidaysEnums(); }\r\n }\r\n\r\n export class MemberEnums implements IMemberEnums {\r\n public ServiceLineRole = {\r\n UNKNOWN: 'UNKNOWN',\r\n DIRECTOR: 'DIRECTOR',\r\n SHAREHOLDER: 'SHAREHOLDER',\r\n EMPLOYEE: 'EMPLOYEE',\r\n NONPRINCIPALDIR: 'NON PRINCIPAL DIR'\r\n };\r\n public ServiceLineBusinessType = {\r\n UNKNOWN: 'UNKNOWN',\r\n LTD: 'LTD',\r\n UMBRELLA: 'UMBRELLA',\r\n SME: 'SME'\r\n };\r\n static Default() { return new MemberEnums(); }\r\n }\r\n\r\n export class IR35Enums implements IIR35Enums {\r\n public IR35Status = {\r\n IR35Status_TaxedAsPAYE: 0,\r\n IR35Status_TaxedAsSelfEmployed: 1,\r\n IR35Status_Caution: 2,\r\n IR35Status_ActionRequired: 3,\r\n IR35Status_WithdrawnReview: 4,\r\n IR35Status_AssessmentFormSubmit: 5,\r\n IR35Status_AssessmentFormStarted: 6,\r\n properties: {\r\n 0: { description: \"Taxed as PAYE\" },\r\n 1: { description: \"Taxed as Self Employed\" },\r\n 2: { description: \"Caution\" },\r\n 3: { description: \"Action Required\" },\r\n 4: { description: \"Review Incomplete\" },\r\n 5: { description: \"Assessment Form Submitted\" },\r\n 6: { description: \"Assessment Form Incomplete\" }\r\n }\r\n };\r\n\r\n public ESAQuestionGroups: {\r\n Group1: '1',\r\n Group1Dot1: '1.1',\r\n Group1Dot2: '1.2',\r\n Group1Dot3: '1.3',\r\n Group2: '2',\r\n Group2Dot1: '2.1',\r\n Group3: '3',\r\n Group3Dot1: '3.1',\r\n Group3Dot2: '3.2',\r\n Group4: '4',\r\n Group5: '5',\r\n Group6: '6',\r\n Group7: '7',\r\n Group8: '8',\r\n Group9: '9',\r\n Group10: '10',\r\n Group11: '11',\r\n Group12: '12',\r\n Group13: '13',\r\n Group14: '14',\r\n Group15: '15',\r\n Group16: '16',\r\n Group17: '17',\r\n Group18: '18'\r\n };\r\n static Default() { return new IR35Enums(); }\r\n }\r\n\r\n angular.module(\"app.shared\")\r\n .constant(\"contact.enums\", ContactEnums.Default())\r\n .constant(\"invoicing.enums\", InvoicingEnums.Default())\r\n .constant(\"currency.enums\", CurrencyEnums.Default())\r\n .constant(\"expenses.enums\", ExpensesEnums.Default())\r\n .constant(\"image.enums\", ImageEnums.Default())\r\n .constant(\"documentStorage.enums\", DocumentStorageEnums.Default())\r\n .constant('dialogue.enums', DialogueEnums.Default())\r\n .constant('personalTax.enums', PersonalTaxEnums.Default())\r\n .constant('taskPlanner.enums', TaskPlannerEnums.Default())\r\n .constant('logging.enums', LoggingEnums.Default())\r\n .constant('bankLink.enums', BankLinkEnums.Default())\r\n .constant('notification.enums', NotificationEnums.Default())\r\n .constant('holidays.enums', HolidaysEnums.Default())\r\n .constant('member.enums', MemberEnums.Default())\r\n .constant('ir35.enums', IR35Enums.Default());\r\n}","module Shared {\r\n export interface IReceiptsService {\r\n getReceipts(silentMode?: boolean) : ng.IPromise>;\r\n getReceiptImageData(id: number, size?: Shared.ImageSize, width?: number, height?: number, silentMode?: boolean): ng.IPromise;\r\n deleteReceipts(receipts: Array): ng.IPromise;\r\n cropReceipt(receiptId: number, imageData: string): ng.IPromise;\r\n }\r\n\r\n export class ReceiptsService implements IReceiptsService {\r\n static $inject = ['$http'];\r\n\r\n constructor(\r\n private $http: Shared.IBrooksonHttp\r\n ) { }\r\n\r\n getReceipts(silentMode?: boolean): ng.IPromise> {\r\n return this.$http.get(`api/Receipts/GetReceipts`, {\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg>) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getReceiptImageData(id: number, size?: Shared.ImageSize, width?: number, height?: number, silentMode?: boolean): ng.IPromise {\r\n const requestData = {\r\n size: size,\r\n width: width,\r\n height: height\r\n };\r\n\r\n return this.$http.get(`api/Receipts/GetReceiptImageData/${id}`, {\r\n params: requestData,\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n\r\n deleteReceipts(receipts: Array): ng.IPromise {\r\n return this.$http.post(`api/Receipts/DeleteReceipts`, receipts)\r\n .then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n\r\n cropReceipt(receiptId: number, imageData: string): ng.IPromise {\r\n const requestData = {\r\n receiptId: receiptId,\r\n imageData: imageData\r\n };\r\n\r\n return this.$http.post(`api/Receipts/CropReceipt`, requestData)\r\n .then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module(\"app.shared\")\r\n .service(\"receiptSrv\", Shared.ReceiptsService);","/// \r\n/// \r\n\r\nmodule Shared {\r\n export interface IExpensesService {\r\n getMileageRates(silentMode?: boolean): ng.IPromise>;\r\n getExpenses(pageSize?: number, pageNo?: number): ng.IPromise>;\r\n saveExpenses(expenses: Shared.SaveExpenseRequest, silentMode?: boolean, hideGrowl?: boolean): ng.IPromise;\r\n deleteExpense(expenseSubmissionId: number): ng.IPromise;\r\n submitExpense(id: number, source: Shared.ExpenseDataSource, acceptMissingReceiptsExpenses?: RegularExpense[]): ng.IPromise;\r\n getExpenseDetails(expenseSubmissionId: number, dataSource: Shared.ExpenseDataSource): ng.IPromise;\r\n expenseReport(id: number, source: Shared.ExpenseDataSource): ng.IPromise;\r\n getExpenseOverView(silentMode?: boolean): ng.IPromise;\r\n getExpenseTypes(silentMode?: boolean): ng.IPromise>;\r\n getExpenseWarnings(silentMode?: boolean): ng.IPromise>;\r\n getExpenseWarningTypes(silentMode?: boolean): ng.IPromise>;\r\n getPublicSectorExpenseTypes(silentMode?: boolean): ng.IPromise>;\r\n getExpenseVehicles(silentMode?: boolean): ng.IPromise>;\r\n getExpenseVehiclesLookup(silentMode?: boolean): ng.IPromise>;\r\n saveExpenseVehicle(vehicle: Shared.ExpenseMileageVehicle): ng.IPromise;\r\n getTotalMileageForCurrentTaxYear(silentMode?: boolean): ng.IPromise;\r\n getTotalMileageForPreviousTaxYear(silentMode?: boolean): ng.IPromise ;\r\n getPersonalMileageAndTotalExpenses(): ng.IPromise;\r\n getExpenseGuidancePaymentCodes(): ng.IPromise>;\r\n removeWarningConfirmationsByExpenseId(expenseSubmissionId: number): ng.IPromise;\r\n }\r\n\r\n export class ExpensesService implements IExpensesService {\r\n\r\n static $inject = ['$http'];\r\n\r\n constructor(\r\n private $http: Shared.IBrooksonHttp\r\n ) { }\r\n\r\n getMileageRates(silentMode?: boolean): ng.IPromise> {\r\n var requestData = {\r\n effectiveDate: new Date()\r\n };\r\n\r\n return this.$http.get(\"api/Expenses/GetMileageRateLookup\",\r\n {\r\n params: requestData,\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg>) => response.data);\r\n }\r\n\r\n getExpenses(pageSize: number, pageNo: number): ng.IPromise> {\r\n const requestData = {\r\n pageSize: pageSize,\r\n pageNo: pageNo\r\n };\r\n\r\n return this.$http.get(\"api/Expenses/GetExpenses\",\r\n {\r\n params: requestData\r\n }).then((response: ng.IHttpPromiseCallbackArg>) => response.data);\r\n }\r\n\r\n getExpenseGuidancePaymentCodes(): ng.IPromise> {\r\n return this.$http.get(\"api/Expenses/GetExpenseGuidancePaymentCodes\")\r\n .then((response: ng.IHttpPromiseCallbackArg>) => response.data);\r\n }\r\n\r\n getPersonalMileageAndTotalExpenses(): ng.IPromise {\r\n\r\n return this.$http.get(\"api/Expenses/GetPersonalMileageAndTotalExpenses\")\r\n .then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n\r\n saveExpenses(expenses: Shared.SaveExpenseRequest, silentMode?: boolean, hideGrowl?: boolean): ng.IPromise {\r\n expenses.hideGrowl = hideGrowl;\r\n\r\n return this.$http.post(\"api/Expenses/SaveExpenses\", expenses, {\r\n silentMode: silentMode\r\n }).then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n\r\n deleteExpense(expenseSubmissionId: number): ng.IPromise {\r\n return this.$http.delete(`api/Expenses/DeleteExpense/${expenseSubmissionId}`)\r\n .then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n\r\n submitExpense(id: number, source: any, acceptMissingReceiptsExpenses?: RegularExpense[]): ng.IPromise {\r\n var request = {\r\n id: id,\r\n source: source,\r\n acceptMissingReceiptsExpenses: acceptMissingReceiptsExpenses\r\n };\r\n\r\n return this.$http.post(\"api/Expenses/SubmitExpenses\", request)\r\n .then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n\r\n getExpenseDetails(expenseSubmissionId: number, dataSource: Shared.ExpenseDataSource): ng.IPromise {\r\n var requestData = {\r\n id: expenseSubmissionId,\r\n source: dataSource\r\n };\r\n\r\n return this.$http.get(\"api/Expenses/GetExpenseDetails\", {\r\n params: requestData\r\n }).then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n\r\n expenseReport(id: number, source: Shared.ExpenseDataSource): ng.IPromise {\r\n const requestData = {\r\n id: id,\r\n source: source\r\n };\r\n\r\n return this.$http.get(`api/Expenses/GetExpenseReport`, {\r\n params: requestData\r\n }).then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n\r\n getExpenseOverView(silentMode?: boolean): ng.IPromise {\r\n return this.$http.get(`api/Expenses/GetExpenseOverview`,\r\n {\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n\r\n getExpenseTypes(silentMode?: boolean): ng.IPromise> {\r\n return this.$http.get(`api/Expenses/GetExpenseTypes/`)\r\n .then((response: ng.IHttpPromiseCallbackArg>) => response.data);\r\n }\r\n\r\n getExpenseWarnings(silentMode?: boolean): ng.IPromise> {\r\n return this.$http.get('api/Expenses/GetExpenseWarnings/')\r\n .then((response: ng.IHttpPromiseCallbackArg>) => response.data);\r\n }\r\n\r\n getExpenseWarningTypes(silentMode?: boolean): ng.IPromise> {\r\n return this.$http.get('api/Expenses/GetExpenseWarningTypes/')\r\n .then((response: ng.IHttpPromiseCallbackArg>) => response.data);\r\n }\r\n\r\n getPublicSectorExpenseTypes(silentMode?: boolean): ng.IPromise> {\r\n return this.$http.get(\"api/Expenses/GetPublicSectorExpenseTypes/\")\r\n .then((response: ng.IHttpPromiseCallbackArg>) => response.data);\r\n }\r\n\r\n getExpenseVehicles(silentMode?: boolean): ng.IPromise> {\r\n return this.$http.get(`api/Expenses/GetExpenseVehicles/`)\r\n .then((response: ng.IHttpPromiseCallbackArg>) => response.data);\r\n }\r\n \r\n getExpenseVehiclesLookup(silentMode?: boolean): ng.IPromise> {\r\n return this.$http.get(`api/Expenses/GetExpenseVehiclesLookup/`)\r\n .then((response: ng.IHttpPromiseCallbackArg>) => response.data);\r\n }\r\n \r\n saveExpenseVehicle(vehicle: Shared.ExpenseMileageVehicle): ng.IPromise {\r\n return this.$http.post(\"api/Expenses/SaveExpenseVehicle\", vehicle).then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n\r\n getTotalMileageForCurrentTaxYear(silentMode?: boolean): ng.IPromise {\r\n const requestData = {\r\n effectiveDate: new Date()\r\n };\r\n return this.$http.get(`api/Expenses/GetMileageTotal`, {\r\n params: requestData,\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getTotalMileageForPreviousTaxYear(silentMode?: boolean): ng.IPromise {\r\n const requestData = {\r\n effectiveDate: moment(new Date()).add(-1, 'year').toDate()\r\n };\r\n return this.$http.get(`api/Expenses/GetMileageTotal`, {\r\n params: requestData,\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n removeWarningConfirmationsByExpenseId(expenseSubmissionId: number): ng.IPromise {\r\n return this.$http.delete(`api/Expenses/DeleteWarningConfirmation/${expenseSubmissionId}`)\r\n .then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module(\"app.shared\")\r\n .service(\"expensesSrv\", Shared.ExpensesService);","module Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n\r\n export class ExpenseWarnings {\r\n\r\n // EXPENSEWARNINGID\r\n public expenseWarningId: number = 0;\r\n // CODEVALUE\r\n public codeValue: string = null;\r\n // CODETEXT\r\n public codeText: string = null;\r\n // CATEGORY\r\n public category: string = null;\r\n // WARNINGMESSAGETEXT\r\n public warningMessageText: string = null;\r\n // TIMELENGTH\r\n public timeLength: number = 0;\r\n // VALUELIMIT\r\n public valueLimit: number = 0;\r\n // HIGHRISK\r\n public highRisk: boolean = false;\r\n // 24MTHRULEAPPLICABLE\r\n public twentyFourMthRuleApplicable: boolean = false;\r\n // 24MTHTRIGGEROVERRIDE\r\n public twentyFourMthTriggerOverride: number = 0;\r\n // ENABLED\r\n public enabled: boolean = false;\r\n }\r\n}\r\n","module Shared {\r\n export interface IExpenseWarningsService {\r\n saveExpenseWarnings(assignmentId: string, memberId: string, expenseHeaderId: number, expenseWarnings: ExpenseWarning[]): ng.IPromise;\r\n getConfirmedExpenseWarnings(memberid, assignmentId): angular.IPromise;\r\n deleteExpenseWarningLogById(expenseWarningLogId: number): angular.IPromise;\r\n }\r\n\r\n export class ExpenseWarningsService implements IExpenseWarningsService {\r\n\r\n static $inject = ['$http'];\r\n\r\n constructor(\r\n private $http: Shared.IBrooksonHttp\r\n ) { }\r\n\r\n saveExpenseWarnings(assignmentId: string,\r\n memberId: string,\r\n expenseHeaderId: number,\r\n expenseWarnings: ExpenseWarning[]): ng.IPromise {\r\n let expenseConfirmationModel = {\r\n memberId: memberId,\r\n assignmentId: assignmentId,\r\n expenseHeaderId: expenseHeaderId,\r\n confirmedWarnings: expenseWarnings\r\n };\r\n return this.$http.post(\"/api/expenses/saveExpenseWarnings\", expenseConfirmationModel)\r\n .then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n\r\n getConfirmedExpenseWarnings(memberid, assignmentId): angular.IPromise {\r\n const requestData = {\r\n memberId: memberid,\r\n assignmentId: assignmentId\r\n };\r\n return this.$http.get(\"/api/expenses/getExpenseWarningConfirmations\", { params: requestData })\r\n .then((response: ng.IHttpPromiseCallbackArg>) => response.data);\r\n }\r\n\r\n deleteExpenseWarningLogById(expenseWarningLogId): angular.IPromise {\r\n return this.$http.delete(`api/Expenses/DeleteExpenseWarningLogById/${expenseWarningLogId}`)\r\n .then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n\r\n }\r\n}\r\n\r\nangular\r\n .module(\"app.shared\")\r\n .service(\"expensesWarningsService\", Shared.ExpenseWarningsService);","module Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n\r\n export class ExpenseWarningTypes {\r\n\r\n // EXPENSETYPEWARNINGTYPEID\r\n public expenseWarningTypeId: number = 0;\r\n // EXPENSEWARNINGID\r\n public expenseWarningId: number = 0;\r\n // EXPENSEWARNINGCODETYPEID\r\n public expenseWarningCodeTypeId: number = 0;\r\n // EXPENSEWARNINGTEXT\r\n public expenseWarningText: string = null;\r\n }\r\n}\r\n","module Shared {\r\n export class AppSettings {\r\n environment: string;\r\n isDevelopment: boolean;\r\n isStaging: boolean;\r\n isProduction: boolean;\r\n isInternal: boolean;\r\n dashboardEnabled: boolean;\r\n personalTaxPlannerEnabled: boolean;\r\n personalTaxEnabled: boolean;\r\n personalTaxTrackerEnabled: boolean;\r\n personalTaxHMRCPersonalAccountBalanceEnabled: boolean;\r\n personalTaxSelfAssessment: boolean;\r\n personalFinanceEnabled: boolean;\r\n pscAssignmentsEnabled: boolean;\r\n personalFinancePortfolioTrackerEnabled: boolean;\r\n personalTaxEnabledPersonalFinanceRiskProfileEnabled: boolean;\r\n personalFinanceRetirementPlannerEnabled: boolean;\r\n \r\n financialServicesEnabled: boolean;\r\n pscEnabled: boolean;\r\n pscMoneyManagerEnabled: boolean;\r\n pscExpensesEnabled: boolean;\r\n pscExpensesEnabledGlobally: boolean;\r\n pscInvoicingEnabled: boolean;\r\n pscBankEnabled: boolean;\r\n pscTaskPlannerEnabled: boolean;\r\n pscDocumentStorageEnabled: boolean;\r\n pscEmploymentStatusEnabled: boolean;\r\n pscCalendarEnabled: boolean;\r\n knowledgeBaseEnabled: boolean;\r\n advisorySectionEnabled: boolean;\r\n allowedToFileSelfAssessments: boolean;\r\n googleAnalyticsTrackingCode: string;\r\n smeEnabled: boolean;\r\n smeHolidaysEnabled: boolean;\r\n smePayslipsEnabled: boolean;\r\n smeExpensesEnabled: boolean;\r\n smeStaffEnabled: boolean;\r\n smeOvertimeEnabled: boolean;\r\n smeManagement: boolean;\r\n employeeSmeEnabled: boolean;\r\n smeHolidayRequestsEnabled: boolean;\r\n smeOvertimeRequestsEnabled: boolean;\r\n smeDocumentStorageEnabled: boolean;\r\n smeEmployeeProfile: boolean;\r\n smeEmployeeOvertime: boolean;\r\n smeEmployeeHolidays: boolean;\r\n smeEmployeeExpenses: boolean;\r\n smeEmployeePayslips: boolean;\r\n smeEmployeeDocumentStorageEnabled: boolean;\r\n smePersonalTaxTrackerEnabled: boolean;\r\n connect2Url: string;\r\n invoiceTitle: string;\r\n paymentTitle: string;\r\n invoiceDescription: string;\r\n hasBeenSdcAssessedForAllAssignments: boolean;\r\n displaySdcQuestionnaireCompletionPopup: boolean;\r\n displayIR35DetailCapturePopup: boolean;\r\n disableExpenseSubmission: boolean;\r\n disableExpenseSubmissionDateTime: boolean;\r\n displayPublicSectorAssignmentCheckPopup: boolean;\r\n displayUmbrellaTrustModal: boolean;\r\n umbEnabled: boolean;\r\n showMoneyMangerTransactions: boolean;\r\n disableSDCOnAssignment: boolean;\r\n enableExpenseEnhancementModal: boolean;\r\n ltdCustomerReference: string;\r\n hasLtdBusinessType: boolean;\r\n hasMulipleLtdCompanies: boolean;\r\n umbCustomerReference: string;\r\n hasUmbBusinessType: boolean;\r\n finplanUrl: string;\r\n validApiSource: boolean;\r\n isIntouchSite: boolean;\r\n newInvoiceEnabled: boolean;\r\n pdfModalEnabled: boolean;\r\n disableWorldPay: boolean;\r\n siteCompanyName: string;\r\n }\r\n}","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n export interface IExpensesFactory {\r\n editMode: boolean;\r\n selectedAssignment: Shared.Assignment;\r\n assignments: Array;\r\n selectedVehicle: Shared.ExpenseMileageVehicle;\r\n expenseLineCounter: number;\r\n expenseHeader: Shared.ExpenseHeader;\r\n expenseTypes: Array;\r\n expenseGuidancePaymentCodes: Array;\r\n expenseWarnings: Array;\r\n expenseWarningTypes: Array;\r\n publicSectorExpenseTypes: Array;\r\n mileageVehicles: Array;\r\n mileageVehiclesLookup: Array;\r\n vehicleFuelTypes: Shared.IExpensesEnums;\r\n regularExpenses: Array;\r\n mileageExpenses: Array;\r\n allowanceExpenses: Array;\r\n receipts: Array;\r\n totalMileageForCurrentTaxYear: number;\r\n totalMileageForPreviousTaxYear: number;\r\n restrictMileage: boolean;\r\n restrictMileageMaxDate: Shared.BrooksonDate;\r\n maxDate: moment.Moment;\r\n refreshRequired: boolean;\r\n isAutoSaving: boolean;\r\n expensesWaitingForIds: Array;\r\n copyMode: boolean;\r\n copyModeValidateMileage: boolean;\r\n copyModeValidateRegular: boolean;\r\n copyModeValidateAllowance: boolean;\r\n showMileageVatableExpenses: boolean;\r\n confirmedExpenseWarning: Array;\r\n expensesWarningsConfirmed: Array;\r\n\r\n getExpenses(pageSize?: number, pageNo?: number): ng.IPromise>;\r\n getExpenseWarningText(expenseWarningId: number, expenseWarningCodeTypeId: number): any;\r\n getExpenseWarning(expense: Shared.ExpenseType): Shared.ExpenseWarnings;\r\n getPersonalMileageAndTotalExpenses(): ng.IPromise;\r\n getExpenseGuidancePaymentCodes(): ng.IPromise>;\r\n addNewExpenseLineData(data: any): void;\r\n mapRatesToMileageExpenseTypes(rates: any): void;\r\n getExpenseTypes(): ng.IPromise>;\r\n getExpenseWarnings(): ng.IPromise>;\r\n deleteIndividualConfirmedExpenseLine(warningCodeValue: string): ng.IPromise;\r\n getExpenseWarningTypes(): ng.IPromise>;\r\n getPublicSectorExpenseTypes(): ng.IPromise>;\r\n getExpenseVehicles(): ng.IPromise>;\r\n getExpenseVehiclesLookup(): ng.IPromise>;\r\n saveExpenseVehicle(request: Shared.ExpenseMileageVehicle): ng.IPromise;\r\n saveExpenses(request: Shared.SaveExpenseRequest, silentMode?: boolean, hideGrowl?: boolean): ng.IPromise;\r\n deleteExpense(expenseSubmissionId: number): ng.IPromise;\r\n submitExpense(id: number, source: Shared.ExpenseDataSource, acceptMissingReceiptsExpenses?: RegularExpense[]): ng.IPromise;\r\n generateGUID(): string;\r\n removeWarningConfirmationsByExpenseId(expenseSubmissionId: number): ng.IPromise;\r\n mapExpenseDetails(data: Shared.ExpenseDetails);\r\n getExpenseDetails(expenseSubmissionId: number, dataSource: Shared.ExpenseDataSource): ng.IPromise;\r\n getTotalMileageForCurrentTaxYear(refresh?: boolean): ng.IPromise;\r\n getTotalMileageForPreviousTaxYear(refresh?: boolean): ng.IPromise;\r\n getReceipts(silentMode?: boolean): ng.IPromise>;\r\n getReceiptImageData(id: number, size?: Shared.ImageSize, width?: number, height?: number, silentMode?: boolean): ng.IPromise;\r\n getReceiptImageThumbnailData(receiptId: number): ng.IPromise;\r\n deleteReceipts(receipts: Array): ng.IPromise;\r\n cropReceipt(receiptId: number, imageData: string): ng.IPromise;\r\n resetReceiptStatus(receiptId: number): void;\r\n expenseReport(id: number, source: Shared.ExpenseDataSource): ng.IPromise;\r\n createReceiptFlowFactory(): flowjs.IFlowOptions;\r\n getExpenseOverView(silentMode?: boolean): ng.IPromise;\r\n mileageExpensesTotal(): number;\r\n regularExpensesTotal(): number;\r\n allowanceExpensesTotal(): number;\r\n receiptsTotal(): number;\r\n receiptAttached(expense: Shared.RegularExpense, listener: Function): void;\r\n deleteReceiptFromExpenseLine(expense: Shared.RegularExpense): void;\r\n prepareSaveExpense(mileageExpenses?: Array, regularExpenses?: Array, allowanceExpenses?: Array): Shared.SaveExpenseRequest;\r\n prepareMileageExpense(expenseItem: Shared.MileageExpense) : void;\r\n prepareAllowanceExpense(expenseItem: Shared.RegularExpense) : void;\r\n prepareRegularExpense(expenseItem: Shared.RegularExpense): void;\r\n getAllVatRates(silentMode?: boolean): ng.IPromise>;\r\n getAllVatRatesConfig(silentMode?: boolean): ng.IPromise>;\r\n isDeemedAssignment(assignment: Shared.Assignment): boolean;\r\n grossPaymentReceived(assignment: Shared.Assignment): boolean;\r\n saveConfirmedExpenseWarning(assignmentId: string, memberId: string, expenseHeaderId: number, expenseWarnings: ExpenseWarning[]): ng.IPromise;\r\n getConfirmedExpenseWarnings(memberid, assignmentId): ng.IPromise;\r\n addExpenseWarningMessage(expenseWarning: ExpenseWarnings, expenseLine: Shared.CoreExpenseItem): void;\r\n removeExpenseWarnings(expenseWarning: ExpenseWarnings, expenseLine: Shared.RegularExpense): void;\r\n removeConfirmedExpense(expense: any): ng.IPromise;\r\n getExpenseWarningType(expense: Shared.ExpenseType): Shared.ExpenseWarnings;\r\n populateConfirmedExpenseWarnings(memberid: number, assignmentId: string): ng.IPromise;\r\n diffMonths(dt1, dt2): number;\r\n getLatestConfirmedExpense(expenseWarning: Shared.ExpenseWarnings, warningCodeType: ExpenseWarningCodeTypes): Shared.ConfirmedExpenseWarning;\r\n setExpenseWarningMessage(expenseLine: Shared.CoreExpenseItem, expenseWarning: Shared.ExpenseWarnings, expenseWarningCodeTypes: ExpenseWarningCodeTypes): void;\r\n showGuidance(paymentCode: string): ng.IPromise;\r\n expenseGuidanceExists(expenseType: any): boolean;\r\n buildPresentedExpenseWarnings(): void;\r\n tabExpenseWarningCount(tabName: string): number;\r\n confirmExpenseWarning(expenseLine: Shared.CoreExpenseItem): void;\r\n confirmExpenseWarningTwentyFour(expenseLine: Shared.CoreExpenseItem): void;\r\n expenseTypeChanged(expense: Shared.ExpenseType, index: number, expenseList: any): void;\r\n autoSaveExpenses(oldVal: Array, newVal: Array, expenseType: ExpenseTypeRef): void;\r\n updateWarningsAssignmentChange(expenses: Shared.CoreExpenseItem[]): void;\r\n showExpenseWarningModal(): ng.IPromise;\r\n clearConfirmedExpenseWarnings();\r\n }\r\n\r\n export class ExpensesFactory implements IExpensesFactory {\r\n public vehicleFuelTypes: IExpensesEnums;\r\n public selectedVehicle: Shared.ExpenseMileageVehicle;\r\n public editMode: boolean = false;\r\n public selectedAssignment: Shared.Assignment = null;\r\n public assignments: Array = [];\r\n\r\n public expenseLineCounter: number = 0;\r\n\r\n public expenseHeader: Shared.ExpenseHeader = new ExpenseHeader();\r\n\r\n public expenseTypes: Array = [];\r\n public expenseGuidancePaymentCodes: Array = [];\r\n public expenseWarnings: Array = [];\r\n public expenseWarningTypes: Array = [];\r\n public publicSectorExpenseTypes: Array = [];\r\n public mileageVehicles: Array = [];\r\n public mileageVehiclesLookup: Array = [];\r\n public regularExpenses: Array = [];\r\n public mileageExpenses: Array = [];\r\n public allowanceExpenses: Array = [];\r\n public receipts: Array = [];\r\n public totalMileageForCurrentTaxYear: number = 0;\r\n public totalMileageForPreviousTaxYear: number = 0;\r\n public restrictMileage: boolean = false;\r\n public restrictMileageMaxDate: Date = null;\r\n public maxDate: moment.Moment = moment().add(7, \"days\");\r\n public refreshRequired: boolean = false;\r\n public isAutoSaving: boolean = false;\r\n public expensesWaitingForIds: Array = [];\r\n public showMileageVatableExpenses: boolean = false;\r\n public confirmedExpenseWarning: ExpenseWarning[];\r\n public expensesWarningsConfirmed: ConfirmedExpenseWarning[];\r\n private expensesTabWarningSummary: ExpenseTabWarnings;\r\n public lastRegularExpenseVal: Array = [];\r\n\r\n /**\r\n * Property to store whether the user is cloning an expense form\r\n * \r\n * @type {boolean}\r\n * @memberOf ExpensesFactory\r\n */\r\n public copyMode: boolean = false;\r\n\r\n /**\r\n * These validation properties are used as the validation looks for whether\r\n * the form is dirty and invalid, however if the user is cloning an expense,\r\n * the form is prepopulated. The form may not have been rendered so the validation\r\n * has nothing to check against.\r\n * */\r\n public copyModeValidateMileage: boolean = false;\r\n public copyModeValidateRegular: boolean = false;\r\n public copyModeValidateAllowance: boolean = false;\r\n\r\n static $inject = [\"$http\", \"$q\", \"$window\", \"expensesSrv\", \"receiptSrv\", \"memberSrv\", \"flowFactory\", \"expenses.enums\", \"brookson.utilities.date\", \"currency.enums\", \"shared.config\", \"expensesWarningsService\", \"$uibModal\", \"localStorageService\", \"appSettings\"];\r\n\r\n constructor(\r\n private $http: any,\r\n private $q: ng.IQService,\r\n private $window: Window,\r\n private expensesSrv: Shared.IExpensesService,\r\n private receiptSrv: Shared.IReceiptsService,\r\n private memberSrv: Shared.IMemberService,\r\n private flowFactory: any,\r\n private expensesEnums: Shared.IExpensesEnums,\r\n private dateUtils: Shared.IBrooksonUtilitiesDate,\r\n private currencyEnums: Shared.ICurrencyCodes,\r\n private sharedConfig: any,\r\n private expensesWarningsService: Shared.IExpenseWarningsService,\r\n private $uibModal: ng.ui.bootstrap.IModalService,\r\n private localStorageService: ng.local.storage.ILocalStorageService,\r\n private appSettings: Shared.AppSettings\r\n ) {\r\n if (!this.confirmedExpenseWarning) this.clearConfirmedExpenseWarnings();\r\n\r\n this.expensesWarningsConfirmed = new Array();\r\n this.getExpenseWarnings().then(data => {\r\n this.expenseWarnings = data;\r\n });\r\n this.getExpenseWarningTypes().then(data => {\r\n this.expenseWarningTypes = data;\r\n });\r\n this.getExpenseGuidancePaymentCodes().then(data => {\r\n this.expenseGuidancePaymentCodes = data;\r\n });\r\n }\r\n\r\n getExpenses(pageSize: number, pageNo: number): ng.IPromise> {\r\n return this.expensesSrv.getExpenses(pageSize, pageNo);\r\n }\r\n\r\n getPersonalMileageAndTotalExpenses(): ng.IPromise {\r\n return this.expensesSrv.getPersonalMileageAndTotalExpenses();\r\n }\r\n\r\n addNewExpenseLineData(data: any): void {\r\n var newId = this.generateGUID();\r\n\r\n data.push({\r\n markedAsDelete: false,\r\n tempID: newId\r\n });\r\n }\r\n\r\n mapRatesToMileageExpenseTypes(rates: Array): void {\r\n var mileageExpenseTypes =\r\n _.filter(this.expenseTypes, eType => (eType.category === this.expensesEnums.ExpenseTypeCategory.MILEAGE));\r\n\r\n _.forEach(mileageExpenseTypes, eType => {\r\n eType.rates = _.filter(rates, (rate: Shared.MileageExpenseRateLookup) => (rate.paymentCode === eType.paymentCode));\r\n });\r\n }\r\n\r\n getExpenseTypes(): ng.IPromise> {\r\n var deferred = this.$q.defer>();\r\n\r\n if (this.expenseTypes.length === 0) {\r\n return this.expensesSrv.getExpenseTypes().then((data: Array) => {\r\n this.expenseTypes = data;\r\n return this.expensesSrv.getMileageRates();\r\n }).then(data => {\r\n this.mapRatesToMileageExpenseTypes(data);\r\n return this.expenseTypes;\r\n });\r\n } else {\r\n deferred.resolve(this.expenseTypes);\r\n }\r\n\r\n return deferred.promise;\r\n }\r\n\r\n getExpenseWarnings(): ng.IPromise> {\r\n var deferred = this.$q.defer>();\r\n\r\n if (this.expenseWarnings.length === 0) {\r\n return this.expensesSrv.getExpenseWarnings()\r\n .then((data: Array) => {\r\n this.expenseWarnings = data;\r\n return this.expenseWarnings; \r\n }).then(data => {\r\n this.expenseWarnings = data;\r\n return this.expenseWarnings;\r\n });\r\n } else {\r\n deferred.resolve(this.expenseWarnings);\r\n }\r\n\r\n return deferred.promise;\r\n }\r\n\r\n getExpenseWarningText = (expenseWarningId: number, expenseWarningCodeTypeId: number): any => {\r\n let expenseType = _.find(this.expenseWarningTypes, (n: any) => {\r\n return n.expenseWarningId === expenseWarningId && n.expenseWarningCodeTypeId === expenseWarningCodeTypeId;\r\n });\r\n\r\n return expenseType;\r\n }\r\n\r\n getExpenseWarningTypes(): ng.IPromise> {\r\n var deferred = this.$q.defer>();\r\n\r\n if (this.expenseWarningTypes.length === 0) {\r\n return this.expensesSrv.getExpenseWarningTypes()\r\n .then((data: Array) => {\r\n this.expenseWarningTypes = data;\r\n return this.expenseWarningTypes;\r\n }).then(data => {\r\n this.expenseWarningTypes = data;\r\n return this.expenseWarningTypes;\r\n });\r\n } else {\r\n deferred.resolve(this.expenseWarningTypes);\r\n }\r\n\r\n return deferred.promise;\r\n }\r\n\r\n getPublicSectorExpenseTypes(): ng.IPromise> {\r\n var deferred = this.$q.defer>();\r\n\r\n if (this.publicSectorExpenseTypes.length === 0) {\r\n return this.expensesSrv.getPublicSectorExpenseTypes().then((data: Array) => {\r\n this.publicSectorExpenseTypes = data;\r\n return this.publicSectorExpenseTypes;\r\n });\r\n } else {\r\n deferred.resolve(this.publicSectorExpenseTypes);\r\n }\r\n\r\n this.getExpenseVehicles();\r\n return deferred.promise;\r\n }\r\n\r\n getExpenseVehicles(): ng.IPromise> {\r\n return this.expensesSrv.getExpenseVehicles().then((data: Array) => {\r\n this.mileageVehicles = data;\r\n return data;\r\n });\r\n }\r\n\r\n getExpenseGuidancePaymentCodes(): ng.IPromise> {\r\n return this.expensesSrv.getExpenseGuidancePaymentCodes().then((data: Array) => {\r\n this.expenseGuidancePaymentCodes = data;\r\n return data;\r\n });\r\n }\r\n\r\n getExpenseVehiclesLookup(): ng.IPromise> {\r\n return this.expensesSrv.getExpenseVehiclesLookup().then((data: Array) => {\r\n this.mileageVehiclesLookup = data;\r\n return data;\r\n });\r\n }\r\n\r\n saveExpenseVehicle(request: Shared.ExpenseMileageVehicle): ng.IPromise {\r\n return this.expensesSrv.saveExpenseVehicle(request);\r\n }\r\n \r\n saveExpenses(request: Shared.SaveExpenseRequest, silentMode?: boolean, hideGrowl?: boolean): ng.IPromise {\r\n if (this.isAutoSaving) {\r\n var defered = this.$q.defer();\r\n defered.resolve(undefined);\r\n return defered.promise;\r\n }\r\n\r\n this.isAutoSaving = true;\r\n this.buildPresentedExpenseWarnings();\r\n return this.expensesSrv.saveExpenses(request, silentMode, hideGrowl).then((data: Shared.ExpenseDetails) => {\r\n var updatedExpenseDetails = this.mapExpenseDetails(data);\r\n return updatedExpenseDetails;\r\n }).then((data) => this.postSaveExpenses(request, data));\r\n }\r\n\r\n deleteExpense(expenseSubmissionId: number): ng.IPromise {\r\n return this.expensesSrv.deleteExpense(expenseSubmissionId);\r\n }\r\n\r\n submitExpense(id: number, source: Shared.ExpenseDataSource, acceptMissingReceiptsExpenses?: RegularExpense[]): ng.IPromise {\r\n return this.expensesSrv.submitExpense(id, source, acceptMissingReceiptsExpenses);\r\n }\r\n\r\n generateGUID(): string {\r\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {\r\n var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);\r\n return v.toString(16);\r\n });\r\n }\r\n\r\n mapExpenseDetails(data: Shared.ExpenseDetails) {\r\n if (!_.isNil(data)) {\r\n this.expenseHeader = data.expenseHeader;\r\n\r\n _.map(data.regularExpenses, (expense: Shared.RegularExpense) => {\r\n expense.markedAsDelete = expense.isDeleted;\r\n\r\n var expenseType = _.find(this.expenseTypes, eType => (eType.expenseTypeId === expense.expenseTypeId));\r\n\r\n expense.typeObject = expenseType;\r\n expense.date = this.dateUtils.convertToJsDate(expense.date);\r\n });\r\n\r\n _.map(data.mileageExpenses, (expense: Shared.MileageExpense) => {\r\n expense.markedAsDelete = expense.isDeleted;\r\n\r\n var expenseType = _.find(this.expenseTypes, eType => (eType.expenseTypeId === expense.expenseTypeId));\r\n var expenseMileageVehicle = _.find(this.mileageVehicles, mVehicles => (mVehicles.registration === expense.vehicleRegistration));\r\n if(this.mileageVehicles.length === 1)\r\n {\r\n expenseMileageVehicle = this.mileageVehicles[0];\r\n }\r\n expense.typeObject = expenseType;\r\n expense.vehicleObject = expenseMileageVehicle;\r\n expense.date = this.dateUtils.convertToJsDate(expense.date);\r\n\r\n // If the expense is an older one from Connect2, it won't have a tempID set, so we make one so that it won't duplicate the expenseItemIDs later in the code [and then the backend ignores the dupes bar 1]\r\n if (expense.tempID === \"00000000-0000-0000-0000-000000000000\") {\r\n expense.tempID = this.generateGUID();\r\n }\r\n\r\n });\r\n\r\n _.map(data.allowanceExpenses, (expense: Shared.RegularExpense) => {\r\n expense.markedAsDelete = expense.isDeleted;\r\n\r\n var expenseType = _.find(this.expenseTypes, eType => (eType.expenseTypeId === expense.expenseTypeId));\r\n\r\n expense.typeObject = expenseType;\r\n expense.date = this.dateUtils.convertToJsDate(expense.date);\r\n });\r\n }\r\n\r\n return data;\r\n }\r\n\r\n removeWarningConfirmationsByExpenseId(expenseSubmissionId: number): ng.IPromise {\r\n return this.expensesSrv.removeWarningConfirmationsByExpenseId(expenseSubmissionId);\r\n }\r\n\r\n getExpenseDetails(expenseSubmissionId: number, dataSource: Shared.ExpenseDataSource): ng.IPromise {\r\n return this.expensesSrv.getExpenseDetails(expenseSubmissionId, dataSource).then((data) => {\r\n if (data) {\r\n this.mapExpenseDetails(data);\r\n\r\n this.expenseHeader = data.expenseHeader;\r\n\r\n if (data.mileageExpenses.length > 0) {\r\n this.mileageExpenses = data.mileageExpenses;\r\n }\r\n\r\n if (data.allowanceExpenses.length > 0) {\r\n this.allowanceExpenses = data.allowanceExpenses;\r\n }\r\n\r\n if (data.regularExpenses.length > 0) {\r\n this.regularExpenses = data.regularExpenses;\r\n }\r\n }\r\n return data;\r\n });\r\n }\r\n\r\n getTotalMileageForCurrentTaxYear(refresh?: boolean): ng.IPromise {\r\n if (!this.totalMileageForCurrentTaxYear || (refresh === true) || this.refreshRequired) {\r\n return this.expensesSrv.getTotalMileageForCurrentTaxYear();\r\n } else {\r\n var defered = this.$q.defer();\r\n defered.resolve(this.totalMileageForCurrentTaxYear);\r\n return defered.promise;\r\n }\r\n }\r\n\r\n getTotalMileageForPreviousTaxYear(refresh?: boolean): ng.IPromise {\r\n if (!this.totalMileageForPreviousTaxYear || (refresh === true) || this.refreshRequired) {\r\n return this.expensesSrv.getTotalMileageForPreviousTaxYear();\r\n } else {\r\n var defered = this.$q.defer();\r\n defered.resolve(this.totalMileageForPreviousTaxYear);\r\n return defered.promise;\r\n }\r\n }\r\n\r\n getReceipts(silentMode?: boolean): ng.IPromise> {\r\n return this.receiptSrv.getReceipts(silentMode).then((data) => {\r\n this.receipts = data;\r\n\r\n _.forEach(this.receipts, receipt => {\r\n // The status value of the receipt may change through the application so we\r\n // need to keep a record of the orignal value\r\n receipt.statusOriginalValue = receipt.status;\r\n\r\n // If the user has added an expense before getReceipts is called, they may have regular expenses with a receipt attached,\r\n // we need to go through and check whether the receiptId has been assigned to an expense.\r\n var isAttachedToUnsavedExpense = _.filter(this.regularExpenses, (expense: Shared.RegularExpense) => (expense.receiptId === receipt.receiptId && !expense.expenseID)).length > 0;\r\n\r\n if (isAttachedToUnsavedExpense) {\r\n receipt.status = this.expensesEnums.ReceiptStatus.UNSUBMITTED;\r\n }\r\n });\r\n\r\n return data;\r\n });\r\n }\r\n\r\n\r\n getExpenseWarning = (expense: Shared.ExpenseType): Shared.ExpenseWarnings => {\r\n if (expense) {\r\n let expenseType = _.filter(this.expenseWarnings,\r\n (n: Shared.ExpenseWarnings) => {\r\n return n.codeValue.trim().toString() === expense.paymentCode.trim().toString();\r\n });\r\n\r\n return expenseType[0];\r\n }\r\n return null;\r\n }\r\n\r\n getReceiptImageData(id: number, size?: Shared.ImageSize, width?: number, height?: number, silentMode?: boolean): ng.IPromise {\r\n return this.receiptSrv.getReceiptImageData(id, size, width, height, silentMode);\r\n }\r\n\r\n getReceiptImageThumbnailData(receiptId: number): ng.IPromise {\r\n return this.getReceiptImageData(receiptId, Shared.ImageSize.CUSTOM, 50, 50).then(data => data);\r\n }\r\n\r\n deleteReceipts(receipts: Array): ng.IPromise {\r\n return this.receiptSrv.deleteReceipts(receipts);\r\n }\r\n\r\n cropReceipt(receiptId: number, imageData: string): ng.IPromise {\r\n return this.receiptSrv.cropReceipt(receiptId, imageData);\r\n }\r\n\r\n resetReceiptStatus(receiptId: number): void {\r\n var oldReceipt = _.find(this.receipts, (receipt: any) => (receipt.receiptId === receiptId));\r\n\r\n if (oldReceipt) {\r\n oldReceipt.status = this.expensesEnums.ReceiptStatus.UNATTACHED;\r\n }\r\n }\r\n\r\n expenseReport(id: number, source: Shared.ExpenseDataSource): ng.IPromise {\r\n return this.expensesSrv.expenseReport(id, source);\r\n }\r\n\r\n createReceiptFlowFactory(): flowjs.IFlowOptions {\r\n return this.flowFactory.create({\r\n target: \"/api/Receipts/Upload\",\r\n permanentErrors: [404, 500, 501],\r\n headers: {\r\n \"__RequestVerificationToken\": this.$window.brookson.antiForgeryToken,\r\n \"Accept\": \"application/json\"\r\n },\r\n testChunks: false,\r\n simultaneousUploads: 1,\r\n chunkSize: 9007199254740992\r\n });\r\n }\r\n\r\n getExpenseOverView(silentMode?: boolean): ng.IPromise {\r\n return this.expensesSrv.getExpenseOverView(silentMode);\r\n }\r\n\r\n mileageExpensesTotal(): number {\r\n return _.filter(this.mileageExpenses, (expense: Shared.MileageExpense) => (expense.markedAsDelete !== true && expense.description && expense.date && expense.gross && expense.miles && expense.rate && expense.typeObject)).length;\r\n }\r\n\r\n regularExpensesTotal(): number {\r\n return _.filter(this.regularExpenses, (expense: Shared.RegularExpense) => (expense.markedAsDelete !== true && expense.date && expense.description && expense.gross && expense.typeObject)).length;\r\n }\r\n\r\n allowanceExpensesTotal(): number {\r\n return _.filter(this.allowanceExpenses, (expense: Shared.RegularExpense) => (expense.markedAsDelete !== true && expense.date && expense.description && expense.gross && expense.typeObject)).length;\r\n }\r\n\r\n receiptsTotal(): number {\r\n return _.filter(this.receipts, (receipt: any) => (receipt.status === this.expensesEnums.ReceiptStatus.UNATTACHED)).length;\r\n }\r\n\r\n receiptAttached = (expense: Shared.RegularExpense, listener: Function) => {\r\n this.deactivateAutoSave(listener);\r\n return receipt => {\r\n // If the expense already has an assigned receiptId, set the status of the receipt to unattached\r\n if (expense.receiptId) {\r\n this.resetReceiptStatus(expense.receiptId);\r\n }\r\n\r\n receipt.status = this.expensesEnums.ReceiptStatus.UNSUBMITTED;\r\n receipt.isSelected = false;\r\n expense.expenseType = expense.typeObject;\r\n receipt.expense = expense;\r\n expense.receiptId = receipt.receiptId;\r\n expense.receiptThumbnail = receipt.imageData;\r\n };\r\n }\r\n\r\n /**\r\n * Deletes an attached receipt from the expense line\r\n * \r\n * @param {Shared.RegularExpense} expense\r\n * \r\n * @memberOf BrooksonExpensesAddExpenseController\r\n */\r\n deleteReceiptFromExpenseLine = (expense: Shared.RegularExpense): void => {\r\n var receipt = _.find(this.receipts, (n: Shared.Receipt) => (n.receiptId === expense.receiptId));\r\n\r\n receipt.status = this.expensesEnums.ReceiptStatus.UNATTACHED;\r\n\r\n expense.receiptId = 0;\r\n }\r\n\r\n /**\r\n * Deactive the wtacher for auto save\r\n * \r\n * \r\n * @memberOf BrooksonExpensesAddExpenseController\r\n */\r\n deactivateAutoSave = (listener: Function): void => {\r\n if (!_.isNil(listener)) {\r\n listener();\r\n }\r\n }\r\n\r\n prepareSaveExpense(mileageExpenses: Array = [], regularExpenses: Array = [], allowanceExpenses: Array = []): Shared.SaveExpenseRequest {\r\n var request = new Shared.SaveExpenseRequest();\r\n request.expenseSubmissionId = this.expenseHeader ? this.expenseHeader.id : 0;\r\n request.description = this.expenseHeader ? this.expenseHeader.description : this.selectedAssignment\r\n ? this.selectedAssignment.assignmentName\r\n : this.expenseHeader.assignment;\r\n request.assignmentId = this.selectedAssignment\r\n ? this.selectedAssignment.assignmentId\r\n : this.expenseHeader.assignmentId;\r\n request.assignmentName = this.selectedAssignment\r\n ? this.selectedAssignment.assignmentName\r\n : this.expenseHeader.assignment;\r\n request.mainSiteDateTime = this.selectedAssignment\r\n ? this.dateUtils.convertToServerString(this.selectedAssignment.dateStarted)\r\n : this.expenseHeader.startDate;\r\n request.endDateTime = this.selectedAssignment\r\n ? this.dateUtils.convertToServerString(this.selectedAssignment.dateEnded)\r\n : null;\r\n request.mileageExpenseItems = mileageExpenses;\r\n request.expenseItems = regularExpenses;\r\n request.allowanceItems = allowanceExpenses;\r\n request.dataSource = 1;\r\n request.isDeleted = false;\r\n\r\n return request;\r\n }\r\n\r\n prepareMileageExpense = (expenseItem: Shared.MileageExpense) : void => {\r\n expenseItem.isDeleted = expenseItem.markedAsDelete;\r\n\r\n if (expenseItem.typeObject) {\r\n expenseItem.workSite = expenseItem.typeObject.offsite ? 'Off Site' : 'Main Site';\r\n expenseItem.type = expenseItem.typeObject.expenseTypeId;\r\n expenseItem.net = expenseItem.gross;\r\n expenseItem.vat = 0;\r\n expenseItem.date = this.dateUtils.convertToServerString(expenseItem.date);\r\n if(expenseItem.vehicleObject !== undefined && expenseItem.vehicleObject !== null)\r\n {\r\n expenseItem.vehicleRegistration = expenseItem.vehicleObject.registration;\r\n expenseItem.expenseMileageVehicle = expenseItem.vehicleObject;\r\n }\r\n }\r\n }\r\n \r\n prepareAllowanceExpense = (expenseItem: Shared.RegularExpense) : void => {\r\n if (expenseItem.typeObject) {\r\n expenseItem.type = expenseItem.typeObject.expenseTypeId;\r\n expenseItem.net = expenseItem.gross;\r\n expenseItem.date = this.dateUtils.convertToServerString(expenseItem.date);\r\n }\r\n\r\n delete expenseItem.flow;\r\n delete expenseItem.flowOptions;\r\n }\r\n\r\n prepareRegularExpense = (expenseItem: Shared.RegularExpense) : void => {\r\n if (expenseItem && expenseItem.typeObject) {\r\n if (!expenseItem.typeObject.expenseReceiptAttachable) {\r\n expenseItem.receiptId = 0;\r\n expenseItem.receiptThumbnail = \"\";\r\n }\r\n\r\n if (expenseItem.typeObject.defaultExpenseRate > 0) {\r\n expenseItem.quantity = expenseItem.total / expenseItem.typeObject.defaultExpenseRate;\r\n }\r\n\r\n expenseItem.type = expenseItem.typeObject.expenseTypeId;\r\n expenseItem.net = expenseItem.gross - (expenseItem.vat ? expenseItem.vat : 0);\r\n expenseItem.date = this.dateUtils.convertToServerString(expenseItem.date);\r\n\r\n delete expenseItem.flow;\r\n delete expenseItem.flowOptions;\r\n }\r\n }\r\n\r\n getAllVatRates = (silentMode?: boolean): ng.IPromise> => {\r\n const url = this.sharedConfig.baseApiUrl + \"api/Expenses/GetAllVatRates\";\r\n\r\n return this.$http.get(url, {\r\n cache: \"true\",\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response) => {\r\n return _.map(response.data,\r\n (item: any) => {\r\n let rate = new VatRate();\r\n rate.amount = item.amount;\r\n rate.startDate = new Date(item.startDate);\r\n return rate;\r\n });\r\n });\r\n }\r\n\r\n getAllVatRatesConfig = (silentMode?: boolean): ng.IPromise> => {\r\n const url = this.sharedConfig.baseApiUrl + \"api/Expenses/GetExpenseVatConfig\";\r\n\r\n return this.$http.get(url, {\r\n cache: \"true\",\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response) => {\r\n return _.map(response.data,\r\n (item: any) => {\r\n let rate = new VatRateConfig();\r\n rate.expenseCode = item.expenseCode;\r\n rate.vatRate = item.vatRate;\r\n rate.effectiveDate = new Date(item.effectiveDate);\r\n rate.endDate = new Date(item.endDate);\r\n return rate;\r\n });\r\n });\r\n }\r\n\r\n private postSaveExpenses(request: Shared.SaveExpenseRequest, response: Shared.ExpenseDetails): Shared.ExpenseDetails {\r\n if (_.isNil(response)) {\r\n this.isAutoSaving = false;\r\n return;\r\n }\r\n\r\n this.removeDeletedExpenses(this.mileageExpenses, request.mileageExpenseItems);\r\n this.removeDeletedExpenses(this.regularExpenses, request.expenseItems);\r\n this.removeDeletedExpenses(this.allowanceExpenses, request.allowanceItems);\r\n this.removeExpensesThatHaveBeenAssignedTempIds();\r\n this.assignExpenseItemIds(response);\r\n\r\n this.isAutoSaving = false;\r\n\r\n return response;\r\n }\r\n\r\n /**\r\n * Removes any expenses that were marked as deleted and have been deleted from the database.\r\n * It checks the requested expenses that were sent up to the API to make sure that the expense has been\r\n * deleted.\r\n * \r\n * @private\r\n * @param {Array} savedExpenses\r\n * @param {Array} requestedExpenses\r\n * \r\n * @memberOf ExpensesFactory\r\n */\r\n private removeDeletedExpenses(savedExpenses: Array, requestedExpenses: Array): void {\r\n _.remove(savedExpenses, (ex: Shared.CoreExpenseItem) =>\r\n ex.markedAsDelete && (_.find(requestedExpenses, (e: Shared.CoreExpenseItem) => e.tempID === ex.tempID))\r\n );\r\n }\r\n\r\n /**\r\n * Removes expenses in the expenses waiting for ids array that have been assigned a tempID\r\n * \r\n * @private\r\n * \r\n * @memberOf ExpensesFactory\r\n */\r\n private removeExpensesThatHaveBeenAssignedTempIds(): void {\r\n _.remove(this.expensesWaitingForIds,\r\n (e: Shared.CoreExpenseItem) => {\r\n var expenses = [...this.mileageExpenses, ...this.regularExpenses, ...this.allowanceExpenses];\r\n\r\n var relatedExpense = _.find(expenses, (re: Shared.RegularExpense) => {\r\n return e.tempID === re.tempID;\r\n });\r\n\r\n return !_.isNil(relatedExpense);\r\n });\r\n }\r\n\r\n /**\r\n * Assign the generated expense item ids to the associated expense items based on the tempID\r\n * \r\n * @private\r\n * @param {Shared.ExpenseDetails} response\r\n * \r\n * @memberOf ExpensesFactory\r\n */\r\n private assignExpenseItemIds(response: Shared.ExpenseDetails): void {\r\n var newExpenses = _.filter([...this.mileageExpenses, ...this.regularExpenses, ...this.allowanceExpenses], (expense: Shared.RegularExpense) => !expense.expenseItemId);\r\n var savedExpenses = [...response.mileageExpenses, ...response.regularExpenses, ...response.allowanceExpenses];\r\n\r\n _.forEach(newExpenses, expense => {\r\n var relatedExpense: Shared.CoreExpenseItem = _.find(savedExpenses, (e: Shared.RegularExpense) => e.tempID === expense.tempID);\r\n\r\n if (relatedExpense) {\r\n expense.expenseItemId = relatedExpense.expenseItemId;\r\n }\r\n });\r\n }\r\n\r\n isDeemedAssignment = (assignment: Shared.Assignment): boolean => {\r\n if (assignment.publicSector !== Shared.Sectors.public && !_.isNull(assignment.iR35CapturedFromDate)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n grossPaymentReceived = (assignment: Shared.Assignment): boolean => {\r\n if (assignment.publicSector === Shared.Sectors.public\r\n && _.isNull(assignment.iR35CapturedFromDate)\r\n && _.isNull(assignment.iR35CapturedEffectiveDate)\r\n ) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n saveConfirmedExpenseWarning(assignmentId: string, memberId: string, expenseHeaderId: number, expenseWarnings: ExpenseWarning[]): ng.IPromise {\r\n return this.expensesWarningsService.saveExpenseWarnings(assignmentId, memberId, expenseHeaderId, expenseWarnings);\r\n }\r\n\r\n getConfirmedExpenseWarnings(memberid, assignmentId): ng.IPromise {\r\n return this.expensesWarningsService.getConfirmedExpenseWarnings(memberid, assignmentId);\r\n }\r\n\r\n addExpenseWarningMessage(expenseWarning: ExpenseWarnings, expenseLine: Shared.CoreExpenseItem): void {\r\n let expenseWarningType = this.getExpenseWarningText(expenseWarning.expenseWarningId, this.expensesEnums.ExpenseWarningCodeTypes.Amount);\r\n if (expenseWarningType) {\r\n expenseLine.expenseWarning.warningMessage = expenseWarningType.warningMessage;\r\n expenseLine.expenseWarning.showWarningAmount = expenseLine.gross > expenseWarning.valueLimit;\r\n expenseLine.expenseWarning.warning = expenseWarning;\r\n }\r\n }\r\n\r\n removeExpenseWarnings(expenseWarning: ExpenseWarnings, expenseLine: Shared.RegularExpense): void {\r\n let exp = _.find(this.regularExpenses, (e: Shared.RegularExpense) => e.description !== expenseLine.description && e.expenseWarning.warning === expenseWarning);\r\n if (exp) {\r\n exp.expenseWarning = new Shared.ExpenseWarning();\r\n }\r\n }\r\n\r\n removeConfirmedExpense(expense: any): angular.IPromise {\r\n let defer = this.$q.defer();\r\n if (!expense.expenseWarning || !expense.expenseWarning.warning) return defer.promise;\r\n var expenseConfirmation = _\r\n .filter(this.confirmedExpenseWarning, n => (n.warning.codeValue === expense.expenseWarning.warning.codeValue));\r\n\r\n if (expenseConfirmation.length > 0) {\r\n for (let i = 0; i < expenseConfirmation.length; i++) {\r\n let index = this.confirmedExpenseWarning.indexOf(expenseConfirmation[i]);\r\n this.confirmedExpenseWarning.splice(index, 1);\r\n }\r\n \r\n }\r\n return defer.promise;\r\n }\r\n\r\n checkExpenseConfirmationLength = (expense: Shared.CoreExpenseItem, monthRule: boolean): any => {\r\n if (expense) {\r\n\r\n let warningType;\r\n if (expense.typeObject)\r\n warningType = this.getExpenseWarningType(expense.typeObject);\r\n\r\n if (!warningType) return false;\r\n if (this.confirmedExpenseWarning.length === 0 && this.expensesWarningsConfirmed.length === 0) return false;\r\n\r\n if (this.confirmedExpenseWarning.length > 0) {\r\n let confirmedExpenses = _.find(this.confirmedExpenseWarning, (n: ExpenseWarning) => {\r\n return n.warning.codeValue.trim().toString() === warningType.codeValue.trim().toString() &&\r\n ((n.confirmedTwentyFour && monthRule) || (n.confirmed && !monthRule));\r\n });\r\n\r\n if (confirmedExpenses) {\r\n return true;\r\n }\r\n }\r\n\r\n if (this.expensesWarningsConfirmed.length > 0) {\r\n let expenseWarning = this.getLatestConfirmedExpense(warningType, monthRule ? Shared.ExpenseWarningCodeTypes.TwentyFourMonthRule : Shared.ExpenseWarningCodeTypes.Amount);\r\n\r\n if (expenseWarning) {\r\n let datediff = this.diffMonths(new Date(), expenseWarning.dateConfirmed);\r\n if (monthRule) {\r\n if (expense.expenseWarning && expenseWarning.dateConfirmed)\r\n return !(datediff >= warningType.timeLength);\r\n } else {\r\n if (expense.expenseWarning && expenseWarning.dateConfirmed) {\r\n if (datediff >= warningType.timeLength) {\r\n if (warningType.highRisk) {\r\n return false;\r\n }\r\n if (expense.gross >= warningType.valueLimit) {\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n public diffMonths = (dt1, dt2): number => {\r\n return moment(dt1).diff(moment(dt2), \"months\", false);\r\n }\r\n\r\n getExpenseWarningType = (expense: Shared.ExpenseType): Shared.ExpenseWarnings => {\r\n let expenseType = _.filter(this.expenseWarnings, (n: Shared.ExpenseWarnings) => {\r\n return n.codeValue.trim().toString() === expense.paymentCode.trim().toString();\r\n });\r\n\r\n return expenseType[0];\r\n }\r\n\r\n populateConfirmedExpenseWarnings(memberid: number, assignmentId: string): angular.IPromise {\r\n let defer = this.$q.defer>();\r\n this.getConfirmedExpenseWarnings(memberid, assignmentId)\r\n .then(data => {\r\n this.expensesWarningsConfirmed = data;\r\n defer.resolve(this.expensesWarningsConfirmed);\r\n });\r\n\r\n return defer.promise; \r\n }\r\n\r\n deleteIndividualConfirmedExpenseLine(warningCodeValue: string): angular.IPromise {\r\n let defer = this.$q.defer();\r\n \r\n if (this.expensesWarningsConfirmed.length > 0) {\r\n let warnings = _.filter(this.expensesWarningsConfirmed,\r\n cWarning => (cWarning.expenseCodeValue === warningCodeValue &&\r\n cWarning.expenseId === this.expenseHeader.id.toString()));\r\n\r\n if (warnings.length > 0) {\r\n _.forEach(warnings,\r\n confirmedExpenseWarning => {\r\n this.expensesWarningsService\r\n .deleteExpenseWarningLogById(confirmedExpenseWarning.expenseWarningLogId);\r\n });\r\n this.populateConfirmedExpenseWarnings(parseInt(this.memberSrv.member.memberId),\r\n this.selectedAssignment.assignmentId);\r\n defer.resolve(true);\r\n }\r\n } else {\r\n defer.resolve(false);\r\n }\r\n\r\n return defer.promise;\r\n }\r\n\r\n getLatestConfirmedExpense(expenseWarning: Shared.ExpenseWarnings, warningCodeType: Shared.ExpenseWarningCodeTypes): Shared.ConfirmedExpenseWarning {\r\n let expenseWarnings = _.filter(this.expensesWarningsConfirmed,\r\n (e: Shared.ConfirmedExpenseWarning) => {\r\n\r\n switch (warningCodeType) {\r\n case Shared.ExpenseWarningCodeTypes.TwentyFourMonthRule:\r\n return e.expenseCodeValue.trim() === expenseWarning.codeValue.trim() && e.twentyFourMonthRuleApplied;\r\n default:\r\n return e.expenseCodeValue.trim() === expenseWarning.codeValue.trim() && !e.twentyFourMonthRuleApplied;\r\n }\r\n });\r\n return expenseWarnings.sort((first : ConfirmedExpenseWarning, second : ConfirmedExpenseWarning): number => {\r\n if (first.dateConfirmed > second.dateConfirmed) return -1;\r\n if (first.dateConfirmed < second.dateConfirmed) return 1;\r\n return 0;\r\n })[0];\r\n }\r\n\r\n setExpenseWarningMessage(expenseLine: Shared.CoreExpenseItem, expenseWarning: Shared.ExpenseWarnings, expenseWarningCodeTypes: Shared.ExpenseWarningCodeTypes): void {\r\n let expenseWarningType = this.getExpenseWarningText(expenseWarning.expenseWarningId, expenseWarningCodeTypes);\r\n if (expenseWarningType) {\r\n expenseLine.expenseWarning.warning = expenseWarning;\r\n expenseLine.expenseWarning.warningMessage = expenseWarningType.expenseWarningText.replace('(i)', '');\r\n } else {\r\n expenseLine.expenseWarning = new Shared.ExpenseWarning();\r\n }\r\n }\r\n\r\n showGuidance = (paymentCode: string): ng.IPromise => {\r\n var sectionId = _.includes(paymentCode, 'MILEAGE') ? 'MILEAGE' :\r\n _.includes(paymentCode, 'OVERNIGHT') ? 'OVERNIGHT' :\r\n paymentCode;\r\n\r\n let modalSettings: angular.ui.bootstrap.IModalSettings = {\r\n animation: true,\r\n templateUrl: \"src/app/expenses/views/modals/brookson.modals.view-guidance.html\",\r\n windowClass: \"viewGuidanceModalWindow\",\r\n controller: \"viewGuidanceCtrl as $ctrl\",\r\n size: \"lg\",\r\n resolve: {\r\n iframeUrl: () => \"https://www.brooksonfaq.co.uk/article-tags/\" + sectionId.replace(/\\s/g, '').replace('&', '').toLowerCase() + \"/\"\r\n }\r\n };\r\n\r\n var modalInstance = this.$uibModal.open(modalSettings);\r\n\r\n return modalInstance.result;\r\n }\r\n\r\n showExpenseWarningModal = (): ng.IPromise => {\r\n if (this.appSettings.enableExpenseEnhancementModal) {\r\n let modalSettings: angular.ui.bootstrap.IModalSettings = {\r\n animation: true,\r\n templateUrl: \"src/app/expenses/views/modals/brookson.modals.expensewarnings.html\",\r\n windowClass: \"expenseWarningsModalWindow\",\r\n controller: \"expenseWarningsCtrl as $ctrl\",\r\n size: \"lg\",\r\n backdrop: 'static',\r\n keyboard: false,\r\n };\r\n\r\n let cookieVal = this.localStorageService.get(\"expenseWarningPopup\");\r\n\r\n if (!cookieVal) {\r\n var modalInstance = this.$uibModal.open(modalSettings);\r\n\r\n return modalInstance.result;\r\n } \r\n }\r\n return null;\r\n }\r\n\r\n\r\n\r\n expenseGuidanceExists = (expenseType: any): boolean => {\r\n if (_.includes(this.expenseGuidancePaymentCodes, expenseType.paymentCode)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n\r\n private countExpenseTabWarnings(expenseLine: Shared.CoreExpenseItem[], warningCount: number): number {\r\n _.forEach(expenseLine, warning => {\r\n let expenseConfirmedMonth = _.find(this.confirmedExpenseWarning, (confirmedExpenseWarning: Shared.ExpenseWarning) => {\r\n return confirmedExpenseWarning.warning.codeValue === warning.expenseWarning.warning.codeValue &&\r\n (confirmedExpenseWarning.showWarningMonthRule ===\r\n warning.expenseWarning.warning.twentyFourMthRuleApplicable &&\r\n confirmedExpenseWarning.confirmedTwentyFour);\r\n });\r\n\r\n let expenseConfirmedHighRisk = _.find(this.confirmedExpenseWarning, (confirmedExpenseWarning: Shared.ExpenseWarning) => {\r\n return confirmedExpenseWarning.warning.codeValue === warning.expenseWarning.warning.codeValue &&\r\n confirmedExpenseWarning.showWarningHighRisk === warning.expenseWarning.showWarningHighRisk\r\n && confirmedExpenseWarning.confirmed;\r\n });\r\n\r\n\r\n let expenseConfirmedAmount = _.find(this.confirmedExpenseWarning, (confirmedExpenseWarning: Shared.ExpenseWarning) => {\r\n return confirmedExpenseWarning.warning.codeValue === warning.expenseWarning.warning.codeValue &&\r\n ((confirmedExpenseWarning.showWarningAmount === warning.expenseWarning.showWarningAmount)\r\n && confirmedExpenseWarning.confirmed);\r\n });\r\n \r\n if (!expenseConfirmedMonth && warning.expenseWarning.warning.twentyFourMthRuleApplicable && warning.expenseWarning.showWarningMonthRule && !warning.expenseWarning.confirmedTwentyFour) warningCount++;\r\n if (!expenseConfirmedHighRisk && warning.expenseWarning.warning.highRisk && !warning.expenseWarning.confirmed) warningCount++;\r\n if (!expenseConfirmedAmount && warning.gross >= warning.expenseWarning.warning.valueLimit && !warning.expenseWarning.confirmed) warningCount++;\r\n });\r\n return warningCount;\r\n }\r\n\r\n private obtainPresentedTabWarnings(tabExpenses: Shared.CoreExpenseItem[]): Shared.CoreExpenseItem[] {\r\n return _.filter(tabExpenses, (tabExpenses: Shared.CoreExpenseItem) => {\r\n return !tabExpenses.markedAsDelete && tabExpenses.expenseWarning &&\r\n (tabExpenses.expenseWarning.showWarningMonthRule || tabExpenses.expenseWarning.showWarningHighRisk || tabExpenses.expenseWarning.showWarningAmount);\r\n });\r\n }\r\n\r\n buildPresentedExpenseWarnings = (): void => {\r\n this.expensesTabWarningSummary = new Shared.ExpenseTabWarnings();\r\n if (this.allowanceExpenses && this.allowanceExpenses.length > 0) {\r\n let allowanceWarnings = this.obtainPresentedTabWarnings(this.allowanceExpenses);\r\n let allowanceTab = new Shared.ExpenseTabWarning(\"Allowances\");\r\n let allowanceTabWarningCount = 0;\r\n if (allowanceWarnings.length > 0) {\r\n allowanceTabWarningCount = this.countExpenseTabWarnings(allowanceWarnings, allowanceTabWarningCount);\r\n }\r\n allowanceTab.presentedWarnings = allowanceTabWarningCount;\r\n this.expensesTabWarningSummary.tabWarnings.push(allowanceTab);\r\n this.expensesTabWarningSummary.warningCount += allowanceTab.presentedWarnings;\r\n }\r\n if (this.mileageExpenses && this.mileageExpenses.length > 0) {\r\n let mileageWarnings = this.obtainPresentedTabWarnings(this.mileageExpenses);\r\n let mileageTab = new ExpenseTabWarning(\"Mileage\");\r\n let mileageTabWarningCount = 0;\r\n if (mileageWarnings.length > 0) {\r\n mileageTabWarningCount = this.countExpenseTabWarnings(mileageWarnings, mileageTabWarningCount);\r\n }\r\n mileageTab.presentedWarnings = mileageTabWarningCount;\r\n this.expensesTabWarningSummary.tabWarnings.push(mileageTab);\r\n this.expensesTabWarningSummary.warningCount += mileageTab.presentedWarnings;\r\n }\r\n if (this.regularExpenses && this.regularExpenses.length > 0) {\r\n let regularWarnings = this.obtainPresentedTabWarnings(this.regularExpenses);\r\n let expensesTab = new ExpenseTabWarning(\"Expenses\");\r\n let expenseTabWarningCount = 0;\r\n if (regularWarnings.length > 0) {\r\n expenseTabWarningCount = this.countExpenseTabWarnings(regularWarnings, expenseTabWarningCount);\r\n }\r\n expensesTab.presentedWarnings = expenseTabWarningCount;\r\n this.expensesTabWarningSummary.tabWarnings.push(expensesTab);\r\n this.expensesTabWarningSummary.warningCount += expensesTab.presentedWarnings;\r\n }\r\n }\r\n\r\n tabExpenseWarningCount = (tabName: string): number => {\r\n if (!this.expensesTabWarningSummary || this.expensesTabWarningSummary.tabWarnings.length === 0) return 0;\r\n let tabWarnings = _.find(this.expensesTabWarningSummary.tabWarnings, (tabWarning: ExpenseTabWarning) => {\r\n return tabWarning.name === tabName;\r\n });\r\n if (tabWarnings) return tabWarnings.presentedWarnings;\r\n return 0;\r\n }\r\n\r\n confirmExpenseWarning = (expenseLine: Shared.CoreExpenseItem): void => {\r\n expenseLine.expenseWarning.confirmed = true;\r\n expenseLine.expenseWarning.dateConfirmed = new Date();\r\n expenseLine.expenseWarning.showWarningMonthRule = false;\r\n this.confirmedExpenseWarning.push(angular.copy(expenseLine.expenseWarning));\r\n this.buildPresentedExpenseWarnings();\r\n }\r\n\r\n confirmExpenseWarningTwentyFour = (expenseLine: Shared.CoreExpenseItem): void => {\r\n expenseLine.expenseWarning.confirmedTwentyFour = true;\r\n expenseLine.expenseWarning.dateConfirmedTwentyFour = new Date();\r\n this.confirmedExpenseWarning.push(angular.copy(expenseLine.expenseWarning));\r\n this.buildPresentedExpenseWarnings();\r\n }\r\n\r\n autoSaveExpenses = (oldVal: Array, newVal: Array, expenseType: ExpenseTypeRef): void => {\r\n if (this.isAutoSaving || !this.selectedAssignment || !this.expenseHeader.description || _.isNil(newVal) || !newVal.length || angular.equals(newVal, this.lastRegularExpenseVal)) {\r\n return;\r\n }\r\n\r\n var hasChanges = false;\r\n\r\n _.forEach(newVal, val => {\r\n hasChanges = hasChanges ||\r\n (!this.isSameRegularExpense(val, this.lastRegularExpenseVal[newVal.indexOf(val)]) &&\r\n !_.isNil(this.lastRegularExpenseVal[newVal.indexOf(val)]) &&\r\n this.isCompleteRegularExpense(val));\r\n });\r\n\r\n var completeExpenses = _.filter(newVal, e => this.isCompleteRegularExpense(e));\r\n\r\n\r\n this.lastRegularExpenseVal = angular.copy(newVal);\r\n if (!hasChanges || !completeExpenses.length) {\r\n return;\r\n }\r\n\r\n var changedExpenses = angular.copy(completeExpenses);\r\n\r\n let requestData;\r\n\r\n _.forEach(changedExpenses, expenseItem => {\r\n\r\n switch (expenseType) {\r\n case ExpenseTypeRef.EXPENSE:\r\n this.prepareRegularExpense(expenseItem);\r\n requestData = this.prepareSaveExpense([], changedExpenses);\r\n break;\r\n case ExpenseTypeRef.MILEAGE:\r\n this.prepareMileageExpense(expenseItem);\r\n requestData = this.prepareSaveExpense(changedExpenses);\r\n break;\r\n case ExpenseTypeRef.ALLOWANCE:\r\n this.prepareAllowanceExpense(expenseItem);\r\n requestData = this.prepareSaveExpense([], [], changedExpenses);\r\n break;\r\n default:\r\n this.prepareRegularExpense(expenseItem);\r\n requestData = this.prepareSaveExpense([], changedExpenses);\r\n } \r\n });\r\n\r\n\r\n this.saveExpenses(requestData, true, true);\r\n }\r\n\r\n isSameRegularExpense = (e1: any, e2: any): boolean => {\r\n if (_.isNil(e1) || _.isNil(e2)) {\r\n return false;\r\n }\r\n\r\n return e1.description === e2.description &&\r\n this.dateUtils.isSame(e1.date, e2.date) &&\r\n angular.equals(e1.typeObject, e2.typeObject) &&\r\n e1.gross === e2.gross &&\r\n e1.markedAsDelete === e2.markedAsDelete &&\r\n (_.isNil(e1.receiptId) ? 0 : e1.receiptId) === (_.isNil(e2.receiptId) ? 0 : e2.receiptId);\r\n }\r\n\r\n isCompleteRegularExpense = (expense: any): boolean => {\r\n return !_.isNil(expense.date) &&\r\n !_.isNil(expense.description) &&\r\n !_.isNil(expense.gross) && expense.gross > 0 &&\r\n !_.isNil(expense.typeObject);\r\n }\r\n\r\n expenseTypeChanged = (expense: any, index: number, expenseList: any): void => {\r\n let expenseLine = expenseList[index];\r\n expenseLine.expenseWarning = new Shared.ExpenseWarning();\r\n if (!expense || !expenseList || !this.selectedAssignment) {\r\n this.buildPresentedExpenseWarnings();\r\n return;\r\n }\r\n\r\n let expenseWarning = this.getExpenseWarningType(expense);\r\n if (!expenseWarning || !expenseWarning.enabled) return;\r\n let presentedAlert = _.find(expenseList, (ex: any) => ex.expenseWarning && ex.expenseWarning.warning && ex.expenseWarning.warning.codeValue === expenseWarning.codeValue && ex.expenseWarning.warningMessage);\r\n if (presentedAlert) {\r\n return;\r\n }\r\n\r\n expenseLine.expenseWarning.assignment = this.selectedAssignment;\r\n expenseLine.expenseWarning.warning = expenseWarning;\r\n let previousConfirmedExpense = this.getLatestConfirmedExpense(expenseWarning, Shared.ExpenseWarningCodeTypes.HighRisk);\r\n expenseLine.expenseWarning.showWarningHighRisk = expenseWarning.highRisk && !previousConfirmedExpense;\r\n if (expenseLine.expenseWarning.showWarningHighRisk) {\r\n this.setExpenseWarningMessage(expenseLine, expenseWarning, this.expensesEnums.ExpenseWarningCodeTypes.HighRisk);\r\n } else {\r\n if (expenseLine.net || expenseLine.gross) {\r\n previousConfirmedExpense = this.getLatestConfirmedExpense(expenseWarning, Shared.ExpenseWarningCodeTypes.Amount);\r\n let expenseLineVal = expenseLine.gross; \r\n if (previousConfirmedExpense) {\r\n let monthDifference = this.diffMonths(new Date(), previousConfirmedExpense.dateConfirmed);\r\n expenseLine.expenseWarning.showWarningAmount = expenseLineVal >= expenseWarning.valueLimit && monthDifference >= expenseWarning.timeLength;\r\n } else {\r\n expenseLine.expenseWarning.showWarningAmount = expenseLineVal >= expenseWarning.valueLimit;\r\n }\r\n\r\n if (expenseLine.expenseWarning.showWarningAmount) {\r\n this.setExpenseWarningMessage(expenseLine, expenseWarning, this.expensesEnums.ExpenseWarningCodeTypes.Amount);\r\n } else {\r\n let exp = _.find(expenseList, (e: any) => e.expenseWarning && !e.expenseWarning.warning && e.typeObject && e.typeObject.paymentCode === expenseLine.typeObject.paymentCode);\r\n if (exp) {\r\n this.setExpenseWarningMessage(expenseLine, expenseWarning, this.expensesEnums.ExpenseWarningCodeTypes.Amount);\r\n }\r\n }\r\n }\r\n }\r\n if (expenseLine.date) {\r\n let presentedAlert = _.find(expenseList, (ex: any) => ex.expenseWarning && ex.expenseWarning.warning && ex.expenseWarning.warning.codeValue === expenseWarning.codeValue && ex.expenseWarning.warningMessageTwentyFour);\r\n if (presentedAlert) {\r\n return;\r\n }\r\n\r\n if (expenseWarning && expenseWarning.twentyFourMthRuleApplicable) {\r\n let previousConfirmedExpenseTwentyFourMonth = this.getLatestConfirmedExpense(expenseWarning, Shared.ExpenseWarningCodeTypes.TwentyFourMonthRule);\r\n\r\n if (previousConfirmedExpenseTwentyFourMonth) {\r\n let monthDifference = this.diffMonths(new Date(), previousConfirmedExpenseTwentyFourMonth.dateConfirmed);\r\n expenseLine.expenseWarning.showWarningMonthRule = monthDifference >= expenseWarning.timeLength;\r\n } else {\r\n let monthDifference = this.diffMonths(expenseLine.date, this.selectedAssignment.dateStarted);\r\n expenseLine.expenseWarning.showWarningMonthRule = monthDifference >= expenseWarning.twentyFourMthTriggerOverride;\r\n }\r\n\r\n if (expenseLine.expenseWarning.showWarningMonthRule && expenseLine.expenseWarning.warning) {\r\n let twentyFourExpenseWarningType = this.getExpenseWarningText(expenseWarning.expenseWarningId, this.expensesEnums.ExpenseWarningCodeTypes.TwentyFourMonthRule);\r\n if (twentyFourExpenseWarningType) {\r\n expenseLine.expenseWarning.warningMessageTwentyFour = twentyFourExpenseWarningType.expenseWarningText.replace('(i)', '');\r\n } else {\r\n expenseLine.expenseWarning.showWarningMonthRule = false;\r\n }\r\n }\r\n }\r\n }\r\n\r\n this.buildPresentedExpenseWarnings();\r\n }\r\n\r\n updateWarningsAssignmentChange = (expenses: CoreExpenseItem[]): void => {\r\n this.removeConfirmationsBySelectedAssignment();\r\n if (expenses.length > 0) {\r\n _.forEach(expenses, (expense) => {\r\n if (expense.expenseWarning) {\r\n expense.expenseWarning.showWarningMonthRule = false;\r\n expense.expenseWarning.showWarningAmount = false;\r\n expense.expenseWarning.showWarningHighRisk = false;\r\n this.expenseTypeChanged(expense.typeObject, expenses.indexOf(expense), expenses);\r\n }\r\n });\r\n this.buildPresentedExpenseWarnings();\r\n } \r\n }\r\n\r\n removeConfirmationsBySelectedAssignment = (): void => {\r\n if (!this.selectedAssignment) return;\r\n for (let i = this.confirmedExpenseWarning.length - 1; i >= 0; i--) {\r\n if (this.confirmedExpenseWarning[i].assignment.assignmentId !== this.selectedAssignment.assignmentId) {\r\n this.confirmedExpenseWarning.splice(i, 1);\r\n }\r\n }\r\n }\r\n\r\n clearConfirmedExpenseWarnings() {\r\n this.confirmedExpenseWarning = new Array();\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module(\"app.shared\")\r\n .service(\"brooksonFactoriesExpenses\", Shared.ExpensesFactory);","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n \r\n export interface IBankLinkFactory {\r\n confirmedTransactions: BankLink.Transaction[];\r\n warningTransactions: BankLink.Transaction[];\r\n confirmedTransactionsTotal: number;\r\n acceptRisk: string;\r\n\r\n bankAccounts: any;\r\n bankAccountsFlatList: Array;\r\n selectedBankAccount: any;\r\n transactions: Array;\r\n categories: Array;\r\n transactionTypes: Array;\r\n selectedTransactionType: any;\r\n addYodleeFasklinkUrl: string;\r\n editYodleeFasklinkUrl: string;\r\n refreshYodleeFasklinkUrl: string;\r\n bankEnabled: boolean;\r\n csvUploadRequired: boolean;\r\n bankActionRequired: boolean;\r\n moneyManagerData: any;\r\n transactionsList: Array;\r\n businessOnly: boolean;\r\n modifiedTransactions: BankLink.Transaction[];\r\n showAside: boolean;\r\n receipts: Array;\r\n paginationArray: Array;\r\n currentPage: number;\r\n itemsPerPage: number;\r\n informationDetail: any;\r\n relatedCategores: Array;\r\n orderBy: string;\r\n reverseSort: boolean;\r\n isMobile: boolean;\r\n refreshedYodleeAccounts: Array;\r\n selectedAssignment: any;\r\n assignments: any;\r\n\r\n getBankAccounts(): void;\r\n addBankLogoAndIconToBankAccount(account): void;\r\n addBankNameToTransactions(transactions): void;\r\n getCategories();\r\n getAllVatRatesConfig(silentMode?: boolean): ng.IPromise>;\r\n setRelatedTransationCategories(transaction: BankLink.Transaction);\r\n getTransactionTypes(): void;\r\n addYodleeAccount();\r\n editYodleeAccount(id);\r\n refreshYodleeAccount(id);\r\n isBankEnabled();\r\n isBankActionRequired();\r\n isCsvUploadRequired();\r\n addBalanceToTransactions(transactions): void;\r\n setOtherTransactionCategoryDescription(transactions): void;\r\n setTransactionsReceiptImageThumbnail(transactions): void;\r\n getTransactions(getReceiptImageThumbnailData?: boolean);\r\n getMoneyManagerData(silentMode?: boolean);\r\n selectedTransactionTypeChanged(transactionType): void;\r\n selectedBankAccountChanged(bankAccount): void;\r\n filterTransactions(selectedBankAccount, selectedTransactionType): void;\r\n addModifiedTransaction(category, transaction: BankLink.Transaction): void;\r\n check24MonthRuleApplicable(transaction: BankLink.Transaction): boolean;\r\n getAllocationConfirmationModal(form: ng.IFormController);\r\n saveTransactions(): void;\r\n updateSuccessfulllyAllocatedTransaction(transactions, transactionAllocationResult): void;\r\n downloadFile(bankName: string): void;\r\n selectBankAccountFromAsideMenu(bankAccount): void;\r\n getReceipts(): void;\r\n receiptAttached(transaction: BankLink.Transaction);\r\n receiptAttachedToAllocated(transaction: BankLink.Transaction);\r\n receiptDeleted(transaction: BankLink.Transaction);\r\n receiptsTotal(): number;\r\n flowOptions(transaction);\r\n flowFileAdded(file, flow, transaction): boolean;\r\n flowFileSuccess(file, response, flow, transaction: BankLink.Transaction): void;\r\n flowFilesSubmitted(files, event, flow): void;\r\n createPaginationArray(): void;\r\n filterTransactionType(item): boolean;\r\n isViewingPersonal(): boolean;\r\n isViewingAll(): boolean;\r\n }\r\n\r\n export class BankLinkFactory implements IBankLinkFactory {\r\n static $inject = [\r\n '$state', '$uibModal', '$timeout', 'bankLinkSrv', 'moneyManagerSrv', 'memberSrv',\r\n 'authenticationSrv', 'bankLink.enums', 'appSettings', 'brookson.file.download',\r\n 'brookson.modal.receipt-bank', 'brooksonFactoriesExpenses', 'screenSize', 'growl',\r\n 'expenses.enums', 'brookson.utilities.date', 'serviceLineSrv'\r\n ];\r\n\r\n public bankAccounts;\r\n public bankAccountsFlatList: Array = [];\r\n public selectedBankAccount;\r\n public transactions: Array = [];\r\n public categories: Array = [];\r\n public vatRatesConfig: Array = [];\r\n public transactionTypes: Array = [];\r\n public selectedTransactionType;\r\n public addYodleeFasklinkUrl: string = '';\r\n public editYodleeFasklinkUrl: string = '';\r\n public refreshYodleeFasklinkUrl: string = '';\r\n public bankEnabled: boolean = false;\r\n public csvUploadRequired: boolean = false;\r\n public bankActionRequired: boolean = false;\r\n public moneyManagerData;\r\n public transactionsList: Array = [];\r\n public businessOnly: boolean = false;\r\n public modifiedTransactions: BankLink.Transaction[] = [];\r\n public showAside: boolean = false;\r\n public receipts: Array = [];\r\n public paginationArray: Array = [];\r\n public currentPage: number = 1;\r\n public itemsPerPage: number = 10;\r\n public informationDetail = {\r\n mandate: false,\r\n yodlee: false,\r\n noLink: false\r\n };\r\n public relatedCategores: Array = [];\r\n public orderBy: string = 'transactionDate';\r\n public reverseSort: boolean = false;\r\n public isMobile: boolean = false;\r\n public refreshedYodleeAccounts: Array = [];\r\n public selectedAssignment: any;\r\n\r\n public confirmedTransactions: BankLink.Transaction[] = [];\r\n public warningTransactions: BankLink.Transaction[] = [];\r\n public confirmedTransactionsTotal: number = 0;\r\n public acceptRisk: string = \"true\";\r\n public headerForm: ng.IFormController;\r\n public assignments: any;\r\n public userName: string;\r\n\r\n constructor (\r\n private $state,\r\n private $uibModal,\r\n private $timeout,\r\n private bankLinkSrv: Shared.IBankLinkSrv,\r\n private moneyManagerSrv: Shared.IMoneyManagerService,\r\n private memberSrv: Shared.IMemberService,\r\n private authenticationSrv: Shared.IAuthenticationService,\r\n private bankLinkEnums: Shared.IBankLinkEnums,\r\n private appSettings,\r\n private fileDownloadSrv: any,\r\n private brooksonModalReceiptBank: any,\r\n private expensesSrv: Shared.IExpensesFactory,\r\n private screenSize: any,\r\n private growl: ng.growl.IGrowlService,\r\n private expensesEnums: Shared.IExpensesEnums,\r\n private dateUtils: Shared.IBrooksonUtilitiesDate,\r\n public serviceLineSrv: Shared.IServiceLineService\r\n ) {\r\n this.isMobile = this.screenSize.is('sm,xs') ? true : false;\r\n this.memberSrv.getMemberDetails(true, true)\r\n .then((data: Member) => {\r\n this.userName = data.firstname + \" \" + data.lastname;\r\n });\r\n }\r\n\r\n getBankAccounts = () => {\r\n return this.bankLinkSrv.getBankAccounts().then(data => {\r\n this.bankAccounts = data;\r\n\r\n _.forEach(data.bankAccountsMandateLink, account => {\r\n this.addBankLogoAndIconToBankAccount(account);\r\n this.bankAccountsFlatList.push(account);\r\n });\r\n\r\n _.forEach(data.bankAccountsYodleeLink, account => {\r\n this.addBankLogoAndIconToBankAccount(account);\r\n this.bankAccountsFlatList.push(account);\r\n });\r\n\r\n _.forEach(data.bankAccountsNoDataLink, account => {\r\n this.addBankLogoAndIconToBankAccount(account);\r\n this.bankAccountsFlatList.push(account);\r\n });\r\n\r\n _.forEach(this.bankAccountsFlatList, account => {\r\n account.displayString = account.bankName + \" - \" + account.accountNumber;\r\n });\r\n\r\n if (this.screenSize.is('md,lg')) {\r\n this.bankAccountsFlatList.unshift({ displayString: \"All accounts\", bankAccountId: \"*\" });\r\n }\r\n\r\n if (this.bankAccountsFlatList.length) {\r\n this.selectedBankAccount = this.bankAccountsFlatList[0];\r\n } else {\r\n this.$timeout(() => {\r\n this.$state.go('brookson.bankLink.introduction');\r\n });\r\n }\r\n\r\n if (this.transactions && this.transactions.length > 0) {\r\n this.addBankNameToTransactions(this.transactions);\r\n _.forEach(this.transactions, (transaction: BankLink.Transaction) => this.setRelatedTransationCategories(transaction));\r\n }\r\n\r\n return data;\r\n });\r\n }\r\n\r\n addBankLogoAndIconToBankAccount = (account) => {\r\n var icon = this.bankLinkEnums.BankIcons[account.bankName.toUpperCase()];\r\n var logo = this.bankLinkEnums.BankLogos[account.bankName.toUpperCase()];\r\n\r\n account.icon = icon;\r\n account.logo = logo;\r\n }\r\n\r\n addBankNameToTransactions = (transactions) => {\r\n _.forEach(transactions, transaction => {\r\n var relatedBankAccount = _.find(this.bankAccountsFlatList, (bankAccount: any) => (bankAccount.bankAccountId === transaction.bankId));\r\n\r\n if (relatedBankAccount) {\r\n transaction.bankName = relatedBankAccount.bankName;\r\n transaction.bankId = relatedBankAccount.bankAccountId;\r\n transaction.icon = relatedBankAccount.icon;\r\n transaction.logo = relatedBankAccount.logo;\r\n }\r\n });\r\n }\r\n\r\n getCategories = () => {\r\n return this.bankLinkSrv.getCategories().then(data => {\r\n\r\n // We remove a couple of categories from the list, historic reasons mean we need to keep them in NAV\r\n _.remove(data, (category:any) => {\r\n if (category.code === \"DLA\" || category.code === \"SALARY\") {\r\n return true;\r\n }\r\n });\r\n\r\n _.forEach(data, category => {\r\n category.transactionTypeLabel = category.transactionType === 0 ? \"Personal\" : \"Business\";\r\n\r\n // Hack: don't want to change it properly in NAV so SW said to do it in the view\r\n if (category.code === \"EXP0185\") {\r\n category.description = \"Subsistence\";\r\n }\r\n });\r\n\r\n this.categories = data;\r\n\r\n _.filter(this.transactions, (transaction: any) => {\r\n return transaction.transactionType === this.bankLinkEnums.TransactionType.UNALLOCATED;\r\n }).forEach(transaction => this.setRelatedTransationCategories(transaction));\r\n\r\n return data;\r\n });\r\n }\r\n\r\n setRelatedTransationCategories = (transaction: BankLink.Transaction) => {\r\n var relatedBankAccount = _.find(this.bankAccountsFlatList, (bankAccount: any) => (bankAccount.bankAccountId === transaction.bankId));\r\n\r\n if (!relatedBankAccount) {\r\n return;\r\n }\r\n\r\n var nonSoleTraderCategories = _.filter(this.categories, (category: any) => {\r\n return !_.startsWith(category.code, \"ST\");\r\n });\r\n\r\n if (relatedBankAccount.accountType === this.bankLinkEnums.BankAccountType.CREDIT_CARD) {\r\n transaction.relatedCategories = nonSoleTraderCategories .filter((category:any) => {\r\n return category.creditCardApplicable && (category.type === \"Debit\" ? transaction.debitAmount < 0 : transaction.creditAmount > 0);\r\n });\r\n\r\n return;\r\n }\r\n\r\n var categoriesWithNoCcDiv = _.filter(nonSoleTraderCategories, category => { return category.code !== \"CC DIV\"; });\r\n var creditOrDebitCategories = _.filter(categoriesWithNoCcDiv, category => {\r\n return category.type === \"Debit\" ? transaction.debitAmount < 0 : transaction.creditAmount > 0;\r\n });\r\n var categoriesGroupedByDescription = _.groupBy(creditOrDebitCategories, 'description');\r\n\r\n transaction.relatedCategories =\r\n _.map(categoriesGroupedByDescription, (categoryGrouping: any) => {\r\n if (categoryGrouping.length > 1) {\r\n var applicableCategory = _.find(categoryGrouping, (category: any) => {\r\n return !category.creditCardApplicable;\r\n });\r\n\r\n return applicableCategory;\r\n }\r\n\r\n return categoryGrouping[0];\r\n });\r\n }\r\n\r\n getTransactionTypes = () => {\r\n _.forEach(this.bankLinkEnums.TransactionType, type => {\r\n if (this.bankLinkEnums.TransactionType.properties[type] && this.bankLinkEnums.TransactionType.properties[type].description) {\r\n this.transactionTypes.push({ value: type, description: this.bankLinkEnums.TransactionType.properties[type].description });\r\n }\r\n });\r\n\r\n this.selectedTransactionType = _.find(this.transactionTypes,\r\n (transactionTypes: any) => (transactionTypes.value === this.bankLinkEnums.TransactionType.UNALLOCATED));\r\n }\r\n\r\n addYodleeAccount = () => {\r\n return this.bankLinkSrv.addYodleeAccount().then(data => {\r\n this.addYodleeFasklinkUrl = data;\r\n\r\n return data;\r\n });\r\n }\r\n\r\n getAllVatRatesConfig = () => {\r\n return this.bankLinkSrv.getAllVatRatesConfig(true).then(data => {\r\n this.vatRatesConfig = data;\r\n return data;\r\n });\r\n }\r\n \r\n editYodleeAccount = (id) => {\r\n return this.bankLinkSrv.editYodleeAccount(id).then(data => {\r\n this.editYodleeFasklinkUrl = data;\r\n\r\n return data;\r\n });\r\n }\r\n\r\n isCsvUploadRequired = () => {\r\n return this.bankLinkSrv.isCsvUploadRequired().then(data => {\r\n this.csvUploadRequired = data;\r\n\r\n return data;\r\n });\r\n }\r\n\r\n refreshYodleeAccount = (id) => {\r\n return this.bankLinkSrv.refreshYodleeAccount(id).then(data => {\r\n this.refreshYodleeFasklinkUrl = data;\r\n\r\n return data;\r\n });\r\n }\r\n\r\n isBankEnabled = () => {\r\n return this.bankLinkSrv.isBankEnabled().then(data => {\r\n this.bankEnabled = data;\r\n\r\n return data;\r\n });\r\n }\r\n\r\n isBankActionRequired = () => {\r\n return this.bankLinkSrv.isBankActionRequired().then(data => {\r\n this.bankActionRequired = data;\r\n\r\n return data;\r\n });\r\n }\r\n\r\n addBalanceToTransactions = (transactions) => {\r\n var transactionsOrderedByDate = _.orderBy(transactions, 'transactionDate', 'desc');\r\n\r\n var groupedTransactionsByBankAccount = _.groupBy(transactionsOrderedByDate, 'bankId');\r\n\r\n _.forEach(groupedTransactionsByBankAccount, (transactionGroup, key) => {\r\n var bankId = key;\r\n var bankAccount = _.find(this.moneyManagerData.bankAccounts, (bankAccount: any) => (bankAccount.bankAccountID === bankId));\r\n\r\n if (bankAccount) {\r\n var endBalance = bankAccount.balance;\r\n\r\n _.forEach(transactionGroup, (transaction: any) => {\r\n transaction.balance = endBalance;\r\n endBalance = endBalance - transaction.creditAmount - transaction.debitAmount;\r\n });\r\n }\r\n });\r\n }\r\n\r\n setOtherTransactionCategoryDescription = (transactions) => {\r\n _.forEach(transactions, transaction => {\r\n if (transaction.transactionType !== 0 && transaction.transactionType === this.bankLinkEnums.TransactionType.UNALLOCATED) {\r\n transaction.transactionCategory.description = \"Other\";\r\n }\r\n });\r\n }\r\n\r\n setTransactionsReceiptImageThumbnail = (transactions) => {\r\n _.forEach(transactions, transaction => {\r\n if (transaction.receiptID) {\r\n this.expensesSrv.getReceiptImageData(transaction.receiptID, null, null, null, true).then(imageData => {\r\n transaction.receiptThumbnail = imageData;\r\n });\r\n }\r\n });\r\n }\r\n\r\n getTransactions = (getReceiptImageThumbnailData?: boolean) => {\r\n return this.moneyManagerSrv.getTransactions().then(data => {\r\n if(data == null)\r\n {\r\n return null;\r\n }\r\n\r\n this.transactions = data.transactions;\r\n\r\n this.setOtherTransactionCategoryDescription(this.transactions);\r\n\r\n //if (getReceiptImageThumbnailData) {\r\n // this.setTransactionsReceiptImageThumbnail(this.transactions);\r\n //}\r\n\r\n _.filter(this.transactions, (transaction: any) => transaction.transactionType === this.bankLinkEnums.TransactionType.UNALLOCATED)\r\n .forEach((transaction) => {\r\n transaction.gross = transaction.debitAmount * -1;\r\n return this.setRelatedTransationCategories(transaction);\r\n });\r\n\r\n // this.expensesNotYetTaken = data.expensesNotYetTaken;\r\n // this.salaryNotYetTaken = data.salaryNotYetTaken;\r\n\r\n if (this.bankAccountsFlatList && this.bankAccountsFlatList.length > 0) {\r\n this.addBankNameToTransactions(this.transactions);\r\n }\r\n\r\n if (this.moneyManagerData && this.moneyManagerData.bankAccounts && this.moneyManagerData.bankAccounts.length > 0) {\r\n this.addBalanceToTransactions(this.transactions);\r\n }\r\n\r\n this.filterTransactions(this.selectedBankAccount, this.selectedTransactionType);\r\n\r\n return data;\r\n });\r\n }\r\n\r\n getMoneyManagerData = (silentMode?: boolean) => {\r\n return this.moneyManagerSrv.getMoneyManagerData(silentMode).then(data => {\r\n this.moneyManagerData = data;\r\n\r\n if (this.transactions && this.transactions.length > 0) {\r\n this.addBalanceToTransactions(this.transactions);\r\n }\r\n\r\n this.filterTransactions(this.selectedBankAccount, this.selectedTransactionType);\r\n\r\n return data;\r\n });\r\n }\r\n\r\n selectedTransactionTypeChanged = (transactionType) => {\r\n if (!transactionType) {\r\n transactionType = this.selectedTransactionType;\r\n }\r\n\r\n this.filterTransactions(this.selectedBankAccount, transactionType);\r\n }\r\n\r\n selectedBankAccountChanged = (bankAccount) => {\r\n if (!bankAccount) {\r\n bankAccount = this.selectedBankAccount;\r\n }\r\n\r\n this.filterTransactions(bankAccount, this.selectedTransactionType);\r\n }\r\n\r\n filterTransactions = (selectedBankAccount, selectedTransactionType) => {\r\n var filteredList;\r\n\r\n if (selectedBankAccount && selectedBankAccount.bankAccountId) {\r\n if (selectedBankAccount.bankAccountId !== \"*\") {\r\n filteredList = _.filter(this.transactions, (transaction: any) => (transaction.bankId === selectedBankAccount.bankAccountId));\r\n } else {\r\n filteredList = this.transactions;\r\n }\r\n }\r\n\r\n if (selectedTransactionType && selectedTransactionType.value !== undefined) {\r\n if (filteredList) {\r\n if (selectedTransactionType.value !== this.bankLinkEnums.TransactionType.ALL) {\r\n filteredList = _.filter(filteredList, (transaction: any) =>\r\n transaction.transactionType === selectedTransactionType.value);\r\n }\r\n } else {\r\n if (selectedTransactionType.value !== this.bankLinkEnums.TransactionType.ALL) {\r\n filteredList = _.filter(this.transactions, (transaction: any) => (transaction.transactionType === selectedTransactionType.value));\r\n }\r\n }\r\n }\r\n\r\n if (filteredList === undefined) {\r\n filteredList = [];\r\n }\r\n\r\n if (this.businessOnly) {\r\n filteredList = _.filter(filteredList, (transacation: any) => transacation.debitAmount < 0);\r\n }\r\n\r\n this.transactionsList = filteredList;\r\n\r\n this.createPaginationArray();\r\n }\r\n\r\n addModifiedTransaction = (category, transaction: BankLink.Transaction) => {\r\n _.remove(this.modifiedTransactions, (t: BankLink.Transaction) => t.transactionId === transaction.transactionId);\r\n transaction.transactionCategory = category;\r\n\r\n if (category) {\r\n this.modifiedTransactions.push(transaction);\r\n }\r\n\r\n transaction.isVatReclaimable = this.serviceLineSrv.businessDetailSummary.getEffectiveVatSchemeOn(this.dateUtils.convertToJsDate(transaction.transactionDate)) ===\r\n VatScheme.nonFlatRate &&\r\n transaction.transactionCategory &&\r\n transaction.transactionCategory.isVatable;\r\n\r\n if (!transaction.isVatReclaimable) {\r\n transaction.hasValidVatReceipt = false;\r\n transaction.vat = 0;\r\n transaction.net = (-transaction.gross || 0) - (transaction.vat || 0);\r\n }\r\n }\r\n\r\n check24MonthRuleApplicable = (transaction): boolean => {\r\n return (\r\n // Check whether transaction category is 24 month rule applicable\r\n transaction.transactionCategory.is24MonthRuleApplicable\r\n \r\n // AND\r\n &&\r\n\r\n // Check whether assignment is over 24 months old\r\n this.selectedAssignment &&\r\n this.selectedAssignment.dateStarted &&\r\n this.dateUtils.isOverNMonthsAgo(this.dateUtils.convertToJsDate(this.selectedAssignment.dateStarted), 24)\r\n );\r\n }\r\n\r\n getAllocationConfirmationModal = (form:ng.IFormController) => {\r\n this.headerForm = form;\r\n this.$uibModal.open({\r\n animation: true,\r\n templateUrl: 'src/app/shared/views/bank/modals/brookson.bankLink.modals.allocationConfirmation.html',\r\n controller: 'bankAllocationConfirmationCtrl',\r\n controllerAs: '$ctrl',\r\n size: \"lg\"\r\n });\r\n\r\n }\r\n\r\n saveTransactions = () => {\r\n _.forEach(this.modifiedTransactions,\r\n transaction => {\r\n transaction.transactionType = transaction.transactionCategory.transactionType;\r\n });\r\n\r\n var modifiedTransactionsCount = this.modifiedTransactions.length;\r\n\r\n _.each(this.modifiedTransactions, (transaction) => {\r\n if (!transaction.passes24MonthRule) {\r\n transaction.accept24MonthRuleRisk = this.acceptRisk === \"true\";\r\n }\r\n });\r\n\r\n this.bankLinkSrv.updateTransactions(this.modifiedTransactions)\r\n .then((result: BankLink.Transaction[]) => {\r\n var successfullyUpdatedTransactions = _.filter(this.modifiedTransactions, (t: BankLink.Transaction) =>\r\n _.find(result, r => r.transactionId === t.transactionId) != null);\r\n\r\n var unsuccessfullyUpdatedTransactions = _.filter(this.modifiedTransactions, (t: BankLink.Transaction) =>\r\n _.find(result, r => r.transactionId === t.transactionId) == null);\r\n\r\n this.updateSuccessfulllyAllocatedTransaction(successfullyUpdatedTransactions, result);\r\n\r\n let config: angular.growl.IGrowlMessageConfig = { title: \"Bank\", ttl: 5000, disableCountDown: true };\r\n\r\n if (result.length === modifiedTransactionsCount) {\r\n this.growl.success(\"The modified transactions were successfully allocated\", config);\r\n this.headerForm.$setPristine();\r\n this.headerForm = null;\r\n } else {\r\n this.growl.warning(\"We were unable to update all of your allocations. If this error persists, please contact customer service.\", config);\r\n\r\n _.forEach(unsuccessfullyUpdatedTransactions,\r\n transaction =>\r\n this.growl.error( `Unable to update transaction ${transaction.transactionDate} : ${transaction.description}.`, config));\r\n }\r\n\r\n this.modifiedTransactions.length = 0;\r\n this.filterTransactions(this.selectedBankAccount, this.selectedTransactionType);\r\n });\r\n }\r\n\r\n updateSuccessfulllyAllocatedTransaction = (transactions, transactionAllocationResult) => {\r\n _.forEach(transactions,\r\n transaction => {\r\n _.remove(this.transactions, t => t === transaction);\r\n });\r\n\r\n _.forEach(transactions, (transaction: BankLink.Transaction) => {\r\n var relatedResult = _.find(transactionAllocationResult, (t: BankLink.Transaction) => { return t.transactionId === transaction.transactionId; });\r\n\r\n transaction.transactionStatus = relatedResult.transactionStatus;\r\n transaction.transactionType = transaction.transactionCategory.transactionType;\r\n transaction.transactionCategory = relatedResult.transactionCategory;\r\n transaction.vat = relatedResult.vat;\r\n transaction.hasValidVatReceipt = relatedResult.hasValidVatReceipt;\r\n transaction.receiptID = relatedResult.receiptID;\r\n this.transactions.push(transaction);\r\n });\r\n\r\n this.transactions = _.orderBy(this.transactions, ['transactionDate', 'transactionId'], ['desc', 'desc']);\r\n }\r\n\r\n downloadFile = (bankName: string) => {\r\n var url = \"api/BankLink/DownloadMandateForm?id=\" + bankName;\r\n var expectedMediaType = \"application/octet-stream\";\r\n var memberId = this.memberSrv.getMember().memberId;\r\n\r\n this.fileDownloadSrv.downloadAndSave(url, null, 'Mandate - ' + bankName + ' - ' + memberId + '.pdf', expectedMediaType);\r\n }\r\n\r\n selectBankAccountFromAsideMenu = (bankAccount) => {\r\n this.selectedBankAccount = bankAccount;\r\n this.selectedBankAccountChanged(bankAccount);\r\n this.showAside = false;\r\n }\r\n\r\n getReceipts = () => {\r\n this.expensesSrv.getReceipts().then(data => {\r\n this.receipts = data;\r\n });\r\n }\r\n\r\n receiptAttached = (transaction: BankLink.Transaction) => {\r\n return receipt => {\r\n transaction.receiptID = receipt.receiptId;\r\n transaction.receiptThumbnail = receipt.imageData;\r\n\r\n var localReceipt = _.find(this.receipts, (n: Shared.Receipt) => (n.receiptId === transaction.receiptID));\r\n localReceipt.status = this.expensesEnums.ReceiptStatus.UNSUBMITTED;\r\n localReceipt.isSelected = false;\r\n\r\n this.addModifiedTransaction(transaction.transactionCategory, transaction);\r\n };\r\n }\r\n\r\n receiptAttachedToAllocated = (transaction: BankLink.Transaction) => {\r\n return receipt => {\r\n transaction.receiptID = receipt.receiptId;\r\n\r\n var localReceipt = _.find(this.receipts, (n: Shared.Receipt) => (n.receiptId === transaction.receiptID));\r\n localReceipt.status = this.expensesEnums.ReceiptStatus.UNSUBMITTED;\r\n localReceipt.isSelected = false;\r\n\r\n this.updateAllocatedTransaction(transaction);\r\n };\r\n }\r\n\r\n receiptDeleted = (transaction: BankLink.Transaction) => {\r\n var receipt = _.find(this.receipts, (n: Shared.Receipt) => (n.receiptId === transaction.receiptID));\r\n\r\n receipt.status = this.expensesEnums.ReceiptStatus.UNATTACHED;\r\n\r\n transaction.receiptID = 0;\r\n this.addModifiedTransaction(transaction.transactionCategory, transaction);\r\n }\r\n\r\n receiptsTotal = (): number => {\r\n return _.filter(this.receipts, (receipt: any) => (receipt.status === this.expensesEnums.ReceiptStatus.UNATTACHED)).length;\r\n }\r\n\r\n flowOptions = (transaction) => {\r\n transaction.flowOptions = this.expensesSrv.createReceiptFlowFactory();\r\n return transaction.flowOptions;\r\n }\r\n\r\n flowFileAdded = (file, flow, transaction): boolean => {\r\n if (!{ jpg: 1, png: 1, pdf: 1, jpeg: 1, gif: 1 }[file.getExtension()]) {\r\n transaction.fileTypeValidationError = true;\r\n }\r\n\r\n if (file.size > 10000000) {\r\n transaction.fileSizeValidationError = true;\r\n }\r\n\r\n if (transaction.fileTypeValidationError || transaction.fileSizeValidationError) {\r\n this.$timeout(transaction => {\r\n transaction.fileTypeValidationError = false;\r\n transaction.fileSizeValidationError = false;\r\n }, 4000, true, transaction);\r\n return false;\r\n }\r\n\r\n flow.files = [];\r\n\r\n return true;\r\n }\r\n\r\n flowFileSuccess = (file, response, flow, transaction: BankLink.Transaction) => {\r\n var receipt = angular.fromJson(response);\r\n transaction.receiptID = receipt.receiptId;\r\n\r\n if (transaction.transactionType === this.bankLinkEnums.TransactionType.BUSINESS) {\r\n flow.files = [];\r\n this.updateAllocatedTransaction(transaction);\r\n }\r\n else {\r\n this.addModifiedTransaction(transaction.transactionCategory, transaction);\r\n transaction.receiptThumbnail = receipt.imageDataEncoded;\r\n receipt.imageData = receipt.imageDataEncoded;\r\n this.receipts.push(receipt);\r\n this.$timeout(flow => { flow.files = []; }, 2000, true, flow);\r\n }\r\n }\r\n\r\n flowFilesSubmitted = (files, event, flow) => {\r\n this.authenticationSrv.refreshToken().then(data => {\r\n flow.opts.headers.Authorization = \"Bearer \" + data.access_token;\r\n flow.upload();\r\n });\r\n }\r\n\r\n createPaginationArray = () => {\r\n this.paginationArray = [];\r\n\r\n let pages = this.transactionsList.length / this.itemsPerPage;\r\n pages = pages < 1 ? pages : Math.ceil(pages);\r\n\r\n for (let i = 0; i < pages; i++) {\r\n this.paginationArray.push(i);\r\n }\r\n\r\n this.currentPage = 1;\r\n }\r\n\r\n filterTransactionType = (item): boolean => {\r\n if (item.value === this.bankLinkEnums.TransactionType.OUTGOINGS)\r\n return false;\r\n\r\n if (this.businessOnly && item.value === this.bankLinkEnums.TransactionType.PERSONAL)\r\n return false;\r\n\r\n return true;\r\n }\r\n\r\n isViewingPersonal = (): boolean => {\r\n return this.selectedTransactionType.value === this.bankLinkEnums.TransactionType.PERSONAL;\r\n }\r\n\r\n colSpanCount = (): number => {\r\n return this.isViewingPersonal() ? 8 : 9;\r\n }\r\n\r\n isViewingAll = (): boolean => {\r\n return this.selectedTransactionType.value === this.bankLinkEnums.TransactionType.ALL;\r\n }\r\n\r\n private updateAllocatedTransaction(transaction: BankLink.Transaction) {\r\n var trans = [];\r\n trans.push(transaction);\r\n this.bankLinkSrv.updateTransactions(trans);\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module(\"app.shared\")\r\n .service(\"bankLinkFactory\", Shared.BankLinkFactory);","module Shared {\r\n export class MicroCalendlyBooking {\r\n memberId: string;\r\n startDate: string;\r\n endDate: Date;\r\n uuid: string;\r\n eventName: string;\r\n eventSlug: string;\r\n createdDate: Date;\r\n utmCampaign: string;\r\n utmMedium: string;\r\n utmSource: string;\r\n eventType: EventType;\r\n }\r\n\r\n export enum EventType {\r\n AccountantIntroduction,\r\n AdvisoryDocument,\r\n FinancialHealthCheck\r\n }\r\n}","/// \r\n\r\nmodule Shared {\r\n export interface ICalendlyService {\r\n\r\n getCalendlyIntroductionBooking(silentMode?: boolean): ng.IPromise;\r\n\r\n getCalendlyAdvisoryBooking(silentMode?: boolean): ng.IPromise;\r\n\r\n getCalendlyFinancialHealthCheckBooking(silentMode?: boolean): ng.IPromise;\r\n /**\r\n * \r\n * Gets the latest advisory doc date for customer\r\n * @param {boolean} silentMode\r\n * @returns {ng.IPromise}\r\n */\r\n //getAdvisoryDocDate(silentMode?: boolean): ng.IPromise;\r\n }\r\n\r\n export class CalendlyService implements ICalendlyService {\r\n\r\n static $inject = ['$http'];\r\n\r\n constructor(private $http: Shared.IBrooksonHttp) { }\r\n\r\n getCalendlyIntroductionBooking = (silentMode?: boolean): ng.IPromise => {\r\n return this.$http.get(`api/Calendly/GetCalendlyIntroductionBooking`,\r\n {\r\n silentMode: silentMode ? silentMode : false\r\n })\r\n .then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getCalendlyAdvisoryBooking = (silentMode?: boolean): ng.IPromise => {\r\n return this.$http.get(`api/Calendly/GetCalendlyAdvisoryBooking`,\r\n {\r\n silentMode: silentMode ? silentMode : false\r\n })\r\n .then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getCalendlyFinancialHealthCheckBooking = (silentMode?: boolean): ng.IPromise => {\r\n return this.$http.get(`api/Calendly/GetCalendlyFinancialHealthCheckBooking`,\r\n {\r\n silentMode: silentMode ? silentMode : false\r\n })\r\n .then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n \r\n }\r\n}\r\n\r\nangular.module('app.shared')\r\n .service('calendlySrv', Shared.CalendlyService);","/// \r\n\r\nmodule Shared {\r\n /**\r\n * Interface for the Calendly Factory\r\n * \r\n * @export\r\n * @interface IBrooksonFactoriesCalendly\r\n */\r\n export interface IBrooksonFactoriesCalendly {\r\n getCalendlyIntroductionBooking(): ng.IPromise;\r\n\r\n getCalendlyAdvisoryBooking(): ng.IPromise;\r\n\r\n getCalendlyFinancialHealthCheckBooking(): ng.IPromise;\r\n /**\r\n * \r\n * Gets the latest advisory doc date for customer\r\n * @returns {ng.IPromise}\r\n */\r\n //getAdvisoryDocDate(): ng.IPromise;\r\n\r\n }\r\n\r\n /**\r\n * \r\n * Factory to handle all the intro walkthroughs for each section\r\n * @export\r\n * @class BrooksonFactoriesCalendly\r\n * @implements {IBrooksonFactoriesCalendly}\r\n */\r\n export class BrooksonFactoriesCalendly implements IBrooksonFactoriesCalendly {\r\n\r\n /**\r\n * \r\n * DI\r\n * @static\r\n */\r\n static $inject = ['$q', 'calendlySrv'];\r\n\r\n constructor(\r\n private $q: ng.IQService,\r\n private service: Shared.ICalendlyService\r\n ) {\r\n }\r\n\r\n getCalendlyIntroductionBooking = (): ng.IPromise => {\r\n return this.service.getCalendlyIntroductionBooking(true).then((response: MicroCalendlyBooking) => {\r\n return response;\r\n });\r\n }\r\n\r\n \r\n getCalendlyAdvisoryBooking = (): ng.IPromise => {\r\n return this.service.getCalendlyAdvisoryBooking(true).then((response: MicroCalendlyBooking) => {\r\n return response;\r\n });\r\n }\r\n\r\n getCalendlyFinancialHealthCheckBooking = (): ng.IPromise => {\r\n return this.service.getCalendlyFinancialHealthCheckBooking(true).then((response: MicroCalendlyBooking) => {\r\n return response;\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular.module('app.shared')\r\n .service('brooksonFactoriesCalendly', Shared.BrooksonFactoriesCalendly);","/// \r\n\r\nmodule Shared {\r\n export interface IBrooksonUiFeedbackFactory {\r\n isScreenshotMode: boolean;\r\n isFeedbackMode: boolean;\r\n\r\n $uibModalInstance: ng.ui.bootstrap.IModalServiceInstance;\r\n\r\n userFeedback: UserFeedback;\r\n userFeedbackCategories: Array;\r\n modalElementSelector: string;\r\n modalBackdropElementSelector: string;\r\n\r\n // Methods\r\n openModal();\r\n hideModal();\r\n showModal();\r\n closeModal();\r\n\r\n // Document Events\r\n setupDocumentEvents();\r\n\r\n // Requests //\r\n getUserFeedbackCategories(): ng.IPromise>;\r\n postUserFeedback();\r\n\r\n // User Information //\r\n getUserAgentInfo();\r\n getState();\r\n getUrl();\r\n\r\n // Screenshot Methods //\r\n takeScreenshot();\r\n resetScreenshot();\r\n destroyCanvas();\r\n addAlphaBackground();\r\n\r\n // Canvas Methods //\r\n createCanvas();\r\n }\r\n \r\n export interface AppSettings extends ng.IWindowService {\r\n appSettings: any;\r\n }\r\n \r\n export class BrooksonUiFeedbackFactory {\r\n static CANVAS_ID: string = 'feedback-canvas';\r\n static FEEDBACK_HIGHLIGHT_CLASS: string = 'feedback-highlight';\r\n\r\n // Modal Data //\r\n isFeedbackMode: boolean;\r\n\r\n // Screenshot data //\r\n isScreenshotMode: boolean;\r\n $uibModalInstance: ng.ui.bootstrap.IModalServiceInstance;\r\n\r\n // Feedback Data //\r\n private userFeedback: UserFeedback = new UserFeedback();\r\n private userFeedbackCategories: Array;\r\n\r\n // HTML Selectors //\r\n private modalElementSelector: string = 'div[uib-modal-window]';\r\n private modalBackdropElementSelector: string = 'div[uib-modal-backdrop]';\r\n private sendFeedbackElementSelector: string = 'div.send-feedback';\r\n\r\n // Canvas Methods //\r\n private ctx;\r\n private isDrawing: boolean = false;\r\n private centerX: number;\r\n private centerY: number;\r\n\r\n static $inject = ['$http', '$state', '$location', '$uibModal', '$timeout', '$document', 'uaParser',\"$window\"];\r\n\r\n constructor(private $http: ng.IHttpService, private $state: ng.ui.IStateService, private $location: ng.ILocationService, private $uibModal: ng.ui.bootstrap.IModalService, private $timeout: ng.ITimeoutService,\r\n private $document: ng.IDocumentService, private uaParser: UAParser,private $window: AppSettings) {\r\n }\r\n\r\n // Send Feedback Methods //\r\n hideSendFeedback() {\r\n const sendFeedback = angular.element(this.sendFeedbackElementSelector);\r\n sendFeedback.addClass('hidden');\r\n }\r\n\r\n showSendFeedback() {\r\n const sendFeedback = angular.element(this.sendFeedbackElementSelector);\r\n sendFeedback.removeClass('hidden');\r\n }\r\n\r\n // Modal Methods //\r\n openModal() {\r\n this.isFeedbackMode = true;\r\n\r\n const modalSettings: ng.ui.bootstrap.IModalSettings = {\r\n animation: true,\r\n size: \"lg\",\r\n templateUrl: \"src/app/shared/views/modals/brookson.modals.feedback.html\",\r\n controller: ['brooksonUiFeedbackFactory', '$detection', BrooksonModalFeedbackController],\r\n controllerAs: '$ctrl'\r\n };\r\n\r\n this.$uibModalInstance = this.$uibModal.open(modalSettings);\r\n this.$uibModalInstance.result.then(() => {\r\n this.closeModal();\r\n }, () => {\r\n this.closeModal();\r\n });\r\n\r\n this.$uibModalInstance.rendered.then((a) => {\r\n this.styleModal();\r\n });\r\n }\r\n\r\n styleModal() {\r\n const modal = $('.modal');\r\n\r\n modal.css('position', 'absolute');\r\n modal.css('marginTop', $(window).scrollTop() + 'px');\r\n modal.css('bottom', 'auto');\r\n\r\n this.$timeout(() => {\r\n const modalBackdrop = $('.modal-backdrop');\r\n modalBackdrop.css('position', 'absolute');\r\n modalBackdrop.css('top', '0');\r\n modalBackdrop.css('left', '0');\r\n modalBackdrop.css('width', '100%');\r\n modalBackdrop.css('height', Math.max(\r\n document.body.scrollHeight, document.documentElement.scrollHeight,\r\n document.body.offsetHeight, document.documentElement.offsetHeight,\r\n document.body.clientHeight, document.documentElement.clientHeight\r\n ) + 'px');\r\n\r\n }, 0);\r\n }\r\n\r\n hideModal() {\r\n const modal = angular.element(this.modalElementSelector);\r\n const modalBackdrop = angular.element(this.modalBackdropElementSelector);\r\n modal.addClass('hidden');\r\n modalBackdrop.addClass('hidden');\r\n }\r\n\r\n showModal() {\r\n const modal = angular.element(this.modalElementSelector);\r\n const modalBackdrop = angular.element(this.modalBackdropElementSelector);\r\n modal.removeClass('hidden');\r\n modalBackdrop.removeClass('hidden');\r\n this.styleModal();\r\n }\r\n\r\n closeModal() {\r\n this.isFeedbackMode = false;\r\n this.$uibModalInstance.close();\r\n this.destroyCanvas();\r\n }\r\n\r\n // Requests //\r\n getUserFeedbackCategories(): ng.IPromise> {\r\n return this.$http.get('api/UserFeedback/GetUserFeedbackCategories').then((response: ng.IHttpPromiseCallbackArg>) => {\r\n this.userFeedbackCategories = response.data;\r\n return this.userFeedbackCategories;\r\n });\r\n }\r\n\r\n postUserFeedback() {\r\n return this.$http.post('api/UserFeedback/PostUserFeedback', this.userFeedback).then(data => {\r\n if (data) {\r\n this.$uibModalInstance.dismiss();\r\n }\r\n });\r\n }\r\n\r\n // User Information //\r\n getUserAgentInfo() {\r\n const browser: UAParser.IBrowser = this.uaParser.getBrowser();\r\n const device: UAParser.IDevice = this.uaParser.getDevice();\r\n const cpu: UAParser.ICPU = this.uaParser.getCPU();\r\n const engine: UAParser.IEngine = this.uaParser.getEngine();\r\n const os: UAParser.IEngine = this.uaParser.getOS();\r\n\r\n this.userFeedback.browser = browser.name;\r\n this.userFeedback.browserVersion = browser.version;\r\n this.userFeedback.cpuArchitecture = cpu.architecture;\r\n this.userFeedback.deviceType = device.type;\r\n this.userFeedback.deviceModel = device.model;\r\n this.userFeedback.deviceVendor = device.vendor;\r\n this.userFeedback.engineName = engine.name;\r\n this.userFeedback.engineVersion = engine.version;\r\n this.userFeedback.os = os.name;\r\n this.userFeedback.osVersion = os.version;\r\n }\r\n\r\n getState() {\r\n this.userFeedback.state = this.$state.current.name;\r\n this.userFeedback.stateParams = JSON.stringify(this.$state.params);\r\n }\r\n\r\n getUrl() {\r\n this.userFeedback.url = this.$location.absUrl();\r\n }\r\n\r\n // Screenshot Methods //\r\n takeScreenshot() {\r\n var options: Html2Canvas.Html2CanvasOptions = {\r\n onrendered: canvas => {\r\n this.isScreenshotMode = false;\r\n this.showModal();\r\n this.showSendFeedback();\r\n this.destroyCanvas();\r\n\r\n canvas.style.width = '100%';\r\n canvas.style.borderRadius = '12px';\r\n\r\n this.$timeout(() => {\r\n this.userFeedback.screenshotBase64 = canvas.toDataURL();\r\n });\r\n }\r\n };\r\n\r\n this.hideModal();\r\n this.hideSendFeedback();\r\n html2canvas(document.body, options);\r\n }\r\n\r\n resetScreenshot() {\r\n this.userFeedback.screenshotBase64 = null;\r\n }\r\n\r\n destroyCanvas() {\r\n this.removeDocumentEvents();\r\n\r\n const canvas = angular.element(`#${BrooksonUiFeedbackFactory.CANVAS_ID}`);\r\n if (canvas) canvas.remove();\r\n\r\n const highlights = angular.element(`.${BrooksonUiFeedbackFactory.FEEDBACK_HIGHLIGHT_CLASS}`);\r\n highlights.remove();\r\n\r\n this.ctx = null;\r\n }\r\n\r\n // Document Events //\r\n setupDocumentEvents() {\r\n this.$document.on('mousedown', (event) => {\r\n this.onMouseDown(event);\r\n });\r\n this.$document.on('mouseup', (event) => {\r\n this.onMouseUp(event);\r\n });\r\n this.$document.on('mousemove', (event) => {\r\n this.onMouseMove(event);\r\n });\r\n }\r\n\r\n removeDocumentEvents() {\r\n this.$document.off('mousedown');\r\n this.$document.off('mouseup');\r\n this.$document.off('mousemove');\r\n }\r\n\r\n onMouseDown = (event: any) => {\r\n this.centerX = event.pageX;\r\n this.centerY = event.pageY;\r\n\r\n this.ctx.beginPath();\r\n\r\n this.isDrawing = true;\r\n\r\n this.redraw();\r\n }\r\n\r\n onMouseMove = (event: any) => {\r\n if (this.isDrawing) {\r\n const width = event.pageX - this.centerX;\r\n const height = event.pageY - this.centerY;\r\n\r\n this.ctx.clearRect(0, 0, this.$document.width(), this.$document.height());\r\n this.addAlphaBackground();\r\n this.ctx.clearRect(this.centerX, this.centerY, width, height);\r\n\r\n this.redraw();\r\n }\r\n }\r\n\r\n onMouseUp = (event: any) => {\r\n this.isDrawing = false;\r\n\r\n const width = event.pageX - this.centerX;\r\n const height = event.pageY - this.centerY;\r\n\r\n this.ctx.fillStyle = 'rgba(0,0,0,0)';\r\n this.ctx.strokeRect(this.centerX, this.centerY, width, height);\r\n this.ctx.fillRect(this.centerX, this.centerY, width, height);\r\n\r\n const highlight = '
      ';\r\n angular.element('body').append(highlight);\r\n\r\n this.redraw();\r\n }\r\n\r\n addAlphaBackground() {\r\n if (!this.ctx) throw Error(\"User feedback context does not exist\");\r\n\r\n this.ctx.fillStyle = 'rgba(102,102,102,0.5)';\r\n this.ctx.fillRect(0, 0, this.$document.width(), this.$document.height());\r\n }\r\n\r\n createCanvas() {\r\n if (!this.ctx) {\r\n const canvas = ``;\r\n const body = angular.element('body');\r\n body.append(canvas);\r\n angular.element(`#${BrooksonUiFeedbackFactory.CANVAS_ID}`).attr({\r\n 'width': this.$document.width(),\r\n 'height': this.$document.height()\r\n });\r\n const canvasElement = document.getElementById(BrooksonUiFeedbackFactory.CANVAS_ID);\r\n this.ctx = canvasElement.getContext('2d');\r\n\r\n this.setupDocumentEvents();\r\n this.addAlphaBackground();\r\n }\r\n }\r\n\r\n private redraw() {\r\n const highlights = angular.element(`.${BrooksonUiFeedbackFactory.FEEDBACK_HIGHLIGHT_CLASS}`);\r\n\r\n _.forEach(highlights, highlight => {\r\n this.ctx.clearRect(parseInt(highlight.style.left), parseInt(highlight.style.top), parseInt(highlight.style.width), parseInt(highlight.style.height));\r\n this.ctx.strokeRect(parseInt(highlight.style.left), parseInt(highlight.style.top), parseInt(highlight.style.width), parseInt(highlight.style.height));\r\n this.ctx.fillRect(parseInt(highlight.style.left), parseInt(highlight.style.top), parseInt(highlight.style.width), parseInt(highlight.style.height));\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular.module('app.shared').service('brooksonUiFeedbackFactory', Shared.BrooksonUiFeedbackFactory);\r\n","\r\nmodule Shared {\r\n export class ConnectIntro {\r\n public connectIntroId: number;\r\n public memberId: number;\r\n public firstTimeLogin: boolean;\r\n public expenses: boolean;\r\n public invoicing: boolean;\r\n public bank: boolean;\r\n public documentStorage: boolean;\r\n public selfAssessment: boolean;\r\n public taskPlanner: boolean;\r\n public assignments: boolean;\r\n public ir35: boolean;\r\n }\r\n}","/// \r\n/// \r\n\r\nmodule Shared {\r\n \r\n export interface IBrooksonServicesIntro {\r\n \r\n getConnectIntros(silentMode?: boolean) : ng.IPromise;\r\n \r\n setFirstTimeLoginSeen(silentMode?: boolean): ng.IPromise;\r\n }\r\n\r\n \r\n export class BrooksonServicesIntro implements IBrooksonServicesIntro {\r\n \r\n static $inject = ['$http'];\r\n \r\n constructor(private $http: Shared.IBrooksonHttp) {}\r\n\r\n \r\n getConnectIntros = (silentMode?: boolean) : ng.IPromise => {\r\n return this.$http.get(`api/Intro/GetConnectIntros`, {\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n \r\n setFirstTimeLoginSeen = (silentMode?: boolean ) : ng.IPromise => {\r\n return this.$http.post(`api/Intro/SetFirstTimeLoginSeen`, {}, {\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular.module('app.shared')\r\n .service('brooksonServicesIntro', Shared.BrooksonServicesIntro);","module Shared {\r\n export interface IIR35ModalService {\r\n getListOfJobTitles(): ng.IPromise;\r\n getListOfSectors(): ng.IPromise;\r\n insertIR35Assessment(answers: IR35AssessmentAnswers): ng.IPromise;\r\n showIR35AssessmentModal(): ng.IPromise;\r\n }\r\n\r\n export class IR35ModalService implements IIR35ModalService {\r\n\r\n static $inject = ['$http'];\r\n\r\n constructor(private $http: Shared.IBrooksonHttp) { }\r\n\r\n getListOfJobTitles(): ng.IPromise {\r\n return this.$http.get('api/IR35Modal/getListOfJobTitles').then((response: ng.IHttpPromiseCallbackArg): string[] => {\r\n return response.data;\r\n });\r\n }\r\n getListOfSectors(): ng.IPromise {\r\n return this.$http.get('api/IR35Modal/getListOfSectors').then((response: ng.IHttpPromiseCallbackArg): string[] => {\r\n return response.data;\r\n });\r\n }\r\n\r\n insertIR35Assessment(answers: IR35AssessmentAnswers): ng.IPromise {\r\n return this.$http.post('api/IR35Modal/insertIR35Assessment', answers)\r\n .then((response: ng.IHttpPromiseCallbackArg): boolean => {\r\n return response.data;\r\n });\r\n }\r\n\r\n showIR35AssessmentModal(): ng.IPromise {\r\n return this.$http.get('api/IR35Modal/showIR35AssessmentModal').then((response: ng.IHttpPromiseCallbackArg): boolean => {\r\n return response.data;\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular.module('app.shared').service('ir35ModalService', Shared.IR35ModalService);","\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n\r\n export class AssignmentRateCompact {\r\n\r\n // RATEID\r\n public rateID: string = null;\r\n // PERIOD\r\n public period: string = null;\r\n // DESCRIPTION\r\n public description: string = null;\r\n // AMOUNT\r\n public amount: number = 0;\r\n // CURRENCY\r\n public currency: string = null;\r\n // RATETYPE\r\n public rateType: string = null;\r\n // PAYMENTCODE\r\n public paymentCode: string = null;\r\n // STARTDATE\r\n public startDate: Date = null;\r\n // ENDDATE\r\n public endDate: Date = null;\r\n public canBeDeleted: boolean = false;\r\n public canBeEdited: boolean = false;\r\n }\r\n}\r\n","/// \r\n/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class AssignmentCompact {\r\n \r\n // ASSIGNMENTID\r\n public assignmentID: string = null;\r\n // ASSIGNMENTNAME\r\n public assignmentName: string = null;\r\n // ASSIGNMENTADDRESS\r\n public assignmentAddress: string = null;\r\n // ASSIGNMENTADDRESSOBJ\r\n public assignmentAddressObj: Address = null;\r\n // ASSIGNMENTNOTES\r\n public assignmentNotes: string = null;\r\n // MEMBERID\r\n public memberID: number = 0;\r\n // CUSTOMERNAME\r\n public customerName: string = null;\r\n // CLIENT\r\n public client: string = null;\r\n // AGENCY\r\n public agency: string = null;\r\n // COMPANY\r\n public company: string = null;\r\n // CURRENCY\r\n public currency: string = null;\r\n // DATESTARTED\r\n public dateStarted: string | Date = null;\r\n // DATEENDED\r\n public dateEnded: string | Date = null;\r\n // MEMBERADVISEDSTATUSOLD\r\n public memberAdvisedStatusOld: string = null;\r\n // CUSTOMER\r\n public customer: CustomerCompact = null;\r\n // RATES\r\n public rates: AssignmentRateCompact[] = [];\r\n // ISSELFBILLING\r\n public isSelfBilling: boolean = false;\r\n // PREFERREDEMAILADDRESSES\r\n public preferredEmailAddresses: string[] = [];\r\n // UNIQUEIDENTIFIERNUMBER\r\n public uniqueIdentifierNumber: string = null;\r\n // AGENCYREFERENCE\r\n public agencyReference: string = null;\r\n // LOCATIONS\r\n public locations: Location[] = [];\r\n // DEEMED\r\n public deemed: boolean = false;\r\n public publicSector: Sectors = null;\r\n public publicSectorFromDate: Date;\r\n public sectorSelector: any = null;\r\n public ir35AssignmentSelector: any = null;\r\n public jobTitle: string = null;\r\n public jobTitleOption: JobTitle = null;\r\n public industry: string = null;\r\n public ir35Capture: boolean;\r\n public ir35AssignmentStatus: any;\r\n public ir35AssessmentCaptured: Shared.IIR35Captured;\r\n public timesheetFrequencySelector: EnumObj;\r\n public timesheetFrequency: any;\r\n public timesheetFrequencyStatus: any;\r\n public timesheetFrequencyOptionsList: Array;\r\n }\r\n}\r\n","\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class ClientRate {\r\n \r\n // CLIENTRATEID\r\n public clientRateID: number = 0;\r\n // CLIENTID\r\n public clientID: number = 0;\r\n // RATE\r\n public rate: number = 0;\r\n // CLIENTRATETYPE\r\n public clientRateType: number = 0;\r\n // ISDEFAULT\r\n public isDefault: boolean = false;\r\n // ISDELETED\r\n public isDeleted: boolean = false;\r\n }\r\n}\r\n","/// \r\n/// \r\n/// \r\n\r\n\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class CustomerCompact {\r\n \r\n // CUSTOMERNUMBER\r\n public customerNumber: string = null;\r\n // CUSTOMERNAME\r\n public customerName: string = null;\r\n // CUSTOMERADDRESS\r\n public customerAddress: string = null;\r\n // CUSTOMERADDRESSOBJ\r\n public customerAddressObj: Address = null;\r\n // CUSTOMEREMAIL\r\n public customerEmail: string = null;\r\n // CONTACTNAME\r\n public contactName: string = null;\r\n // CONTACTNUMBER\r\n public contactNumber: string = null;\r\n // CONTACTEMAIL\r\n public contactEmail: string = null;\r\n // BILLINGADDRESS\r\n public billingAddress: string = null;\r\n // BILLINGADDRESSOBJ\r\n public billingAddressObj: Address = null;\r\n // ASSIGNMENTS\r\n public assignments: AssignmentCompact[] = [];\r\n // STATUS\r\n public status: boolean = false;\r\n // ISSELFBILLING\r\n public isSelfBilling: boolean = false;\r\n // SELFBILLINGMETHOD\r\n public selfBillingMethod: number = 0;\r\n // RATES\r\n public rates: ClientRate[] = [];\r\n // CUSTOMERADDRESSADDRESSLINE1\r\n public customerAddressAddressLine1: string = null;\r\n // CUSTOMERADDRESSADDRESSLINE2\r\n public customerAddressAddressLine2: string = null;\r\n // CUSTOMERADDRESSADDRESSLINE3\r\n public customerAddressAddressLine3: string = null;\r\n // CUSTOMERADDRESSTOWN\r\n public customerAddressTown: string = null;\r\n // CUSTOMERADDRESSCOUNTY\r\n public customerAddressCounty: string = null;\r\n // CUSTOMERADDRESSPOSTCODE\r\n public customerAddressPostcode: string = null;\r\n // CUSTOMERADDRESSCOUNTRY\r\n public customerAddressCountry: string = null;\r\n // BILLINGADDRESSADDRESSLINE1\r\n public billingAddressAddressLine1: string = null;\r\n // BILLINGADDRESSADDRESSLINE2\r\n public billingAddressAddressLine2: string = null;\r\n // BILLINGADDRESSADDRESSLINE3\r\n public billingAddressAddressLine3: string = null;\r\n // BILLINGADDRESSTOWN\r\n public billingAddressTown: string = null;\r\n // BILLINGADDRESSCOUNTY\r\n public billingAddressCounty: string = null;\r\n // BILLINGADDRESSPOSTCODE\r\n public billingAddressPostcode: string = null;\r\n // BILLINGADDRESSCOUNTRY\r\n public billingAddressCountry: string = null;\r\n // AGENCYREFERENCE\r\n public agencyReference: string = null;\r\n // CLIENTID\r\n public clientId: number = 0;\r\n // CLIENTADDRESSID\r\n public clientAddressId: number = 0;\r\n // BILLINGADDRESSID\r\n public billingAddressId: number = 0;\r\n // NARRATIVE\r\n public narrative: string = null;\r\n // PONUMBER\r\n public poNumber: string = null;\r\n public timesheetFrequencySelector: EnumObj;\r\n public timesheetFrequencyStatus: any;\r\n public timesheetFrequency: Shared.ITimesheetFrequency;\r\n public timesheetFrequencyOptionsList: Array;\r\n public isDirectEngagement: boolean = false;\r\n }\r\n}\r\n","/// \r\n\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class PaymentCode {\r\n \r\n // CODE\r\n public code: string = null;\r\n // DESCRIPTION\r\n public description: string = null;\r\n // LINETYPE\r\n public lineType: string = null;\r\n // TIMEUNITS\r\n public timeUnits: string = null;\r\n // GUIDANCE\r\n public guidance: string = null;\r\n // RECEIPTREQUIRED\r\n public receiptRequired: boolean = false;\r\n // ISBANDED\r\n public isBanded: boolean = false;\r\n // CATEGORY\r\n public category: string = null;\r\n // ACCOUNTTYPE\r\n public accountType: AccountType = null;\r\n // DEFAULTEXPENSERATE\r\n public defaultExpenseRate: number = 0;\r\n // ISPUBLIC\r\n public isPublic: boolean = false;\r\n // ISMILEAGE\r\n public isMileage: boolean = false;\r\n // ISOFFSITE\r\n public isOffSite: boolean = false;\r\n }\r\n}\r\n","module Shared {\r\n export enum PaymentFrequency {\r\n weekly = 0,\r\n fortnightly = 2,\r\n monthly = 3,\r\n }\r\n\r\n\r\n export class PaymentFrequencyParser {\r\n public static getDescription = (value: number): PaymentFrequency => {\r\n switch (value) {\r\n case 0:\r\n return PaymentFrequency.weekly;\r\n case 2:\r\n return PaymentFrequency.fortnightly;\r\n case 3:\r\n return PaymentFrequency.monthly;\r\n default:\r\n return PaymentFrequency.weekly;\r\n }\r\n }\r\n public static getEnum = (value: number): EnumObj => {\r\n switch (value) {\r\n case 0:\r\n return new EnumObj('Weekly', 0);\r\n case 2:\r\n return new EnumObj('Fortnightly', 2);\r\n case 3:\r\n return new EnumObj('Monthly', 3);\r\n default:\r\n return new EnumObj('Weekly', 0);\r\n }\r\n }\r\n }\r\n}","module Shared {\r\n export enum PayPersonBureau {\r\n none = -99,\r\n bur15 = 0,\r\n bur16 = 2,\r\n bur17 = 3,\r\n }\r\n}","/// \r\n/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n export class TimesheetFrequencyDetails {\r\n \r\n public payPersonBureau: PayPersonBureau;\r\n\r\n public payPersonBureauDescription: string = null;\r\n\r\n public timesheetFrequencyStatus: PaymentFrequency;\r\n\r\n public timesheetFrequencies: PaymentFrequency[] = [];\r\n\r\n public timesheetFrequencyDescription: string = null;\r\n\r\n public timesheetFrequencyOptions: PaymentFrequency[] = [];\r\n\r\n public timesheetFrequencyOptionsList: Array;\r\n }\r\n}\r\n","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n export interface IAssignmentService {\r\n publicOrPrivateAssignment: Array;\r\n ir35CapturedAssignment: Array;\r\n timesheetFrequency: Array;\r\n paymentCodes: Array;\r\n \r\n getAssignment(assignmentRef: string): ng.IPromise;\r\n getAssignments(silentMode?: boolean): ng.IPromise>;\r\n getPaymentCodes(): ng.IPromise>;\r\n getPaymentCodeValue(paymentCode: string): string;\r\n getAllAssignments(silentMode?: boolean): ng.IPromise>;\r\n getAssignmentsForInvoiceCrediting(invoiceId: any, silentMode?: boolean): ng.IPromise>;\r\n closeAssignment(id: string): ng.IPromise;\r\n reopenAssignment(id: number): ng.IPromise;\r\n getTimesheetFrequencyDetails(): ng.IPromise;\r\n }\r\n\r\n export class AssignmentSrv implements IAssignmentService {\r\n private serviceBase: string;\r\n public publicOrPrivateAssignment: Array;\r\n public ir35CapturedAssignment: Array;\r\n public timesheetFrequency: Array;\r\n public paymentCodes: Array;\r\n\r\n static $inject = ['$http', 'shared.config', \"brookson.utilities.date\", \"invoicing.enums\"];\r\n\r\n constructor(\r\n private $http: ng.IHttpService,\r\n private sharedConfig: any,\r\n private dateUtils: IBrooksonUtilitiesDate,\r\n private invoicingEnums: Shared.IInvoicingEnums\r\n ) {\r\n this.serviceBase = sharedConfig.baseApiUrl;\r\n\r\n let publicOrPrivateAssignment = this.invoicingEnums.Sectors.properties;\r\n delete publicOrPrivateAssignment['2'];\r\n this.publicOrPrivateAssignment = publicOrPrivateAssignment;\r\n\r\n this.ir35CapturedAssignment = this.invoicingEnums.Ir35Captured.properties; \r\n this.timesheetFrequency = this.invoicingEnums.TimesheetFrequency.properties; \r\n }\r\n\r\n getAssignment(assignmentRef: string): ng.IPromise {\r\n let url = this.serviceBase + 'api/Assignment/GetAssignment/' + assignmentRef;\r\n return this.$http.get(url).then((response: ng.IHttpPromiseCallbackArg) => {\r\n if (response.data.publicSectorFromDate) {\r\n response.data.publicSectorFromDate = this.dateUtils.convertToJsDate(response.data.publicSectorFromDate);\r\n }\r\n return response.data;\r\n });\r\n }\r\n\r\n getAssignments(silentMode?: boolean, umbrellaExpenses?: boolean): ng.IPromise> {\r\n let url = this.serviceBase + 'api/Assignment/GetAssignments?umbrellaExpenses=' + umbrellaExpenses;\r\n let params = {\r\n headers: {\r\n silentMode: silentMode ? silentMode : false\r\n }\r\n };\r\n return this.$http.get(url, params).then((response: ng.IHttpPromiseCallbackArg>) => {\r\n _.forEach(response.data,\r\n (assignment: InvoicingAssignment) => {\r\n if (assignment.publicSectorFromDate) {\r\n assignment.publicSectorFromDate = this.dateUtils.convertToJsDate(assignment.publicSectorFromDate);\r\n }\r\n });\r\n return response.data;\r\n });\r\n }\r\n\r\n getAssignmentsForFullInvoice(silentMode?: boolean, umbrellaExpenses?: boolean): ng.IPromise> {\r\n let url = this.serviceBase + 'api/Assignment/GetAssignmentsForFullInvoice?umbrellaExpenses=' + umbrellaExpenses;\r\n let params = {\r\n headers: {\r\n silentMode: silentMode ? silentMode : false\r\n }\r\n };\r\n return this.$http.get(url, params).then((response: ng.IHttpPromiseCallbackArg>) => {\r\n _.forEach(response.data,\r\n (assignment: InvoicingAssignment) => {\r\n if (assignment.publicSectorFromDate) {\r\n assignment.publicSectorFromDate = this.dateUtils.convertToJsDate(assignment.publicSectorFromDate);\r\n }\r\n });\r\n return response.data;\r\n });\r\n }\r\n\r\n getPaymentCodes(): ng.IPromise> {\r\n let url = this.serviceBase + 'api/Assignment/getPaymentCodes';\r\n //return this.$http.get(url).then((response: ng.IHttpPromiseCallbackArg>) => response.data);\r\n return this.$http.get(url).then((response: ng.IHttpPromiseCallbackArg>) => {\r\n this.paymentCodes = response.data;\r\n return this.paymentCodes;\r\n });\r\n }\r\n\r\n getPaymentCodeValue(paymentCode: string): string {\r\n let paymentCodeObj = _.find(this.paymentCodes, (paymentCodeIndex) => {\r\n return paymentCodeIndex.code === paymentCode;\r\n });\r\n\r\n return (paymentCodeObj) ? paymentCodeObj.description : '';\r\n }\r\n\r\n getTimesheetFrequencyDetails(): ng.IPromise {\r\n let url = this.serviceBase + 'api/Assignment/GetTimesheetFrequencyDetails';\r\n return this.$http.get(url).then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n\r\n getAllAssignments(silentMode?: boolean): ng.IPromise> {\r\n const url = this.serviceBase + 'api/Assignment/GetCustomers';\r\n const config = {\r\n headers: {\r\n silentMode: silentMode ? silentMode : false\r\n } };\r\n return this.$http.get(url, config).then((response: ng.IHttpPromiseCallbackArg>) => {\r\n _.forEach(response.data,\r\n customer => {\r\n _.forEach(customer.assignments,\r\n assignment => {\r\n if (assignment.publicSectorFromDate) {\r\n assignment.publicSectorFromDate = new Date(assignment.publicSectorFromDate.toString());\r\n }\r\n });\r\n });\r\n return response.data;\r\n });\r\n }\r\n\r\n getAssignmentsForInvoiceCrediting(invoiceId: any): ng.IPromise> {\r\n var id = invoiceId.replace(\":\",\"-\");\r\n let url = this.serviceBase + 'api/Assignment/GetAssignmentsForInvoiceCrediting?invoiceId=' + id;\r\n const config = {\r\n headers: {\r\n silentMode: false\r\n } };\r\n return this.$http.get(url, config).then((response: ng.IHttpPromiseCallbackArg>) => {\r\n _.forEach(response.data,\r\n (assignment: InvoicingAssignment) => {\r\n if (assignment.publicSectorFromDate) {\r\n assignment.publicSectorFromDate = this.dateUtils.convertToJsDate(assignment.publicSectorFromDate);\r\n }\r\n });\r\n return response.data;\r\n });\r\n }\r\n\r\n closeAssignment(id: string): ng.IPromise {\r\n let url = this.serviceBase + 'api/Assignment/CloseAssignment';\r\n let data = {\r\n assignmentId: id\r\n };\r\n return this.$http.put(url, data).then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n\r\n reopenAssignment(id: number): ng.IPromise {\r\n let url = this.serviceBase + 'api/Assignment/ReopenAssignment';\r\n let data = {\r\n assignmentId: id\r\n };\r\n return this.$http.put(url, data).then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n }\r\n}\r\n\r\nangular.module('app.shared').service('AssignmentSrv', Shared.AssignmentSrv);\r\n","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n\r\n\r\nmodule Shared {\r\n\r\n export interface IBrooksonFactoriesIntro {\r\n\r\n getConnectIntros(): ng.IPromise;\r\n setFirstTimeLoginSeen(): ng.IPromise;\r\n startIntro: any;\r\n insertAuthorsationCode(authorisationCode: number): ng.IPromise;\r\n showIR35AssessmentModal(): ng.IPromise;\r\n insertIR35Assessment(answers: IR35AssessmentAnswers): ng.IPromise;\r\n getAllAssignments(): ng.IPromise>;\r\n getListOfJobTitles(): ng.IPromise;\r\n getListOfSectors(): ng.IPromise;\r\n\r\n }\r\n\r\n export class BrooksonFactoriesIntro implements IBrooksonFactoriesIntro {\r\n\r\n connectIntros: ConnectIntro;\r\n member: MemberModel;\r\n\r\n static INTRO_LOCAL_STORAGE_KEY: string = \"brookson.intro\";\r\n\r\n\r\n static $inject = ['$q', 'brooksonServicesIntro', 'localStorageService', 'memberSrv', 'AssignmentSrv','ir35ModalService'];\r\n\r\n\r\n\r\n constructor(\r\n private $q: ng.IQService,\r\n private service: Shared.IBrooksonServicesIntro,\r\n private localStorageService: ng.local.storage.ILocalStorageService,\r\n private memberSrv: Shared.IMemberService,\r\n private assignmentSrv: Shared.IAssignmentService,\r\n private ir35ModalService: Shared.IIR35ModalService\r\n ) {\r\n this.member = this.memberSrv.getMember();\r\n }\r\n\r\n insertAuthorsationCode = (authorisationCode: number): ng.IPromise => {\r\n return this.memberSrv.insertAuthorsationCode(authorisationCode)\r\n .then((data) => {\r\n return data;\r\n });\r\n }\r\n\r\n getAllAssignments = (): ng.IPromise> => {\r\n return this.assignmentSrv.getAssignments().then((data) => {\r\n return data;\r\n });\r\n }\r\n\r\n showIR35AssessmentModal = (): ng.IPromise => {\r\n return this.ir35ModalService.showIR35AssessmentModal().then((data) => {\r\n return data;\r\n });\r\n }\r\n\r\n insertIR35Assessment = (answers: IR35AssessmentAnswers): ng.IPromise => {\r\n return this.ir35ModalService.insertIR35Assessment(answers).then((data) => {\r\n return data;\r\n });\r\n }\r\n\r\n getListOfJobTitles = (): ng.IPromise => {\r\n return this.ir35ModalService.getListOfJobTitles().then((data) => {\r\n return data;\r\n });\r\n }\r\n\r\n getListOfSectors = (): ng.IPromise => {\r\n return this.ir35ModalService.getListOfSectors().then((data) => {\r\n return data;\r\n });\r\n }\r\n\r\n /**\r\n * Returns an object containing each section on whether a user has seen the walkthrough\r\n * or not. It first checks local storage, if it exists, it will not make another request\r\n */\r\n getConnectIntros = (): ng.IPromise => {\r\n let data = this.getIntrosFromLocalStorage();\r\n\r\n if (data) {\r\n var defer = this.$q.defer();\r\n defer.resolve(data);\r\n return defer.promise;\r\n }\r\n\r\n return this.service.getConnectIntros(true).then((data) => {\r\n this.connectIntros = data;\r\n this.setIntrosIntroLocalStorage();\r\n\r\n return data;\r\n });\r\n }\r\n\r\n\r\n setFirstTimeLoginSeen = (): ng.IPromise => {\r\n this.connectIntros.firstTimeLogin = true;\r\n this.setIntrosIntroLocalStorage();\r\n\r\n return this.service.setFirstTimeLoginSeen(true).then((response: boolean) => {\r\n return response;\r\n });\r\n }\r\n\r\n startIntro = () => { };\r\n\r\n private getIntrosFromLocalStorage = (): ConnectIntro => {\r\n var data = this.localStorageService.get(this.getLocalStorageKey());\r\n\r\n this.connectIntros = data;\r\n\r\n return data;\r\n }\r\n\r\n\r\n private setIntrosIntroLocalStorage = (): void => {\r\n this.localStorageService.set(this.getLocalStorageKey(), this.connectIntros);\r\n }\r\n\r\n\r\n private getLocalStorageKey = (): string => `${BrooksonFactoriesIntro.INTRO_LOCAL_STORAGE_KEY}-${this.member.memberId}`;\r\n }\r\n}\r\n\r\nangular.module('app.shared')\r\n .service('brooksonFactoriesIntro', Shared.BrooksonFactoriesIntro);","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular\r\n .module('app.shared')\r\n .factory('brookson.logger', logger);\r\n\r\n logger.$inject = ['$log', 'loggerSrv', 'logging.enums'];\r\n\r\n function logger($log, loggerSrv, loggingEnums) {\r\n var service = {\r\n error: error,\r\n info: info,\r\n success: success,\r\n warning: warning,\r\n log: log\r\n };\r\n\r\n return service;\r\n\r\n function error(title, data, cause) {\r\n $log.error('Error: ' + title + '\\nStack: ' + data + '\\nCause: ' + cause);\r\n loggerSrv.log(loggingEnums.LoggingLevel.ERROR, title, data, cause);\r\n }\r\n\r\n function info(title, data, cause) {\r\n $log.info('Error: ' + title + '\\nStack: ' + data + '\\nCause: ' + cause);\r\n loggerSrv.log(loggingEnums.LoggingLevel.INFO, title, data, cause);\r\n }\r\n\r\n function success(title, data, cause) {\r\n $log.info('Error: ' + title + '\\nStack: ' + data + '\\nCause: ' + cause);\r\n loggerSrv.log(loggingEnums.LoggingLevel.INFO, title, data, cause);\r\n }\r\n\r\n function warning(title, data, cause) {\r\n $log.warn('Error: ' + title + '\\nStack: ' + data + '\\nCause: ' + cause);\r\n loggerSrv.log(loggingEnums.LoggingLevel.WARN, title, data, cause);\r\n }\r\n\r\n function log(title, data, cause) {\r\n $log.log('Error: ' + title + '\\nStack: ' + data + '\\nCause: ' + cause);\r\n loggerSrv.log(loggingEnums.LoggingLevel.INFO, title, data, cause);\r\n }\r\n }\r\n})();\r\n","module Shared {\r\n /**\r\n * \r\n * Interface for the Privacy Factory\r\n * @export\r\n * @interface IBrooksonFactoryPrivacy\r\n */\r\n export interface IBrooksonFactoryPrivacy {\r\n privacyModeEnabled: boolean;\r\n hotKeyToEnablePrivacyMode: string;\r\n\r\n togglePrivacy(): void;\r\n isPrivacyModeEnabled(silentMode?: boolean): ng.IPromise;\r\n setPrivacyMode(enabled: boolean, silentMode?: boolean): ng.IPromise;\r\n }\r\n\r\n /**\r\n * \r\n * Factory to handle toggling the privary feature\r\n * @export\r\n * @class BrooksonFactoryPrivacy\r\n * @implements {IBrooksonFactoryPrivacy}\r\n */\r\n export class BrooksonFactoryPrivacy implements IBrooksonFactoryPrivacy {\r\n\r\n /**\r\n * \r\n * Stores the value on whether privacy mode is enabled\r\n * @private\r\n * @type {boolean}\r\n */\r\n public privacyModeEnabled: boolean = false;\r\n\r\n /**\r\n * \r\n * The hotkey to toggle privacy mode\r\n * WARNING: This is used by the hotkey library and also used to display the hotkey on screen.\r\n * @private\r\n * @type {string}\r\n */\r\n public hotKeyToEnablePrivacyMode: string = \"Ctrl + Shift + H\";\r\n\r\n /**\r\n * \r\n * DI\r\n * @static\r\n */\r\n static $inject = ['$document', '$http', 'hotkeys','screenSize'];\r\n\r\n /**\r\n * Creates an instance of BrooksonFactoryPrivacy.\r\n * \r\n * @param {ng.IDocumentService} $document\r\n */\r\n constructor(\r\n private $document: ng.IDocumentService,\r\n private $http: Shared.IBrooksonHttp,\r\n private hotkeys: angular.hotkeys.HotkeysProvider,\r\n private screenSize: any\r\n ) {\r\n this.setupHotkeys();\r\n }\r\n\r\n /**\r\n * Turn the privacy feature on and off\r\n */\r\n public togglePrivacy = () => {\r\n this.privacyModeEnabled = !this.privacyModeEnabled;\r\n this.toggleBlur();\r\n this.setPrivacyMode(this.privacyModeEnabled, true);\r\n }\r\n\r\n /**\r\n * Returns whether the last state of the dashboard was in privacy mode or not\r\n * \r\n * @private\r\n * @param {boolean} [silentMode]\r\n * @returns {ng.IPromise}\r\n */\r\n public isPrivacyModeEnabled(silentMode?: boolean): ng.IPromise {\r\n return this.$http.get(`api/Dashboard/IsPrivacyModeEnabled`, {\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg) => {\r\n if (!this.screenSize.is(\"lg\")) {\r\n response.data = false; //this will be toggled to true for anything but lg\r\n }\r\n if (response.data) this.togglePrivacy();\r\n return response.data;\r\n });\r\n }\r\n\r\n /**\r\n * Sets the PrivacyModeEnabled flag in the database to either true or false\r\n * \r\n * @param {boolean} enabled\r\n * @param {boolean} [silentMode]\r\n * @returns {ng.IPromise}\r\n */\r\n public setPrivacyMode(enabled: boolean, silentMode?: boolean): ng.IPromise {\r\n return this.$http.post(`api/Dashboard/SetPrivacyMode`, {\r\n enabled: enabled\r\n }, {\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n /**\r\n * \r\n * Toggles the blur class on the blur-area element identifier\r\n * @private\r\n */\r\n private toggleBlur = () => {\r\n const blurArea = angular.element('.blur-area');\r\n\r\n if (this.privacyModeEnabled) blurArea.addClass('blur');\r\n else blurArea.removeClass('blur');\r\n }\r\n\r\n /**\r\n * Uses the hotkeys library to create a hotkey for enabling and disabling\r\n * \r\n * @private\r\n */\r\n private setupHotkeys = () => {\r\n let formatHotKey = this.hotKeyToEnablePrivacyMode.replace(/ /g, '').toLowerCase();\r\n\r\n this.hotkeys.add({\r\n combo: formatHotKey,\r\n callback: () => {\r\n this.togglePrivacy();\r\n }\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular.module('app.shared')\r\n .service('brookson.factory.privacy', Shared.BrooksonFactoryPrivacy);","module Shared {\r\n export class SdcQuestionnaireAnswer {\r\n questionKey: string;\r\n answer: T;\r\n }\r\n}","/// \r\n/// \r\n\r\nmodule Shared {\r\n export class SdcQuestionnaireInput {\r\n agencyNumber: string; \r\n answers: Array>; \r\n assignmentIndustry: string; \r\n clientAddress: Address; \r\n clientName: string; \r\n expectedLengthOfAssignmentMonths: number; \r\n jobTitle: string; \r\n startDate: BrooksonDate;\r\n workSiteAddress: Address;\r\n sdcStatus: SdcOutcomeType;\r\n }\r\n}","module Shared {\r\n export class AssignmentInfo {\r\n jobTitle: string;\r\n jobTitleOption: Shared.JobTitle;\r\n assignmentIndustry: string; \r\n clientName: string; \r\n clientAddress: Shared.Address; \r\n dateStartedAtWorkSite: Shared.BrooksonDate;\r\n expectedLengthOfAssignmentMonths: number; \r\n siteAddress: Shared.Address; \r\n }\r\n}","/// \r\n\r\nmodule Shared {\r\n export class SdcQuestionnaireOutcome {\r\n outcome: SdcOutcomeType;\r\n outcomeCode: string;\r\n outcomeText: string;\r\n }\r\n}","/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n export class SdcQuestionnaire {\r\n memberId: number;\r\n companyRef: string;\r\n agencyNumber: string;\r\n assignmentId: string;\r\n crmAssignmentId: string;\r\n extraInfo: Shared.AssignmentInfo;\r\n outcome: Shared.SdcQuestionnaireOutcome;\r\n answers: SdcQuestionnaireAnswer[];\r\n }\r\n}","module Shared {\r\n export class SdcQuestionnaireInputForm {\r\n sdcWillIncurExpenses: boolean;\r\n sdcIntendMultipleAssignments: boolean;\r\n sdcDoesClientSupervise: boolean;\r\n sdcDoesClientInstruct: boolean;\r\n sdcCannotOverruleImplementation: boolean;\r\n sdcCannotOverrulePlan: boolean;\r\n sdcInPermanentTeam: boolean;\r\n sdcStatus: SdcOutcomeType;\r\n }\r\n}","module Shared {\r\n export class AssignmentSdcOutcome {\r\n agencyName: string;\r\n assignmentId: string;\r\n canSubmitExpenses: boolean;\r\n canSubmitTimesheets: boolean;\r\n clientName: string;\r\n dateStarted: Date;\r\n outcome: number;\r\n outcomeText: string;\r\n }\r\n}","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n export interface ISdcService {\r\n getLatestQuestionnaire(assignmentId: string): ng.IPromise;\r\n getOutcome(input: Shared.SdcQuestionnaireInput): ng.IPromise;\r\n searchJobTitle(data: string, silentMode?: boolean): ng.IPromise>;\r\n getAssignmentOutcomes(silentMode?: boolean): ng.IPromise>;\r\n declineExpensesForAssignment(assignmentId: string, silentMode?: boolean): ng.IPromise;\r\n }\r\n\r\n export class SdcService implements ISdcService {\r\n\r\n static $inject = ['$http'];\r\n\r\n constructor(\r\n private $http: Shared.IBrooksonHttp\r\n ) { }\r\n\r\n /**\r\n * Returns the latest questionnaire for a given assignment\r\n * \r\n * \r\n * @memberOf SdcService\r\n */\r\n getLatestQuestionnaire = (assignmentId: string): ng.IPromise => {\r\n return this.$http.get(`api/Sdc/GetLatestQuestionnaire?assignmentId=${assignmentId}`).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n /**\r\n * Returns whether a user has passed SDC based on their input\r\n * \r\n * \r\n * @memberOf SdcService\r\n */\r\n getOutcome = (input: Shared.SdcQuestionnaireInput): ng.IPromise => {\r\n return this.$http.post(`api/Sdc/GetOutcome`, input).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n /**\r\n * Searches Digita for a list of Job Titles based on the query provided\r\n * \r\n * \r\n * @memberOf SdcService\r\n */\r\n searchJobTitle = (data: string, silentMode?: boolean): ng.IPromise> => {\r\n return this.$http.get(`api/Sdc/SearchJobTitle?query=${data}`, {\r\n silentMode: silentMode ? silentMode : false,\r\n cache: true\r\n }).then((response: ng.IHttpPromiseCallbackArg>) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n /**\r\n * Returns a list of assignment outcomes for the member\r\n * \r\n * \r\n * @memberOf SdcService\r\n */\r\n getAssignmentOutcomes = (silentMode?: boolean): ng.IPromise> => {\r\n return this.$http.get(`api/Sdc/GetAssignmentOutcomes`, {\r\n silentMode: silentMode ? silentMode : false,\r\n cache: true\r\n }).then((response: ng.IHttpPromiseCallbackArg>) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n /**\r\n * Declines as assignment to submit expenses\r\n * \r\n * \r\n * @memberOf SdcService\r\n */\r\n declineExpensesForAssignment = (assignmentId: string, silentMode?: boolean): ng.IPromise => {\r\n return this.$http.patch(`api/Sdc/DeclineExpensesForAssignment?assignmentId=${assignmentId}`, {\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular.module('app.shared').service('sdcService', Shared.SdcService);","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n export interface ISdcFactory {\r\n // Data\r\n sdcQuestionnaireInput: Shared.SdcQuestionnaireInput;\r\n sdcQuestionnaireInputForm: Shared.SdcQuestionnaireInputForm;\r\n sdcQuestionnaire: Shared.SdcQuestionnaire;\r\n sdcOutcome: Shared.SdcQuestionnaireOutcome;\r\n\r\n // Methods\r\n getLatestQuestionnaire(assignmentId: string): ng.IPromise;\r\n getOutcome(form: Shared.SdcQuestionnaireInputForm): ng.IPromise;\r\n searchJobTitle(query: string, silentMode?: boolean): ng.IPromise>;\r\n setRates(rates: Array);\r\n hasOutcomeSet(): boolean;\r\n hasFailedOutcome(): boolean;\r\n createSdcQuestionnaireInput(form: SdcQuestionnaireInputForm);\r\n }\r\n\r\n export class SdcFactory {\r\n public static SDC_QKEY_RATEVALUEHOURLY: string = \"PAY RATE VALUE HOURLY\";\r\n public static SDC_QKEY_RATEVALUEDAILY: string = \"PAY RATE VALUE DAILY\";\r\n public static SDC_QKEY_WILLINCUREXPENSES: string = \"WILL INCUR EXPENSES\";\r\n public static SDC_QKEY_INTENDMULTIPLEASSIGNMENTS: string = \"INTEND MULTIPLE ASSIGNMENTS\";\r\n public static SDC_QKEY_DOESCLIENTSUPERVISE: string = \"DOES CLIENT SUPERVISE\";\r\n public static SDC_QKEY_DOESCLIENTINSTRUCT: string = \"DOES CLIENT INSTRUCT\";\r\n public static SDC_QKEY_CANNOTOVERRULEIMPLEMENTATION: string = \"CANNOT OVERRULE IMPLEMENTATION\";\r\n public static SDC_QKEY_CANNOTOVERRULEPLAN: string = \"CANNOT OVERRULE PLAN\";\r\n public static SDC_QKEY_PERMANENTTEAMSAMEROLE: string = \"IN PERM TEAM SAME ROLE\";\r\n public static SDC_QKEY_ASSIGNMENTCURRENCY: string = \"ASSIGNMENT CURRENCY\";\r\n\r\n public static PAYMENT_CODE_STANDARD_DAILY: string = \"STD DAYS\";\r\n public static PAYMENT_CODE_STANDARD_HOURLY: string = \"STD\";\r\n\r\n public sdcQuestionnaireInput: Shared.SdcQuestionnaireInput = new SdcQuestionnaireInput();\r\n public sdcQuestionnaireInputForm: Shared.SdcQuestionnaireInputForm = new Shared.SdcQuestionnaireInputForm();\r\n public sdcQuestionnaire: Shared.SdcQuestionnaire = new Shared.SdcQuestionnaire();\r\n public sdcOutcome: Shared.SdcQuestionnaireOutcome = new Shared.SdcQuestionnaireOutcome();\r\n\r\n private rates: Array;\r\n\r\n static $inject = ['sdcService'];\r\n\r\n constructor(\r\n private sdcService: Shared.ISdcService\r\n ) { }\r\n\r\n /**\r\n * Returns the latest SDC questionnaire for a given assignment\r\n * \r\n * \r\n * @memberOf SdcService\r\n */\r\n getLatestQuestionnaire = (assignmentId: string): ng.IPromise => {\r\n return this.sdcService.getLatestQuestionnaire(assignmentId).then((data) => {\r\n if (data) {\r\n this.sdcQuestionnaire = data;\r\n let jobTitle = new JobTitle();\r\n jobTitle.titleText = this.sdcQuestionnaire.extraInfo.jobTitle;\r\n this.sdcQuestionnaire.extraInfo.jobTitleOption = jobTitle;\r\n this.sdcQuestionnaireInputForm = this.createSdcQuestionnaireInputForm(this.sdcQuestionnaire.answers);\r\n }\r\n\r\n return data;\r\n });\r\n }\r\n\r\n /**\r\n * Returns whether a user has passed SDC based on their input\r\n * \r\n * \r\n * @memberOf SdcService\r\n */\r\n getOutcome = (form: Shared.SdcQuestionnaireInputForm): ng.IPromise => {\r\n this.createSdcQuestionnaireInput(form);\r\n\r\n return this.sdcService.getOutcome(this.sdcQuestionnaireInput).then((data: Shared.SdcQuestionnaireOutcome) => {\r\n this.sdcOutcome = data;\r\n return data;\r\n });\r\n }\r\n\r\n /**\r\n * Searches Digita for Job Titles based on the query\r\n * \r\n * \r\n * @memberOf SdcFactory\r\n */\r\n searchJobTitle = (query: string, silentMode?: boolean): ng.IPromise> => {\r\n return this.sdcService.searchJobTitle(query, silentMode);\r\n }\r\n\r\n /**\r\n * Sets the array of rates \r\n * \r\n * \r\n * @memberOf SdcFactory\r\n */\r\n setRates = (rates: Array) => {\r\n this.rates = rates;\r\n }\r\n\r\n hasOutcomeSet = (): boolean => {\r\n return this.sdcOutcome && this.sdcOutcome.outcome !== Shared.SdcOutcomeType.NotAssessed;\r\n }\r\n\r\n hasFailedOutcome = (): boolean => {\r\n return this.hasOutcomeSet() && this.sdcOutcome.outcome === Shared.SdcOutcomeType.Fail;\r\n }\r\n\r\n /**\r\n * Creates a model for the input fields on the form\r\n * It will assign the property values based on the array of answers\r\n * \r\n * @private\r\n * \r\n * @memberOf SdcFactory\r\n */\r\n private createSdcQuestionnaireInputForm = (answers: Array>): Shared.SdcQuestionnaireInputForm => {\r\n var form = new Shared.SdcQuestionnaireInputForm();\r\n\r\n if (!answers || answers.length === 0) return form;\r\n\r\n form.sdcWillIncurExpenses = this.getAnswerValue(answers, SdcFactory.SDC_QKEY_WILLINCUREXPENSES);\r\n form.sdcIntendMultipleAssignments = this.getAnswerValue(answers, SdcFactory.SDC_QKEY_INTENDMULTIPLEASSIGNMENTS);\r\n form.sdcDoesClientSupervise = this.getAnswerValue(answers, SdcFactory.SDC_QKEY_DOESCLIENTSUPERVISE);\r\n form.sdcDoesClientInstruct = this.getAnswerValue(answers, SdcFactory.SDC_QKEY_DOESCLIENTINSTRUCT);\r\n form.sdcCannotOverruleImplementation = this.getAnswerValue(answers, SdcFactory.SDC_QKEY_CANNOTOVERRULEIMPLEMENTATION);\r\n form.sdcCannotOverrulePlan = this.getAnswerValue(answers, SdcFactory.SDC_QKEY_CANNOTOVERRULEPLAN);\r\n form.sdcInPermanentTeam = this.getAnswerValue(answers, SdcFactory.SDC_QKEY_PERMANENTTEAMSAMEROLE);\r\n\r\n return form;\r\n }\r\n\r\n /**\r\n * Finds an answer in an array of ansawers and returns the values\r\n * \r\n * @private\r\n * \r\n * @memberOf SdcFactory\r\n */\r\n private getAnswerValue = (answers: Array>, key: string): T => {\r\n var result = _.find(answers, (answer: Shared.SdcQuestionnaireAnswer) => answer.questionKey === key);\r\n\r\n if (!result) return null;\r\n\r\n return result.answer;\r\n }\r\n\r\n /**\r\n * Adds the question key and answer to the answers array if the user has answered the question\r\n * \r\n * @private\r\n * \r\n * @memberOf SdcFactory\r\n */\r\n private setAnswerValue = (answers: Array> = [], questionKey: string, answer: any): void => {\r\n if (!_.isUndefined(answer)) {\r\n let questionnaireAnswer = new Shared.SdcQuestionnaireAnswer();\r\n questionnaireAnswer.questionKey = questionKey;\r\n questionnaireAnswer.answer = answer;\r\n answers.push(questionnaireAnswer);\r\n }\r\n }\r\n\r\n /**\r\n * Creates an Sdc Questionnaire input model to be sent to the GetOutcome endpoint\r\n * \r\n * @private\r\n * \r\n * @memberOf SdcFactory\r\n */\r\n createSdcQuestionnaireInput = (form: Shared.SdcQuestionnaireInputForm) => {\r\n this.sdcQuestionnaireInput = new Shared.SdcQuestionnaireInput();\r\n var answers = new Array>();\r\n\r\n this.setAnswerValue(answers, SdcFactory.SDC_QKEY_WILLINCUREXPENSES, form.sdcWillIncurExpenses);\r\n this.setAnswerValue(answers, SdcFactory.SDC_QKEY_INTENDMULTIPLEASSIGNMENTS, form.sdcIntendMultipleAssignments);\r\n this.setAnswerValue(answers, SdcFactory.SDC_QKEY_DOESCLIENTSUPERVISE, form.sdcDoesClientSupervise);\r\n this.setAnswerValue(answers, SdcFactory.SDC_QKEY_DOESCLIENTINSTRUCT, form.sdcDoesClientInstruct);\r\n this.setAnswerValue(answers, SdcFactory.SDC_QKEY_CANNOTOVERRULEIMPLEMENTATION, form.sdcCannotOverruleImplementation);\r\n this.setAnswerValue(answers, SdcFactory.SDC_QKEY_CANNOTOVERRULEPLAN, form.sdcCannotOverrulePlan);\r\n this.setAnswerValue(answers, SdcFactory.SDC_QKEY_PERMANENTTEAMSAMEROLE, form.sdcInPermanentTeam);\r\n this.setAnswerValue(answers, SdcFactory.SDC_QKEY_RATEVALUEDAILY, this.findRateValue(SdcFactory.PAYMENT_CODE_STANDARD_DAILY));\r\n this.setAnswerValue(answers, SdcFactory.PAYMENT_CODE_STANDARD_HOURLY, this.findRateValue(SdcFactory.PAYMENT_CODE_STANDARD_HOURLY));\r\n\r\n this.sdcQuestionnaireInput.agencyNumber = this.sdcQuestionnaire.agencyNumber;\r\n this.sdcQuestionnaireInput.answers = answers;\r\n\r\n if (this.sdcQuestionnaire.extraInfo) {\r\n this.sdcQuestionnaireInput.assignmentIndustry = this.sdcQuestionnaire.extraInfo.assignmentIndustry;\r\n this.sdcQuestionnaireInput.clientAddress = this.sdcQuestionnaire.extraInfo.clientAddress;\r\n this.sdcQuestionnaireInput.workSiteAddress = this.sdcQuestionnaire.extraInfo.siteAddress;\r\n this.sdcQuestionnaireInput.clientName = this.sdcQuestionnaire.extraInfo.clientName;\r\n this.sdcQuestionnaireInput.expectedLengthOfAssignmentMonths = this.sdcQuestionnaire.extraInfo.expectedLengthOfAssignmentMonths;\r\n this.sdcQuestionnaireInput.startDate = this.sdcQuestionnaire.extraInfo.dateStartedAtWorkSite;\r\n\r\n if (this.sdcQuestionnaire.extraInfo.jobTitleOption) {\r\n this.sdcQuestionnaireInput.jobTitle = this.sdcQuestionnaire.extraInfo.jobTitleOption.titleText;\r\n }\r\n } else {\r\n console.warn(`No extra info has been added to the SDC questionnaire input model`);\r\n }\r\n }\r\n\r\n private findRateValue = (paymentCode: string) : number => {\r\n var rate = _.find(this.rates, (rate: Shared.AssignmentRateCompact) => {\r\n return rate.paymentCode === paymentCode;\r\n });\r\n\r\n if (!rate) {\r\n console.warn(`There was no rate matching the payment code: ${paymentCode}`);\r\n return 0;\r\n }\r\n\r\n return rate.amount;\r\n }\r\n }\r\n}\r\n\r\nangular.module('app.shared').service('sdcFactory', Shared.SdcFactory);","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n\r\n angular.module('app.shared').factory('brooksonSignalrFactory', brooksonSignalrFactory);\r\n\r\n brooksonSignalrFactory.$inject = ['$rootScope'];\r\n function brooksonSignalrFactory(rootScope) {\r\n if (!$.connection) {\r\n throw ('SignalR required');\r\n }\r\n\r\n var connected = false;\r\n var connect = $.connection.hub.start().then(() => { connected = true; });\r\n var openBankingSubscriptions = [];\r\n var openBankingReconsentSubscriptions = [];\r\n var fullInvoicePdfSubscriptions = [];\r\n\r\n const ensureConnected = (callback: any): void => {\r\n if ($.connection.hub.state === $.signalR.connectionState.connected) {\r\n callback();\r\n }\r\n else if ($.connection.hub.state === $.signalR.connectionState.disconnected) {\r\n $.connection.hub.start()\r\n .done(() => {\r\n connected = true;\r\n callback();\r\n });\r\n }\r\n };\r\n\r\n // Base connect instance\r\n var instance: any = {\r\n connect: (callback) => {\r\n connect.then(() => {\r\n if (callback) {\r\n rootScope.$apply(() => {\r\n callback();\r\n });\r\n }\r\n });\r\n }\r\n };\r\n\r\n\r\n // OpenBanking Methods\r\n var openBankingHub = $.connection.openBankingHub;\r\n instance.openBanking = {\r\n subscribeToPage: (memberId, companyRef) => {\r\n ensureConnected(() => { openBankingHub.server.subscribeToPage(memberId, companyRef); });\r\n openBankingSubscriptions.push(memberId + '-' + companyRef);\r\n },\r\n unSubscribeFromPage: (memberId, companyRef) => {\r\n ensureConnected(() => { openBankingHub.server.unSubscribeFromPage(memberId, companyRef); });\r\n var index = openBankingSubscriptions.indexOf(memberId + '-' + companyRef);\r\n openBankingSubscriptions.splice(index,1);\r\n }\r\n };\r\n\r\n var openBankingReconsentHub = $.connection.openBankingReconsentHub;\r\n instance.openBankingReconsent = {\r\n subscribeToPage: (memberId, companyRef) => {\r\n ensureConnected(() => { openBankingReconsentHub.server.subscribeToPage(memberId, companyRef); });\r\n openBankingReconsentSubscriptions.push(memberId + '-' + companyRef);\r\n },\r\n unSubscribeFromPage: (memberId, companyRef) => {\r\n ensureConnected(() => { openBankingReconsentHub.server.unSubscribeFromPage(memberId, companyRef); });\r\n var index = openBankingReconsentSubscriptions.indexOf(memberId + '-' + companyRef);\r\n openBankingReconsentSubscriptions.splice(index, 1);\r\n }\r\n };\r\n\r\n // Full Invoice Methods\r\n var fullInvoiceHub = $.connection.fullInvoicegHub;\r\n instance.fullInvoicePdfNotifications = {\r\n subscribeToPage: (memberId, companyRef) => {\r\n ensureConnected(() => { fullInvoiceHub.server.subscribeToPage(memberId, companyRef); });\r\n fullInvoicePdfSubscriptions.push(memberId + '-' + companyRef);\r\n },\r\n unSubscribeFromPage: (memberId, companyRef) => {\r\n ensureConnected(() => { fullInvoiceHub.server.unSubscribeFromPage(memberId, companyRef); });\r\n var index = fullInvoicePdfSubscriptions.indexOf(memberId + '-' + companyRef);\r\n fullInvoicePdfSubscriptions.splice(index, 1);\r\n }\r\n };\r\n\r\n // Radar Listeners\r\n openBankingHub.client.notification = (notification) => {\r\n rootScope.$apply(() => {\r\n rootScope.$broadcast(notification.Action, notification);\r\n });\r\n };\r\n\r\n openBankingReconsentHub.client.notification = (notification) => {\r\n rootScope.$apply(() => {\r\n rootScope.$broadcast(notification.Action, notification);\r\n });\r\n };\r\n\r\n fullInvoiceHub.client.notification = (notification) => {\r\n rootScope.$apply(() => {\r\n rootScope.$broadcast(notification.Action, notification);\r\n });\r\n };\r\n\r\n return instance;\r\n }\r\n\r\n})();","module Shared {\r\n export function FilterAddress() {\r\n return (input) => {\r\n return input ? input.replace(/\\n/g, \"
      \") : '';\r\n };\r\n }\r\n}\r\n\r\nangular.module(\"app.shared\").filter(\"address\", Shared.FilterAddress);","module Shared {\r\n export function FilterBankAccount() {\r\n return (value) => {\r\n if (value && value.length >= 6 && value.indexOf('-') === -1) {\r\n return value.substr(0, 2) + \"-\" + value.substr(2, 2) + \"-\" + value.substr(4, 2);\r\n }\r\n\r\n return value;\r\n };\r\n }\r\n}\r\n\r\nangular.module(\"app.shared\").filter(\"sortcode\", Shared.FilterBankAccount);","module Shared {\r\n export function FilterBankAccountType() {\r\n return (input) => {\r\n var result = 'unknown';\r\n\r\n switch (input) {\r\n case 0:\r\n result = \"Current Account\";\r\n break;\r\n case 1:\r\n result = \"Deposit Account\";\r\n break;\r\n case 2:\r\n result = \"Credit Card\";\r\n break;\r\n case 3:\r\n result = \"Deposit Bond\";\r\n break;\r\n default:\r\n break;\r\n }\r\n return result;\r\n };\r\n }\r\n}\r\n\r\nangular.module(\"app.shared\").filter(\"bankAccountType\", Shared.FilterBankAccountType);","module Shared {\r\n export function FilterBoolean() {\r\n return (input) => {\r\n return input ? 'Yes' : 'No';\r\n };\r\n }\r\n}\r\n\r\nangular.module(\"app.shared\").filter(\"boolean\", Shared.FilterBoolean);","module Shared {\r\n export function FilterCurrency($filter, currencyEnums) {\r\n return (input, code, useValue, fractionSize) => {\r\n code = code ? code : currencyEnums.CurrencyCodes.GBP;\r\n input = input ? input : 0;\r\n\r\n return useValue ? $filter('currency')(input, currencyEnums.CurrencyCodes.properties[code].value, fractionSize)\r\n : $filter('currency')(input, currencyEnums.CurrencyCodes.properties[code].code, fractionSize);\r\n };\r\n }\r\n FilterCurrency.$inject = ['$filter', 'currency.enums'];\r\n}\r\n\r\nangular.module(\"app.shared\").filter(\"brooksonCurrency\", Shared.FilterCurrency);","module Shared {\r\n export function FilterBkShortDate(brooksonUtilitiesDate: Shared.IBrooksonUtilitiesDate) {\r\n return (input, format, defaultValue) => {\r\n if (!input) {\r\n return '';\r\n }\r\n\r\n var m = brooksonUtilitiesDate.convertToMoment(input);\r\n\r\n if (m.year() === 1 || isNaN(m.year()) || m.year() === 1753) {\r\n if (defaultValue) {\r\n let convertToDate = brooksonUtilitiesDate.convertToMoment(defaultValue).format(format);\r\n\r\n return convertToDate === 'Invalid date' ? defaultValue : convertToDate;\r\n } else {\r\n return '';\r\n }\r\n }\r\n\r\n return m.format(format);\r\n };\r\n }\r\n FilterBkShortDate.$inject = ['brookson.utilities.date'];\r\n\r\n export function FilterBkRelativeDate(brooksonUtilitiesDate: Shared.IBrooksonUtilitiesDate) {\r\n return (input) => {\r\n if (!input) {\r\n return '';\r\n }\r\n\r\n var m = brooksonUtilitiesDate.convertToMoment(input);\r\n\r\n if (m.year() === 1 || isNaN(m.year()) || m.year() === 1753) {\r\n return '';\r\n }\r\n\r\n return m.from(moment());\r\n };\r\n }\r\n FilterBkRelativeDate.$inject = ['brookson.utilities.date'];\r\n}\r\n\r\nangular.module(\"app.shared\")\r\n .filter(\"bkShortDate\", Shared.FilterBkShortDate)\r\n .filter(\"bkRelativeDate\", Shared.FilterBkRelativeDate);","module Shared {\r\n export function DisplayLineBrakes() {\r\n return (input) => {\r\n return input ? input.replace(/\\n/g, \"
      \") : '';\r\n };\r\n }\r\n}\r\n\r\nangular.module(\"app.shared\").filter(\"lineBrakes\", Shared.DisplayLineBrakes);","module Shared {\r\n export function FilterStartFrom() {\r\n return (input, start) => {\r\n if (input && _.isArray(input)) {\r\n start = +start;\r\n return input.slice(start);\r\n }\r\n\r\n return [];\r\n };\r\n }\r\n}\r\n\r\nangular.module(\"app.shared\").filter(\"startFrom\", Shared.FilterStartFrom);","module Shared {\r\n\texport function FilterBytes() {\r\n\t\treturn (bytes, precision, displayUnit) => {\r\n\t\t\tif (isNaN(parseFloat(bytes)) || !isFinite(bytes)) {\r\n\t\t\t\treturn '-';\r\n\t\t\t}\r\n\r\n\t\t\tif (typeof precision === 'undefined') {\r\n\t\t\t\tprecision = 1;\r\n\t\t\t}\r\n\r\n\t\t\tvar units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'];\r\n\t\t\tvar number = Math.floor(Math.log(bytes) / Math.log(1024));\r\n\t\t\tvar value = (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision);\r\n\r\n\t\t\tvalue = isNaN(value) ? 0 : value;\r\n\r\n\t\t\tif (displayUnit === false) {\r\n\t\t\t\treturn value;\r\n\t\t\t} else {\r\n\t\t\t\treturn value + ' ' + units[number];\r\n\t\t\t}\r\n\t\t};\r\n\t}\r\n}\r\n\r\nangular.module(\"app.shared\").filter(\"bytes\", Shared.FilterBytes);","module Shared {\r\n export class ActionsToTakeSummary {\r\n // ADDRESSLINE1\r\n public expensesToAuthorize: number = null;\r\n\r\n // ADDRESSLINE2\r\n public holidaysToAuthorize: number = null;\r\n\r\n // ADDRESSLINE3\r\n public overtimeToAuthorize: number = null;\r\n }\r\n}","module Shared {\r\n\r\n export module Models {\r\n export class AgencyMarginCompact {\r\n client: string;\r\n agency: string;\r\n currentMarginValue: number;\r\n onePlusUmbrella: number;\r\n umbrellaMargin: number;\r\n umbrellaPlusMargin: number;\r\n }\r\n }\r\n}\r\n","module Shared {\r\n export class Calendar {\r\n public calendarUrl: string;\r\n public eventType: string;\r\n public accountantSalespersonCode: string;\r\n }\r\n}","module Shared {\r\n export class CompanyDetails {\r\n public companyname: string;\r\n public line1: string;\r\n public line2: string;\r\n public city: string;\r\n public county: string;\r\n public postcode: string;\r\n }\r\n}\r\n","module Shared {\r\n export class ConnectReceipt {\r\n receiptID: number;\r\n memberID: number;\r\n imageName: string;\r\n imageData: string;\r\n imageDataEncoded: string;\r\n imageType: number;\r\n description: string;\r\n uploadedDate: Date;\r\n usedBy: number;\r\n status: any;\r\n expenses: any;\r\n }\r\n}","module Shared {\r\n export class CS01ConfirmationDetails {\r\n public companyRef: string;\r\n public periodend: Date;\r\n public memberId: number;\r\n public duedate: Date;\r\n public confirmationrequired: Date;\r\n public response: string;\r\n public responseUser: string;\r\n public amendmentdetails: string = '';\r\n }\r\n}\r\n","module Shared {\r\n export class DashboardWidget {\r\n dashboardWidgetId: number;\r\n componentName: string;\r\n displayName: string;\r\n }\r\n}","/// \r\n\r\nmodule Shared {\r\n export class DashboardUserWidget extends DashboardWidget {\r\n dashboardUserWidgetsId: number;\r\n dashboardUserId: number;\r\n orderIndex: number;\r\n }\r\n}","/// \r\n\r\nmodule Shared {\r\n export class DashboardUser\r\n {\r\n dashboardUserId: number;\r\n memberId: number;\r\n companyRef: string;\r\n name: string;\r\n isDefault: boolean;\r\n widgets: Array;\r\n isBrookson:boolean;\r\n status:string;\r\n }\r\n}","\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class FixedTaxData {\r\n \r\n // TAXFREEDIVIDENDALLOWANCE\r\n public taxFreeDividendAllowance: number = 0;\r\n // LOWERRATEDIVIDENDTAXRATE\r\n public lowerRateDividendTaxRate: number = 0;\r\n // HIGHERRATEDIVIDENDTAXRATE\r\n public higherRateDividendTaxRate: number = 0;\r\n // ADDITIONALRATEDIVIDENDTAXRATE\r\n public additionalRateDividendTaxRate: number = 0;\r\n // PERSONALALLOWANCE\r\n public personalAllowance: number = 0;\r\n // BASICRATETHRESHOLD\r\n public basicRateThreshold: number = 0;\r\n // HIGHERRATETHRESHOLD\r\n public higherRateThreshold: number = 0;\r\n // FULLPERSONALALLOWANCEUPPERLIMIT\r\n public fullPersonalAllowanceUpperLimit: number = 0;\r\n // LOWERRATEINCOMETAX\r\n public lowerRateIncomeTax: number = 0;\r\n // BASICRATEINCOMETAX\r\n public basicRateIncomeTax: number = 0;\r\n // HIGHERRATETAX\r\n public higherRateTax: number = 0;\r\n // ADDITIONALRATETAX\r\n public additionalRateTax: number = 0;\r\n // EMPLOYMENTINCOMESTUDENTREPAYTHRESHOLD\r\n public employmentIncomeStudentRepayThreshold: number = 0;\r\n // NONEMPLOYMENTINCOMESTUDENTREPAYTHRESHOLD\r\n public nonEmploymentIncomeStudentRepayThreshold: number = 0;\r\n // REPAYMENTPERCENTAGE\r\n public repaymentPercentage: number = 0;\r\n // CHILDBENEFITTAXCHARGETHRESHOLD\r\n public childBenefitTaxChargeThreshold: number = 0;\r\n // PERCENTAGEINCREMENTS\r\n public percentageIncrements: number = 0;\r\n }\r\n}\r\n","\nmodule Shared {\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n\n // More info: http://frhagn.github.io/Typewriter/\n\n \n export class ForecastCalculations {\n \n // MONTHSYEARTODATE\n public monthsYearToDate: number = 0;\n // MONTHSREMAINING\n public monthsRemaining: number = 0;\n // WEEKSYEARTODATE\n public weeksYearToDate: number = 0;\n // WEEKSREMAINING\n public weeksRemaining: number = 0;\n // WEEKSYEARTODATEFROMTAXSTART\r\n public weeksYearToDateFromTaxStart: number = 0;\r\n // WEEKSREMAININGFROMTAXSTART\r\n public weeksRemainingFromTaxStart: number = 0;\n // PSCEMPLOYMENT\n public pscEmployment: number = 0;\n // CURRENTDIRECTORSFEEWEEKLY\n public currentDirectorsFeeWeekly: number = 0;\n // SHAREHOLDERSPLIT\n public shareholderSplit: number = 0;\n // CONFIRMEDASDIVIDENDS\n public confirmedAsDividends: number = 0;\n // UNCONFIRMEDTRANSACTIONS\n public unconfirmedTransactions: number = 0;\n // TRANSACTIONSBEINGPROCESSED\n public transactionsBeingProcessed: number = 0;\n // TAXDEDUCTEDFROMPSCINCOME\n public taxDeductedFromPSCIncome: number = 0;\n public isMonthlyBureau: boolean = false;\n }\n}\n","\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class Notification {\r\n \r\n // ID\r\n public id: number = 0;\r\n // COMPANYCONTACTNO\r\n public companyContactNo: string = null;\r\n // TYPE\r\n public type: string = null;\r\n // TITLE\r\n public title: string = null;\r\n // METADESCRIPTION\r\n public metaDescription: string = null;\r\n // LINK\r\n public link: string = null;\r\n // SYMBOL\r\n public symbol: string = null;\r\n // COLOUR\r\n public colour: string = null;\r\n // SHOWGUIDE\r\n public showGuide: boolean = false;\r\n // ACTION\r\n public action: string = null;\r\n\r\n public sortOrder: number = 0;\r\n\r\n public onClick: Function = null;\r\n\r\n public documentCategoryMappingId: number = 0;\r\n }\r\n}\r\n","/// \r\n\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class GetNotificationsResponse {\r\n \r\n // SMARTTILENOTIFICATIONS\r\n public smartTileNotifications: Notification[] = [];\r\n // ALERTNOTIFICATIONS\r\n public alertNotifications: Notification[] = [];\r\n // ACTIONNOTIFACTIONS\r\n public actionTileNotifications: Notification[] = [];\r\n // ACTIONNOTIFACTIONS\r\n public bannersNotifications: Notification[] = [];\r\n }\r\n}\r\n","\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class GLEntrySummary {\r\n \r\n // ENTRYNO\r\n public entryNo: number = 0;\r\n // GLACCOUNTNO\r\n public glAccountNo: string = null;\r\n // BALACCOUNTNO\r\n public balAccountNo: string = null;\r\n // DESCRIPTION\r\n public description: string = null;\r\n // DESCRIPTION2\r\n public description2: string = null;\r\n // AMOUNT\r\n public amount: number = 0;\r\n // POSTINGDATE\r\n public postingDate: Date = null;\r\n // DOCUMENTDATE\r\n public documentDate: Date = null;\r\n // PERIODSTART\r\n public periodStart: Date = null;\r\n // PERIODEND\r\n public periodEnd: Date = null;\r\n }\r\n}\r\n","/// \r\n\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n\r\n export class HolidayRequest {\r\n \r\n public authorizedBy: number;\r\n\r\n public companyRef: string;\r\n\r\n public employeeId: number;\r\n\r\n public duration: string;\r\n\r\n public endDate: BrooksonDate;\r\n\r\n public holidayRequestId: number;\r\n\r\n public reason: string;\r\n\r\n public startDate: BrooksonDate;\r\n\r\n public status: number;\r\n\r\n public hidden: boolean;\r\n\r\n public canBeCancelled: boolean;\r\n }\r\n}\r\n","\r\nmodule Shared {\r\n export class IntroVideo {\r\n public videoId: string;\r\n public thumbnailFilename: string;\r\n public description: string;\r\n public order: number;\r\n public videoUrl: string;\r\n public imageUrl: string;\r\n public thumbnailImage: string;\r\n public accountantCalenderUrl: string;\r\n public advisoryDocUrl: string;\r\n }\r\n}","\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class MemberCurrentStage {\r\n \r\n // MEMBERID\r\n public memberId: number = 0;\r\n // STAGE\r\n public stage: number = 0;\r\n // STEP3\r\n public step3: boolean = false;\r\n // STEP4\r\n public step4: boolean = false;\r\n // COMPLETIONDATE\r\n public completionDate: Date = null;\r\n // COUNTOFASSIGNMENTREQUIRINGACTIONS\r\n public countOfAssignmentRequiringActions: number = 0;\r\n // ISIR35CONFIRMED\r\n public isIr35Confirmed: boolean = false;\r\n // ISDRAFTSCONFIRMED\r\n public isDraftsConfirmed: boolean = false;\r\n // SHOWCONFIRMATIONMESSAGE\r\n public showConfirmationMessage: boolean = false;\r\n }\r\n}\r\n","\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n\r\n export class UserInputData {\r\n\r\n // PERSONALTAXTRACKERDATAID\r\n public personalTaxTrackerDataId: number = 0;\r\n // YEAR\r\n public year: string = null;\r\n // OTHEREMPLOYMENTINCOME\r\n public otherEmploymentIncome: number = 0;\r\n // OTHEREMPLOYMENTINCOMEYTD\r\n public otherEmploymentIncomeYTD: number = 0;\r\n // PENSIONINCOME\r\n public pensionIncome: number = 0;\r\n // PENSIONINCOMEYTD\r\n public pensionIncomeYTD: number = 0;\r\n // INTERESTINCOME\r\n public interestIncome: number = 0;\r\n // INTERESTINCOMEYTD\r\n public interestIncomeYTD: number = 0;\r\n // TAXABLEBENEFITSINKIND\r\n public taxableBenefitsInKind: number = 0;\r\n // TAXABLEBENEFITSINKINDYTD\r\n public taxableBenefitsInKindYTD: number = 0;\r\n // OTHERDIVIDENDINCOME\r\n public otherDividendIncome: number = 0;\r\n // OTHERDIVIDENDINCOMEYTD\r\n public otherDividendIncomeYTD: number = 0;\r\n // PERSONALPENSIONPAYMENTS\r\n public personalPensionPayments: number = 0;\r\n // PERSONALPENSIONPAYMENTSYTD\r\n public personalPensionPaymentsYTD: number = 0;\r\n // CHILDBENEFITAMOUNTRECEIVED\r\n public childBenefitAmountReceived: number = 0;\r\n // CHILDBENEFITAMOUNTRECEIVEDYTD\r\n public childBenefitAmountReceivedYTD: number = 0;\r\n // STUDENTLOANBALANCEATBEGINNINGOFTAXYEAR\r\n public studentLoanBalanceAtBeginningOfTaxYear: number = 0;\r\n // STUDENTLOANBALANCEATBEGINNINGOFTAXYEARYTD\r\n public studentLoanBalanceAtBeginningOfTaxYearYTD: number = 0;\r\n // TAXALREADYPAID\r\n public taxAlreadyPaid: number = 0;\r\n // PAYMENTONACCOUNTPAIDJANUARY\r\n public paymentOnAccountPaidJanuary: number = 0;\r\n // PAYMENTONACCOUNTPAIDJULY\r\n public paymentOnAccountPaidJuly: number = 0;\r\n // DIVIDENDS\r\n public dividends: number = 0;\r\n }\r\n}\r\n","\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class UmbrellaTaxData {\r\n \r\n public grossSalaryFromUmbrella: number = 0;\r\n\r\n public taxDeductedUmbrellaEarnings: number = 0;\r\n\r\n public grossSalaryFromUmbrellaYTD: number = 0;\r\n\r\n public taxDeductedUmbrellaEarningsYTD: number = 0;\r\n }\r\n}\r\n","/// \r\n/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class PersonalTaxTrackerData {\r\n \r\n // FIXEDTAXDATA\r\n public fixedTaxData: FixedTaxData = null;\r\n // FORECASTCALCULATIONS\r\n public forecastCalculations: ForecastCalculations = null;\r\n // USERINPUTDATA\r\n public userInputData: UserInputData = null;\r\n // COMPANYNAME\r\n public companyName: string = null;\r\n\r\n public umbrellaTaxTracker: UmbrellaTaxTracker = null;\r\n\r\n public hasUmbrella: boolean = null;\r\n }\r\n}\r\n","module Shared {\r\n export class ProfitAndLossSummary {\r\n grossMargin: number;\r\n\r\n grossMarginPercentage: number;\r\n\r\n incomeBeforeInterestAndVat: number;\r\n\r\n operatingExpenses: number;\r\n\r\n operatingExpensesMargin: number;\r\n\r\n operatingExpensesMarginPercentage: number;\r\n\r\n otherExpenses: number;\r\n\r\n totalCost: number;\r\n\r\n totalRevenue: number;\r\n }\r\n}","/// \r\n/// \r\n\r\nmodule Shared {\r\n export class PscInformation {\r\n navPersonalInformation: NavPersonalInformation = null;\r\n jobTitle: string = null;\r\n jobTitleOption: Shared.JobTitle = null;\r\n industry: string = null;\r\n assignmentId: string = null;\r\n doSubmitPSC: boolean = null;\r\n }\r\n}","module Shared {\r\n export class RemusRewardParameters {\r\n cidValue: string;\r\n dataValue: string;\r\n }\r\n}","module Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n export interface ITaskAction {\r\n\r\n // ACTIONID\r\n actionId: string;\r\n // ACTION_WEB_TASK_NO\r\n action_Web_Task_no: string;\r\n // ACTIONTITLE\r\n actionTitle: string;\r\n // ACTIONDESCRIPTION\r\n actionDescription: string;\r\n // EXTENDEDACTIONDESCRIPTION\r\n extendedActionDescription: string;\r\n // RESPONSIBILITY\r\n responsibility: string;\r\n // DUEDATE\r\n dueDate: Date;\r\n // DEADLINE\r\n deadline: Date;\r\n // STATUS\r\n status: TaskStatus;\r\n // ACTIONORDER\r\n actionOrder: number;\r\n // ATTACHMENT\r\n attachment: string;\r\n // ISINWARNING\r\n isInWarning: boolean;\r\n // BUTTON1TEXT\r\n button1Text: string;\r\n // BUTTON2TEXT\r\n button2Text: string;\r\n // CATEGORYID\r\n categoryId: number;\r\n\r\n categoryDesc: string;\r\n\r\n documents: Array;\r\n }\r\n\r\n export class TaskAction implements ITaskAction {\r\n\r\n\r\n // ACTIONID\r\n public actionId: string = null;\r\n // ACTION_WEB_TASK_NO\r\n public action_Web_Task_no: string = null;\r\n // ACTIONTITLE\r\n public actionTitle: string = null;\r\n // ACTIONDESCRIPTION\r\n public actionDescription: string = null;\r\n // EXTENDEDACTIONDESCRIPTION\r\n public extendedActionDescription: string = null;\r\n // RESPONSIBILITY\r\n public responsibility: string = null;\r\n // DUEDATE\r\n public dueDate: Date = null;\r\n // DEADLINE\r\n public deadline: Date = null;\r\n // STATUS\r\n public status: TaskStatus = null;\r\n // ACTIONORDER\r\n public actionOrder: number = 0;\r\n // ATTACHMENT\r\n public attachment: string = null;\r\n // ISINWARNING\r\n public isInWarning: boolean = false;\r\n // BUTTON1TEXT\r\n public button1Text: string = null;\r\n // BUTTON2TEXT\r\n public button2Text: string = null;\r\n // CATEGORYID\r\n public categoryId: number = 0;\r\n\r\n public categoryDesc: string = \"\";\r\n\r\n public documents: Array = [];\r\n public closeable: boolean = false;\r\n public closeMessage: string = \"\";\r\n\r\n public taskCode: string = \"\";\r\n public taskTitle: string = \"\";\r\n public camelCase: string = \"\";\r\n }\r\n \r\n export enum TaskStatus {\r\n completed = 0,\r\n current = 1,\r\n future = 2,\r\n overdue = 3,\r\n }\r\n}\r\n","/// \r\n\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class Task {\r\n \r\n // TASKTITLE\r\n public taskTitle: string = null;\r\n // COMPLETEDDATE\r\n public completedDate: Date = null;\r\n // TASKACTIONS\r\n public taskActions: TaskAction[] = [];\r\n // TASKCODE\r\n public taskCode: string = null;\r\n // BUSINESS\r\n public business: boolean = false;\r\n }\r\n\r\n export class TaskObject {\r\n public title: string = null;\r\n public type: string = null;\r\n public startsAt: moment.Moment = null;\r\n public endsAt: moment.Moment = null;\r\n public action_Web_Task_no: string = null;\r\n public status: string = null;\r\n public actionId: string = null;\r\n public actionTitle: string = null;\r\n public timestamp: moment.Moment = null;\r\n public events: Array = null;\r\n public highlightMonth: boolean = false;\r\n }\r\n\r\n}\r\n","\r\nmodule Shared {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n\r\n export class UserFeedback {\r\n\r\n // USERFEEDBACKID\r\n public userFeedbackId: number = 0;\r\n // USERFEEDBACKCATEGORYID\r\n public userFeedbackCategoryId: number = 0;\r\n // USERFEEDBACKCATEGORYOPTION\r\n public userFeedbackCategoryOption: EnumObj;\r\n // DESCRIPTION\r\n public description: string = null;\r\n // SCREENSHOT\r\n public screenshot: number[] = [];\r\n // SCREENSHOTBASE64\r\n public screenshotBase64: string = null;\r\n // DATE\r\n public date: Date = null;\r\n // BROWSER\r\n public browser: string = null;\r\n // BROWSERVERSION\r\n public browserVersion: string = null;\r\n // DEVICETYPE\r\n public deviceType: string = null;\r\n // DEVICEMODEL\r\n public deviceModel: string = null;\r\n // DEVICEVENDOR\r\n public deviceVendor: string = null;\r\n // OS\r\n public os: string = null;\r\n // OSVERSION\r\n public osVersion: string = null;\r\n // ENGINENAME\r\n public engineName: string = null;\r\n // ENGINE\r\n public engineVersion: string = null;\r\n // CPUARCHITECTURE\r\n public cpuArchitecture: string = null;\r\n // URL\r\n public url: string = null;\r\n // STATE\r\n public state: string = null;\r\n // STATEPARAMS\r\n public stateParams: string = null;\r\n // EMAIL\r\n public email: string = null;\r\n // NAME\r\n public name: string = null;\r\n }\r\n}\r\n","\r\nmodule Shared { \r\n export class UtrNumber {\r\n public utrReceived: boolean = null;\r\n public utrNumber: string = null;\r\n }\r\n}\r\n","/// \r\n/// \r\n\r\nmodule Shared {\r\n export class WelcomeScreen {\r\n public showWelcomeScreen: boolean;\r\n public viewCount: number;\r\n public hideWelcomeScreen: boolean;\r\n public welcomeScreenLogin: boolean;\r\n public accountantSalespersonCode: string;\r\n public accountantFirstName: string;\r\n public accountantSurname: string;\r\n public accountantVideoId: string;\r\n public introVideos: Array;\r\n public accountantVideo: Shared.IntroVideo;\r\n public hasWelcomeScreen: boolean;\r\n public hasCalenderLink: boolean;\r\n public calendars: Array;\r\n }\r\n}","/// \r\n\r\n(() => {\r\n'use strict';\r\n\r\n angular\r\n .module('app.shared')\r\n .factory('brooksonDocumentPreview', brooksonDocumentPreview);\r\n\r\n brooksonDocumentPreview.$inject = ['documentStorage.enums','documentStorageSrv','screenSize','brookson.ui.image-preview.modal','FileSaver', 'brookson.pdf.modal', '$detection', '$window'];\r\n function brooksonDocumentPreview(enums, documentStorageSrv, screenSize, brooksonUiImagePreviewModal, FileSaver, brooksonPdfModal, $detection, $window) {\r\n var service = {\r\n previewDoc:previewDoc\r\n };\r\n\r\n return service;\r\n\r\n ////////////////\r\n function previewDoc(document) {\r\n if (document.dataSource === enums.DocumentDataSource.DROPBOX) {\r\n documentStorageSrv.getFullSizedImage(document).then((data) => {\r\n brooksonUiImagePreviewModal.showImagePreviewModal(data);\r\n });\r\n } else {\r\n documentStorageSrv.getSelectedPDF(document.documentId, document.path).then((data) => {\r\n var blobObject = new Blob([data], {type: 'application/pdf'});\r\n\r\n // If it's iOS and particularly Safari, we can't get a new window with a blob... so do this...\r\n FileSaver.saveAs(blobObject, document.path);\r\n });\r\n }\r\n\r\n document.lastOpened = moment();\r\n }\r\n function callback(id, path) {\r\n\r\n return documentStorageSrv.getSelectedPDF(id, path).then((data) => {\r\n return data;\r\n });\r\n }\r\n }\r\n})();\r\n","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular\r\n .module('app.shared')\r\n .factory('brookson.file.download', fileDownloadSrv);\r\n\r\n fileDownloadSrv.$inject = ['$http', 'FileSaver', 'Blob', 'growl'];\r\n\r\n function fileDownloadSrv($http, FileSaver, Blob, growl) {\r\n var service = {\r\n download: download,\r\n downloadAndSave: downloadAndSave\r\n };\r\n\r\n return service;\r\n\r\n function download(url, requestData, fileName, expectedMediaType) {\r\n var responseType = 'arraybuffer';\r\n\r\n return $http.post(url, requestData, {\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Accept': expectedMediaType\r\n },\r\n responseType: responseType\r\n }).then(response => {\r\n return response;\r\n });\r\n }\r\n\r\n function downloadAndSave(url, requestData, fileName, expectedMediaType) {\r\n download(url, requestData, fileName, expectedMediaType)\r\n .then(response => openSaveAsDialog(fileName, response.data, expectedMediaType))\r\n .catch(e => growl.error('We were unable to retrieve your document'));\r\n }\r\n\r\n function openSaveAsDialog(filename, content, mediaType) {\r\n var blob = new Blob([content], { type: mediaType });\r\n FileSaver.saveAs(blob, filename);\r\n }\r\n }\r\n})();\r\n","/// \r\n\r\n(() => {\r\n \"use strict\";\r\n\r\n var app = angular.module(\"app.shared\");\r\n\r\n app.factory(\"brookson.http.gritter\", [\"growl\", \"$q\", brooksonHttpGritter])\r\n .config(['$httpProvider', httpInterceptorGritterConfig]);\r\n\r\n function brooksonHttpGritter(growl, $q) {\r\n var extractMessages = (response) => {\r\n if (response.headers) {\r\n var messages = response.headers(\"gritter-messages\");\r\n\r\n if (messages) {\r\n messages = JSON.parse(messages);\r\n\r\n var config: any = {\r\n ttl: 5000,\r\n disableCountDown: true\r\n };\r\n\r\n _.forEach(messages, (message) => {\r\n switch (message.Severity) {\r\n case \"success\":\r\n config.ttl = 15000;\r\n config.title = message.Title;\r\n growl.success(message.Text, config);\r\n \r\n break;\r\n case \"info\":\r\n config.title = message.Title;\r\n growl.info(message.Text, config);\r\n break;\r\n case \"warning\":\r\n config.ttl = 15000;\r\n config.title = message.Title;\r\n growl.warning(message.Text, config);\r\n \r\n break;\r\n case \"error\":\r\n config.ttl = 15000;\r\n config.title = message.Title;\r\n growl.error(message.Text, config);\r\n break;\r\n default:\r\n config.ttl = -1;\r\n config.title = message.Title;\r\n growl.error(message.Text, config);\r\n }\r\n });\r\n }\r\n }\r\n\r\n return response;\r\n };\r\n\r\n return {\r\n 'response': (response) => {\r\n return extractMessages(response);\r\n },\r\n\r\n 'responseError': (response) => {\r\n return $q.reject(extractMessages(response));\r\n }\r\n };\r\n }\r\n\r\n function httpInterceptorGritterConfig($httpProvider) {\r\n $httpProvider.interceptors.push(\"brookson.http.gritter\");\r\n }\r\n})();\r\n","/// \r\n\r\n(() => {\r\n \"use strict\";\r\n\r\n var app = angular.module(\"app.shared\");\r\n\r\n app.factory(\"brookson.http.interceptor\", ['$q', '$injector', brooksonHttpInterceptor])\r\n .config(['$httpProvider', httpInterceptorConfig]);\r\n\r\n function brooksonHttpInterceptor($q, $injector) {\r\n var numRequests = 0;\r\n var showing = false;\r\n var previousResponseErrors = [];\r\n\r\n var hide = (r) => {\r\n if (r && (!r.config.silentMode || (r.config.headers.silentMode !== undefined && !r.config.headers.silentMode)) && !--numRequests) {\r\n NProgress.done(true);\r\n showing = false;\r\n }\r\n\r\n return r;\r\n };\r\n\r\n return {\r\n 'request': (config) => {\r\n if (!config.silentMode || (config.headers.silentMode !== undefined && !config.headers.silentMode)) {\r\n numRequests++;\r\n if (!showing) {\r\n showing = true;\r\n NProgress.start();\r\n }\r\n }\r\n\r\n return config;\r\n },\r\n\r\n 'response': (response) => {\r\n return hide(response);\r\n },\r\n\r\n 'responseError': (response) => {\r\n if (response && response.status !== 401 && response.data.error !== 'invalid_grant') {\r\n var previousResponseError = _.find(previousResponseErrors, (previousError) => {\r\n return previousError.config.url === response.config.url &&\r\n previousError.method === response.method &&\r\n previousError.status === response.status;\r\n });\r\n\r\n if (!previousResponseError) {\r\n var logger = $injector.get('brookson.logger');\r\n\r\n if (response.config.data != null && response.config.data.password != null) {\r\n angular.forEach(response.config.data.password, (item, key) => {\r\n // substitute all passwords enterd by the user before logging\r\n response.config.data.password[key] = \"********\";\r\n });\r\n }\r\n\r\n logger.error(\"HTTP Error: \" + response.config.url, response);\r\n\r\n previousResponseErrors.push(response);\r\n }\r\n }\r\n\r\n return $q.reject(hide(response));\r\n }\r\n };\r\n }\r\n\r\n function httpInterceptorConfig($httpProvider) {\r\n $httpProvider.interceptors.push(\"brookson.http.interceptor\");\r\n }\r\n})();\r\n","/// \r\n/// \r\n\r\nmodule Shared {\r\n export class BrooksonModalFeedbackController {\r\n\r\n constructor(private factory: IBrooksonUiFeedbackFactory, private $detection : any) {\r\n this.factory.getUserFeedbackCategories();\r\n this.factory.resetScreenshot();\r\n this.factory.userFeedback.userFeedbackCategoryId = null;\r\n this.factory.userFeedback = new UserFeedback();\r\n this.factory.userFeedback.userFeedbackCategoryId = null;\r\n }\r\n\r\n // Public Methods //\r\n closeModal() {\r\n this.factory.closeModal();\r\n }\r\n\r\n submitButtonPressed(form: ng.IFormController) {\r\n if (form.$invalid) {\r\n return;\r\n }\r\n\r\n this.factory.getUserAgentInfo();\r\n this.factory.getState();\r\n this.factory.getUrl();\r\n this.factory.postUserFeedback();\r\n }\r\n\r\n takeScreenshotButtonPressed() {\r\n // If mobile, take screenshot only\r\n if (this.$detection.isAndroid() || this.$detection.isiOS() || this.$detection.isWindowsPhone() || this.$detection.isBB10()) {\r\n this.factory.takeScreenshot();\r\n } else {\r\n this.factory.hideModal();\r\n this.factory.isScreenshotMode = true;\r\n this.factory.createCanvas();\r\n }\r\n }\r\n }\r\n}\r\n","/// \r\n\r\nmodule Shared {\r\n export interface IBrooksonModalsGlEntries {\r\n show(payload: Array, reportType?: string, title?: string): void;\r\n }\r\n}\r\n\r\n(() => {\r\n \"use strict\";\r\n\r\n var app = angular.module(\"app.shared\");\r\n\r\n app.factory(\"brookson.modal.glentries\", [\r\n \"$q\", \"$uibModal\", \"$sce\", \"screenSize\", ($q, $uibModal, $sce, screenSize) => {\r\n\r\n var options: any = {\r\n animation: true,\r\n size: \"lg\",\r\n templateUrl: screenSize.is('xs') ?\r\n \"src/app/shared/views/modals/brookson.modals.gl-entries.mobile.html\" :\r\n \"src/app/shared/views/modals/brookson.modals.gl-entries.html\"\r\n };\r\n\r\n var _show = (payload, reportType, title) => {\r\n var defer = $q.defer();\r\n var glEntriesOptions = options;\r\n\r\n glEntriesOptions.controller = ['$scope', '$uibModalInstance', ($scope, $uibModalInstance) => {\r\n $scope.cancel = cancel;\r\n $scope.payload = payload;\r\n $scope.reportType = reportType;\r\n $scope.title = title;\r\n $scope.total = 0;\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n function activate() {\r\n $scope.total = $scope.reportType === \"BS\"\r\n ? _.first(payload).balance \r\n : _.reduce(payload, (sum: number, n: any) => sum + n.amount, 0);\r\n }\r\n\r\n activate();\r\n }];\r\n\r\n $uibModal.open(glEntriesOptions);\r\n\r\n return defer.promise;\r\n };\r\n\r\n return {\r\n show: _show\r\n };\r\n }\r\n ]);\r\n})();\r\n","module Shared {\r\n export class IR35DetailCaptureRequiresCompletion {\r\n requiresCompletion: boolean;\r\n canBeCancelled: boolean;\r\n }\r\n}","/// \r\n\r\nmodule Shared {\r\n export interface IIR35DetailCaptureService {\r\n ir35DetailCaptureRequiresCompletion: Shared.IR35DetailCaptureRequiresCompletion;\r\n getIR35DetailCaptureOutcome(silentMode?: boolean): ng.IPromise;\r\n postIR35DetailCapture(sector: Shared.IR35DetailCaptureButtonPressed): ng.IPromise;\r\n }\r\n\r\n export class IR35DetailCaptureService implements IIR35DetailCaptureService {\r\n\r\n public ir35DetailCaptureRequiresCompletion: Shared.IR35DetailCaptureRequiresCompletion;\r\n\r\n static $inject = ['$http'];\r\n\r\n constructor(\r\n private $http: Shared.IBrooksonHttp\r\n ) { }\r\n\r\n // Returns whether the member is required to complete the IR35 Detail Capture form or not\r\n getIR35DetailCaptureOutcome = (silentMode?: boolean): ng.IPromise => {\r\n return this.$http.get(`api/IR35/ir35DetailCapture`, {\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg) => {\r\n this.ir35DetailCaptureRequiresCompletion = response.data;\r\n\r\n return response.data;\r\n });\r\n }\r\n\r\n // Posts back to the server what the user chose\r\n postIR35DetailCapture = (sector: Shared.IR35DetailCaptureButtonPressed): ng.IPromise => {\r\n return this.$http.post(`api/IR35/ir35DetailCapture`, sector).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular.module('app.shared').service('ir35DetailCaptureService', Shared.IR35DetailCaptureService);","/// \r\n\r\nmodule Shared {\r\n /**\r\n * Interface for the Brookson IR35 Detail Capture Modal Service\r\n */\r\n export interface IBrooksonIR35DetailCaptureModalService {\r\n /**\r\n * Displays the IR35 Detail Capture modal\r\n */\r\n show(): ng.ui.bootstrap.IModalServiceInstance;\r\n }\r\n\r\n interface AppSettings extends ng.IWindowService {\r\n appSettings: any;\r\n }\r\n\r\n /**\r\n * Brookson IR35 Detail Capture Modal Service\r\n */\r\n export class BrooksonIR35DetailCaptureModalService implements IBrooksonIR35DetailCaptureModalService {\r\n /**\r\n * The options for the bootstrap modal \r\n */\r\n options: ng.ui.bootstrap.IModalSettings = {\r\n animation: true,\r\n size: \"md\",\r\n templateUrl: \"src/app/shared/views/modals/brookson.modals.ir35DetailCapture.html\",\r\n keyboard: false,\r\n controller: BrooksonIR35DetailCaptureModalController,\r\n controllerAs: \"$ctrl\",\r\n backdrop: 'static',\r\n windowClass: \"ir35-detail-capture\"\r\n };\r\n\r\n static $inject = ['$uibModal'];\r\n\r\n constructor(\r\n private $uibModal: ng.ui.bootstrap.IModalService\r\n ) { }\r\n\r\n show = (): ng.ui.bootstrap.IModalServiceInstance => {\r\n return this.$uibModal.open(this.options);\r\n }\r\n }\r\n\r\n /**\r\n * The controller for the Brookson IR35 Detail Capture Modal\r\n */\r\n export class BrooksonIR35DetailCaptureModalController {\r\n\r\n // From the backend: whether or not the popup modal can be cancelled or not\r\n public canBeCancelled: boolean = false;\r\n\r\n // Whether the user is on InternalConnect or not\r\n private isInternal: boolean;\r\n private validApiSource: boolean;\r\n\r\n static $inject = ['$uibModalInstance', 'ir35DetailCaptureService', '$window', 'memberSrv'];\r\n\r\n constructor(\r\n private $uibModalInstance,\r\n private ir35DetailCaptureService: Shared.IIR35DetailCaptureService,\r\n private $window: AppSettings,\r\n private memberService: Shared.IMemberService\r\n ) {\r\n this.validApiSource = this.$window.appSettings.validApiSource;\r\n this.isInternal = this.$window.appSettings.isInternal;\r\n this.canBeCancelled = (this.memberService.member.isAdmin || this.isInternal || this.validApiSource);\r\n }\r\n\r\n // One of the three buttons has been pressed...\r\n public buttonPressed = (sector: IR35DetailCaptureButtonPressed): void => {\r\n console.log('buttonPressed', sector);\r\n\r\n this.ir35DetailCaptureService.postIR35DetailCapture(sector).then((data: Shared.IR35DetailCaptureButtonPressed) => {\r\n this.close();\r\n });\r\n }\r\n\r\n // Close the modal\r\n public close = (): void => {\r\n this.$uibModalInstance.dismiss('cancel');\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"app.shared\").service(\"brookson.modal.ir35DetailCapture\", Shared.BrooksonIR35DetailCaptureModalService);","module Shared {\n export interface IPublicSectorAssignmentCheckService {\n publicSectorAssignmentCheckRequiresCompletion: Array;\n getPublicSectorAssignmentCheckOutcome(silentMode?: boolean): ng.IPromise>;\n postPublicSectorAssignmentCheck(assignments: Array): ng.IPromise>;\n }\n\n export class PublicSectorAssignmentCheckService implements IPublicSectorAssignmentCheckService {\n\n public publicSectorAssignmentCheckRequiresCompletion: Array;\n\n static $inject = ['$http'];\n\n constructor(\n private $http: Shared.IBrooksonHttp\n ) { }\n\n // Returns whether the member is required to complete the Public Sector Assignment Check form or not\n getPublicSectorAssignmentCheckOutcome = (silentMode?: boolean): ng.IPromise> => {\n return this.$http.get(`api/Assignment/GetAllOpenUnknownSectorAssignments`, {\n silentMode: silentMode ? silentMode : false\n }).then((response: ng.IHttpPromiseCallbackArg>) => {\n this.publicSectorAssignmentCheckRequiresCompletion = response.data;\n if (response.data !== null) {\n response.data.forEach(assignment => {\r\n assignment.jobTitleOption = new JobTitle();\r\n assignment.jobTitleOption.titleText = assignment.jobTitle;\r\n });\r\n }\n return response.data;\n });\n }\n\n // Posts back to the server what the user chose\n postPublicSectorAssignmentCheck = (assignments: Array): ng.IPromise> => {\n assignments.forEach(assignment => {\r\n assignment.jobTitle = assignment.jobTitleOption.titleText;\r\n });\n return this.$http.post(`api/Assignment/SaveAssignmentSectorData`, assignments).then((response: ng.IHttpPromiseCallbackArg>) => {\n return response.data;\n });\n }\n }\n}\n\nangular.module('app.shared').service('publicSectorAssignmentCheckService', Shared.PublicSectorAssignmentCheckService);","/// \r\n\r\nmodule Shared {\r\n export interface IBrooksonPublicSectorAssignmentCheckModalService {\r\n show(): ng.ui.bootstrap.IModalServiceInstance;\r\n }\r\n\r\n interface AppSettings extends ng.IWindowService {\r\n appSettings: any;\r\n }\r\n\r\n export class BrooksonPublicSectorAssignmentCheckModalService implements IBrooksonPublicSectorAssignmentCheckModalService {\r\n options: ng.ui.bootstrap.IModalSettings = {\r\n animation: true,\r\n size: \"md\",\r\n templateUrl: \"src/app/shared/views/modals/brookson.modals.publicSectorAssignmentCheck.html\",\r\n keyboard: false,\r\n controller: BrooksonPublicSectorAssignmentCheckModalController,\r\n controllerAs: \"$ctrl\",\r\n backdrop: 'static',\r\n windowClass: \"public-sector-assignment-check\"\r\n };\r\n\r\n static $inject = ['$uibModal'];\r\n\r\n constructor(\r\n private $uibModal: ng.ui.bootstrap.IModalService\r\n ) { }\r\n\r\n show = (): ng.ui.bootstrap.IModalServiceInstance => {\r\n return this.$uibModal.open(this.options);\r\n }\r\n }\r\n\r\n export class BrooksonPublicSectorAssignmentCheckModalController {\r\n\r\n // From the backend: whether or not the popup modal can be cancelled or not\r\n public canBeCancelled: boolean = false;\r\n\r\n // Whether the user is on InternalConnect or not\r\n private isInternal: boolean;\r\n private validApiSource: boolean;\r\n\r\n static $inject = ['$uibModalInstance', 'publicSectorAssignmentCheckService', '$window', 'memberSrv'];\r\n\r\n constructor(\r\n private $uibModalInstance,\r\n private publicSectorAssignmentCheckService: Shared.IPublicSectorAssignmentCheckService,\r\n private $window: AppSettings,\r\n private memberService: Shared.IMemberService\r\n ) {\r\n this.isInternal = this.$window.appSettings.isInternal;\r\n this.validApiSource = this.$window.appSettings.validApiSource;\r\n this.canBeCancelled = (this.memberService.member.isAdmin || this.isInternal || this.validApiSource);\r\n }\r\n\r\n public submitAssignments = (): void => {\r\n this.publicSectorAssignmentCheckService.postPublicSectorAssignmentCheck(this.publicSectorAssignmentCheckService.publicSectorAssignmentCheckRequiresCompletion).then(() => {\r\n this.close();\r\n });\r\n }\r\n\r\n // Close the modal\r\n public close = (): void => {\r\n this.$uibModalInstance.dismiss('cancel');\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"app.shared\").service(\"publicSectorAssignmentCheckModalService\", Shared.BrooksonPublicSectorAssignmentCheckModalService);","/// \r\n\r\n(() => {\r\n \"use strict\";\r\n\r\n var app = angular.module(\"app.shared\");\r\n\r\n app.factory(\"brookson.modal.receipt-bank\", [\r\n \"$q\", \"$uibModal\", \"$sce\", 'expenses.enums', ($q, $uibModal, $sce, enums) => {\r\n var options: any = {\r\n animation: true,\r\n size: \"lg\",\r\n templateUrl: \"src/app/shared/views/modals/brookson.modals.receipt-bank.attach-receipt.html\"\r\n };\r\n\r\n var _attachReceipt = (receipts, receiptId) => {\r\n var defer = $q.defer();\r\n var attachReceiptModal = options;\r\n\r\n attachReceiptModal.controller = ['$scope', '$uibModalInstance', ($scope, $uibModalInstance) => {\r\n // Data\r\n $scope.enums = enums;\r\n $scope.selectedReceipt = receiptId;\r\n $scope.receipts = receipts;\r\n $scope.currentPage = 1;\r\n\r\n // Methods\r\n $scope.cancel = cancel;\r\n $scope.attachReceipt = attachReceipt;\r\n $scope.receiptSelected = receiptSelected;\r\n\r\n activate();\r\n\r\n function activate() {\r\n if ($scope.receipts && $scope.selectedReceipt) {\r\n _.forEach($scope.receipts, (receipt: Shared.Receipt) => {\r\n if (receipt.receiptId === receiptId) {\r\n receipt.isSelected = true;\r\n }\r\n });\r\n }\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n function attachReceipt() {\r\n \r\n //check to see if any receipts are selected\r\n let receipt: Shared.Receipt = _.find($scope.receipts, (receipt: Shared.Receipt) => receipt.isSelected === true );\r\n if (receipt) {\r\n $scope.selectedReceipt = receipt.receiptId;\r\n $uibModalInstance.close();\r\n defer.resolve(receipt);\r\n } else {\r\n return;\r\n }\r\n \r\n }\r\n\r\n function receiptSelected(data) {\r\n if (data.isSelected) {\r\n $scope.selectedReceipt = data.receiptId;\r\n\r\n _.forEach($scope.receipts, (receipt) => {\r\n if (data.receiptId !== receipt.receiptId) {\r\n receipt.isSelected = false;\r\n }\r\n });\r\n } else {\r\n $scope.selectedReceipt = 0;\r\n }\r\n }\r\n }];\r\n\r\n $uibModal.open(attachReceiptModal);\r\n\r\n return defer.promise;\r\n };\r\n\r\n return {\r\n attachReceipt: _attachReceipt\r\n };\r\n }\r\n ]);\r\n})();\r\n","/// \r\n\r\n(() => {\r\n \"use strict\";\r\n\r\n var app = angular.module(\"app.shared\");\r\n\r\n app.factory(\"brookson.modal.receipt-preview\", [\r\n \"$q\", \"$uibModal\", ($q, $uibModal) => {\r\n var options: any = {\r\n animation: true,\r\n size: \"md\",\r\n templateUrl: \"src/app/shared/views/modals/brookson.modals.receipt-preview.html\"\r\n };\r\n var _show = (receiptId) => {\r\n var defer = $q.defer();\r\n var receiptPreview = options;\r\n\r\n receiptPreview.controller = ['$scope', '$uibModalInstance', ($scope, $uibModalInstance) => {\r\n $scope.cancel = cancel;\r\n $scope.receiptId = receiptId;\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n }];\r\n\r\n $uibModal.open(receiptPreview);\r\n\r\n return defer.promise;\r\n };\r\n\r\n return {\r\n show: _show\r\n };\r\n }\r\n ]);\r\n})();\r\n","module Shared {\r\n /**\r\n * Interface for the Brookson SDC Modal Service\r\n * \r\n * @export\r\n * @interface IBrooksonSdcModalService\r\n */\r\n export interface IBrooksonSdcModalService {\r\n /**\r\n * Displays the SDC Unassessed Assignments modal\r\n * \r\n * @returns {ng.ui.bootstrap.IModalServiceInstance}\r\n * \r\n * @memberOf IBrooksonSdcModalService\r\n */\r\n show(): ng.ui.bootstrap.IModalServiceInstance;\r\n }\r\n\r\n /**\r\n * Brookson SDC Modal Service\r\n * \r\n * @export\r\n * @class BrooksonSdcModalService\r\n * @implements {IBrooksonSdcModalService}\r\n */\r\n export class BrooksonSdcModalService implements IBrooksonSdcModalService {\r\n /**\r\n * The options for the bootstrap modal \r\n * \r\n * @type {ng.ui.bootstrap.IModalSettings}\r\n * @memberOf BrooksonSdcModalService\r\n */\r\n options: ng.ui.bootstrap.IModalSettings = {\r\n animation: true,\r\n size: \"md\",\r\n templateUrl: \"src/app/shared/views/modals/brookson.modals.sdc.html\",\r\n keyboard: false,\r\n controller: BrooksonSdcModalController,\r\n controllerAs: \"$ctrl\",\r\n backdrop: 'static',\r\n windowClass: 'modal-sdcOutcome'\r\n };\r\n\r\n /**\r\n * Dependency Injection\r\n * \r\n * @static\r\n * \r\n * @memberOf BrooksonSdcModalService\r\n */\r\n static $inject = ['$uibModal'];\r\n\r\n /**\r\n * Creates an instance of BrooksonSdcModalService.\r\n * \r\n * @param {ng.ui.bootstrap.IModalService} $uibModal\r\n * \r\n * @memberOf BrooksonSdcModalService\r\n */\r\n constructor(\r\n private $uibModal: ng.ui.bootstrap.IModalService\r\n ) { }\r\n\r\n /**\r\n * Displays the SDC Unassessed Assignments modal\r\n * \r\n * \r\n * @memberOf BrooksonSdcModalService\r\n */\r\n show = (): ng.ui.bootstrap.IModalServiceInstance => {\r\n return this.$uibModal.open(this.options);\r\n }\r\n }\r\n\r\n /**\r\n * Customer $scope class for the Brookson SDC Modal\r\n * \r\n * @export\r\n * @interface BrooksonSdcModalScope\r\n * @extends {ng.IScope}\r\n */\r\n export interface BrooksonSdcModalScope extends ng.IScope {\r\n /**\r\n * Closes the bootstrap modal\r\n * \r\n * @param {*} [result]\r\n * \r\n * @memberOf BrooksonSdcModalScope\r\n */\r\n $close(result?: any);\r\n }\r\n\r\n /**\r\n * The controller for the Brookson SDC Modal\r\n * \r\n * @export\r\n * @class BrooksonSdcModalController\r\n */\r\n export class BrooksonSdcModalController {\r\n\r\n /**\r\n * A list of assignments that require the users attention\r\n * \r\n * @type {Array}\r\n * @memberOf BrooksonSdcModalController\r\n */\r\n assignmentOutcomes: Array;\r\n\r\n /**\r\n * A list of assignment id's that are making the CloseAssignment request\r\n * \r\n * @type {Array}\r\n * @memberOf BrooksonSdcModalController\r\n */\r\n assignmentEndedRequestInProgress: Array = [];\r\n\r\n /**\r\n * A list of assignment id's that are making the DeclineExpensesForAssignment request\r\n * \r\n * @type {Array}\r\n * @memberOf BrooksonSdcModalController\r\n */\r\n noClaimOnAssignmentRequestInProgress: Array = [];\r\n\r\n /**\r\n * Angular DI\r\n * \r\n * @static\r\n * \r\n * @memberOf BrooksonSdcModalController\r\n */\r\n static $inject = ['$scope', 'sdcService', 'AssignmentSrv', 'brookson.navigation'];\r\n\r\n /**\r\n * Creates an instance of BrooksonSdcModalController.\r\n * \r\n * @param {BrooksonSdcModalScope} $scope\r\n * @param {Shared.ISdcService} sdcService\r\n * @param {Shared.IAssignmentService} assignmentSrv\r\n * \r\n * @memberOf BrooksonSdcModalController\r\n */\r\n constructor(\r\n private $scope: BrooksonSdcModalScope,\r\n private sdcService: Shared.ISdcService,\r\n private assignmentSrv: Shared.IAssignmentService,\r\n private navigation: Shared.IBrooksonNavigation\r\n ) {\r\n this.getAssignmentOutcomes();\r\n }\r\n\r\n /**\r\n * Event fired when the \"Yes I wish to claim\" button is pressed\r\n * \r\n * \r\n * @memberOf BrooksonSdcModalController\r\n */\r\n claimOnAssignmentButtonPressed = (assignment: AssignmentSdcOutcome) : void => {\r\n this.claimOnAssignment(assignment);\r\n }\r\n\r\n /**\r\n * Event fired when the \"No I do not wish to claim\" button is pressed\r\n * \r\n * \r\n * @memberOf BrooksonSdcModalController\r\n */\r\n noClaimOnAssignmentButtonPressed = (assignment: AssignmentSdcOutcome): void => {\r\n this.noClaimOnAssignment(assignment);\r\n }\r\n\r\n /**\r\n * Event fired when the \"This assignment has ended\" button is pressed\r\n * \r\n * \r\n * @memberOf BrooksonSdcModalController\r\n */\r\n closeAssignmentButtonPressed = (assignment: AssignmentSdcOutcome): void => {\r\n this.closeAssignment(assignment);\r\n }\r\n\r\n /**\r\n * Returns whether the assignment ended button should be disabled for this assignment\r\n * \r\n * \r\n * @memberOf BrooksonSdcModalController\r\n */\r\n disableAssignmentEndedButton = (assignment: AssignmentSdcOutcome): boolean => {\r\n return _.some(this.assignmentEndedRequestInProgress, (assignmentId: string) => {\r\n return assignmentId === assignment.assignmentId;\r\n });\r\n }\r\n\r\n /**\r\n * Returns whether the no claim assignment button should be disabled for this assignment\r\n * \r\n * \r\n * @memberOf BrooksonSdcModalController\r\n */\r\n disableAssignmentNoClainButton = (assignment: AssignmentSdcOutcome): boolean => {\r\n return _.some(this.noClaimOnAssignmentRequestInProgress, (assignmentId: string) => {\r\n return assignmentId === assignment.assignmentId;\r\n });\r\n }\r\n\r\n /**\r\n * Returns a list of assignment outcomes from the API\r\n * \r\n * @private\r\n * \r\n * @memberOf BrooksonSdcModalController\r\n */\r\n private getAssignmentOutcomes = () : ng.IPromise> => {\r\n return this.sdcService.getAssignmentOutcomes().then(this.handleGetAssignmentOutcomesResponse);\r\n }\r\n\r\n /**\r\n * Sets the appropiate properties when the reponse has returned from the API GetAssignnmentOutcome response\r\n * \r\n * @private\r\n * \r\n * @memberOf BrooksonSdcModalController\r\n */\r\n private handleGetAssignmentOutcomesResponse = (data: Array): Array => {\r\n this.assignmentOutcomes = data.filter(x => x.outcome === Shared.SdcOutcomeType.NotAssessed);\r\n return this.assignmentOutcomes;\r\n }\r\n\r\n /**\r\n * Closes the modal\r\n * \r\n * @private\r\n * \r\n * @memberOf BrooksonSdcModalController\r\n */\r\n private closeModal = () => {\r\n this.$scope.$close();\r\n }\r\n\r\n /**\r\n * Navigate to the edit assignment page so the user can complete an SDC questionnaire\r\n * \r\n * @private\r\n * \r\n * @memberOf BrooksonSdcModalController\r\n */\r\n private claimOnAssignment = (assignment: AssignmentSdcOutcome): void => {\r\n this.navigation.assignments.editAssignment(assignment.assignmentId);\r\n }\r\n\r\n /**\r\n * Submits an SDC questionnaire with the incurr expenses key\r\n * \r\n * @private\r\n * \r\n * @memberOf BrooksonSdcModalController\r\n */\r\n private noClaimOnAssignment = (assignment: AssignmentSdcOutcome): void => {\r\n this.noClaimOnAssignmentRequestInProgress.push(assignment.assignmentId);\r\n\r\n this.sdcService.declineExpensesForAssignment(assignment.assignmentId).then((data: boolean) => {\r\n _.remove(this.noClaimOnAssignmentRequestInProgress, (inProgress: string) => {\r\n return inProgress === assignment.assignmentId;\r\n });\r\n\r\n if (data) {\r\n this.removeAssignmentFromList(assignment);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Closes the assignment and removes it from the list if the request was successful\r\n * \r\n * @private\r\n * \r\n * @memberOf BrooksonSdcModalController\r\n */\r\n private closeAssignment = (assignment: AssignmentSdcOutcome): void => {\r\n this.assignmentEndedRequestInProgress.push(assignment.assignmentId);\r\n\r\n this.assignmentSrv.closeAssignment(assignment.assignmentId).then((data: boolean) => {\r\n _.remove(this.assignmentEndedRequestInProgress, (inProgress: string) => {\r\n return inProgress === assignment.assignmentId;\r\n });\r\n\r\n if (data) {\r\n this.removeAssignmentFromList(assignment);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Removes a given assignment from the list\r\n * \r\n * @private\r\n * \r\n * @memberOf BrooksonSdcModalController\r\n */\r\n private removeAssignmentFromList = (assignment: AssignmentSdcOutcome): void => {\r\n _.remove(this.assignmentOutcomes, assignment);\r\n\r\n if (this.assignmentOutcomes.length === 0) {\r\n this.closeModal();\r\n }\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"app.shared\").service(\"brookson.modal.sdc\", Shared.BrooksonSdcModalService);","module Shared {\r\n 'use strict';\r\n\r\n export interface IBrooksonModalSelect {\r\n showSelect(items: Array, title: string): ng.IPromise;\r\n }\r\n\r\n export class BrooksonModalSelect implements IBrooksonModalSelect {\r\n static $inject: Array = ['$uibModal'];\r\n constructor(private $uibModal: ng.ui.bootstrap.IModalService) { }\r\n\r\n public showSelect = (items: Array, title: string) => {\r\n var options: ng.ui.bootstrap.IModalSettings = {\r\n animation: true,\r\n size: \"md\",\r\n templateUrl: \"src/app/shared/views/modals/brookson.modals.select.html\",\r\n controller: Shared.BrooksonModalSelectController,\r\n resolve: {\r\n selectItems: () => { return items; },\r\n title: () => { return title; }\r\n }\r\n };\r\n\r\n return this.$uibModal.open(options).result;\r\n }\r\n }\r\n\r\n angular\r\n .module('app.shared')\r\n .service('brookson.modal.select.service', BrooksonModalSelect);\r\n}\r\n\r\nmodule Shared {\r\n 'use strict';\r\n\r\n export class BrooksonModalSelectController {\r\n\r\n static $inject: Array = ['$scope', '$uibModalInstance', 'selectItems', 'title'];\r\n\r\n constructor(private $scope: any, private $uibModalInstance: ng.ui.bootstrap.IModalServiceInstance, public selectItems: Array, public title: string) {\r\n $scope.cancel = this.cancel;\r\n $scope.ok = this.ok;\r\n $scope.selectItems = this.selectItems;\r\n $scope.title = this.title;\r\n }\r\n\r\n public cancel = () => {\r\n this.$uibModalInstance.dismiss();\r\n }\r\n\r\n public ok = () => {\r\n\r\n this.$uibModalInstance.close(_.filter(this.selectItems, (item) => { return item.selected; }));\r\n }\r\n\r\n }\r\n\r\n angular\r\n .module('app.shared')\r\n .controller('brooksonModalSelectController', BrooksonModalSelectController);\r\n}\r\n\r\n\r\nmodule Shared {\r\n export class ModalSelectItem {\r\n constructor(description: string, id: number, selected: boolean) {\r\n this.description = description;\r\n this.id = id;\r\n this.selected = selected;\r\n }\r\n\r\n public description: string = null;\r\n\r\n public id: number = null;\r\n\r\n public selected: boolean = false;\r\n }\r\n}","/// \r\n\r\n(() => {\r\n \"use strict\";\r\n\r\n var app = angular.module(\"app.shared\");\r\n\r\n app.factory(\"brookson.modal.vehicle-details\", [\r\n \"$q\", \"$uibModal\", \"$sce\", 'expenses.enums', ($q, $uibModal, $sce, enums) => {\r\n var options: any = {\r\n animation: true,\r\n size: \"lg\",\r\n templateUrl: \"src/app/shared/views/modals/brookson.modals.add-edit-vehicle.html\"\r\n };\r\n\r\n var _vehicleDetails = (vehicles, registration) => {\r\n var defer = $q.defer();\r\n var addVehicleModal = options;\r\n\r\n addVehicleModal.controller = ['$scope', '$uibModalInstance', ($scope, $uibModalInstance) => {\r\n // Data\r\n $scope.enums = enums;\r\n $scope.selectedVehicles = registration;\r\n $scope.vehicles = vehicles;\r\n\r\n // Methods\r\n $scope.cancel = cancel;\r\n $scope.selectVehicle = selectVehicle;\r\n $scope.vehicleSelected = vehicleSelected;\r\n\r\n activate();\r\n\r\n function activate() {\r\n if ($scope.vehicles && $scope.selectedVehicles) {\r\n _.forEach($scope.vehicles, (vehicle: Shared.ExpenseMileageVehicle) => {\r\n if (vehicle.registration === registration) {\r\n vehicle.isSelected = true;\r\n }\r\n });\r\n }\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n\r\n function selectVehicle() {\r\n \r\n let vehicle: Shared.ExpenseMileageVehicle = _.find($scope.vehicles, (vehicle: Shared.ExpenseMileageVehicle) => vehicle.isSelected === true );\r\n if (vehicle) {\r\n $scope.vehicleSelected = vehicle.registration;\r\n $uibModalInstance.close();\r\n defer.resolve(vehicle);\r\n } else {\r\n return;\r\n }\r\n \r\n }\r\n\r\n function vehicleSelected(data) {\r\n if (data.isSelected) {\r\n $scope.selectedVehicle = data.registration;\r\n\r\n _.forEach($scope.vehicles, (vehicle) => {\r\n if (data.receiptId !== vehicle.registration) {\r\n vehicle.isSelected = false;\r\n }\r\n });\r\n } else {\r\n $scope.selectedVehicle = 0;\r\n }\r\n }\r\n }];\r\n\r\n $uibModal.open(addVehicleModal);\r\n\r\n return defer.promise;\r\n };\r\n\r\n return {\r\n selectVehicle: _vehicleDetails\r\n };\r\n }\r\n ]);\r\n})();\r\n","/// \r\n\r\nmodule Shared {\r\n export interface INotificationService {\r\n getNotifications(silentMode?: boolean): ng.IPromise;\r\n closeNotification(notification: Notification) : ng.IPromise;\r\n }\r\n}\r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular\r\n .module('app.shared')\r\n .service('notificationSrv', notificationSrv);\r\n\r\n notificationSrv.$inject = ['$http', 'shared.config'];\r\n\r\n function notificationSrv($http, sharedConfig) {\r\n\r\n var service:any = {};\r\n var serviceBase = sharedConfig.baseApiUrl;\r\n\r\n // Methods\r\n service.getNotifications = getNotifications;\r\n service.closeNotification = closeNotification;\r\n\r\n function getNotifications(silentMode) {\r\n return $http.get('api/Notifications/GetNotifications', {\r\n silentMode: silentMode ? silentMode : false,\r\n cache: true\r\n }).then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n function closeNotification(notification) {\r\n return $http.delete(serviceBase + \"api/Notifications/DeleteNotification/\" + notification.id)\r\n .then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n return service;\r\n }\r\n})();\r\n","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n\r\n\r\n\r\nmodule Shared {\r\n\r\n export interface ITaskPlannerSrv {\r\n taskTitle: string;\r\n sectionTitle: any;\r\n sectionTitles: any;\r\n selectedTask: any;\r\n selectedAction: Object;\r\n viewDate: any;\r\n annualMonths: any;\r\n flatActions: Array;\r\n tasks: Array;\r\n taskActions: Array;\r\n enums: ITaskPlannerEnums;\r\n screenSize: any;\r\n overrideCacheMode: boolean;\r\n\r\n\r\n updateUTR(utrNumber: string, branchId: string): ng.IPromise;\r\n updateAuthCode(authCode: string): ng.IPromise;\r\n buildMonths(silentMode?: boolean): ng.IPromise>;\r\n getAndParseTasks(silentMode?: boolean): ng.IPromise>;\r\n parseTasks(data);\r\n getTasksComplete(data): ng.IPromise>;\r\n getTasks(silentMode?: boolean, cacheMode?: boolean): ng.IPromise;\r\n getActionsByDay(day): any;\r\n addMonth(): any;\r\n subtractMonth(): any;\r\n getTaskActions(silentMode?: boolean): ng.IPromise>;\r\n getTasksToBeDisplayed(silentMode: boolean): ng.IPromise>;\r\n getFolderByID(folderID, silentMode): any;\r\n get3MonthsRelatedDocs(folderID): any;\r\n getYearEndStage(silentMode?: boolean): any;\r\n getYearEndMemberConfirmationStatus(silentMode: boolean): any;\r\n exportCalendar(silentMode?: boolean): any;\r\n generateCalendarKey(silentMode?: boolean): any;\r\n getTaskCalendarSync(silentMode?: boolean): any;\r\n showTaskCompletionInput(webTaskNo: string);\r\n confirmAccountsStep(step: number);\r\n getYearEndStatus(): ng.IPromise;\r\n previewDocument(document: any): any;\r\n previewCallback(id: any, path: any): any;\r\n isMobile(): boolean;\r\n closeTask(taskAction: Shared.ITaskAction, silentMode?: boolean): ng.IPromise;\r\n // Tax Pack Confirm and Approval\r\n getIsPayBeforeSubmit(silentMode?: boolean): ng.IPromise;\r\n getUtrNumber(): ng.IPromise;\r\n }\r\n}\r\n\r\nmodule Shared {\r\n\r\n export class TaskPlannerSrv implements ITaskPlannerSrv {\r\n\r\n public taskTitle: string;\r\n public flatActions: Array;\r\n public sectionTitle: string = '';\r\n public sectionTitles: any;\r\n public selectedTask: any = {};\r\n public selectedAction: Shared.TaskAction = new Shared.TaskAction();\r\n public viewDate: any;\r\n public annualMonths: Array;\r\n public tasks: Array;\r\n public taskActions: Array;\r\n public overrideCacheMode: boolean;\r\n static $inject: Array = ['$http', '$q', 'brookson.logger', 'growl', '$stateParams', 'documentStorageSrv', 'brookson.pdf.modal', 'taskPlanner.enums', 'screenSize', '$cacheFactory', '$rootScope'];\r\n\r\n constructor(\r\n private $http: IBrooksonHttp,\r\n private $q: ng.IQService,\r\n private logger: any,\r\n private growl: angular.growl.IGrowlService,\r\n public $stateParams: ng.ui.IStateParamsService,\r\n public documentStorageSrv: any,\r\n public brooksonPdfModal: any,\r\n public enums: ITaskPlannerEnums,\r\n public screenSize: any,\r\n private $cacheFactory: angular.ICacheFactoryService,\r\n private $rootScope: angular.IRootScopeService\r\n ) {\r\n this.sectionTitles = {\r\n business: {\r\n name: 'Business Tasks',\r\n overdue: 0\r\n },\r\n personal: {\r\n name: 'Personal',\r\n overdue: 0\r\n },\r\n personalTax: {\r\n name: 'Personal Tax'\r\n },\r\n saPersonalTax: {\r\n name: 'SA Personal Tax'\r\n },\r\n paye: {\r\n name: 'PAYE'\r\n },\r\n payroll: {\r\n name: 'Payroll'\r\n },\r\n utr: {\r\n name: 'UTR'\r\n },\r\n vat: {\r\n name: 'VAT'\r\n },\r\n yearEnd: {\r\n name: 'Year End'\r\n }\r\n };\r\n }\r\n //private methods\r\n private buildMonthsArray = () : Array => {\r\n var months : TaskObject[] = [];\r\n var i;\r\n\r\n for (i = -2; i < 10; i++) {\r\n var selectedMonth = moment(this.viewDate).add(i, 'month').startOf('month');\r\n var currentMonth = moment().startOf('month');\r\n //var month = {\r\n // timestamp: selectedMonth,\r\n // events: [],\r\n // highlightMonth: (moment(selectedMonth).isSame(currentMonth) ? true : false)\r\n //};\r\n var month = new TaskObject();\r\n month.timestamp = selectedMonth;\r\n month.events = [];\r\n month.highlightMonth = (moment(selectedMonth).isSame(currentMonth) ? true : false);\r\n months.push(month);\r\n }\r\n return months;\r\n }\r\n\r\n\r\n private flattenActions = (data) => {\r\n var result = [];\r\n\r\n result = _.chain(data).map((task) => {\r\n\r\n return _.map(task.taskActions, (taskAction: any) => {\r\n taskAction.taskGroup = task.taskTitle;\r\n return taskAction;\r\n });\r\n }).flatten().value();\r\n\r\n return result;\r\n\r\n }\r\n\r\n //public methods\r\n public updateUTR = (utrNumber: string, branchId: string): ng.IPromise => {\r\n var url = 'api/Planner/UpdateUTRNumbers';\r\n\r\n return this.$http.post(url, {\r\n UtrNumber: utrNumber, BranchId: branchId\r\n }\r\n ).then((response) => {\r\n\r\n this.buildMonths(false, false).then((data) => {\r\n let config: angular.growl.IGrowlMessageConfig = { title: \"Task Planner\" };\r\n this.growl.success(\"UTR has been updated.\", config);\r\n this.closeTask(this.selectedAction).then(() => {\r\n let cache = this.$cacheFactory.get('$http');\r\n cache.remove('api/Planner/GetTasks');\r\n this.getAndParseTasks().then(() => {\r\n this.updateCurrentTaskAndAction();\r\n });\r\n });\r\n });\r\n\r\n return response.data;\r\n }).catch(() => {\r\n let config: angular.growl.IGrowlMessageConfig = { title: \"Task Planner\" };\r\n this.growl.error(\"UTR failed to update.\", config);\r\n\r\n });\r\n\r\n }\r\n\r\n public updateAuthCode = (authCode: string): ng.IPromise => {\r\n var url = 'api/Planner/UpdateAuthCode';\r\n\r\n return this.$http.post(url, {\r\n AuthCode: authCode\r\n }\r\n ).then((response) => {\r\n\r\n this.buildMonths(false, false).then((data) => {\r\n let config: angular.growl.IGrowlMessageConfig = { title: \"Task Planner\" };\r\n this.growl.success(\"Auth Code has been updated.\", config);\r\n this.closeTask(this.selectedAction).then(() => {\r\n let cache = this.$cacheFactory.get('$http');\r\n cache.remove('api/Planner/GetTasks');\r\n this.getAndParseTasks().then(() => {\r\n this.updateCurrentTaskAndAction();\r\n });\r\n });\r\n });\r\n\r\n return response.data;\r\n }).catch(() => {\r\n let config: angular.growl.IGrowlMessageConfig = { title: \"Task Planner\" };\r\n this.growl.error(\"Auth Code failed to update.\", config);\r\n\r\n });\r\n\r\n }\r\n\r\n private updateCurrentTaskAndAction = () => {\r\n if (this.tasks.length) {\r\n let task = _.find(this.tasks, n => (n.id.toLowerCase() === this.$stateParams['taskID'].toLowerCase()));\r\n\r\n if (!task || task.taskActions.length === 0) {\r\n this.taskActions = [];\r\n } else {\r\n this.taskActions = task.taskActions;\r\n this.selectedTask = task;\r\n this.taskTitle = task.taskTitle;\r\n\r\n if (this.selectedAction.action_Web_Task_no) {\r\n let action = _.find(this.taskActions,\r\n m => (m.action_Web_Task_no === this.selectedAction.action_Web_Task_no));\r\n if (action) {\r\n this.selectedAction.status = action.status;\r\n this.selectedAction = action;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n public buildMonths = (silentMode: boolean = true, cacheMode: boolean = true): ng.IPromise> => {\r\n\r\n // Get the tasks, once complete, filter them into the monthly buckets\r\n return this.getTasks(silentMode, cacheMode).then(\r\n (data) => {\r\n this.flatActions = this.flattenActions(data);\r\n return this.getTasksComplete(data);\r\n }\r\n );\r\n }\r\n\r\n public getAndParseTasks = (silentMode?: boolean) : ng.IPromise> => {\r\n return this.getTasks(silentMode).then((data) => {\r\n return this.parseTasks(data);\r\n });\r\n }\r\n\r\n public parseTasks = (data): ng.IPromise => {\r\n // Do any special parsing of the tasks here\r\n\r\n let deferred = this.$q.defer();\r\n\r\n this.sectionTitles.business.overdue = 0;\r\n this.sectionTitles.personal.overdue = 0;\r\n\r\n // Add on an ID for menus and an overdue counter\r\n for (let i = 0; i < data.length; i++) {\r\n data[i].id = _.camelCase(data[i].taskTitle);\r\n data[i].overdue = 0;\r\n\r\n data[i].taskActions = _.orderBy(data[i].taskActions, ['actionOrder'], ['asc']);\r\n\r\n let taskActions = data[i].taskActions;\r\n for (let j = 0; j < taskActions.length; j++) {\r\n // Status: 0 = Completed, 1 = Current, 2 = Future, 3 = Overdue\r\n\r\n // Overdue calcs\r\n if (taskActions[j].status === 3) {\r\n // BUSINESS\r\n if (data[i].business) {\r\n this.sectionTitles.business.overdue++;\r\n } else {\r\n // PERSONAL\r\n this.sectionTitles.personal.overdue++;\r\n }\r\n data[i].overdue++;\r\n }\r\n // /Overdue calcs\r\n }\r\n }\r\n\r\n this.tasks = data;\r\n\r\n deferred.resolve(data);\r\n\r\n return deferred.promise;\r\n }\r\n\r\n public getTasksComplete = (data): ng.IPromise> => {\r\n var months = [];\r\n\r\n var deferred = this.$q.defer>();\r\n\r\n months = this.buildMonthsArray();\r\n\r\n // Loop over each month and find any data within data\r\n for (var month = 0; month < months.length; month++) {\r\n\r\n var currentMonth = moment(months[month].timestamp);\r\n var i;\r\n\r\n for (i = 0; i < data.length; i++) {\r\n var j;\r\n for (j = 0; j < data[i].taskActions.length; j++) {\r\n\r\n var taskDate = data[i].taskActions[j].dueDate;\r\n\r\n if (moment(taskDate).startOf('month').isSame(currentMonth)) {\r\n\r\n var date = moment(taskDate);\r\n //var task = {\r\n // title: data[i].taskTitle,\r\n // type: 'info',\r\n // startsAt: date,\r\n // endsAt: date,\r\n // action_Web_Task_no: data[i].taskActions[j].action_Web_Task_no,\r\n // // Status: 0 = Completed, 1 = Current, 2 = Future, 3 = Overdue\r\n // status: data[i].taskActions[j].status,\r\n // actionId: data[i].taskActions[j].actionId,\r\n // actionTitle: data[i].taskActions[j].actionTitle\r\n //};\r\n var task = new TaskObject();\r\n task.title = data[i].taskTitle;\r\n task.type = 'info';\r\n task.startsAt = date;\r\n task.endsAt = date;\r\n task.action_Web_Task_no = data[i].taskActions[j].action_Web_Task_no;\r\n task.status = data[i].taskActions[j].status;\r\n task.actionId = data[i].taskActions[j].actionId;\r\n task.actionTitle = data[i].taskActions[j].actionTitle;\r\n months[month].events.push(task);\r\n }\r\n }\r\n }\r\n }\r\n\r\n this.annualMonths = months;\r\n deferred.resolve(this.annualMonths);\r\n\r\n return deferred.promise;\r\n }\r\n\r\n public getTasks = (silentMode: boolean, cacheMode: boolean = true): ng.IPromise => {\r\n var url = 'api/Planner/GetTasks';\r\n\r\n if (this.overrideCacheMode)\r\n cacheMode = false;\r\n\r\n return this.$http.get(url, {\r\n silentMode: silentMode ? silentMode : false,\r\n cache: cacheMode\r\n }).then((response: any) => {\r\n if (response.data === \"nill\") {\r\n response.data = [];\r\n }\r\n\r\n return response.data;\r\n });\r\n }\r\n\r\n\r\n public getActionsByDay = (day) => {\r\n var result = [];\r\n\r\n result = _.filter(this.flatActions, (n) => {\r\n return moment(n.dueDate).isSame(day, 'day');\r\n });\r\n\r\n return result;\r\n }\r\n\r\n public getActionById = (id) => {\r\n var result = [];\r\n\r\n result = _.filter(this.flatActions, (n) => {\r\n return n.actionId === id;\r\n });\r\n\r\n return result;\r\n }\r\n\r\n public addMonth = () => {\r\n this.viewDate = moment(this.viewDate).add(1, 'months');\r\n this.buildMonths(false);\r\n }\r\n\r\n public subtractMonth = () => {\r\n this.viewDate = moment(this.viewDate).subtract(1, 'months');\r\n this.buildMonths(false);\r\n }\r\n\r\n public getTaskActions = (silentMode: boolean = false) => {\r\n return this.getTasks(silentMode).then((data) => {\r\n let result = [];\r\n _.forEach(data, (task) => {\r\n result = _.concat(result, task.taskActions);\r\n });\r\n\r\n return result;\r\n });\r\n }\r\n\r\n public getTasksToBeDisplayed = (silentMode: boolean = false, cacheMode: boolean = true) => {\r\n return this.$http.get('api/Planner/GetTasksToBeDisplayed', {\r\n silentMode: silentMode,\r\n cache: cacheMode\r\n }).then((response: any) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n public getFolderByID = (folderID, silentMode = false) => {\r\n var url = 'api/DocumentStorage/GetFolderById/' + folderID;\r\n\r\n return this.$http.get(url, {\r\n silentMode: silentMode,\r\n cache: true\r\n }).then((data: any) => {\r\n return data.data.documents;\r\n });\r\n }\r\n\r\n public get3MonthsRelatedDocs = (folderID) => {\r\n return this.getFolderByID(folderID)\r\n .then(this.getFolderByIDComplete)\r\n .catch((error) => {\r\n // logger, error\r\n });\r\n }\r\n\r\n private getFolderByIDComplete = (data) => {\r\n var docData = data;\r\n var docs = [];\r\n\r\n // #5102 FUTURE VAT2 was bringing back previous VAT return doc if created too early.\r\n if (!(this.selectedAction.status === TaskStatus.future && this.selectedAction.action_Web_Task_no === 'VAT2')) {\r\n var threeMonthsAgo = moment().subtract(3, 'months');\r\n docs = _.filter(docData, (o: any) => {\r\n return moment(o.date).isAfter(threeMonthsAgo);\r\n });\r\n }\r\n\r\n this.selectedAction.documents = docs;\r\n return this.selectedAction.documents;\r\n }\r\n\r\n public getYearEndStage = (silentMode?: boolean): ng.IPromise => {\r\n var url = 'api/Planner/GetYearEndStage';\r\n\r\n return this.$http.get(url, {\r\n cache: 'true',\r\n params: {\r\n silentMode: silentMode ? silentMode : false\r\n }\r\n })\r\n .then((response: any) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n public getYearEndMemberConfirmationStatus = (silentMode: boolean = false) => {\r\n var url = 'api/Planner/GetYearEndMemberConfirmationStatus';\r\n\r\n return this.$http.get(url, {\r\n cache: 'true',\r\n silentMode: silentMode\r\n }).then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n public exportCalendar = (silentMode?: boolean) => {\r\n var url = 'api/Planner/ExportTasks';\r\n\r\n return this.$http.get(url, {\r\n cache: true,\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n public generateCalendarKey = (silentMode?: boolean) => {\r\n var url = 'api/Planner/GenerateCalendarKey';\r\n\r\n return this.$http.get(url, {\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response) => {\r\n return response.data;\r\n });\r\n }\r\n public getTaskCalendarSync = (silentMode?: boolean) => {\r\n var url = 'api/Planner/GetTaskCalendarSync';\r\n\r\n return this.$http.get(url, {\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n public showTaskCompletionInput = (webTaskNo: string, actionDetails?) => {\r\n if (actionDetails) {\r\n this.selectedAction = actionDetails;\r\n }\r\n if (this.selectedAction.action_Web_Task_no === webTaskNo && (this.selectedAction.status > 0 && this.selectedAction.status < 4)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n public confirmAccountsStep = (step: number): ng.IPromise => {\r\n var url = 'api/Planner/UpdateConfirmAccountsStep';\r\n\r\n return this.$http.post(url, {\r\n step: step\r\n }\r\n ).then((response: ng.IHttpPromiseCallbackArg) => {\r\n this.buildMonths(false, false).then((data: Array) => {\r\n let config: angular.growl.IGrowlMessageConfig = { title: \"Task Planner\" };\r\n this.growl.success(`Step ${step} has been updated`, config);\r\n //return response.data;\r\n });\r\n return response.data;\r\n })\r\n .catch(() => {\r\n let config: angular.growl.IGrowlMessageConfig = { title: \"Task Planner\" };\r\n this.growl.error(\"Account confirmation failed to update.\", config);\r\n let defer = this.$q.defer();\r\n defer.resolve(false);\r\n return defer.promise;\r\n });\r\n }\r\n\r\n public getYearEndStatus = (): ng.IPromise => {\r\n var url = 'api/Planner/GetYearEndStatus';\r\n\r\n return this.$http.get(url, {\r\n cache: true\r\n }).then((response: any) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n public updatePackStatus = (): ng.IPromise => {\r\n var url = 'api/SelfAssessment/UpdatePackStatus';\r\n\r\n return this.$http.post(url, {\r\n status: 2\r\n }).then((response: any) => {\r\n this.closeTask(this.selectedAction).then(() => {\r\n var cache = this.$cacheFactory.get('$http');\r\n cache.remove('api/Planner/GetTasks');\r\n this.getAndParseTasks().then(() => {\r\n this.updateCurrentTaskAndAction();\r\n });\r\n });\r\n return response.data;\r\n });\r\n }\r\n\r\n public getTaxPackStatus = (): ng.IPromise => {\r\n var url = 'api/SelfAssessment/GetTaxPackStatus';\r\n\r\n return this.$http.get(url, {\r\n cache: false\r\n }).then((response: any) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n public getUtrNumber = (): ng.IPromise => {\r\n var url = 'api/SelfAssessment/GetUtrNumber';\r\n\r\n return this.$http.get(url, {\r\n cache: false\r\n }).then((response: any) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n public previewDocument = (document: any) => {\r\n this.brooksonPdfModal.view(document.documentId, document.path, this.previewCallback);\r\n }\r\n\r\n public previewCallback = (id, path) => {\r\n return this.documentStorageSrv.getSelectedPDF(id, path).then(data => data);\r\n }\r\n\r\n /**\r\n * Returns whether the user is viewing on a small device\r\n */\r\n public isMobile = (): boolean => this.screenSize.is('xs', 'sm');\r\n\r\n /**\r\n * Closes a task by adding an entry into the database based on the task action number.\r\n * \r\n * \r\n * @memberOf TaskPlannerSrv\r\n */\r\n public closeTask = (taskAction: Shared.TaskAction, silentMode?: boolean): ng.IPromise => {\r\n let actionWebTaskNo = taskAction.action_Web_Task_no;\r\n let actionNumber = taskAction.actionId;\r\n\r\n var actionNumbers = actionWebTaskNo + '|' + actionNumber;\r\n\r\n return this.$http.put('api/Planner/CloseTask/' + actionNumbers, {}, {\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n public getIsPayBeforeSubmit = (silentMode?: boolean): ng.IPromise => {\r\n var url = 'api/SelfAssessment/GetIsPayBeforeSubmit';\r\n return this.$http.get(url, { silentMode: silentMode ? silentMode : false\r\n }).then((response: any) => {\r\n return response.data;\r\n });\r\n }\r\n }\r\n\r\n\r\n}\r\nangular\r\n .module('app.shared')\r\n .service('taskPlannerSrv', Shared.TaskPlannerSrv);\r\n","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n\r\n /**\r\n * Model for local storage to identify whether notifications have been shown\r\n * \r\n * @export\r\n * @class NotificationsShown\r\n */\r\n export class NotificationsShown {\r\n /**\r\n * Have the task planner notifications been displayed to the user\r\n * \r\n * @type {boolean}\r\n * @memberOf NotificationsShown\r\n */\r\n taskPlannerNotifications: boolean;\r\n /**\r\n * Has the unallocated transaction notifcation been displayed to the user\r\n * \r\n * @type {boolean}\r\n * @memberOf NotificationsShown\r\n */\r\n unallocatedTransactions: boolean;\r\n }\r\n\r\n /**\r\n * A model of all the notifications / smart tiles when getNotifications is called \r\n * \r\n * @export\r\n * @class Notifications\r\n */\r\n export class Notifications {\r\n /**\r\n * Creates an instance of Notifications.\r\n * \r\n * @param {Array} notifications\r\n * @param {Array} tiles\r\n * @param {Array} planner\r\n * @param {Array} banners \r\n * \r\n * @memberOf Notifications\r\n */\r\n constructor(public notifications: Array, public tiles: Array, public planner: Array, public banners: Array) { }\r\n }\r\n\r\n /**\r\n * Interface for the brookson notification manager\r\n * \r\n * @export\r\n * @interface IBrooksonNotificationManager\r\n */\r\n export interface IBrooksonNotificationManager {\r\n /**\r\n * Property to store the notifications\r\n * \r\n * @type {Notifications}\r\n * @memberOf IBrooksonNotificationManager\r\n */\r\n notifications: Notifications;\r\n /**\r\n * Gets a model of all the notifications \r\n * \r\n * @returns {ng.IPromise}\r\n * \r\n * @memberOf IBrooksonNotificationManager\r\n */\r\n getNotifications(): ng.IPromise;\r\n /**\r\n * Returns any task planner notifications\r\n * \r\n * @returns {ng.IPromise>}\r\n * \r\n * @memberOf IBrooksonNotificationManager\r\n */\r\n getTaskPlannerNotifications(): ng.IPromise>;\r\n /**\r\n * Returns if there are an unallocated transactions\r\n * \r\n * @returns {ng.IPromise}\r\n * \r\n * @memberOf IBrooksonNotificationManager\r\n */\r\n getUnallocatedTransactions(): ng.IPromise;\r\n /**\r\n * Dismisses a smart tile\r\n * \r\n * @param {Notification} smartTile\r\n * \r\n * @memberOf IBrooksonNotificationManager\r\n */\r\n closeSmartTile(smartTile: Notification): void;\r\n /**\r\n * Closes all of the alerts\r\n * \r\n * \r\n * @memberOf IBrooksonNotificationManager\r\n */\r\n closeAlerts(): void;\r\n /**\r\n * Go to a Task in Task Planner \r\n * \r\n * @param {TaskAction} task\r\n * \r\n * @memberOf IBrooksonNotificationManager\r\n */\r\n goToTask(task: TaskAction): void;\r\n /**\r\n * Reset the local storage value to state that the user has not viewed the notifications\r\n * \r\n * \r\n * @memberOf IBrooksonNotificationManager\r\n */\r\n clearNotificationsShown(): void;\r\n }\r\n\r\n\r\n /**\r\n * A notification manager to help maintain the notifications and smart tiles\r\n * \r\n * @export\r\n * @class BrooksonNotificationManager\r\n * @implements {IBrooksonNotificationManager}\r\n */\r\n export class BrooksonNotificationManager implements IBrooksonNotificationManager {\r\n /**\r\n * The local storage key for storing whether a user has seen notifications\r\n * \r\n * @static\r\n * @type {string}\r\n * @memberOf BrooksonNotificationManager\r\n */\r\n static LOCAL_STORAGE_KEY: string = 'brookson.notifications';\r\n /**\r\n * The local storage key for whether they have seen the task planner notifications\r\n * \r\n * @static\r\n * @type {string}\r\n * @memberOf BrooksonNotificationManager\r\n */\r\n static TASK_PLANNER_NOTIFICATION_KEY: string = 'taskPlannerNotifications';\r\n /**\r\n * The local storage key for whether they have seen the unallocated transactions notifications\r\n * \r\n * @static\r\n * @type {string}\r\n * @memberOf BrooksonNotificationManager\r\n */\r\n static UNALLOCATED_TRANSACTIONS_KEY: string = 'unallocatedTransactions';\r\n /**\r\n * The local storage key for whether the user has dismissed all of the alerts \r\n * \r\n * @static\r\n * @type {string}\r\n * @memberOf BrooksonNotificationManager\r\n */\r\n static UNALLOCATED_TRANSACTIONS_CLEAR_KEY: string = 'unallocatedTransactionsClear';\r\n\r\n /**\r\n * Property that stores whether a type of notification has been shown\r\n * \r\n * @private\r\n * @type {NotificationsShown}\r\n * @memberOf BrooksonNotificationManager\r\n */\r\n private notificationsShown: NotificationsShown = {\r\n taskPlannerNotifications: false,\r\n unallocatedTransactions: false\r\n };\r\n\r\n /**\r\n * A model of all notifications \r\n * \r\n * @type {Notifications}\r\n * @memberOf BrooksonNotificationManager\r\n */\r\n public notifications: Notifications;\r\n\r\n /**\r\n * Angular Dependency Injection\r\n * \r\n * @static\r\n * \r\n * @memberOf BrooksonNotificationManager\r\n */\r\n static $inject = ['$q', '$window', 'notificationSrv', 'taskPlannerSrv', 'moneyManagerSrv', 'brookson.utilities.date', 'growl', 'taskPlanner.enums', 'bankLink.enums', 'localStorageService', 'brookson.navigation', 'screenSize', 'calendlySrv', 'brookson.utilities.date'];\r\n\r\n /**\r\n * Creates an instance of BrooksonNotificationManager.\r\n * \r\n * @param {ng.IQService} $q\r\n * @param {ng.IWindowService} $window\r\n * @param {INotificationService} notificationSrv\r\n * @param {ITaskPlannerSrv} taskPlannerSrv\r\n * @param {*} moneyManagerSrv\r\n * @param {IBrooksonUtilitiesDate} brooksonUtilitiesDate\r\n * @param {ng.growl.IGrowlService} growl\r\n * @param {ITaskPlannerEnums} taskPlannerEnums\r\n * @param {IBankLinkEnums} bankLinkEnums\r\n * @param {ng.local.storage.ILocalStorageService} localStorageService\r\n * @param {IBrooksonNavigation} brooksonNavigation\r\n * @param {*} screenSize\r\n * \r\n * @memberOf BrooksonNotificationManager\r\n */\r\n constructor(\r\n private $q: ng.IQService,\r\n private $window: ng.IWindowService,\r\n private notificationSrv: INotificationService,\r\n private taskPlannerSrv: ITaskPlannerSrv,\r\n private moneyManagerSrv: any,\r\n private brooksonUtilitiesDate: IBrooksonUtilitiesDate,\r\n private growl: ng.growl.IGrowlService,\r\n private taskPlannerEnums: ITaskPlannerEnums,\r\n private bankLinkEnums: IBankLinkEnums,\r\n private localStorageService: ng.local.storage.ILocalStorageService,\r\n private brooksonNavigation: IBrooksonNavigation,\r\n private screenSize: any,\r\n private calendlyService: Shared.ICalendlyService,\r\n private dateUtils: IBrooksonUtilitiesDate) { }\r\n\r\n /**\r\n * Gets a model of all the notifications\r\n * \r\n * @returns {ng.IPromise}\r\n * \r\n * @memberOf BrooksonNotificationManager\r\n */\r\n public getNotifications = (): ng.IPromise => {\r\n return this.$q.all([this.getTaskPlannerNotifications(), this.getSmartNotifications(), this.getUnallocatedTransactions()]).then(data => {\r\n var planner = >data[0];\r\n var smartNotifications = data[1];\r\n var unallocatedTransactionNotification = data[2];\r\n\r\n planner.forEach(task => {\r\n task.camelCase = _.camelCase(task.taskTitle);\r\n return task;\r\n });\r\n\r\n var notifications: Array = [];\r\n notifications = _.concat(notifications, smartNotifications.alertNotifications);\r\n\r\n if (unallocatedTransactionNotification) notifications.push(unallocatedTransactionNotification);\r\n\r\n this.calendlyService.getCalendlyFinancialHealthCheckBooking().then((financialHealthCheckCalendlyBooking: Shared.MicroCalendlyBooking): void => {\r\n if (financialHealthCheckCalendlyBooking) {\r\n var endDate = this.dateUtils.convertToJsDate(financialHealthCheckCalendlyBooking.endDate);\r\n var minimumPreviousDate = new Date();\r\n minimumPreviousDate.setDate(minimumPreviousDate.getDate() - 30);\r\n \r\n if (!(endDate <= minimumPreviousDate)) {\r\n smartNotifications.actionTileNotifications = smartNotifications.actionTileNotifications.filter(f => f.action !== \"FinancialHealthCheck\");\r\n }\r\n }\r\n var tiles: Array = [];\r\n tiles = _.concat(tiles, smartNotifications.actionTileNotifications);\r\n tiles = _.concat(tiles, smartNotifications.smartTileNotifications);\r\n\r\n\r\n var result = new Notifications(notifications, tiles, planner, smartNotifications.bannersNotifications);\r\n\r\n this.notifications = result;\r\n });\r\n\r\n return this.notifications;\r\n\r\n });\r\n }\r\n\r\n /**\r\n * Returns any task planner notifications\r\n * \r\n * @returns {ng.IPromise>}\r\n * \r\n * @memberOf BrooksonNotificationManager\r\n */\r\n public getTaskPlannerNotifications = (): ng.IPromise> => {\r\n return this.taskPlannerSrv.getTasksToBeDisplayed(true).then(data => {\r\n if (!this.getNotificationKey(BrooksonNotificationManager.TASK_PLANNER_NOTIFICATION_KEY)) {\r\n var taskActions = data;\r\n\r\n _.filter(taskActions, (taskAction) => {\r\n return taskAction.responsibility === this.taskPlannerEnums.TaskResponsibility.ME;\r\n });\r\n\r\n var overDueTaskActions = _.filter(taskActions, (taskAction) => taskAction.status === this.taskPlannerEnums.TaskStatus.OVERDUE);\r\n var upcomingTaskActions = _.filter(taskActions, (taskAction) => taskAction.status !== this.taskPlannerEnums.TaskStatus.OVERDUE);\r\n\r\n /**\r\n * If there is more than 1 upcoming task action to be completed, only display\r\n * one notification so we don't clutter the dashboard \r\n * */\r\n if (upcomingTaskActions.length === 1) {\r\n _.forEach(upcomingTaskActions, taskAction => {\r\n if (!this.screenSize.is('xs, sm')) {\r\n this.growl.warning(taskAction.actionTitle + \" is upcoming \" + moment(taskAction.dueDate).format(\"DD/MM/YYYY\") + \"\", {\r\n title: \"Task Planner\",\r\n ttl: 5000,\r\n disableCountDown: true,\r\n variables: {\r\n onClick: () => {\r\n this.goToTask(taskAction);\r\n }\r\n }\r\n });\r\n }\r\n });\r\n } else if (upcomingTaskActions.length > 1) {\r\n this.growl.warning(`You have tasks that are upcoming.`, {\r\n title: \"Task Planner\",\r\n ttl: 5000,\r\n disableCountDown: true,\r\n variables: {\r\n onClick: () => {\r\n this.goToTaskPlanner();\r\n }\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * If there is more than 1 overdue task action to be completed, only display\r\n * one notification so we don't clutter the dashboard \r\n * */\r\n if (overDueTaskActions.length === 1) {\r\n _.forEach(overDueTaskActions, taskAction => {\r\n\r\n if (!this.screenSize.is('xs, sm')) {\r\n this.growl.error(taskAction.actionTitle + \" is overdue \" + moment(taskAction.dueDate).format(\"DD/MM/YYYY\") + \"\", {\r\n title: \"Task Planner\",\r\n ttl: -1,\r\n disableCountDown: true,\r\n variables: {\r\n onClick: () => {\r\n this.goToTask(taskAction);\r\n }\r\n }\r\n });\r\n }\r\n\r\n });\r\n } else if (overDueTaskActions.length > 1) {\r\n this.growl.error(`You have tasks that are overdue.`, {\r\n title: \"Task Planner\",\r\n ttl: -1,\r\n disableCountDown: true,\r\n variables: {\r\n onClick: () => {\r\n this.goToTaskPlanner();\r\n }\r\n }\r\n });\r\n }\r\n\r\n this.setNotificationKey(BrooksonNotificationManager.TASK_PLANNER_NOTIFICATION_KEY);\r\n }\r\n\r\n return data;\r\n });\r\n }\r\n\r\n /**\r\n * Go to a Task in Task Planner \r\n * \r\n * @param {TaskAction} task\r\n * \r\n * @memberOf IBrooksonNotificationManager\r\n */\r\n public goToTask = (task: TaskAction): void => {\r\n this.brooksonNavigation.taskPlanner.selectedActionTask('todo', task.actionId);\r\n }\r\n\r\n /**\r\n * \r\n * \r\n * \r\n * @memberOf BrooksonNotificationManager\r\n */\r\n public getUnallocatedTransactions = (): ng.IPromise => {\r\n if (this.getNotificationKey(BrooksonNotificationManager.UNALLOCATED_TRANSACTIONS_CLEAR_KEY)) {\r\n var deferred = this.$q.defer();\r\n deferred.resolve();\r\n return deferred.promise;\r\n }\r\n\r\n return this.moneyManagerSrv.getTransactions('', true).then((data) => {\r\n let result: Notification = null;\r\n if (data == null) {\r\n return result;\r\n }\r\n var transactions = data.transactions;\r\n\r\n\r\n var transactionsToAllocate = _.filter(transactions, {\r\n transactionType: this.bankLinkEnums.TransactionType.UNALLOCATED\r\n }).length;\r\n\r\n\r\n\r\n if (transactionsToAllocate > 0) {\r\n\r\n if (!this.getNotificationKey(BrooksonNotificationManager.UNALLOCATED_TRANSACTIONS_KEY)) {\r\n this.growl.warning(`You have ${transactionsToAllocate} unallocated transaction${transactionsToAllocate === 1 ? '' : 's'}`, {\r\n title: \"Bank\",\r\n ttl: 5000,\r\n disableCountDown: true,\r\n variables: {\r\n /**\r\n * \r\n */\r\n onClick: () => {\r\n this.brooksonNavigation.bankLink.main();\r\n }\r\n }\r\n });\r\n\r\n }\r\n\r\n result = {\r\n title: 'Bank',\r\n metaDescription: `${transactionsToAllocate} unallocated transaction${transactionsToAllocate === 1 ? '' : 's'}`,\r\n colour: 'yellow',\r\n symbol: 'money'\r\n };\r\n\r\n result.onClick = () => this.brooksonNavigation.expenses.business();\r\n }\r\n\r\n this.notificationsShown.unallocatedTransactions = true;\r\n\r\n this.setNotificationKey(BrooksonNotificationManager.UNALLOCATED_TRANSACTIONS_KEY);\r\n\r\n return result;\r\n });\r\n }\r\n\r\n /**\r\n * Dismisses a smart tile\r\n * \r\n * @param {Notification} smartTile\r\n * \r\n * @memberOf IBrooksonNotificationManager\r\n */\r\n public closeSmartTile = (smartTile: Notification): void => {\r\n _.pull(this.notifications.tiles, smartTile);\r\n this.notificationSrv.closeNotification(smartTile);\r\n }\r\n\r\n /**\r\n * Closes all of the alerts\r\n * \r\n * \r\n * @memberOf IBrooksonNotificationManager\r\n */\r\n public closeAlerts = (): void => {\r\n _.forEach(this.notifications.notifications, (alert) => {\r\n if (alert.id) this.notificationSrv.closeNotification(alert);\r\n });\r\n\r\n this.notifications.notifications.length = 0;\r\n this.setNotificationKey(BrooksonNotificationManager.UNALLOCATED_TRANSACTIONS_CLEAR_KEY);\r\n }\r\n\r\n /**\r\n * Reset the local storage value to state that the user has not viewed the notifications\r\n * \r\n * \r\n * @memberOf IBrooksonNotificationManager\r\n */\r\n public clearNotificationsShown = (): void => {\r\n this.localStorageService.set(BrooksonNotificationManager.LOCAL_STORAGE_KEY, {});\r\n }\r\n\r\n /**\r\n * Returns a list of all the smart notifications to be displayed \r\n * \r\n * @private\r\n * @returns {ng.IPromise}\r\n * \r\n * @memberOf BrooksonNotificationManager\r\n */\r\n private getSmartNotifications = (): ng.IPromise => {\r\n return this.notificationSrv.getNotifications(true).then(data => data);\r\n }\r\n\r\n /**\r\n * Returns a value from notificaiton local storage container and returns the property\r\n * \r\n * @private\r\n * @param {string} notification\r\n * @returns\r\n * \r\n * @memberOf BrooksonNotificationManager\r\n */\r\n private getNotificationKey = (notification: string): Notification => {\r\n var data = this.localStorageService.get(BrooksonNotificationManager.LOCAL_STORAGE_KEY);\r\n\r\n this.notificationsShown = data === null ? {} : data;\r\n\r\n return this.notificationsShown[notification];\r\n }\r\n\r\n /**\r\n * Sets that a certain type of notification has been displayed to the user by setting it in local storage\r\n * \r\n * @private\r\n * \r\n * @memberOf BrooksonNotificationManager\r\n */\r\n private setNotificationKey = (notification: string) => {\r\n this.notificationsShown[notification] = true;\r\n this.localStorageService.set(BrooksonNotificationManager.LOCAL_STORAGE_KEY, this.notificationsShown);\r\n }\r\n\r\n /**\r\n * Redirects the user to Task Planner\r\n * \r\n * \r\n * @memberOf BrooksonNotificationManager\r\n */\r\n private goToTaskPlanner = (): void => {\r\n this.brooksonNavigation.taskPlanner.main();\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .service('brookson.notifications.manager', Shared.BrooksonNotificationManager);\r\n","\r\nmodule EmploymentStatus {\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n\r\n export class AssignmentHeader {\r\n\r\n public diff: number = null;\r\n // AGENCY\r\n public agency: string = null;\r\n // DATESTARTED\r\n public dateStarted: Date = null;\r\n // DATEENDED\r\n public dateEnded: Date = null;\r\n // ASSIGNMENTID\r\n public assignmentId: string = null;\r\n // CLIENT\r\n public client: string = null;\r\n // ASSIGNMENTNAME\r\n public assignmentName: string = null;\r\n // INSTRUCTIONTEXT\r\n public instructionText: string = null;\r\n // OVERALLSTATUSTEXT\r\n public overallStatusText: string = null;\r\n // ASSIGNMENTADDRESS\r\n public assignmentAddress: string = null;\r\n // ASSIGNMENTNOTES\r\n public assignmentNotes: string = null;\r\n // CUSTOMER\r\n public customer: string = null;\r\n // AGENCYREFERENCE\r\n public agencyReference: string = null;\r\n // STATUSSTYLE\r\n public ir35Status: IR35Status = null;\r\n }\r\n\r\n export class IR35Status {\r\n text:string;\r\n style: string;\r\n }\r\n}\r\n","module Shared {\r\n export enum IR35DetailCaptureButtonPressed {\r\n public = 0,\r\n private = 1,\r\n both = 2\r\n }\r\n}","/// \r\n\r\n/*! Angular-PDF Version: 1.2.4 | Released under an MIT license */\r\n((PDFJS) => {\r\n\r\n 'use strict';\r\n\r\n angular.module('app.shared').directive('ngPdf', ['$window', ($window) => {\r\n var renderTask = null;\r\n var pdfLoaderTask = null;\r\n\r\n var backingScale = (canvas) => {\r\n var ctx = canvas.getContext('2d');\r\n var dpr = window.devicePixelRatio || 1;\r\n var bsr = ctx.webkitBackingStorePixelRatio ||\r\n ctx.mozBackingStorePixelRatio ||\r\n ctx.msBackingStorePixelRatio ||\r\n ctx.oBackingStorePixelRatio ||\r\n ctx.backingStorePixelRatio || 1;\r\n\r\n return dpr / bsr;\r\n };\r\n\r\n var setCanvasDimensions = (canvas, w, h) => {\r\n var ratio = backingScale(canvas);\r\n canvas.width = Math.floor(w * ratio);\r\n canvas.height = Math.floor(h * ratio);\r\n canvas.style.width = Math.floor(w) + 'px';\r\n canvas.style.height = Math.floor(h) + 'px';\r\n canvas.getContext('2d').setTransform(ratio, 0, 0, ratio, 0, 0);\r\n return canvas;\r\n };\r\n\r\n var controller = ['$scope', '$attrs', ($scope, $attrs) => {\r\n var vm = this;\r\n vm.pdfId = $attrs.pdfid;\r\n vm.pdfpath = $attrs.pdfpath;\r\n\r\n activate();\r\n\r\n ////////////////\r\n function activate() {\r\n $scope.callback(vm.pdfId, vm.pdfpath).then((result) => {\r\n $scope.pdfUrl = result;\r\n });\r\n }\r\n }];\r\n\r\n return {\r\n restrict: 'E',\r\n templateUrl: (element, attr) => {\r\n return attr.templateUrl ? attr.templateUrl : 'partials/viewer.html';\r\n },\r\n controller: controller,\r\n\r\n\r\n link: (scope, element, attrs) => {\r\n var url = scope.pdfUrl;\r\n var pdfDoc = null;\r\n var pageNum = (attrs.page ? attrs.page : 1);\r\n var scale = attrs.scale > 0 ? attrs.scale : 1;\r\n var canvas;\r\n\r\n if (attrs) {\r\n canvas = document.getElementById(attrs.canvasid);\r\n } else {\r\n canvas = document.getElementById('pdf-canvas');\r\n }\r\n\r\n\r\n var ctx = canvas.getContext('2d');\r\n var windowEl = angular.element($window);\r\n\r\n windowEl.on('scroll', () => {\r\n scope.$apply(() => {\r\n scope.scroll = windowEl[0].scrollY;\r\n });\r\n });\r\n\r\n PDFJS.disableWorker = false;\r\n\r\n\r\n scope.pageNum = pageNum;\r\n\r\n scope.renderPage = (num) => {\r\n if (renderTask) {\r\n renderTask._internalRenderTask.cancel();\r\n }\r\n\r\n pdfDoc.getPage(num).then((page) => {\r\n var viewport;\r\n var pageWidthScale;\r\n var pageHeightScale;\r\n var renderContext;\r\n\r\n if (attrs.scale === 'page-fit' && !scale) {\r\n viewport = page.getViewport(1);\r\n pageWidthScale = element[0].clientWidth / viewport.width;\r\n pageHeightScale = element[0].clientHeight / viewport.height;\r\n scale = Math.min(pageWidthScale, pageHeightScale);\r\n } else {\r\n viewport = page.getViewport(scale);\r\n }\r\n\r\n setCanvasDimensions(canvas, viewport.width, viewport.height);\r\n\r\n renderContext = {\r\n canvasContext: ctx,\r\n viewport: viewport\r\n };\r\n\r\n renderTask = page.render(renderContext);\r\n renderTask.promise.then(() => {\r\n if (typeof scope.onPageRender === 'function') {\r\n scope.onPageRender();\r\n }\r\n });\r\n });\r\n };\r\n\r\n scope.goPrevious = () => {\r\n if (scope.pageToDisplay <= 1) {\r\n return;\r\n }\r\n scope.pageToDisplay = parseInt(scope.pageToDisplay) - 1;\r\n scope.pageNum = scope.pageToDisplay;\r\n };\r\n\r\n scope.goNext = () => {\r\n if (scope.pageToDisplay >= pdfDoc.numPages) {\r\n return;\r\n }\r\n scope.pageToDisplay = parseInt(scope.pageToDisplay) + 1;\r\n scope.pageNum = scope.pageToDisplay;\r\n };\r\n\r\n scope.zoomIn = () => {\r\n scale = parseFloat(scale) + 0.2;\r\n scope.renderPage(scope.pageToDisplay);\r\n return scale;\r\n };\r\n\r\n scope.zoomOut = () => {\r\n scale = parseFloat(scale) - 0.2;\r\n scope.renderPage(scope.pageToDisplay);\r\n return scale;\r\n };\r\n\r\n scope.changePage = () => {\r\n scope.renderPage(scope.pageToDisplay);\r\n };\r\n\r\n scope.rotate = () => {\r\n if (canvas.getAttribute('class') === 'rotate0') {\r\n canvas.setAttribute('class', 'rotate90');\r\n } else if (canvas.getAttribute('class') === 'rotate90') {\r\n canvas.setAttribute('class', 'rotate180');\r\n } else if (canvas.getAttribute('class') === 'rotate180') {\r\n canvas.setAttribute('class', 'rotate270');\r\n } else {\r\n canvas.setAttribute('class', 'rotate0');\r\n }\r\n };\r\n\r\n function clearCanvas() {\r\n if (ctx) {\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n }\r\n }\r\n\r\n function renderPDF() {\r\n clearCanvas();\r\n\r\n if (url) {\r\n pdfLoaderTask = PDFJS.getDocument(url, null, null, scope.onProgress);\r\n pdfLoaderTask.then(\r\n (_pdfDoc) => {\r\n if (typeof scope.onLoad === 'function') {\r\n scope.onLoad();\r\n }\r\n\r\n pdfDoc = _pdfDoc;\r\n scope.renderPage(scope.pageToDisplay);\r\n\r\n scope.$apply(() => {\r\n scope.pageCount = _pdfDoc.numPages;\r\n });\r\n }, (error) => {\r\n if (error) {\r\n if (typeof scope.onError === 'function') {\r\n scope.onError(error);\r\n }\r\n }\r\n }\r\n );\r\n }\r\n }\r\n\r\n scope.$watch('pageNum', (newVal) => {\r\n scope.pageToDisplay = parseInt(newVal);\r\n if (pdfDoc !== null) {\r\n scope.renderPage(scope.pageToDisplay);\r\n }\r\n });\r\n\r\n scope.$watch('pdfUrl', (newVal) => {\r\n if (newVal !== '') {\r\n url = newVal;\r\n scope.pageToDisplay = 1;\r\n if (pdfLoaderTask) {\r\n pdfLoaderTask.destroy().then(() => {\r\n renderPDF();\r\n });\r\n } else {\r\n renderPDF();\r\n }\r\n }\r\n });\r\n\r\n }\r\n };\r\n }]);\r\n})(window.PDFJS);\r\n","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n var app = angular.module('app.shared');\r\n\r\n\r\n app.factory('brookson.pdf.modal', brooksonPdfModal);\r\n\r\n brooksonPdfModal.$inject = ['$uibModal'];\r\n function brooksonPdfModal($uibModal) {\r\n\r\n var service = {\r\n view: view\r\n };\r\n\r\n return service;\r\n ////////////////\r\n function view(id, path, callback) {\r\n\r\n $uibModal.open({\r\n animation: true,\r\n controller: 'brooksonPdfModalCtrl',\r\n templateUrl: 'src/app/shared/views/modals/brookson.modals.pdf-modal.html',\r\n size: \"lg\",\r\n resolve: {\r\n callback: () => {\r\n return callback;\r\n },\r\n documentID: () => {\r\n return id;\r\n },\r\n documentPath: () => {\r\n return path;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n app.controller('brooksonPdfModalCtrl', ['$scope', '$uibModalInstance', 'callback', 'documentID', 'documentPath', 'documentStorageSrv', 'FileSaver',\r\n ($scope, $uibModalInstance, callback, documentID, documentPath, documentStorageSrv, FileSaver) => {\r\n $scope.callback = callback;\r\n $scope.documentID = documentID;\r\n\r\n $scope.documentPath = documentPath;\r\n\r\n\r\n $scope.downloadPDF = () => {\r\n documentStorageSrv.getSelectedPDF(documentID, documentPath).then((data) => {\r\n var blobObject = new Blob([data], { type: 'application/pdf' });\r\n \r\n FileSaver.saveAs(blobObject, documentPath += \".pdf\");\r\n });\r\n };\r\n\r\n $scope.cancel = () => {\r\n $uibModalInstance.dismiss('cancel');\r\n };\r\n }]);\r\n})();\r\n","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n var app = angular.module('app.shared');\r\n\r\n app.factory('brookson.ui.image-preview.modal', [\"$q\", \"$uibModal\", ($q, $uibModal) => {\r\n var options: any = {\r\n animation: true,\r\n size: \"lg\",\r\n templateUrl: \"src/app/shared/views/ui/brookson.ui.image-preview.modal.html\"\r\n };\r\n\r\n var _showImagePreviewModal = (imageData) => {\r\n var defer = $q.defer();\r\n var confirmationOptions = options;\r\n\r\n confirmationOptions.controller = ['$scope', '$uibModalInstance', ($scope, $uibModalInstance) => {\r\n $scope.imageData = imageData;\r\n\r\n $scope.close = () => {\r\n $uibModalInstance.close();\r\n defer.resolve();\r\n };\r\n }];\r\n\r\n $uibModal.open(confirmationOptions);\r\n\r\n return defer.promise;\r\n };\r\n\r\n return {\r\n showImagePreviewModal: _showImagePreviewModal\r\n };\r\n }]);\r\n})();\r\n","/// \r\n\r\nmodule Shared {\r\n export interface IBrooksonUiPopup {\r\n showConfirmationPopup(title: string, message: string, acceptText?: string, closeText?: string): ng.IPromise;\r\n showTemplatedConfirmationPopup(title: string, templateUrl: string, model: any, acceptText?: string, closeText?: string, popupSize?: string): ng.IPromise;\r\n showYesNoPopup(title: string, message: string): ng.IPromise;\r\n showInfoPopup(title: string, message: string): ng.IPromise;\r\n showTemplatedInfoPopup(title: string, templateUrl: string): ng.IPromise;\r\n showTemplatedHelpPopup(title: string, templateUrl: string): ng.IPromise;\r\n showErrorPopup(message: string, errorRef: string): ng.IPromise;\r\n showAcceptPopup(title: string, message: string, acceptText: string, size?: string): ng.IPromise;\r\n showSaveAs(title: string, message: string): ng.IPromise;\r\n }\r\n}\r\n\r\n(() => {\r\n \"use strict\";\r\n\r\n var app = angular.module(\"app.shared\");\r\n\r\n app.factory(\"brookson.ui.popup\", [\r\n \"$q\", \"$uibModal\", \"$sce\", \"$sanitize\", ($q, $uibModal, $sce, $sanitize) => {\r\n var options: any = {\r\n animation: true,\r\n size: \"sm\",\r\n templateUrl: \"src/app/shared/views/ui/brookson.ui.popup.html\"\r\n };\r\n var _showConfirmationPopup = (title, message, acceptText, closeText) => {\r\n var defer = $q.defer();\r\n var confirmationOptions = options;\r\n\r\n confirmationOptions.controller = ['$scope', '$uibModalInstance', '$rootScope', ($scope, $uibModalInstance, $rootScope) => {\r\n $scope.title = title;\r\n $scope.message = $sanitize($sce.trustAsHtml(message));\r\n\r\n if (acceptText) {\r\n $scope.acceptButtonText = acceptText;\r\n } else {\r\n $scope.acceptButtonText = \"Ok\";\r\n }\r\n\r\n if (closeText) {\r\n $scope.closeButtonText = closeText;\r\n } else {\r\n $scope.closeButtonText = \"Cancel\";\r\n }\r\n\r\n $scope.ok = () => {\r\n $uibModalInstance.close();\r\n defer.resolve();\r\n };\r\n\r\n $scope.cancel = () => {\r\n $uibModalInstance.dismiss();\r\n $rootScope.$broadcast('UserCancelledConfirmationPopup', { userClickedCancelledButton: true });\r\n defer.reject();\r\n };\r\n }];\r\n $uibModal.open(confirmationOptions);\r\n\r\n return defer.promise;\r\n };\r\n\r\n var _showTemplatedConfirmationPopup = (title, messageTemplateUrl, model, acceptText, closeText, popupSize) => {\r\n var defer = $q.defer();\r\n popupSize = popupSize || \"sm\";\r\n\r\n var infoOptions: any = {\r\n animation: true,\r\n size: popupSize,\r\n windowClass: \"templated-confirmation-popup\",\r\n templateUrl: \"src/app/shared/views/ui/brookson.ui.templated-confirmation-popup.html\"\r\n };\r\n\r\n infoOptions.controller = ['$scope', '$uibModalInstance', 'memberSrv', ($scope, $uibModalInstance, memberSrv) => {\r\n $scope.title = title;\r\n $scope.messageTemplateUrl = messageTemplateUrl;\r\n $scope.model = model;\r\n $scope.businessType = memberSrv.member.businessType;\r\n \r\n if (acceptText) {\r\n $scope.acceptButtonText = acceptText;\r\n } else {\r\n $scope.acceptButtonText = \"Ok\";\r\n }\r\n\r\n if (closeText) {\r\n $scope.closeButtonText = closeText;\r\n } else {\r\n $scope.closeButtonText = \"Cancel\";\r\n }\r\n\r\n $scope.ok = () => {\r\n $uibModalInstance.close();\r\n defer.resolve();\r\n };\r\n\r\n $scope.cancel = () => {\r\n $uibModalInstance.dismiss();\r\n defer.reject();\r\n };\r\n }];\r\n $uibModal.open(infoOptions);\r\n\r\n return defer.promise;\r\n };\r\n\r\n var _showSaveAs = (title, message, acceptText, closeText) => {\r\n var defer = $q.defer();\r\n\r\n options.templateUrl = \"src/app/shared/views/ui/brookson.ui.popup.input.html\";\r\n options.size = \"md\";\r\n var confirmationOptions = options;\r\n\r\n confirmationOptions.controller = ['$scope', '$uibModalInstance', ($scope, $uibModalInstance) => {\r\n $scope.title = title;\r\n $scope.message = $sanitize($sce.trustAsHtml(message));\r\n $scope.result = \"\";\r\n\r\n if (acceptText) {\r\n $scope.acceptButtonText = acceptText;\r\n } else {\r\n $scope.acceptButtonText = \"Ok\";\r\n }\r\n\r\n if (closeText) {\r\n $scope.closeButtonText = closeText;\r\n } else {\r\n $scope.closeButtonText = \"Cancel\";\r\n }\r\n\r\n $scope.ok = () => {\r\n $uibModalInstance.close();\r\n defer.resolve($scope.result);\r\n };\r\n\r\n $scope.cancel = () => {\r\n $uibModalInstance.dismiss();\r\n defer.reject();\r\n };\r\n }];\r\n $uibModal.open(confirmationOptions);\r\n\r\n return defer.promise;\r\n };\r\n\r\n\r\n var _showYesNoPopup = (title, message) => {\r\n var defer = $q.defer();\r\n var yesNoOptions = options;\r\n\r\n yesNoOptions.controller = ['$scope', '$uibModalInstance', ($scope, $uibModalInstance) => {\r\n $scope.title = title;\r\n $scope.message = $sanitize($sce.trustAsHtml(message));\r\n $scope.acceptButtonText = \"Yes\";\r\n $scope.closeButtonText = \"No\";\r\n\r\n $scope.ok = () => {\r\n $uibModalInstance.close();\r\n defer.resolve();\r\n };\r\n\r\n $scope.cancel = () => {\r\n $uibModalInstance.dismiss();\r\n defer.reject();\r\n };\r\n }];\r\n\r\n $uibModal.open(yesNoOptions);\r\n\r\n return defer.promise;\r\n };\r\n var _showInfoPopup = (title, message) => {\r\n var defer = $q.defer();\r\n var infoOptions = options;\r\n\r\n infoOptions.controller = ['$scope', '$uibModalInstance', ($scope, $uibModalInstance) => {\r\n $scope.title = title;\r\n $scope.message = $sanitize($sce.trustAsHtml(message));\r\n $scope.acceptButtonText = \"Ok\";\r\n\r\n $scope.ok = () => {\r\n $uibModalInstance.close();\r\n defer.resolve();\r\n };\r\n\r\n $scope.cancel = () => {\r\n $uibModalInstance.dismiss();\r\n defer.reject();\r\n };\r\n }];\r\n $uibModal.open(infoOptions);\r\n\r\n return defer.promise;\r\n };\r\n var _showTemplatedInfoPopup = (title, messageTemplateUrl) => {\r\n var defer = $q.defer();\r\n var infoOptions: any = {\r\n animation: true,\r\n size: \"sm\",\r\n windowClass: \"templated-info-popup\",\r\n templateUrl: \"src/app/shared/views/ui/brookson.ui.templated-info-popup.html\"\r\n };\r\n\r\n infoOptions.controller = ['$scope', '$uibModalInstance', ($scope, $uibModalInstance) => {\r\n $scope.title = title;\r\n $scope.messageTemplateUrl = messageTemplateUrl;\r\n $scope.acceptButtonText = \"Ok\";\r\n\r\n $scope.ok = () => {\r\n $uibModalInstance.close();\r\n defer.resolve();\r\n };\r\n\r\n $scope.cancel = () => {\r\n $uibModalInstance.dismiss();\r\n defer.reject();\r\n };\r\n }];\r\n $uibModal.open(infoOptions);\r\n\r\n return defer.promise;\r\n };\r\n var _showTemplatedHelpPopup = (title, messageTemplateUrl) => {\r\n var defer = $q.defer();\r\n var infoOptions: any = {\r\n animation: true,\r\n size: \"sm\",\r\n windowClass: \"templated-info-popup\",\r\n templateUrl: \"src/app/shared/views/ui/brookson.ui.templated-help-popup.html\"\r\n };\r\n\r\n infoOptions.controller = ['$scope', '$uibModalInstance', ($scope, $uibModalInstance) => {\r\n $scope.title = title;\r\n $scope.messageTemplateUrl = messageTemplateUrl;\r\n $scope.acceptButtonText = \"Ok\";\r\n\r\n $scope.ok = () => {\r\n $uibModalInstance.close();\r\n defer.resolve();\r\n };\r\n\r\n $scope.cancel = () => {\r\n $uibModalInstance.dismiss();\r\n defer.reject();\r\n };\r\n }];\r\n $uibModal.open(infoOptions);\r\n\r\n return defer.promise;\r\n };\r\n\r\n var _showErrorPopup = (message, errorRef) => {\r\n var defer = $q.defer();\r\n var errorOptions = options;\r\n\r\n errorOptions.controller = ['$scope', '$uibModalInstance', ($scope, $uibModalInstance) => {\r\n $scope.title = \"Sorry\";\r\n $scope.message = $sanitize($sce.trustAsHtml(message));\r\n $scope.acceptButtonText = \"Ok\";\r\n\r\n if (errorRef) {\r\n var errorMsg = \"(Ref: \" + errorRef + \")\";\r\n $scope.errorRef = $sce.trustAsHtml(errorMsg);\r\n }\r\n\r\n $scope.ok = () => {\r\n $uibModalInstance.close();\r\n defer.resolve();\r\n };\r\n\r\n $scope.cancel = () => {\r\n $uibModalInstance.dismiss();\r\n defer.reject();\r\n };\r\n }];\r\n\r\n $uibModal.open(errorOptions);\r\n\r\n return defer.promise;\r\n };\r\n var _showAcceptPopup = (title, message, acceptText, size) => {\r\n var defer = $q.defer();\r\n\r\n options.size = size ? size : 'sm';\r\n var acceptOptions = options;\r\n\r\n acceptOptions.controller = ['$scope', '$uibModalInstance', ($scope, $uibModalInstance) => {\r\n $scope.title = title;\r\n $scope.message = $sanitize($sce.trustAsHtml(message));\r\n\r\n if (acceptText) {\r\n $scope.acceptButtonText = acceptText;\r\n } else {\r\n $scope.acceptButtonText = \"Ok\";\r\n }\r\n\r\n $scope.ok = () => {\r\n $uibModalInstance.close();\r\n defer.resolve();\r\n };\r\n }];\r\n $uibModal.open(acceptOptions);\r\n\r\n return defer.promise;\r\n };\r\n return {\r\n showConfirmationPopup: _showConfirmationPopup,\r\n showTemplatedConfirmationPopup: _showTemplatedConfirmationPopup,\r\n showYesNoPopup: _showYesNoPopup,\r\n showInfoPopup: _showInfoPopup,\r\n showTemplatedInfoPopup: _showTemplatedInfoPopup,\r\n showTemplatedHelpPopup: _showTemplatedHelpPopup,\r\n showErrorPopup: _showErrorPopup,\r\n showAcceptPopup: _showAcceptPopup,\r\n showSaveAs: _showSaveAs\r\n };\r\n }\r\n ]);\r\n})();\r\n","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular\r\n .module('app.shared')\r\n .factory('brookson.ui.scroll-top', brooksonUiScrollTop);\r\n\r\n brooksonUiScrollTop.$inject = ['$window'];\r\n\r\n function brooksonUiScrollTop($window) {\r\n // Data\r\n var self = $window;\r\n\r\n // Methods\r\n var _currentYPosition = () => {\r\n if (self.pageYOffset)\r\n return self.pageYOffset;\r\n if ($window.document.documentElement && $window.document.documentElement.scrollTop)\r\n return $window.document.documentElement.scrollTop;\r\n if ($window.document.body.scrollTop)\r\n return $window.document.body.scrollTop;\r\n return 0;\r\n };\r\n\r\n var _smoothScroll = (setSpeed) => {\r\n var startY = _currentYPosition();\r\n var stopY = 0;\r\n var distance = stopY > startY ? stopY - startY : startY - stopY;\r\n if (distance < 100) {\r\n $window.scrollTo(0, stopY);\r\n return;\r\n }\r\n\r\n setSpeed = setSpeed ? setSpeed : 1500;\r\n\r\n var speed = Math.round(setSpeed / 100);\r\n var step = Math.round(distance / 25);\r\n var leapY = stopY > startY ? startY + step : startY - step;\r\n var timer = 0;\r\n if (stopY > startY) {\r\n for (var i = startY; i < stopY; i += step) {\r\n $window.setTimeout(\"window.scrollTo(0, \" + leapY + \")\", timer * speed);\r\n leapY += step;\r\n if (leapY > stopY) leapY = stopY;\r\n timer++;\r\n }\r\n return;\r\n }\r\n for (var j = startY; j > stopY; j -= step) {\r\n $window.setTimeout(\"window.scrollTo(0, \" + leapY + \")\", timer * speed);\r\n leapY -= step;\r\n if (leapY < stopY) leapY = stopY;\r\n timer++;\r\n }\r\n };\r\n\r\n var service = {\r\n currentYPosition: _currentYPosition,\r\n smoothScroll: _smoothScroll\r\n };\r\n\r\n return service;\r\n }\r\n})();\r\n","(() => {\r\n 'use strict';\r\n\r\n angular.module('app.shared')\r\n .directive('compile',\r\n [\r\n '$compile', ($compile) => {\r\n return (scope, element, attrs) => {\r\n scope.$watch(\r\n (scope) => {\r\n // watch the 'compile' expression for changes\r\n return scope.$eval(attrs.compile);\r\n },\r\n (value) => {\r\n // when the 'compile' expression changes\r\n // assign it into the current DOM\r\n element.html(value);\r\n\r\n // compile the new DOM and link it to the current\r\n // scope.\r\n // NOTE: we only compile .childNodes so that\r\n // we don't get into infinite loop compiling ourselves\r\n element.removeAttr(\"compile\");\r\n $compile(element)(scope);\r\n }\r\n );\r\n };\r\n }\r\n ]);\r\n})();","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular\r\n .module('app.shared')\r\n .service('authInterceptorSrv', authInterceptorSrv);\r\n\r\n authInterceptorSrv.$inject = ['$q', '$window', '$injector', 'memberSrv', 'authenticationSrv'];\r\n\r\n function authInterceptorSrv($q, $window, $injector, memberSrv, authenticationSrv) {\r\n\r\n var MAX_RETRY_COUNT = 3;\r\n var authInterceptorServiceFactory: any = {};\r\n var $http;\r\n var refreshingRequest = false;\r\n var requestQueue = [];\r\n\r\n var _request = (config) => {\r\n config.headers = config.headers || {};\r\n\r\n var authData = memberSrv.getMember();\r\n\r\n if (authData) {\r\n if (authData.isAuthenticated) {\r\n config.headers.Authorization = 'Bearer ' + authData.token;\r\n\r\n if ($window.brookson && $window.brookson.antiForgeryToken) {\r\n config.headers.__RequestVerificationToken = $window.brookson.antiForgeryToken || \"no request verification token\";\r\n }\r\n }\r\n }\r\n\r\n return config;\r\n };\r\n\r\n var _responseError = (rejection) => {\r\n var deferred = $q.defer();\r\n\r\n if (rejection.status === 401) {\r\n\r\n requestQueue.push({ config: rejection.config, deferred: deferred });\r\n\r\n if (!refreshingRequest) {\r\n refreshingRequest = true;\r\n authenticationSrv.refreshToken().then((response) => {\r\n //retry login with new refresh\r\n _.each(requestQueue, (request) => {\r\n if (!request.config.retryCount || request.config.retryCount < MAX_RETRY_COUNT) {\r\n _retryHttpRequest(request.config, request.deferred);\r\n }else{\r\n request.deferred.reject(\"Too many of the same request has been made\");\r\n }\r\n });\r\n\r\n requestQueue = [];\r\n refreshingRequest = false;\r\n }, (err) => {\r\n requestQueue = [];\r\n authenticationSrv.logout();\r\n deferred.reject(rejection);\r\n });\r\n }\r\n }\r\n else {\r\n deferred.reject(rejection);\r\n }\r\n return deferred.promise;\r\n };\r\n\r\n var _retryHttpRequest = (config, deferred) => {\r\n $http = $http || $injector.get('$http');\r\n\r\n if (!config.retryCount) config.retryCount = 0;\r\n\r\n config.retryCount++;\r\n\r\n $http(config).then((response) => {\r\n deferred.resolve(response);\r\n }, (response) => {\r\n deferred.reject(response);\r\n });\r\n };\r\n\r\n authInterceptorServiceFactory.request = _request;\r\n authInterceptorServiceFactory.responseError = _responseError;\r\n\r\n return authInterceptorServiceFactory;\r\n }\r\n})();\r\n","module Shared {\r\n export module AutoAllocation {\r\n export interface IAutoAllocationItem {\r\n id: number;\r\n memberId: number;\r\n company: string;\r\n keyword: string;\r\n categoryCode: string;\r\n reclaimVat: boolean;\r\n enabled: boolean;\r\n navCategory: any;\r\n createdBy: string;\r\n updatedBy: string;\r\n validationMessage: string;\r\n hasChanged: boolean;\r\n transactionMatches: MatchingTransactions;\r\n }\r\n\r\n export class AutoAllocationItem implements IAutoAllocationItem {\r\n id: number;\r\n memberId: number;\r\n company: string;\r\n keyword: string;\r\n categoryCode: string;\r\n reclaimVat: boolean;\r\n enabled: boolean;\r\n navCategory: any;\r\n createdBy: string;\r\n updatedBy: string;\r\n validationMessage: string;\r\n hasChanged: boolean;\r\n transactionMatches: MatchingTransactions;\r\n }\r\n\r\n export class MatchingTransactions {\r\n constructor() {\r\n this.count = 0;\r\n this.items = [];\r\n }\r\n count: number;\r\n items: Array;\r\n }\r\n }\r\n}","/// \r\n\r\nmodule Shared {\r\n\r\n export interface IAutoAllocationService {\r\n memberModel: MemberModel;\r\n categoryList: Array;\r\n companyConfig: Array;\r\n transactions: Array;\r\n\r\n getAutoAllocationSettings(): ng.IPromise>;\r\n saveNewAutoAllocationSetting(model: Shared.AutoAllocation.IAutoAllocationItem): ng.IPromise;\r\n updateAutoAllocationSetting(model: Shared.AutoAllocation.IAutoAllocationItem): ng.IPromise;\r\n\r\n internalNavUser(): boolean;\r\n RequestedFromAllowedApiSource(): boolean;\r\n getSettingsList(includeDisabled: boolean): Array;\r\n createNewAllocationSetting(): Shared.AutoAllocation.IAutoAllocationItem;\r\n duplicateKeyword(newSetting: Shared.AutoAllocation.IAutoAllocationItem): boolean;\r\n resetTransactionMatches(autoSetting: Shared.AutoAllocation.IAutoAllocationItem): void;\r\n searchTransactions(autoSetting: Shared.AutoAllocation.IAutoAllocationItem): void;\r\n }\r\n\r\n export class AutoAllocationService implements IAutoAllocationService {\r\n static $inject = [\"$http\", \"$q\", \"appSettings\", \"localStorageService\"];\r\n public member: Shared.MemberModel = {};\r\n memberModel: MemberModel;\r\n categoryList: Array;\r\n companyConfig: Array;\r\n transactions: Array;\r\n\r\n constructor(\r\n private $http: IBrooksonHttp,\r\n private $q: ng.IQService,\r\n private appSettings,\r\n private localStorageService: ng.local.storage.ILocalStorageService\r\n ) {\r\n this.memberModel = this.localStorageService.get(\"brookson.member\") as MemberModel;\r\n this.transactions = [];\r\n }\r\n\r\n getAutoAllocationSettings(silentMode?: boolean): ng.IPromise {\r\n const deferred = this.$q.defer();\r\n const url = \"api/autoallocation/getconfig\";\r\n\r\n this.$http.get(url)\r\n .then((response: any): void => {\r\n deferred.resolve(response.data);\r\n });\r\n\r\n return deferred.promise;\r\n }\r\n\r\n saveNewAutoAllocationSetting(model: Shared.AutoAllocation.IAutoAllocationItem): angular.IPromise {\r\n const deferred = this.$q.defer();\r\n const url = \"api/autoallocation/addnew\";\r\n\r\n this.$http.post(url, model)\r\n .then((response: any): void => {\r\n deferred.resolve(response.data);\r\n });\r\n\r\n return deferred.promise; \r\n }\r\n\r\n updateAutoAllocationSetting(model: Shared.AutoAllocation.IAutoAllocationItem): angular.IPromise {\r\n const deferred = this.$q.defer();\r\n const url = \"api/autoallocation/update\";\r\n\r\n this.$http.post(url, model)\r\n .then((response: any): void => {\r\n deferred.resolve(response.data);\r\n });\r\n\r\n return deferred.promise; \r\n }\r\n\r\n internalNavUser(): boolean {\r\n if (!this.appSettings.isInternal) return false;\r\n }\r\n\r\n RequestedFromAllowedApiSource(): boolean {\r\n if (!this.appSettings.validApiSource) return false;\r\n if (_.isNull(this.memberModel) || _.isNull(this.memberModel.navReferral)) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n getSettingsList(includeDisabled: boolean): Array {\r\n let list = this.companyConfig;\r\n\r\n if (!includeDisabled) {\r\n list = _.filter(list, (config: AutoAllocation.IAutoAllocationItem) => {\r\n return config.enabled === true;\r\n });\r\n }\r\n\r\n list = _.orderBy(angular.copy(list), (data: AutoAllocation.IAutoAllocationItem) => data.id);\r\n this.populateNavCategories(list);\r\n return list;\r\n }\r\n\r\n private populateNavCategories(companyConfig: Array): void {\r\n _.forEach(companyConfig, (autoAllocationSettings: AutoAllocation.IAutoAllocationItem) => {\r\n autoAllocationSettings.navCategory = _.find(this.categoryList, (category) => {\r\n return category.code === autoAllocationSettings.categoryCode;\r\n });\r\n });\r\n }\r\n\r\n createNewAllocationSetting(): AutoAllocation.IAutoAllocationItem {\r\n const newAutoSetting: AutoAllocation.AutoAllocationItem = new AutoAllocation.AutoAllocationItem();\r\n let createdBy = \"Customer\";\r\n if(!_.isNull(this.memberModel.isAdmin))\r\n {\r\n createdBy = \"Superuser\";\r\n } else if (!_.isNull(this.memberModel.navReferral)) \r\n {\r\n createdBy = this.memberModel.navReferral;\r\n }\r\n\r\n newAutoSetting.id = -1;\r\n newAutoSetting.enabled = true;\r\n newAutoSetting.createdBy = createdBy;\r\n newAutoSetting.memberId = parseInt(this.memberModel.memberId);\r\n newAutoSetting.company = this.memberModel.companyRef;\r\n return newAutoSetting;\r\n }\r\n\r\n duplicateKeyword = (newSetting: AutoAllocation.IAutoAllocationItem): boolean => {\r\n newSetting.validationMessage = \"\";\r\n if (_.isUndefined(newSetting.keyword)) return false;\r\n\r\n let uniqueKeywordCheck = _.find(this.companyConfig, (config) => {\r\n return config.keyword.toLowerCase() === newSetting.keyword.toLowerCase();\r\n });\r\n\r\n if (!_.isUndefined(uniqueKeywordCheck)) {\r\n if (!uniqueKeywordCheck.enabled) {\r\n newSetting.validationMessage = \"A disabled rule already exists with this keyword.\";\r\n } else {\r\n newSetting.validationMessage = \"A rule already exists with this keyword.\";\r\n }\r\n this.resetTransactionMatches(newSetting);\r\n return true;\r\n }\r\n\r\n return false;\r\n\r\n }\r\n\r\n resetTransactionMatches = (autoSetting: AutoAllocation.IAutoAllocationItem): void => {\r\n if (_.isUndefined(autoSetting.transactionMatches)) {\r\n autoSetting.transactionMatches = new AutoAllocation.MatchingTransactions();\r\n }\r\n autoSetting.transactionMatches.count = 0;\r\n autoSetting.transactionMatches.items = [];\r\n }\r\n\r\n searchTransactions = (autoSetting: AutoAllocation.IAutoAllocationItem): void => {\r\n if (!_.isUndefined(autoSetting.keyword) && autoSetting.keyword.length >= 1) {\r\n let transactionMatches = _.filter(this.transactions,\r\n (transaction) => {\r\n return _.unescape(transaction.description).toLowerCase().indexOf(_.unescape(autoSetting.keyword).toLowerCase()) > -1\r\n && transaction.debitAmount < 0 && (transaction.transactionType === 0 || transaction.transactionType === 2);\r\n });\r\n transactionMatches = _.orderBy(angular.copy(transactionMatches), (matchedTransactions: any) => matchedTransactions.transactionDate, \"desc\");\r\n if (transactionMatches.length === 0) {\r\n let noRecordsFound = { description: \"No business paid transactions found\", transactionDate: null, debitAmount: null };\r\n transactionMatches.push(noRecordsFound);\r\n }\r\n autoSetting.transactionMatches = new AutoAllocation.MatchingTransactions();\r\n autoSetting.transactionMatches.count = transactionMatches.length;\r\n autoSetting.transactionMatches.items = transactionMatches.slice(0, 10);\r\n this.decorateKeyword(autoSetting);\r\n } else {\r\n this.resetTransactionMatches(autoSetting);\r\n }\r\n }\r\n\r\n private decorateKeyword(autoSetting: AutoAllocation.IAutoAllocationItem): void {\r\n if (_.isUndefined(autoSetting)) return;\r\n if (_.isUndefined(autoSetting.transactionMatches) || autoSetting.transactionMatches.count === 0) return;\r\n _.forEach(autoSetting.transactionMatches.items, (matchedTransaction: any) => {\r\n matchedTransaction.description = _.unescape(matchedTransaction.description.toUpperCase())\r\n .replace(_.escape(autoSetting.keyword).toUpperCase(), `${_.escape(autoSetting.keyword).toUpperCase()}`);\r\n\r\n });\r\n }\r\n\r\n }\r\n}\r\n\r\nangular.module(\"app.shared\").service(\"autoAllocationService\", Shared.AutoAllocationService);","/// \r\n\r\nmodule Shared {\r\n \r\n export interface IBrooksonServicesCompanyYearEnd {\r\n \r\n getCompanyYearEndTileDetails(silentMode?: boolean) : ng.IPromise;\r\n \r\n setDraftAccountsConfirmed(taxYear: number, reason: string): ng.IPromise;\r\n }\r\n\r\n \r\n export class BrooksonServicesCompanyYearEnd implements IBrooksonServicesCompanyYearEnd {\r\n \r\n static $inject = ['$http'];\r\n \r\n constructor(private $http: Shared.IBrooksonHttp) {}\r\n\r\n \r\n getCompanyYearEndTileDetails = (silentMode?: boolean) : ng.IPromise => {\r\n return this.$http.get(`api/CompanyYearEnd/GetCompanyYearEndTile`, {\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n setDraftAccountsConfirmed = (taxYear: number, reason: string): ng.IPromise => {\r\n let url = 'api/CompanyYearEnd/SetDraftAccountsConfirmed';\r\n\r\n var requestData = {\r\n taxYear: taxYear,\r\n reason: reason\r\n };\r\n\r\n const config = {\r\n silentMode: false\r\n };\r\n\r\n return this.$http.post(url, requestData, config).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular.module('app.shared')\r\n .service('brooksonServicesCompanyYearEnd', Shared.BrooksonServicesCompanyYearEnd);","/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n export interface ICS01ConfirmationService {\r\n GetNextIfOpen(): ng.IPromise;\r\n GetCompanyDetails(): ng.IPromise;\r\n SaveResponse(CS01ConfirmationStatus: CS01ConfirmationDetails): ng.IPromise;\r\n }\r\n\r\n export class CS01ConfirmationService implements ICS01ConfirmationService {\r\n static $inject = ['$injector', 'shared.config'];\r\n\r\n public serviceBase: string;\r\n public $http: ng.IHttpService;\r\n\r\n constructor(\r\n private $injector: ng.auto.IInjectorService,\r\n private sharedConfig: any\r\n ) {\r\n this.serviceBase = sharedConfig.baseApiUrl;\r\n }\r\n\r\n GetNextIfOpen = (): ng.IPromise => {\r\n this.$http = this.$http || this.$injector.get(\"$http\");\r\n const url: string = this.serviceBase + \"api/CS01Confirmation/GetNextIfOpen\";\r\n\r\n return this.$http.get(url)\r\n .then((response: ng.IHttpPromiseCallbackArg): CS01ConfirmationDetails => {\r\n return response.data;\r\n });\r\n }\r\n\r\n GetCompanyDetails = (): ng.IPromise => {\r\n this.$http = this.$http || this.$injector.get(\"$http\");\r\n const url: string = this.serviceBase + \"api/CS01Confirmation/GetCompanyDetails\";\r\n\r\n return this.$http.get(url)\r\n .then((response: ng.IHttpPromiseCallbackArg): CompanyDetails => {\r\n return response.data;\r\n });\r\n }\r\n\r\n SaveResponse = (CS01ConfirmationDetails: CS01ConfirmationDetails): ng.IPromise => {\r\n this.$http = this.$http || this.$injector.get(\"$http\");\r\n const url: string = this.serviceBase + \"api/CS01Confirmation/Save\";\r\n\r\n const request: CS01ConfirmationDetails = CS01ConfirmationDetails;\r\n\r\n return this.$http.post(url, request)\r\n .then((response: ng.IHttpPromiseCallbackArg): boolean => {\r\n return response.data;\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .service('cs01ConfirmationSrv', Shared.CS01ConfirmationService);","/// \r\n/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n export interface IDashboardService {\r\n customiseOn: boolean;\r\n userDashboards: Array;\r\n currentDashboard: Shared.DashboardUser;\r\n msnry: IMasonry;\r\n allWidgets: Array;\r\n availableWidgets: Array;\r\n showMasonryItems: boolean;\r\n\r\n getDashboardsForMember(silentMode?: boolean): ng.IPromise>;\r\n getDashboardWidgets(silentMode?: boolean): ng.IPromise>;\r\n makeDefault(currentDash: DashboardUser);\r\n saveAsNew(currentDash: DashboardUser): ng.IPromise;\r\n resetCurrentDashboard(): void;\r\n reloadMasonry(): void;\r\n removeWidget(widgetName: string): void;\r\n saveExisting(currentDash: DashboardUser, showGritterMessage?: boolean);\r\n showDelete(): ng.IPromise>;\r\n deleteDashboards(dashboards: Array, silentMode?: boolean);\r\n downloadFile(documentType: string): void;\r\n getDateIsNull(value: string): boolean;\r\n }\r\n\r\n export class DashboardService implements IDashboardService {\r\n static $inject: Array = ['$http', 'brookson.ui.popup', '$q', 'brookson.modal.select.service', 'brookson.file.download'];\r\n\r\n public showMasonryItems: boolean = false;\r\n public customiseOn: boolean = false;\r\n public userDashboards: Array = [];\r\n public allWidgets: Array;\r\n public msnry: IMasonry;\r\n\r\n private _currentDashboard: DashboardUser;\r\n public get currentDashboard(): DashboardUser {\r\n return this._currentDashboard;\r\n }\r\n public set currentDashboard(v: DashboardUser) {\r\n this._currentDashboard = angular.copy(v);\r\n }\r\n\r\n public get availableWidgets(): Array {\r\n if (this.allWidgets && this.currentDashboard) {\r\n\r\n\r\n return _.differenceBy(this.allWidgets, this.currentDashboard.widgets, 'dashboardWidgetId');\r\n }\r\n return [];\r\n }\r\n\r\n constructor(\r\n private $http: Shared.IBrooksonHttp,\r\n private popup: Shared.IBrooksonUiPopup,\r\n private $q: ng.IQService,\r\n private selectModal: Shared.IBrooksonModalSelect,\r\n private fileDownloadSrv: any\r\n ) { }\r\n\r\n public addWidget = (widget: any) => {\r\n const dashCopy = angular.copy(this.currentDashboard);\r\n dashCopy.widgets.push(widget);\r\n this.currentDashboard = dashCopy;\r\n }\r\n\r\n public removeWidget = (widgetName: string) => {\r\n const dashCopy = angular.copy(this.currentDashboard);\r\n _.remove(dashCopy.widgets, (widget) => {\r\n return widget.componentName === widgetName;\r\n });\r\n this.currentDashboard = dashCopy;\r\n }\r\n\r\n public reloadMasonry = (): void => {\r\n this.msnry.reloadItems();\r\n this.msnry.layout();\r\n this.showMasonryItems = true;\r\n }\r\n\r\n // Returns a list of dashboards and widgets for the member\r\n public getDashboardsForMember = (silentMode?: boolean): ng.IPromise> => {\r\n return this.$http.get('api/Dashboard/GetDashboardsForMember', {\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg>) => {\r\n this.userDashboards = _.sortBy(response.data, 'dashboardUserId');\r\n\r\n if (!_.some(this.userDashboards, { 'isDefault': true })) {\r\n //if you can't find a default then set the first as default\r\n this.userDashboards[0].isDefault = true;\r\n this.insertDashboardForMember(this.userDashboards[0]);\r\n }\r\n\r\n return this.userDashboards;\r\n });\r\n }\r\n\r\n // Returns a list of all the available widgets include their component name and display name\r\n public getDashboardWidgets = (silentMode?: boolean): ng.IPromise> => {\r\n return this.$http.get('api/Dashboard/GetDashboardWidgets', {\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg>): DashboardWidget[] => {\r\n this.allWidgets = response.data;\r\n return this.allWidgets;\r\n });\r\n }\r\n\r\n // Inserts or updates a customised dashboard for the member. It will update if there is an dashboardWidgetId value\r\n private insertDashboardForMember = (data: DashboardUser, showGritterMessage: boolean = true, silentMode?: boolean): ng.IPromise => {\r\n return this.$http.post('api/Dashboard/InsertDashboardForMember?showGritterMessage=' + showGritterMessage, data, {\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n public saveExisting = (currentDash: DashboardUser, showGritterMessage: boolean = true) => {\r\n return this.insertDashboardForMember(currentDash, showGritterMessage).then((result) => {\r\n this.replaceDashboard(result);\r\n });\r\n }\r\n\r\n public saveAsNew = (currentDash: DashboardUser): ng.IPromise => {\r\n return this.popup.showSaveAs(\"Save Dashboard\", \"Save your dashboard as:\").then((fileName: string) => {\r\n let dashCopy = angular.copy(currentDash);\r\n dashCopy.name = fileName;\r\n dashCopy.dashboardUserId = null;\r\n dashCopy.isDefault = false;\r\n dashCopy.isBrookson = false;\r\n _.each(dashCopy.widgets, (widget) => { widget.dashboardUserWidgetsId = null; widget.dashboardUserId = null; });\r\n\r\n return this.insertDashboardForMember(dashCopy).then((result) => {\r\n this.userDashboards.push(result);\r\n this.currentDashboard = result;\r\n return result;\r\n });\r\n });\r\n }\r\n\r\n public showDelete = (): ng.IPromise> => {\r\n // return this.popup.selectOptions();\r\n let items: Array = [];\r\n items = _.chain(this.userDashboards).filter({ 'isBrookson': false }).map((v) => {\r\n if (!v.isBrookson) {\r\n return new ModalSelectItem(v.name, v.dashboardUserId, false);\r\n }\r\n }).value();\r\n\r\n return this.selectModal.showSelect(items, \"Remove Dashboards\").then((selected: Array) => {\r\n if (selected.length) {\r\n return _.filter(this.userDashboards, (item) => {\r\n return _.some(selected, (select) => select.id === item.dashboardUserId);\r\n });\r\n }\r\n });\r\n }\r\n\r\n public deleteDashboards = (dashboards: Array, silentMode?: boolean) => {\r\n\r\n return this.$http.post('api/Dashboard/DeleteDashboards', dashboards, {\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg) => {\r\n\r\n //refresh the list of dashboards\r\n this.getDashboardsForMember();\r\n\r\n });\r\n } \r\n\r\n public makeDefault = (currentDash: DashboardUser) => {\r\n let promises: Array> = [];\r\n\r\n _.each(this.userDashboards, (dash) => {\r\n if (dash.dashboardUserId === currentDash.dashboardUserId) {\r\n dash.isDefault = true;\r\n promises.push(this.insertDashboardForMember(dash));\r\n }\r\n else if (dash.isDefault === true) {\r\n dash.isDefault = false;\r\n promises.push(this.insertDashboardForMember(dash));\r\n }\r\n });\r\n\r\n return this.$q.all(promises).then((promises) => {\r\n _.each(promises, (result) => {\r\n this.replaceDashboard(result);\r\n });\r\n });\r\n }\r\n\r\n public resetCurrentDashboard = (): void => {\r\n let dash = _.find(this.userDashboards, (dash: DashboardUser): boolean => {\r\n return dash.dashboardUserId === this.currentDashboard.dashboardUserId;\r\n });\r\n this.currentDashboard = dash;\r\n }\r\n\r\n private replaceDashboard = (newDash: DashboardUser): void => {\r\n let index = _.indexOf(this.userDashboards, _.find(this.userDashboards, { dashboardUserId: newDash.dashboardUserId }));\r\n this.userDashboards.splice(index, 1, newDash);\r\n }\r\n\r\n public downloadFile = (documentType: string): void => {\r\n var url = \"api/Dashboard/DownloadEmploymentDocuments?documentType=\" + documentType;\r\n console.log(url);\r\n var expectedMediaType = \"application/octet-stream\";\r\n this.fileDownloadSrv.downloadAndSave(url, null, documentType + '.pdf', expectedMediaType);\r\n }\r\n\r\n \r\n public getDateIsNull(value: string): boolean {\r\n if (!value) {\r\n return true; \r\n }\r\n\r\n return moment(value).format(\"DD/MM/YYYY\") === '01/01/1753';\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .service('dashboardService', Shared.DashboardService);","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular\r\n .module('app.shared')\r\n .service('dialogueSrv', dialogueSrv);\r\n\r\n dialogueSrv.$inject = ['$http', '$q', 'shared.config', 'dialogue.enums', 'localStorageService', 'memberSrv'];\r\n\r\n function dialogueSrv($http, $q, sharedConfig, enums, localStorageService, memberSrv) {\r\n var member = memberSrv.getMember();\r\n var dialogueSrvFactory: any = {};\r\n var serviceBase = sharedConfig.baseApiUrl;\r\n var localStorageData = null;\r\n var localStorageDashboardData = null;\r\n\r\n\r\n // Get\r\n function hasExpensesNoticeBeenDisplayed() {\r\n if (getData().expensesNotice !== member.memberId) {\r\n return $http.get(serviceBase + 'api/Dialogue/HasExpensesNoticeBeenDisplayed', {\r\n silentMode: true\r\n }).then((response) => {\r\n if (response.data === true) {\r\n localStorageData.expensesNotice = member.memberId;\r\n setData();\r\n }\r\n\r\n return response.data;\r\n });\r\n } else {\r\n var deferred = $q.defer();\r\n deferred.resolve(true);\r\n return deferred.promise;\r\n }\r\n }\r\n\r\n // Set\r\n function setExpensesNoticeDisplayed() {\r\n return $http.get(serviceBase + 'api/Dialogue/SetExpensesNoticeDisplayed', {\r\n silentMode: true\r\n }).then((response) => {\r\n if (response.data === true) {\r\n localStorageData.expensesNotice = member.memberId;\r\n setData();\r\n }\r\n\r\n return response.data;\r\n });\r\n }\r\n\r\n\r\n // Get\r\n function hasFinancialReviewBannerHidden() {\r\n if (getDashboardData().hidemortgagereviewbanner !== member.memberId) {\r\n return $http.get(serviceBase + 'api/Dialogue/HasFinancialReviewBannerHidden', {\r\n silentMode: true\r\n }).then((response) => {\r\n if (response.data === true) {\r\n localStorageDashboardData.hidemortgagereviewbanner = member.memberId;\r\n setData();\r\n }\r\n\r\n return response.data;\r\n });\r\n } else {\r\n var deferred = $q.defer();\r\n deferred.resolve(true);\r\n return deferred.promise;\r\n }\r\n }\r\n\r\n // Set\r\n function setFinancialReviewBannerHidden() {\r\n return $http.get(serviceBase + 'api/Dialogue/SetFinancialReviewBannerHidden', {\r\n silentMode: true\r\n }).then((response) => {\r\n if (response.data === true) {\r\n localStorageDashboardData.hidemortgagereviewbanner = member.memberId;\r\n setData();\r\n }\r\n\r\n return response.data;\r\n });\r\n }\r\n \r\n // Set\r\n function setFinancialReviewBannerClosed() {\r\n localStorageDashboardData.hidemortgagereviewbanner = member.memberId;\r\n setDashboardData();\r\n }\r\n \r\n // Set\r\n function setRecommendAFriendTileClosed() {\r\n localStorageDashboardData.recommendAFriendTile = member.memberId;\r\n setDashboardData();\r\n}\r\n\r\n\r\n // Get\r\n function hasRecommendAFriendTileHidden() {\r\n if (getDashboardData().recommendAFriendTile !== member.memberId) {\r\n return $http.get(serviceBase + 'api/Dialogue/HasRecommendAFriendTileHidden', {\r\n silentMode: true\r\n }).then((response) => {\r\n if (response.data === true) {\r\n localStorageDashboardData.recommendAFriendTile = member.memberId;\r\n setDashboardData();\r\n }\r\n\r\n return response.data;\r\n });\r\n } else {\r\n var deferred = $q.defer();\r\n deferred.resolve(true);\r\n return deferred.promise;\r\n }\r\n }\r\n\r\n\r\n // Set\r\n function setRecommendAFriendTileHidden() {\r\n return $http.get(serviceBase + 'api/Dialogue/SetRecommendAFriendTileHidden', {\r\n silentMode: true\r\n }).then((response) => {\r\n if (response.data === true) {\r\n localStorageDashboardData.recommendAFriendTile = member.memberId;\r\n setDashboardData();\r\n }\r\n\r\n return response.data;\r\n });\r\n }\r\n\r\n\r\n // Local storage\r\n function setData() {\r\n localStorageService.set('brookson.dialogues', localStorageData);\r\n }\r\n\r\n function getData() {\r\n var data = localStorageService.get('brookson.dialogues');\r\n\r\n return data === null ? {} : data;\r\n }\r\n \r\n function setDashboardData() {\r\n localStorageService.set('brookson.dashboard', localStorageDashboardData);\r\n }\r\n\r\n function getDashboardData() {\r\n var data = localStorageService.get('brookson.dashboard');\r\n\r\n return data === null ? {} : data;\r\n }\r\n\r\n localStorageData = getData();\r\n localStorageDashboardData = getDashboardData();\r\n\r\n dialogueSrvFactory.hasExpensesNoticeBeenDisplayed = hasExpensesNoticeBeenDisplayed;\r\n dialogueSrvFactory.setExpensesNoticeDisplayed = setExpensesNoticeDisplayed;\r\n \r\n dialogueSrvFactory.hasFinancialReviewBannerHidden = hasFinancialReviewBannerHidden;\r\n dialogueSrvFactory.setFinancialReviewBannerHidden = setFinancialReviewBannerHidden;\r\n dialogueSrvFactory.setFinancialReviewBannerClosed = setFinancialReviewBannerClosed;\r\n dialogueSrvFactory.setRecommendAFriendTileClosed = setRecommendAFriendTileClosed;\r\n \r\n dialogueSrvFactory.hasRecommendAFriendTileHidden = hasRecommendAFriendTileHidden;\r\n dialogueSrvFactory.setRecommendAFriendTileHidden = setRecommendAFriendTileHidden;\r\n return dialogueSrvFactory;\r\n }\r\n})();\r\n","module Shared {\r\n export class DocumentCompact {\r\n docType: number;\r\n dataSource: number;\r\n date: Date;\r\n name: string;\r\n path: string;\r\n documentId: string;\r\n storedFileName: string;\r\n originalFileName: string;\r\n displayName: string;\r\n folderName: string;\r\n isInCurrentYear: boolean;\r\n isFavourite: boolean;\r\n sharedDriveId: number;\r\n lastOpened: Date;\r\n selected: boolean;\r\n imageData: string;\r\n imageDataError: boolean;\r\n }\r\n}","/// \r\n\r\nmodule Shared {\r\n export class FolderCompact {\r\n folderID: number;\r\n name: string;\r\n documents: DocumentCompact[];\r\n documentCount: number;\r\n }\r\n}","/// \r\n/// \r\n\r\nmodule Shared {\r\n export class DocumentStorageData {\r\n folders: FolderCompact[];\r\n recentDocuments: DocumentCompact[];\r\n }\r\n}","module Shared {\r\n export class DocumentStorageFolder {\r\n id: string;\r\n name: string;\r\n path: string;\r\n documents: DocumentCompact[];\r\n folders: DocumentStorageFolder[];\r\n }\r\n}","module Shared {\r\n export class FavouriteRequest {\r\n dataSource: Shared.DocumentDataSource;\r\n documentId: string;\r\n documentPath: string;\r\n }\r\n}","module Shared {\r\n export class GetFullSizedImageRequest\r\n {\r\n sharedDriveId: number;\r\n dataSource: Shared.DocumentDataSource;\r\n documentId: string;\r\n path: string;\r\n }\r\n}","/// \r\n\r\nmodule Shared {\r\n export class SharedDrive {\r\n sharedDriveId: number;\r\n sharedDriveProvider: DocumentDataSource;\r\n folder: DocumentStorageFolder;\r\n }\r\n}","module Shared {\r\n export class SharedDrives {\r\n dropboxSharedDrive: SharedDrive;\r\n }\r\n}","module Shared {\r\n export class SharedDriveFolder {\r\n id: string;\r\n name: string;\r\n path: string;\r\n documents: DocumentCompact[];\r\n folders: SharedDriveFolder[];\r\n }\r\n}","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n 'use strict';\r\n\r\n export interface IDocumentStorageService {\r\n // Data\r\n folders: Array;\r\n recentDocuments: Array;\r\n favourites: Array;\r\n sharedDrives: Shared.SharedDrives;\r\n folderId: number;\r\n sharedDriveId: number;\r\n sharedDrivePath: string;\r\n subFolderID: string;\r\n folder: any;\r\n sharedDriveFolder: Shared.DocumentStorageFolder;\r\n fileView: FileView;\r\n orderByField: string;\r\n reverseSort: boolean;\r\n isMobile: boolean;\r\n currentCategory: string;\r\n\r\n // Methods\r\n getSharedDriveFolder(): Shared.SharedDrive;\r\n getSharedDrives(): ng.IPromise;\r\n getFolders(silentMode?: boolean): ng.IPromise;\r\n removeFavourite(category: Shared.DocumentDataSource, documentId: string, documentPath: string): ng.IPromise;\r\n setFavourite(dataSource: Shared.DocumentDataSource, documentId: string, documentPath: string): ng.IPromise;\r\n getThumbnail(document: Shared.GetFullSizedImageRequest, silentMode?: boolean);\r\n getPreviousFolder(folderPath: string): string;\r\n getDocumentStorageWidgetData(silentMode?: boolean): ng.IPromise;\r\n downloadEmploymentFile(documentType: string);\r\n }\r\n\r\n export class DocumentStorageService implements IDocumentStorageService {\r\n static $inject: Array = ['$rootScope', '$http', 'documentStorage.enums', 'brookson.file.download'];\r\n\r\n public folders: Array = [];\r\n public recentDocuments: Array = [];\r\n public favourites: Array = [];\r\n\r\n public sharedDrives: SharedDrives = {\r\n dropboxSharedDrive: {}\r\n };\r\n\r\n public folderId: number = 0;\r\n public sharedDriveId: number = 0;\r\n public subFolderID: string;\r\n public sharedDrivePath: string = '';\r\n public folder: any = {};\r\n public sharedDriveFolder: Shared.DocumentStorageFolder = null;\r\n public fileView: FileView;\r\n public orderByField: string = 'date';\r\n public reverseSort: boolean = true;\r\n public isMobile: boolean = false;\r\n public currentCategory: string;\r\n\r\n constructor(\r\n private $rootScope: ng.IRootScopeService,\r\n private $http: Shared.IBrooksonHttp,\r\n private enums: Shared.IDocumentStorageEnums,\r\n private fileDownloadSrv: any\r\n ) {\r\n this.fileView = this.enums.FileView.DETAILED;\r\n this.currentCategory = this.enums.DocumentCategory.FOLDER;\r\n\r\n this.setupWatched();\r\n }\r\n\r\n public getFolder = (): Shared.FolderCompact | Shared.DocumentStorageFolder => {\r\n if (this.folderId > 0) {\r\n this.folder = _.find(this.folders, (folder: Shared.FolderCompact): boolean => {\r\n return folder.folderID === parseInt(this.folderId.toString());\r\n });\r\n\r\n if (this.folder && this.subFolderID) {\r\n this.folder = _.find(this.folder.folders, (folder: Shared.FolderCompact): boolean => {\r\n return folder.folderID === parseInt(this.subFolderID.toString());\r\n });\r\n }\r\n } else {\r\n if (this.folders.length > 0) {\r\n this.folderId = this.folders[0].folderID;\r\n this.folder = this.folders[0];\r\n }\r\n }\r\n\r\n return this.folder;\r\n }\r\n\r\n public getSharedDriveFolder = (): Shared.SharedDrive => {\r\n if (this.sharedDriveId > 0) {\r\n this.folder = this.sharedDrives.dropboxSharedDrive;\r\n\r\n if (this.sharedDrivePath) {\r\n this.sharedDriveFolder = this.getNestedFolder(this.folder, this.sharedDrivePath);\r\n } else {\r\n this.sharedDriveFolder = this.folder ? this.folder.folder : {};\r\n }\r\n }\r\n\r\n return this.folder;\r\n }\r\n\r\n public getNestedFolder = (data: Shared.DocumentStorageFolder, path: string): Shared.DocumentStorageFolder => {\r\n if (data.path === path) {\r\n return data;\r\n }\r\n\r\n let result: Shared.DocumentStorageFolder;\r\n let p: string;\r\n\r\n for (p in data) {\r\n if (data.hasOwnProperty(p) && data[p] !== null && typeof data[p] === 'object') {\r\n result = this.getNestedFolder(data[p], path);\r\n if (result) {\r\n return result;\r\n }\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n public getPreviousFolder = (folderPath: string): string => {\r\n if (!folderPath || folderPath === '/') {\r\n return folderPath;\r\n }\r\n\r\n let splitFolderPath: string[] = folderPath.split('/');\r\n let slicedFolderPath: string[] = _.slice(splitFolderPath, 0, splitFolderPath.length - 1);\r\n\r\n if (slicedFolderPath.length <= 1) {\r\n return '/';\r\n }\r\n\r\n let previousFolderPath = slicedFolderPath.join('/');\r\n\r\n return previousFolderPath;\r\n }\r\n\r\n public isSharedDriveAttached = (): boolean => {\r\n return this.sharedDrives.dropboxSharedDrive.sharedDriveId > 0;\r\n }\r\n\r\n public getFolderName = (): string => {\r\n if (!this.currentCategory && this.folder) {\r\n return this.folder.name;\r\n }\r\n\r\n return this.currentCategory;\r\n }\r\n\r\n public getFavourites = (): Array => {\r\n this.favourites.length = 0;\r\n\r\n _.forEach(this.folders, (folder: FolderCompact): void => {\r\n let favourites: DocumentCompact[] = _.filter(folder.documents, { isFavourite: true });\r\n\r\n _.merge(this.favourites, this.favourites.concat(favourites));\r\n });\r\n\r\n let favourites: DocumentCompact[] = this.getSharedDriveFavourites(this.sharedDrives.dropboxSharedDrive.folder);\r\n\r\n _.merge(this.favourites, this.favourites.concat(favourites));\r\n\r\n return this.favourites;\r\n }\r\n\r\n public getSharedDriveFavourites = (data: Shared.DocumentStorageFolder): Array => {\r\n if (data) {\r\n let fav: DocumentCompact[] = _.filter(data.documents, { isFavourite: true });\r\n let f: any;\r\n\r\n for (f in data.folders) {\r\n if (data.folders.hasOwnProperty(f)) {\r\n fav = fav.concat(this.getSharedDriveFavourites(data.folders[f]));\r\n }\r\n }\r\n\r\n return fav;\r\n } else {\r\n return [];\r\n }\r\n }\r\n\r\n public removeFavourite = (category: Shared.DocumentDataSource, documentId: string, documentPath: string): ng.IPromise => {\r\n _.forEach(this.folders, (folder: Shared.FolderCompact): void => {\r\n _.forEach(folder.documents, (document: Shared.DocumentCompact): void => {\r\n if (document.documentId === documentId && document.path === documentPath) {\r\n document.isFavourite = false;\r\n }\r\n });\r\n });\r\n\r\n _.forEach(this.recentDocuments, (document: Shared.DocumentCompact): void => {\r\n if (document.documentId === documentId && document.path === documentPath) {\r\n document.isFavourite = false;\r\n }\r\n });\r\n\r\n this.setSharedDriveFavouriteValue(this.sharedDrives.dropboxSharedDrive.folder, documentId, documentPath, false);\r\n this.getFavourites();\r\n\r\n return this.unfavouriteDocument(category, documentId, documentPath);\r\n }\r\n\r\n public setFavourite = (dataSource: Shared.DocumentDataSource, documentId: string, documentPath: string): ng.IPromise => {\r\n _.forEach(this.folders, (folder: Shared.FolderCompact): void => {\r\n _.forEach(folder.documents, (document: Shared.DocumentCompact): void => {\r\n if (document.documentId === documentId && document.path === documentPath) {\r\n document.isFavourite = true;\r\n }\r\n });\r\n });\r\n\r\n _.forEach(this.recentDocuments, (document: Shared.DocumentCompact): void => {\r\n if (document.documentId === documentId && document.path === documentPath) {\r\n document.isFavourite = true;\r\n }\r\n });\r\n\r\n this.setSharedDriveFavouriteValue(this.sharedDrives.dropboxSharedDrive.folder, documentId, documentPath, true);\r\n this.getFavourites();\r\n\r\n return this.favouriteDocument(dataSource, documentId, documentPath);\r\n }\r\n\r\n public setSharedDriveFavouriteValue = (data: Shared.DocumentStorageFolder, documentId: string, documentPath: string, value: boolean): void => {\r\n if (data) {\r\n _.forEach(data.documents, (document: Shared.DocumentCompact): void => {\r\n if (document.documentId === documentId && document.path === documentPath) {\r\n document.isFavourite = value;\r\n }\r\n });\r\n\r\n let f: any;\r\n\r\n for (f in data.folders) {\r\n if (data.folders.hasOwnProperty(f)) {\r\n _.forEach(data.folders[f].documents, (document: Shared.DocumentCompact): void => {\r\n if (document.documentId === documentId && document.path === documentPath) {\r\n document.isFavourite = value;\r\n }\r\n });\r\n\r\n this.setSharedDriveFavouriteValue(data.folders[f], documentId, documentPath, value);\r\n }\r\n }\r\n }\r\n }\r\n\r\n public getSelected = (): Array => {\r\n let selected: Array = [];\r\n\r\n _.forEach(this.folders, (folder: Shared.FolderCompact): void => {\r\n this.findSelected(folder.documents, selected);\r\n });\r\n\r\n this.findSelected(this.recentDocuments, selected);\r\n this.findSelected(this.favourites, selected);\r\n this.getSharedDriveSelected(this.sharedDrives.dropboxSharedDrive.folder, selected);\r\n\r\n return selected;\r\n }\r\n\r\n public getSharedDriveSelected = (data: Shared.DocumentStorageFolder, selected: Array): void => {\r\n if (!data) {\r\n return;\r\n }\r\n\r\n this.findSelected(data.documents, selected);\r\n\r\n let f: any;\r\n\r\n for (f in data.folders) {\r\n if (data.folders.hasOwnProperty(f)) {\r\n this.getSharedDriveSelected(data.folders[f], selected);\r\n }\r\n }\r\n }\r\n\r\n public findSelected = (documents: Array, selected: Array): void => {\r\n let selectedDocs = _.chain(documents)\r\n .filter({ selected: true })\r\n .value();\r\n\r\n _.forEach(selectedDocs, (selectedDoc: DocumentCompact): void => {\r\n selected.push(selectedDoc);\r\n });\r\n }\r\n\r\n public downloadFile = (document: Shared.DocumentCompact): void => {\r\n let url: string = \"api/DocumentStorage/DownloadFile\";\r\n let expectedMediaType: string = \"application/octet-stream\";\r\n let requestData = {\r\n sharedDriveId: document.sharedDriveId,\r\n path: document.path,\r\n dataSource: document.dataSource\r\n };\r\n\r\n this.fileDownloadSrv.downloadAndSave(url, requestData, document.name, expectedMediaType);\r\n }\r\n\r\n public downloadEmploymentFile = (documentType: string): void => {\r\n var url = \"api/Dashboard/DownloadEmploymentDocuments?documentType=\" + documentType;\r\n console.log(url);\r\n var expectedMediaType = \"application/octet-stream\";\r\n this.fileDownloadSrv.downloadAndSave(url, null, documentType + '.pdf', expectedMediaType);\r\n }\r\n\r\n public getThumbnail = (document: Shared.GetFullSizedImageRequest, silentMode?: boolean): ng.IPromise => {\r\n return this.$http.get('api/DocumentStorage/GetThumbnail?sharedDriveId=' + document.sharedDriveId + '&dataSource=' + document.dataSource + '&path=' + document.path,\r\n {\r\n silentMode: silentMode ? silentMode : false\r\n })\r\n .then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n public getFullSizedImage = (document: Shared.GetFullSizedImageRequest, silentMode?: boolean): ng.IPromise => {\r\n return this.$http.post('api/DocumentStorage/GetFullSizedImage',\r\n document,\r\n {\r\n silentMode: silentMode ? silentMode : false\r\n })\r\n .then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n public getSelectedDocumentZip = (): void => {\r\n let selected: DocumentCompact[] = this.getSelected();\r\n\r\n if (selected.length > 0) {\r\n let url: string = \"api/DocumentStorage/GetZipDocuments\";\r\n let expectedMediaType: string = \"application/zip\";\r\n let requestData: DocumentCompact[] = selected;\r\n\r\n this.fileDownloadSrv.downloadAndSave(url, requestData, \"Brookson.Documents.zip\", expectedMediaType);\r\n }\r\n }\r\n\r\n public getSharedDrives = (): ng.IPromise => {\r\n return this.$http.get('api/DocumentStorage/GetSharedDrives')\r\n .then((response: ng.IHttpPromiseCallbackArg): SharedDrives => {\r\n this.sharedDrives = response.data;\r\n\r\n return this.sharedDrives;\r\n });\r\n }\r\n\r\n public favouriteDocument = (dataSource: Shared.DocumentDataSource, documentId: string, documentPath: string): ng.IPromise => {\r\n let request: Shared.FavouriteRequest = {\r\n dataSource: dataSource,\r\n documentId: documentId,\r\n documentPath: documentPath\r\n };\r\n\r\n return this.$http.post('api/DocumentStorage/FavouriteDocument', request,\r\n {\r\n silentMode: true\r\n })\r\n .then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n public unfavouriteDocument = (dataSource: Shared.DocumentDataSource, documentId: string, documentPath: string): ng.IPromise => {\r\n const request = {\r\n dataSource: dataSource,\r\n documentId: documentId,\r\n documentPath: documentPath\r\n };\r\n\r\n return this.$http.post('api/DocumentStorage/UnfavouriteDocument', request,\r\n {\r\n silentMode: true\r\n })\r\n .then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n public getSelectedPDF = (id: string, path: string): ng.IPromise => {\r\n\r\n if (id) {\r\n let url: string = \"api/DocumentStorage/GetPDFDocument\";\r\n let expectedMediaType: string = \"application/pdf\";\r\n let requestData: any = {\r\n documentId: id,\r\n documentPath: path\r\n };\r\n return this.fileDownloadSrv.download(url, requestData, \"Brookson.Documents.zip\", expectedMediaType)\r\n .then((response) => {\r\n return response.data;\r\n });\r\n }\r\n }\r\n\r\n public getFolders = (silentMode?: boolean): ng.IPromise => {\r\n return this.$http.get('api/DocumentStorage/GetFolders',\r\n {\r\n silentMode: silentMode ? silentMode : false\r\n })\r\n .then((response: ng.IHttpPromiseCallbackArg) => {\r\n if (response.data) {\r\n this.folders.length = 0;\r\n this.folders.push.apply(this.folders, response.data.folders);\r\n\r\n this.recentDocuments.length = 0;\r\n this.recentDocuments.push.apply(this.recentDocuments, response.data.recentDocuments);\r\n\r\n this.folders = _.sortBy(this.folders, (folder: Shared.FolderCompact): string => {\r\n return folder.name;\r\n });\r\n\r\n this.getFolder();\r\n }\r\n\r\n return response.data;\r\n });\r\n }\r\n\r\n public getDocumentStorageWidgetData = (silentMode?: boolean): ng.IPromise => {\r\n return this.$http.get('api/DocumentStorage/GetDocumentStorageWidgetData',\r\n {\r\n silentMode: silentMode ? silentMode : false\r\n })\r\n .then((response: ng.IHttpPromiseCallbackArg) => {\r\n if (response.data) {\r\n this.recentDocuments.length = 0;\r\n this.recentDocuments.push.apply(this.recentDocuments, response.data.recentDocuments);\r\n this.getFolder();\r\n }\r\n\r\n return response.data;\r\n });\r\n }\r\n\r\n public setupWatched = (): void => {\r\n this.$rootScope.$watch((): number => {\r\n return this.folderId;\r\n }, (): void => {\r\n this.getFolder();\r\n this.getFavourites();\r\n }, true);\r\n\r\n this.$rootScope.$watch((): string => {\r\n return this.subFolderID;\r\n }, (): void => {\r\n this.getFolder();\r\n this.getFavourites();\r\n }, true);\r\n\r\n this.$rootScope.$watch((): SharedDrives => {\r\n return this.sharedDrives;\r\n }, (): void => {\r\n this.getSharedDriveFolder();\r\n this.getFavourites();\r\n }, true);\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .service('documentStorageSrv', Shared.DocumentStorageService);","/// \r\n/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n export interface IDropboxService {\r\n connect() : ng.IPromise;\r\n disconnect(sharedDriveId: string) : ng.IPromise;\r\n createDropboxFileFactory() : flowjs.IFlow;\r\n flowFilesSubmitted (files: Array, event: Event, flow: any, path: string) : void;\r\n flowComplete($flow: flowjs.IFlow) : void;\r\n }\r\n\r\n export class DropboxService implements IDropboxService {\r\n\r\n static $inject = ['$http', '$q', '$window', '$timeout', 'flowFactory', 'authenticationSrv'];\r\n\r\n constructor(\r\n private $http: Shared.IBrooksonHttp,\r\n private $q: ng.IQService,\r\n private $window: Window,\r\n private $timeout: ng.ITimeoutService,\r\n private flowFactory: ng.flow.IFlowFactory,\r\n private authenticationSrv: Shared.IAuthenticationService\r\n ) { }\r\n\r\n connect = () : ng.IPromise => {\r\n return this.$http.get('api/Dropbox/Connect').then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n disconnect = (sharedDriveId: string) : ng.IPromise => {\r\n return this.$http.delete('api/Dropbox/Disconnect?id=' + sharedDriveId).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n createDropboxFileFactory = () : flowjs.IFlow => {\r\n const options: flowjs.IFlowOptions = {\r\n target: '/api/Dropbox/UploadFile',\r\n permanentErrors: ['404', '500', '501'],\r\n headers: {\r\n \"__RequestVerificationToken\": this.$window.brookson.antiForgeryToken,\r\n \"Accept\": \"application/json\"\r\n },\r\n testChunks: false,\r\n simultaneousUploads: 1,\r\n chunkSize: 9007199254740992\r\n };\r\n \r\n return this.flowFactory.create(options);\r\n }\r\n\r\n flowFilesSubmitted = (files: Array, event: Event, flow: any, path: string) : void => {\r\n this.authenticationSrv.refreshToken().then((data) => {\r\n flow.opts.query.dropboxUploadPath = path;\r\n flow.opts.headers.Authorization = \"Bearer \" + data.access_token;\r\n flow.upload();\r\n });\r\n }\r\n\r\n flowComplete = ($flow: flowjs.IFlow) : void => {\r\n this.$timeout((flow) => {\r\n flow.files = [];\r\n }, 2000, true, $flow);\r\n }\r\n }\r\n}\r\n\r\nangular.module('app.shared').service('dropboxSrv', Shared.DropboxService);","module EmploymentStatus {\r\n\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n export class EsaQuestionaireAnswer {\r\n public answerId: number;\r\n public questionNumber: number;\r\n public question: string;\r\n public answerText: any;\r\n public answerFixedSelection: string;\r\n public esaQuestionaireID: number;\r\n public sectionNumber: number = 0;\r\n }\r\n}\r\n","module EmploymentStatus {\r\n\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n export class ESAContractFile {\r\n // ESACONTRACTFILEID\r\n public esaContractFileId: number = 0;\r\n // ESAQUESTIONAIREID\r\n public esaQuestionaireId: number = 0;\r\n // CONTRACTFILE\r\n public contractFile: Blob = null;\r\n // CONTRACTFILENAME\r\n public contractFileName: string = null;\r\n // CONTRACTFILESIZE\r\n public contractFileSize: number = 0;\r\n }\r\n}\r\n","module EmploymentStatus {\r\n export class IndustrySector {\r\n name: string;\r\n value: string;\r\n group: string;\r\n constructor(name: string, value: string, group: string) {\r\n this.name = name;\r\n this.value = value;\r\n this.group = group;\r\n }\r\n }\r\n}\r\n","/// \n/// \n/// \n\nmodule EmploymentStatus {\n\n // $Classes/Enums/Interfaces(filter)[template][separator]\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\n // template: The template to repeat for each matched item\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\n\n // More info: http://frhagn.github.io/Typewriter/\n\n\n export class EsaQuestionaire {\n\n // ESAQUESTIONAIREID\n public esaQuestionaireId: number = 0;\n // REVIEWID\n public reviewId: number = 0;\n // DATECREATED\n public dateCreated: Date = null;\n // VERSION\n public version: number = 0;\n // EMPSTATUSHELPCONFIRM\n public empStatusHelpConfirm: boolean = false;\n // ANSWERSTRUECONFIRM\n public answersTrueConfirm: boolean = false;\n // CONTACTTIME\n public contactTime: string = null;\n // ASSIGNMENTID\n public assignmentId: string = null;\n // SAVED\n public saved: boolean = false;\n // SITELOCATION\n public siteLocation: string = null;\n // JOBTITLE\n public jobTitle: string = null;\n // INDUSTRYSECTOR\n public industrySector: string = null;\n // DATESUBMITTED\n public dateSubmitted: Date = null;\n // ESAQUESTIONAIREANSWERS\n public esaQuestionaireAnswers: Array = [];\n //ESACONTRACTFILE\r\n public contractFileExists: boolean = false;\r\n //FLOW\r\n public flow: any = null;\r\n //FLOWOPTIONS\r\n public flowOptions: any = null;\r\n //ESACONTRACTFILE\r\n public esaContractFile: ESAContractFile = null;\r\n //DELETE CONTRACT\r\n public deleteContract: boolean = false;\n\n /**\n *\n */\n constructor(assignmentID:string) {\n this.assignmentId = assignmentID;\n this.dateCreated = new Date();\n this.version = 3;\n this.dateSubmitted = new Date();\n }\n }\n}\n","\r\nmodule EmploymentStatus {\r\n\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class EsaQuestionaireQuestions {\r\n \r\n // QUESTIONNUMBERID\r\n public questionNumberID: number = 0;\r\n // QUESTIONNUMBER\r\n public questionNumber: number = 0;\r\n // QUESTION\r\n public question: string = null;\r\n }\r\n}\r\n","/// \r\nmodule EmploymentStatus {\r\n\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class EsaQuestionaireQuestions3 extends EsaQuestionaireQuestions {\r\n \r\n // GROUP\r\n public group: string = null;\r\n // SUPPLEMENTALQUESTION\r\n public supplementalQuestion: string = null;\r\n }\r\n}\r\n","\r\nmodule EmploymentStatus {\r\n\r\n // $Classes/Enums/Interfaces(filter)[template][separator]\r\n // filter (optional): Matches the name or full name of the current item. * = match any, wrap in [] to match attributes or prefix with : to match interfaces or base classes.\r\n // template: The template to repeat for each matched item\r\n // separator (optional): A separator template that is placed between all templates e.g. $Properties[public $name: $Type][, ]\r\n\r\n // More info: http://frhagn.github.io/Typewriter/\r\n\r\n \r\n export class MemberAdvisedStatus {\r\n \r\n // MEMBERADVISEDSTATUSID\r\n public memberAdvisedStatusId: number = 0;\r\n // STATUS\r\n public status: string = null;\r\n // ASSIGNMENTID\r\n public assignmentId: string = null;\r\n // DATECREATED\r\n public dateCreated: Date = null;\r\n }\r\n}\r\n","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n import EsaQuestionaire = EmploymentStatus.EsaQuestionaire;\r\n import EsaQuestionaireQuestions3 = EmploymentStatus.EsaQuestionaireQuestions3;\r\n import MemberStatus = EmploymentStatus.MemberAdvisedStatus;\r\n\r\n export class GetQuestionnaireRequest {\r\n assignmentId: string;\r\n reviewId: number;\r\n\r\n constructor(assignmentId: string, reviewId: number) {\r\n this.assignmentId = assignmentId;\r\n this.reviewId = reviewId;\r\n }\r\n }\r\n\r\n export interface IEmploymentStatusSrv {\r\n getAssignments(silentMode?: boolean,cache?:boolean): ng.IPromise<{}>;\r\n getQuestions(silentMode?: boolean): ng.IPromise>;\r\n getQuestionnaire(assignmentId: string, reviewId: any): ng.IPromise;\r\n saveQuestionnaire(qnairre: EsaQuestionaire): ng.IPromise;\r\n getQuestionByQuestionNumber(questionNumber: number): Array;\r\n getQuestionByQuestionNumberAndGroup(questionNumber: number, group: string): Array;\r\n saveIR35Status(memberStatus: MemberStatus): ng.IPromise;\r\n getIR35Status(assignmentId: string): ng.IPromise;\r\n removeContractData(esaQuestionnaireId: string);\r\n CheckIR35AssessmentAllowed();\r\n\r\n IR35Status_TaxedAsPAYE: EmploymentStatus.IR35Status;\r\n IR35Status_TaxedAsSelfEmployed: EmploymentStatus.IR35Status;\r\n IR35Status_Caution: EmploymentStatus.IR35Status;\r\n IR35Status_ActionRequired: EmploymentStatus.IR35Status;\r\n IR35Status_WithdrawnReview: EmploymentStatus.IR35Status;\r\n IR35Status_AssessmentFormSubmit: EmploymentStatus.IR35Status;\r\n IR35Status_AssessmentFormStarted: EmploymentStatus.IR35Status;\r\n FinalOutcome_Captured: EmploymentStatus.IR35Status;\r\n FinalOutcome_NotCaptured: EmploymentStatus.IR35Status;\r\n FinalOutcome_Inconclusive: EmploymentStatus.IR35Status;\r\n FinalOutcome_UnderReview: EmploymentStatus.IR35Status;\r\n\r\n }\r\n\r\n class EmploymentStatusSrv implements IEmploymentStatusSrv {\r\n\r\n public IR35Status_TaxedAsPAYE: EmploymentStatus.IR35Status = { text: \"Taxed as PAYE (No Review)\", style: 'label-success' };\r\n public IR35Status_TaxedAsSelfEmployed: EmploymentStatus.IR35Status = { text:\"Taxed as Self Employed (No Review)\", style: 'label-success' };\r\n public IR35Status_Caution: EmploymentStatus.IR35Status = { text:\"Caution\", style: 'label-warning' };\r\n public IR35Status_ActionRequired: EmploymentStatus.IR35Status = { text:\"Action Required\", style: 'label-danger' };\r\n public IR35Status_WithdrawnReview: EmploymentStatus.IR35Status = { text:\"Review Incomplete\", style: 'label-warning' };\r\n public IR35Status_AssessmentFormSubmit: EmploymentStatus.IR35Status = { text:\"Assessment Form Submitted\", style: 'label-success' };\r\n public IR35Status_AssessmentFormStarted: EmploymentStatus.IR35Status = { text:\"Assessment Form Incomplete\", style: 'label-warning' };\r\n public FinalOutcome_Captured :EmploymentStatus.IR35Status= { text:\"Captured\", style: 'label-success' };\r\n public FinalOutcome_NotCaptured :EmploymentStatus.IR35Status= { text:\"Not Captured\", style: 'label-success' };\r\n public FinalOutcome_Inconclusive :EmploymentStatus.IR35Status= { text:\"Inconclusive\", style: 'label-warning' };\r\n public FinalOutcome_UnderReview :EmploymentStatus.IR35Status= { text:\"Under Review\", style: 'label-warning' };\r\n\r\n serviceBase: any;\r\n private questions: Array;\r\n\r\n static $inject = ['$http', '$q', 'shared.config'];\r\n\r\n constructor(private $http: ng.IHttpService, private $q: ng.IQService, private sharedConfig: any) {\r\n this.serviceBase = sharedConfig.baseApiUrl;\r\n this.$http = $http;\r\n this.$q = $q;\r\n this.questions = [];\r\n }\r\n\r\n getAssignments(silentMode: boolean,cache:boolean=true): ng.IHttpPromise> {\r\n let url = this.serviceBase + 'api/IR35/GetAssignments';\r\n let params = {\r\n cache: cache,\r\n silentMode: silentMode ? silentMode : false\r\n };\r\n\r\n return this.$http.get(url, params).then(response => response.data);\r\n }\r\n\r\n getQuestions(silentMode: boolean): ng.IPromise> {\r\n const url = this.serviceBase + 'api/IR35/GetQuestionList';\r\n const params = {\r\n cache: true,\r\n silentMode: silentMode ? silentMode : false\r\n };\r\n let defer = this.$q.defer>();\r\n\r\n if (!this.questions || !this.questions.length) {\r\n this.$http.get(url, params).then((response: ng.IHttpPromiseCallbackArg>) => {\r\n defer.resolve(response.data);\r\n this.questions = response.data;\r\n });\r\n } else {\r\n defer.resolve(this.questions);\r\n }\r\n\r\n return defer.promise;\r\n }\r\n\r\n getQuestionnaire(assignmentId: string, reviewId: any): ng.IPromise {\r\n let url = this.serviceBase + 'api/IR35/GetQuestionnaire';\r\n var config: ng.IRequestShortcutConfig = { params: { assignmentId: assignmentId, reviewId: reviewId } };\r\n return this.$http.get(url, config).then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n\r\n saveQuestionnaire(qnnaire: EsaQuestionaire): ng.IPromise {\r\n let url = this.serviceBase + 'api/IR35/SaveQuestionnaire';\r\n let defer = this.$q.defer();\r\n this.$http.post(url, qnnaire).then((result: ng.IHttpPromiseCallbackArg) => {\r\n defer.resolve(result.data);\r\n }).catch(() => {\r\n defer.reject();\r\n });\r\n\r\n return defer.promise;\r\n }\r\n\r\n removeContractData = (esaQuestionnaireId: string, silentMode?: boolean) => {\r\n let url = this.serviceBase + 'api/IR35/RemoveContractData';\r\n return this.$http.post(url, esaQuestionnaireId).then(response => response.data);\r\n }\r\n\r\n getQuestionByQuestionNumber(questionNumber: number): Array {\r\n return _.filter(this.questions, { 'questionNumber': questionNumber });\r\n }\r\n\r\n getQuestionByQuestionNumberAndGroup(questionNumber: number, group: string): Array {\r\n return _.filter(this.questions, { 'questionNumber': questionNumber, 'group': group });\r\n }\r\n\r\n saveIR35Status = (memberStatus: MemberStatus): ng.IPromise => {\r\n let url = this.serviceBase + 'api/IR35/SaveIr35Status';\r\n return this.$http.post(url, memberStatus).then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n\r\n getIR35Status = (assignmentId: string): ng.IPromise => {\r\n let url = this.serviceBase + 'api/IR35/GetIr35Status';\r\n var config: ng.IRequestShortcutConfig = { params: { assignmentId: assignmentId } };\r\n return this.$http.get(url, config).then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n\r\n CheckIR35AssessmentAllowed = (): ng.IPromise => {\r\n let url = this.serviceBase + 'api/IR35/CheckIR35AssessmentAllowed';\r\n return this.$http.get(url).then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n }\r\n\r\n angular\r\n .module('app.shared')\r\n .service('employmentStatusSrv', EmploymentStatusSrv);\r\n}\r\n","/// \r\nmodule Shared {\r\n export interface IFinancialCenterService {\r\n getProfitAndLossSummary(startDate: Date, endDate: Date): ng.IPromise;\r\n }\r\n\r\n export class FinancialCenterService implements IFinancialCenterService {\r\n\r\n static $inject = [\"$http\", \"shared.config\", \"brookson.utilities.date\"];\r\n\r\n private serviceBase: any;\r\n\r\n constructor(private $http: ng.IHttpService, private sharedConfig: any, private dateUtils: IBrooksonUtilitiesDate) {\r\n this.serviceBase = sharedConfig.baseApiUrl;\r\n }\r\n\r\n getProfitAndLossSummary(startDate: Date, endDate: Date): angular.IPromise {\r\n let url = this.serviceBase + \"api/FinancialCenter/GetProfitAndLossSummary\";\r\n\r\n var requestData = {\r\n startDate: this.dateUtils.convertToServerString(startDate),\r\n endDate: this.dateUtils.convertToServerString(endDate)\r\n };\r\n\r\n return this.$http.get(url, { params: requestData }).then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"app.shared\").service(\"financialCenterSrv\", Shared.FinancialCenterService);","/// \r\n/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n export interface IHolidaysSrv {\r\n submitHolidayRequest(startDate: BrooksonDate, endDate: BrooksonDate, employeeName: string): ng.IPromise;\r\n approveHolidayRequest(requestId: number): ng.IPromise;\r\n rejectHolidayRequest(requestId: number, reason: string): ng.IPromise;\r\n getCompanyHolidays(startDate: Date, endDate: Date): ng.IPromise>;\r\n getBankHolidays(country: string, endDate: Date, region: string, startDate: Date): ng.IPromise>;\r\n getRemainingHolidayAllowance(): ng.IPromise;\r\n getEmployeeHolidayAllowance(): ng.IPromise;\r\n getStartOfHolidayYear(): ng.IPromise;\r\n deleteHolidayRequest(holidayRequestId: number, employeeId: number): ng.IPromise;\r\n getUserHolidayRequests(startDate: BrooksonDate, endDate: BrooksonDate, status: number): angular.IPromise>;\r\n getCompanyHolidayRequests(startDate: Date, endDate: Date, status: number): angular.IPromise>;\r\n getCompanyActiveHolidayRequests(): angular.IPromise>;\r\n getNextHoliday(): ng.IPromise;\r\n }\r\n\r\n export class HolidaysSrv implements IHolidaysSrv {\r\n\r\n static $inject = [\"$http\", \"brookson.utilities.date\"];\r\n\r\n constructor(\r\n private $http: ng.IHttpService,\r\n private dateUtils: Shared.IBrooksonUtilitiesDate) {\r\n }\r\n\r\n submitHolidayRequest(startDate: BrooksonDate, endDate: BrooksonDate, employeeName: string): angular.IPromise {\r\n let url = \"api/Holiday/SubmitHolidayRequest\";\r\n\r\n var requestData = {\r\n startDate: this.dateUtils.convertToServerString(startDate),\r\n endDate: this.dateUtils.convertToServerString(endDate),\r\n employeeName: employeeName\r\n };\r\n\r\n return this.$http.get(url, { params: requestData }).then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n\r\n approveHolidayRequest(requestId: number): angular.IPromise {\r\n let url = \"api/Holiday/ApproveHolidayRequest?requestId=\" + requestId;\r\n\r\n const config = {\r\n headers: {\r\n silentMode: false\r\n }\r\n };\r\n\r\n return this.$http.get(url, config).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n rejectHolidayRequest(requestId: number, reason: string): angular.IPromise {\r\n let url = \"api/Holiday/RejectHolidayRequest\";\r\n\r\n var requestData = {\r\n holidayRequestId: requestId,\r\n reason: reason\r\n };\r\n\r\n const config = {\r\n headers: {\r\n silentMode: false\r\n }\r\n };\r\n\r\n return this.$http.post(url, requestData, config).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getCompanyHolidays(startDate: Date, endDate: Date): angular.IPromise> {\r\n let url = \"api/Holiday/GetCompanyHolidays\";\r\n\r\n var requestData = {\r\n startDate: this.dateUtils.convertToServerString(startDate),\r\n endDate: this.dateUtils.convertToServerString(endDate)\r\n };\r\n\r\n return this.$http.get(url, { params: requestData }).then((response: ng.IHttpPromiseCallbackArg>) => response.data);\r\n }\r\n\r\n getCompanyHolidayRequests(startDate: Date, endDate: Date, status: number): angular.IPromise> {\r\n let url = \"api/Holiday/GetCompanyHolidayRequests\";\r\n\r\n var requestData = {\r\n startDate: startDate,\r\n endDate: endDate,\r\n status: status\r\n };\r\n\r\n const config = {\r\n headers: {\r\n silentMode: false\r\n }\r\n };\r\n\r\n return this.$http.post(url, requestData, config).then((response: ng.IHttpPromiseCallbackArg>) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getUserHolidayRequests(startDate: BrooksonDate, endDate: BrooksonDate, status: number): angular.IPromise> {\r\n let url = \"api/Holiday/GetUserHolidayRequests\";\r\n\r\n var requestData = {\r\n startDate: startDate,\r\n endDate: endDate,\r\n status: status\r\n };\r\n\r\n const config = {\r\n headers: {\r\n silentMode: false\r\n }\r\n };\r\n\r\n return this.$http.post(url, requestData, config).then((response: ng.IHttpPromiseCallbackArg>) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getBankHolidays(country: string, endDate: Date, region: string, startDate: Date): angular.IPromise {\r\n throw new Error(\"Not implemented\");\r\n }\r\n\r\n getRemainingHolidayAllowance(): angular.IPromise {\r\n let url = \"api/Holiday/GetRemainingHolidayTime\";\r\n\r\n return this.$http.get(url).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getEmployeeHolidayAllowance(): angular.IPromise {\r\n let url = \"api/Holiday/GetEmployeeHolidayAllowance\";\r\n\r\n return this.$http.get(url).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n deleteHolidayRequest(holidayRequestId: number, employeeId: number): angular.IPromise {\r\n let url = `api/Holiday/DeleteHolidayRequest?holidayRequestId=${holidayRequestId}&employeeId=${employeeId}`;\r\n\r\n const config = {\r\n headers: {\r\n silentMode: false\r\n }\r\n };\r\n\r\n return this.$http.delete(url, config).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n },\r\n error => {\r\n return false;\r\n });\r\n }\r\n\r\n getStartOfHolidayYear(): angular.IPromise {\r\n let url = \"api/Holiday/GetStartOfHolidayYear\";\r\n\r\n return this.$http.get(url).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getNextHoliday(): angular.IPromise {\r\n let url = \"api/Holiday/GetNextHoliday\";\r\n\r\n return this.$http.get(url).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getCompanyActiveHolidayRequests(): angular.IPromise {\r\n let url = \"api/Holiday/GetCompanyActiveHolidayRequests\";\r\n\r\n const config = {\r\n headers: {\r\n silentMode: false\r\n }\r\n };\r\n\r\n return this.$http.get(url, config).then((response: ng.IHttpPromiseCallbackArg>) => {\r\n return response.data;\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"app.shared\").service(\"holidaysSrv\", Shared.HolidaysSrv);","module Shared {\r\n export module Invoicing {\r\n export enum InvoiceType {\r\n any,\r\n salesLedger,\r\n invoicing,\r\n receipts,\r\n credits\r\n }\r\n }\r\n}","/// \r\n\r\nmodule Shared {\r\n export module Invoicing {\r\n export class TimesheetCompactUmbrella { \r\n companyNumber: string;\r\n timesheetID: string;\r\n timesheetEndDate: Shared.BrooksonDate;\r\n timesheetCreated: Shared.BrooksonDate;\r\n timesheetValue: number;\r\n timesheetModified: Shared.BrooksonDate;\r\n agencyName: string;\r\n inRemittanceApp: boolean;\r\n remittanceReceived: Shared.BrooksonDate;\r\n hasRemittanceReceived: boolean;\r\n fundsReceivedDate: Shared.BrooksonDate;\r\n payYear: number;\r\n payPeriod: number;\r\n payrollStatus: string;\r\n payrollDate: Shared.BrooksonDate;\r\n fundsReceived: boolean;\r\n payrollProcessed: boolean;\r\n paymentMade: boolean; \r\n }\r\n }\r\n}","/// \r\n\r\nmodule Shared {\r\n export module Invoicing {\r\n export class InvoiceUmbrellaCompact { \r\n companyNumber: string;\r\n timesheetNumber: string;\r\n workPeriodEndDate: Shared.BrooksonDate;\r\n postingDescription: string;\r\n created: Shared.BrooksonDate;\r\n rationale: number;\r\n approvedOn: Shared.BrooksonDate;\r\n lastUpdated: Shared.BrooksonDate;\r\n invoiceAmount: number;\r\n hours: number;\r\n payPeriod: number;\r\n statusDescription: string;\r\n rationaleDescription: string;\r\n sellToCustomerName: string;\r\n customerRationaleDis: string;\r\n payslip: string;\r\n }\r\n }\r\n}","/// \r\n\r\nmodule Shared {\r\n export module Invoicing {\r\n export class PaymentUmbrellaCompact {\r\n memberId: string;\r\n payslip: string;\r\n paymentDate: string;\r\n paymentAmount: number;\r\n cumulativePayment: number;\r\n }\r\n }\r\n}","/// \r\n\r\nmodule Shared {\r\n export module Invoicing {\r\n export class PayslipUmbrellaCompact {\r\n companyNumber: string;\r\n payYear: number;\r\n payPeriod: number;\r\n payrollNumber: number;\r\n personId: number;\r\n paymentDate: string;\r\n payrollItemCode: string;\r\n workPeriodEndDate: string;\r\n amount: number;\r\n timesheetNumber: string;\r\n createdDate: string;\r\n payslip: string;\r\n invoiceCount: number;\r\n }\r\n }\r\n}","module Shared {\r\n export module Invoicing {\r\n export class InvoicePreference {\r\n includeCompanyLogo: boolean;\r\n azureCompanyLogoSharedAccessSignature: string;\r\n colour: string;\r\n fontfamily: string;\r\n includeCompanyAddress: boolean;\r\n includeCompanyRegNo: boolean;\r\n includeInvoiceDate: boolean;\r\n includePaymentDueDate: boolean;\r\n includeOrderReference: boolean;\r\n includeDiscountPounds: boolean;\r\n includeDiscountPercentage: boolean;\r\n includeDeductions: boolean;\r\n includeCisDeductions: boolean;\r\n includeBankDetails: boolean;\r\n includeNotes: boolean;\r\n defaultNoteText: string;\r\n fullInvoiceId: number;\r\n }\r\n }\r\n}","/// \r\n\r\nmodule Shared {\r\n export module Invoicing {\r\n\r\n export class FullInvoice {\r\n id: number;\r\n memberId: number;\r\n companyRef: string;\r\n assignmentId: string;\r\n periodEndDate: Shared.BrooksonDate;\r\n invoiceDate: Shared.BrooksonDate;\r\n paymentDueDate: Shared.BrooksonDate;\r\n poNumber: string;\r\n totalExVat: number;\r\n discount: number;\r\n discountPercentage: number;\r\n vatRate: number;\r\n vatAmount: number;\r\n totalincVat: number;\r\n deductions: number;\r\n deductionText: string;\r\n cisDeductions: number;\r\n totalAmountDue: number;\r\n notes: string;\r\n invoicePreferences: InvoicePreference;\r\n invoiceLines: FullInvoiceLine[];\r\n fullInvoiceAttachments: FullInvoiceAttachment[];\r\n submitToNav: boolean;\r\n type: string;\r\n bankAccountId: string;\r\n invoiceNumber: string;\r\n currencyCode: number;\r\n }\r\n\r\n export class FullInvoiceLine {\r\n id: number;\r\n fullInvoiceId: number;\r\n description: string;\r\n quantity: number;\r\n rateCode: string;\r\n rateCodeDescription: string;\r\n rateCodeValue: number;\r\n lineAmount: number;\r\n }\r\n\r\n export class FullInvoiceAttachment {\r\n id: number;\r\n fullInvoiceId: number;\r\n fileName: string;\r\n azureFileName: string;\r\n mimetype: string;\r\n }\r\n }\r\n}","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\nmodule Shared {\r\n interface IBrooksonInvoicingServiceCalcTotalsReturn {\r\n gross: number;\r\n net: number;\r\n }\r\n\r\n export class BrooksonInvoicingService {\r\n static $inject = ['$http', 'shared.config'];\r\n\r\n public serviceBase: string;\r\n\r\n constructor(\r\n private $http: Shared.IBrooksonHttp,\r\n private sharedConfig\r\n ) {\r\n this.init();\r\n }\r\n\r\n init = (): void => {\r\n this.serviceBase = this.sharedConfig.baseApiUrl;\r\n }\r\n\r\n getInvoicesByType = (pageSize: number, pageNo: number, invoiceType: number, ledgerStatus: number): ng.IPromise> => {\r\n let requestData = {\r\n pageNo: pageNo,\r\n pageSize: pageSize,\r\n ledgerStatus: ledgerStatus,\r\n invoiceType: invoiceType\r\n };\r\n\r\n return this.$http.post(this.serviceBase + 'api/Invoicing/GetInvoices', requestData)\r\n .then((response: ng.IHttpPromiseCallbackArg>): Array => {\r\n return response.data;\r\n });\r\n }\r\n\r\n createInvoice = (invoice: Shared.Invoicing.Invoice): ng.IPromise => {\r\n let requestData = {\r\n invoice: invoice\r\n };\r\n\r\n return this.$http.post(this.serviceBase + 'api/Invoicing/CreateInvoice', requestData)\r\n .then((response: ng.IHttpPromiseCallbackArg): Shared.InvoiceCreationStatus => {\r\n return response.data;\r\n });\r\n }\r\n\r\n createInvoiceOverride = (invoice: Shared.Invoicing.Invoice): ng.IPromise => {\r\n let requestData = {\r\n invoice: invoice\r\n };\r\n\r\n return this.$http.post(this.serviceBase + 'api/Invoicing/CreateInvoiceOverride', requestData)\r\n .then((response: ng.IHttpPromiseCallbackArg): Shared.InvoiceCreationStatus => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getInvoice = (id: string): ng.IPromise => {\r\n return this.$http.get(this.serviceBase + 'api/Invoicing/GetDetailedInvoiceById/' + id.replace(\":\", '-'))\r\n .then((response: ng.IHttpPromiseCallbackArg): Shared.Invoicing.DetailedInvoice => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getInvoicingOverview = (): ng.IPromise => {\r\n return this.$http.get(this.serviceBase + 'api/Invoicing/GetInvoicingOverview', {\r\n silentMode: true\r\n })\r\n .then((response: ng.IHttpPromiseCallbackArg): Shared.Invoicing.InvoicingOverview => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getTimesheetUmbreallaOverview = (): ng.IPromise => {\r\n return this.$http.get(this.serviceBase + 'api/Invoicing/GetTimesheetUmbrellaCompact', {\r\n silentMode: true\r\n })\r\n .then((response: ng.IHttpPromiseCallbackArg): Shared.Invoicing.TimesheetCompactUmbrella => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getInvoicingUmbrellaOverview = (): ng.IPromise => {\r\n return this.$http.get(this.serviceBase + 'api/Invoicing/GetInvoicingUmbrellaDashboard', {\r\n silentMode: true\r\n })\r\n .then((response: ng.IHttpPromiseCallbackArg): Shared.Invoicing.InvoicingUmbrellaDashboard => {\r\n return response.data;\r\n });\r\n }\r\n\r\n saveInvoice = (invoice: Shared.Invoicing.Invoice, silentMode?: boolean): ng.IPromise => {\r\n let requestData = {\r\n invoice: invoice\r\n };\r\n\r\n return this.$http.post('api/Invoicing/SaveInvoice', requestData, {\r\n silentMode: silentMode ? silentMode : false\r\n })\r\n .then((response: ng.IHttpPromiseCallbackArg): boolean => {\r\n return response.data;\r\n });\r\n }\r\n\r\n updateDefaultHoursPerDay = (defaultHours: Shared.Invoicing.DefaultHoursRequest): ng.IPromise => {\r\n return this.$http.post('api/Invoicing/UpdateDefaultHoursPerDay', defaultHours).then((response: ng.IHttpPromiseCallbackArg): boolean => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getSavedInvoice = (invoiceId: string, silentMode?: boolean): ng.IPromise => {\r\n return this.$http.get(`api/Invoicing/GetSavedInvoice/${invoiceId}`, {\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg): Shared.SavedInvoice => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getSavedInvoiceForCrediting = (invoiceId: string, silentMode?: boolean): ng.IPromise => {\r\n var id = invoiceId.replace(\":\",\"-\");\r\n return this.$http.get(`api/Invoicing/GetInvoiceForCrediting/${id}`, {\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg): Shared.SavedInvoice => {\r\n return response.data;\r\n });\r\n }\r\n\r\n deleteSavedInvoice = (invoiceId: number, silentMode?: boolean): ng.IPromise => {\r\n return this.$http.delete(`api/Invoicing/DeleteSavedInvoice/${invoiceId}`, {\r\n silentMode: silentMode ? silentMode : false\r\n })\r\n .then((response: ng.IHttpPromiseCallbackArg): boolean => {\r\n return response.data;\r\n });\r\n }\r\n\r\n deleteSavedFullInvoice = (invoiceId: number, silentMode?: boolean): ng.IPromise => {\r\n return this.$http.delete(`api/Invoicing/DeleteSavedFullInvoice/${invoiceId}`, {\r\n silentMode: silentMode ? silentMode : false\r\n })\r\n .then((response: ng.IHttpPromiseCallbackArg): boolean => {\r\n return response.data;\r\n });\r\n }\r\n\r\n calculateTotals = (invoice: Shared.Invoicing.DetailedInvoice): IBrooksonInvoicingServiceCalcTotalsReturn => {\r\n let gross = 0;\r\n let net = 0;\r\n\r\n for (let index in invoice.appliedRates) {\r\n if (invoice.appliedRates.hasOwnProperty(index)) {\r\n let rate = invoice.appliedRates[index];\r\n if (rate.amountGross) {\r\n gross += rate.amountGross;\r\n }\r\n if (rate.amountNet) {\r\n net += rate.amountNet;\r\n }\r\n }\r\n }\r\n\r\n gross += invoice.expenses ? invoice.expenses : 0;\r\n\r\n return {\r\n gross: gross,\r\n net: net\r\n };\r\n }\r\n\r\n hidePublicSectorModal = (assignment: Shared.Assignment): ng.IPromise => {\r\n return this.$http.post(this.serviceBase + \"api/Invoicing/HidePublicSectorModal\", assignment).then((response: ng.IHttpPromiseCallbackArg) => { return response.data; });\r\n }\r\n\r\n creditInvoice = (invoiceId: string, replacementInvoice?: Shared.Invoicing.Invoice): ng.IPromise => {\r\n var data = {\r\n InvoiceId: invoiceId,\r\n ReplacementInvoice: replacementInvoice\r\n };\r\n return this.$http.post(this.serviceBase + \"api/Invoicing/creditInvoice\", data).then((response: ng.IHttpPromiseCallbackArg) => { \r\n return response.data; \r\n });\r\n }\r\n\r\n saveInvoicePreferences = (invoicePreferences: Shared.Invoicing.InvoicePreference): ng.IPromise => {\r\n return this.$http.post(this.serviceBase + \"api/Invoicing/saveInvoicePreferences\", invoicePreferences).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getCompanyInvoicePreferences = (): ng.IPromise => {\r\n return this.$http.get(this.serviceBase + \"api/Invoicing/getCompanyInvoicePreferences\").then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n saveFullInvoice = (fullinvoice: Shared.Invoicing.FullInvoice): ng.IPromise => {\r\n return this.$http.post(this.serviceBase + \"api/Invoicing/saveFullInvoice\", fullinvoice).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getFullInvoiceById = (fullinvoiceId: number): ng.IPromise => {\r\n let model = {\r\n fullinvoiceId: fullinvoiceId\r\n };\r\n\r\n return this.$http.post(this.serviceBase + \"api/Invoicing/getFullInvoiceById\", model).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getAttachmentsById = (fullinvoiceId: number): ng.IPromise> => {\r\n let model = {\r\n fullinvoiceId: fullinvoiceId\r\n };\r\n\r\n return this.$http.post(this.serviceBase + \"api/Invoicing/getAttachmentsById\", model).then((response: ng.IHttpPromiseCallbackArg>) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n removeAttachmentById = (fullInvoiceId: number, attachmentId: number, azureFilename: string): ng.IPromise => {\r\n var model = {\r\n fullinvoiceId: fullInvoiceId,\r\n attachmentId: attachmentId,\r\n azureFileName: azureFilename\r\n };\r\n\r\n return this.$http.post(this.serviceBase + \"api/Invoicing/removeAttachmentById\", model).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getInvoicePdfSharedAccessSignatureUrl = (invoiceNumber: string): ng.IPromise => {\r\n var model = {\r\n invoiceNumber: invoiceNumber\r\n };\r\n\r\n return this.$http.post(this.serviceBase + \"api/Invoicing/InvoicePdfSharedAccessSignatureUrl\", model).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n downloadInvoicePdf = (invoiceNumber: string): any => {\r\n var model = {\r\n invoiceNumber: invoiceNumber\r\n };\r\n\r\n return this.$http.post(this.serviceBase + \"Invoicing/DownloadInvoicePdf\", model).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n getCurrentVatrate = (vatBusPostingGroup: string, vatProdPostingGroup: string): ng.IPromise => {\r\n var model = {\r\n vatBusPostingGroup: vatBusPostingGroup,\r\n vatProdPostingGroup: vatProdPostingGroup\r\n };\r\n return this.$http.post(this.serviceBase + 'api/invoicing/getCurrentVatrate', model).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n determineVatStatusByPeriodEndDate = (periodEndDate: Date): ng.IPromise => {\r\n var model = {\r\n periodEndDate: periodEndDate\r\n };\r\n return this.$http.post(this.serviceBase + 'api/invoicing/determineVatStatusByPeriodEndDate', model).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n umbrellaCheck = (companyRef : string): ng.IPromise => {\r\n var model = {\r\n CompanyRef : companyRef\r\n };\r\n return this.$http.post(this.serviceBase + 'api/invoicing/IsUmbrellaCompany', model).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n regenerateFullInvoicePdf = (invoice: Shared.Invoicing.InvoiceCompact): ng.IPromise => {\r\n return this.$http.post(this.serviceBase + 'api/invoicing/RegenerateFullInvoice', invoice).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .service('invoicingSrv', Shared.BrooksonInvoicingService);","(() => {\r\n 'use strict';\r\n\r\n angular\r\n .module('app.shared')\r\n .service('loggerSrv', loggerSrv);\r\n\r\n loggerSrv.$inject = ['$injector', 'shared.config'];\r\n\r\n function loggerSrv($injector, sharedConfig) {\r\n // Service\r\n var service:any = {};\r\n\r\n // Data\r\n var serviceBase = sharedConfig.baseApiUrl;\r\n var $http;\r\n\r\n // Methods\r\n service.log = log;\r\n\r\n function log(level, title, data, cause) {\r\n $http = $http || $injector.get('$http');\r\n\r\n var request = {\r\n loggingLevel: level,\r\n url: location.href,\r\n title: title,\r\n data: data ? angular.toJson(data, true) : data,\r\n cause: cause\r\n };\r\n\r\n return $http.post(serviceBase + 'api/Logging/Log', request, {\r\n silentMode: true\r\n }).then((response) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n return service;\r\n }\r\n})();\r\n","module Shared {\r\n export interface IUmbrellaTrustModalService {\r\n options: ng.ui.bootstrap.IModalSettings;\r\n\r\n show(): ng.ui.bootstrap.IModalServiceInstance;\r\n }\r\n\r\n export class BrooksonUmbrellaTrustModalService implements IUmbrellaTrustModalService {\r\n public options: ng.ui.bootstrap.IModalSettings = {\r\n animation: true,\r\n size: \"md\",\r\n template: `
      \r\n
      \r\n

      Notice

      \r\n
      \r\n
      \r\n
      \r\n
      \r\n

      Please ensure that you submit timesheets on the appropriate Trust timesheet portal, which you should have received an email activation for. Connect is for your records and reference only and not viewed by your Trust.

      \r\n
      \r\n
      \r\n
      \r\n
      \r\n \r\n
      \r\n
      `,\r\n keyboard: false,\r\n controller: BrooksonUmbrellaTrustModalController,\r\n controllerAs: \"$ctrl\",\r\n backdrop: \"static\",\r\n windowClass: \"modal-umbrellaTrustModal\"\r\n };\r\n\r\n static $inject = ['$uibModal'];\r\n\r\n constructor (\r\n private $uibModal: ng.ui.bootstrap.IModalService\r\n ) { }\r\n\r\n public show = (): ng.ui.bootstrap.IModalServiceInstance => {\r\n return this.$uibModal.open(this.options);\r\n }\r\n }\r\n\r\n class BrooksonUmbrellaTrustModalController {\r\n static $inject = ['$uibModalInstance'];\r\n\r\n constructor(\r\n private $uibModalInstance\r\n ) { }\r\n\r\n public close = (): void => {\r\n this.$uibModalInstance.dismiss(\"cancel\");\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module(\"app.shared\")\r\n .service(\"umbrellaTrustModalService\", Shared.BrooksonUmbrellaTrustModalService);","\r\nmodule Shared {\r\n\r\n export module openbankingWidget{\r\n\r\n export interface IWidgetAccount {\r\n bankAccountKey: string;\r\n sortCode: string;\r\n accountNumber: string;\r\n availableBalance: number;\r\n blocked: boolean;\r\n reconciliationDate: Date;\r\n bankName: string;\r\n bankId: string;\r\n accountType: string;\r\n type: string;\r\n viewAccess: boolean;\r\n key: string;\r\n viewAccessDescription: string;\r\n bankLogo: string;\r\n className: string;\r\n authorisedProvider: boolean;\r\n authLink: string;\r\n consentReminder: boolean;\r\n consentDateDue: Date;\r\n consentExpired: boolean;\r\n consentStatus: number;\r\n success: boolean;\r\n pendingStatus: boolean;\r\n mandateAvailable: boolean;\r\n hasAccessToken: boolean;\r\n hasPendingBankStatement: boolean;\r\n pendingBankStatementBalance: number;\r\n csvUploadEnabled: boolean;\r\n }\r\n\r\n export class WidgetAccount implements IWidgetAccount\r\n {\r\n bankAccountKey: string;\r\n sortCode: string;\r\n accountNumber: string;\r\n availableBalance: number;\r\n blocked: boolean;\r\n reconciliationDate: Date;\r\n bankName: string;\r\n bankId: string;\r\n accountType: string;\r\n type: string;\r\n viewAccess: boolean;\r\n key: string;\r\n viewAccessDescription: string;\r\n bankLogo: string;\r\n className: string;\r\n authorisedProvider: boolean;\r\n authLink: string;\r\n truelayerAuthLink: string;\r\n consentReminder: boolean;\r\n consentDateDue: Date;\r\n consentExpired: boolean;\r\n consentStatus: number;\r\n success: boolean;\r\n pendingStatus: boolean;\r\n mandateAvailable: boolean;\r\n hasAccessToken: boolean;\r\n hasPendingBankStatement: boolean;\r\n pendingBankStatementBalance: number;\r\n csvUploadEnabled: boolean;\r\n }\r\n\r\n export enum accountType {\r\n Business,\r\n Personal,\r\n DLA\r\n }\r\n\r\n export enum bankType {\r\n Current,\r\n Deposit,\r\n Credit_Card,\r\n Deposit_Bond\r\n }\r\n\r\n export enum ConsentStatus {\r\n ConsentError = -3,\r\n AccessTokenError = -2,\r\n NotConsented = 0,\r\n AccessTokenPending = 1,\r\n AccessTokenReceived = 2,\r\n BankAccountsReceived = 3,\r\n BankBalancesReceived = 4,\r\n BankTransactionsReceive = 5\r\n }\r\n\r\n }\r\n\r\n\r\n}\r\n","/// \r\n/// \r\n\r\nmodule Shared {\r\n export interface IOpenbankingWidgetService {\r\n getOpenBankingWidgetData(): ng.IPromise;\r\n getGetBankStatementData(): ng.IPromise;\r\n disableWidgetButtons(disableButtons: boolean): ng.IPromise;\r\n }\r\n\r\n export class OpenbankingWidgetService implements IOpenbankingWidgetService {\r\n static $inject = ['$http', '$q'];\r\n constructor(private $http: IBrooksonHttp, private $q: ng.IQService) { }\r\n\r\n public getOpenBankingWidgetData = (silentMode?: boolean): ng.IPromise => {\r\n\r\n const deferred = this.$q.defer();\r\n const url = \"api/ob/GetOpenBankingWidgetData\";\r\n\r\n this.$http.get(url, { silentMode: silentMode ? silentMode : false})\r\n .then((response: any): void => {\r\n deferred.resolve(response.data);\r\n });\r\n\r\n return deferred.promise;\r\n }\r\n \r\n public getGetBankStatementData = (silentMode?: boolean): ng.IPromise => {\r\n\r\n const deferred = this.$q.defer();\r\n const url = \"api/ob/GetBankStatementData\";\r\n\r\n this.$http.get(url, { silentMode: silentMode ? silentMode : false})\r\n .then((response: any): void => {\r\n deferred.resolve(response.data);\r\n });\r\n\r\n return deferred.promise;\r\n }\r\n\r\n public disableWidgetButtons = (disable: boolean, silentMode?: boolean): ng.IPromise => {\r\n const deferred = this.$q.defer();\r\n const url = \"api/ob/DisableWidgetButtons?disable=\" + disable;\r\n\r\n this.$http.get(url, { silentMode: silentMode ? silentMode : false })\r\n .then((response: any): void => {\r\n deferred.resolve(response.data);\r\n });\r\n\r\n\r\n return deferred.promise;\r\n }\r\n\r\n }\r\n}\r\nangular.module(\"app.shared\").service('openbankingWidgetService', Shared.OpenbankingWidgetService);","module Shared {\r\n export class UmbrellaTaxTracker {\r\n businessID: string;\r\n personID: string;\r\n connectUser: string;\r\n section: string;\r\n subSection: string;\r\n order: number;\r\n payYear: number;\r\n sumGrossPay: number;\r\n sumPaye: number;\r\n createdDate: string;\r\n }\r\n}","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n\r\n\r\nmodule Shared {\r\n export interface ITimeframe {\r\n value: string;\r\n description: string;\r\n }\r\n\r\n export interface IDetailedViewToggles {\r\n all: boolean;\r\n incomeSummary: boolean;\r\n forecastCalculations: boolean;\r\n tracker: boolean;\r\n liabilityDue: boolean;\r\n }\r\n\r\n export interface IBreakdownWidgetData {\r\n pscEmployment(): number;\r\n otherEmploymentIncome(): number;\r\n pensionIncome(): number;\r\n interestIncome(): number;\r\n taxableBenefitsInKind(): number;\r\n pscDividendIncome(): number;\r\n otherDividendIncome(): number;\r\n }\r\n\r\n export interface IForecastCalculationsWidgetData {\r\n monthsYearToDate(): number;\r\n monthsRemaining(): number;\r\n weeksYearToDate(): number;\r\n weeksRemaining(): number;\r\n weeksYearToDateFromTaxStart(): number;\r\n weeksRemainingFromTaxStart(): number;\r\n pscEmployment(): number;\r\n currentDirectorsFeeWeekly(): number;\r\n forecastPSCEmployment(): number;\r\n confirmedAsDividends(): number;\r\n unconfirmedTransactions(): number;\r\n transactionsBeingProcessed(): number;\r\n totalPSCDividendIncome(): number;\r\n forecastPSCDividendIncome(): number;\r\n }\r\n\r\n export interface ITaxLiabilityDueWidgetData {\r\n totalTaxPayable(): number;\r\n studentLoanPaymentDue(): number;\r\n childBenefitTaxCharge(): number;\r\n taxBillForThisYear(): number;\r\n taxDeductedFromDirectorsFees(): number;\r\n taxAlreadyPaid(): number;\r\n paymentsOnAccountPaidforJan(): number;\r\n paymentOnAccountPaidForJuly(): number;\r\n paymentsMadeAgainstTaxBill(): number;\r\n balancingPaymentDueJan(): number;\r\n paymentOnAccountDueJan(): number;\r\n unpaidTaxForTaxYear(): number;\r\n paymentOnAccountDueJuly(): number;\r\n taxDeductedUmbrellaEarnings(): number;\r\n }\r\n\r\n export interface ITaxTrackerWidgetData {\r\n nonDividendIncome: {\r\n personalAllowance(): number;\r\n basicRate: {\r\n income(): number;\r\n tax(): number;\r\n };\r\n higherRate: {\r\n income(): number;\r\n tax(): number;\r\n }\r\n additionalRate: {\r\n income(): number;\r\n tax(): number;\r\n },\r\n totalNonDividendIncome: {\r\n income(): number;\r\n tax(): number;\r\n }\r\n };\r\n dividendIncome: {\r\n personalAllowance(): number;\r\n dividendAllowance(): number;\r\n basicRate: {\r\n income(): number;\r\n tax(): number;\r\n },\r\n higherRate: {\r\n income(): number;\r\n tax(): number;\r\n },\r\n taxableDividends: {\r\n income(): number;\r\n tax(): number;\r\n },\r\n totalDividendIncome: {\r\n income(): number;\r\n tax(): number;\r\n }\r\n };\r\n totalIncome: {\r\n income(): number;\r\n tax(): number;\r\n };\r\n incomeLeftInEachTaxBand: {\r\n personalAllowance(): number;\r\n dividendIncome: {\r\n dividendAllowance(): number;\r\n basicRate(): number;\r\n higherRate(): number;\r\n },\r\n incomeAvailableBeforeHigherRateTax(): number;\r\n };\r\n }\r\n\r\n export interface IIncomeSummaryWidgetData {\r\n directorsFees(): number;\r\n grossSalaryFromUmbrella(): number;\r\n nonDividendIncome(): number;\r\n dividends(): number;\r\n dividendIncome(): number;\r\n totalIncome(): number;\r\n hasUmbrella(): boolean;\r\n }\r\n\r\n export interface IPersonalTaxTrackerService {\r\n title: string;\r\n selectedTimeframe: ITimeframe;\r\n selectedTaxYear: string;\r\n availableTaxYears: string[];\r\n taxYearOffset: number;\r\n companyName: string;\r\n hasUmbrella: boolean;\r\n msnry: IMasonry;\r\n isEditingDividends: boolean;\r\n debounceLength: number;\r\n fixedTaxData: FixedTaxData;\r\n forecastCalculations: ForecastCalculations;\r\n userInputData: UserInputData;\r\n umbrellaTaxTracker: UmbrellaTaxTracker;\r\n detailedViewToggles: IDetailedViewToggles;\r\n resetEditingDividends(): void;\r\n personalTaxData: IPersonalTaxData;\r\n incomeSummaryWidgetData: IIncomeSummaryWidgetData;\r\n taxTrackerWidgetData: ITaxTrackerWidgetData;\r\n taxLiabilityDueWidgetData: ITaxLiabilityDueWidgetData;\r\n forecastCalculationsWidgetData: IForecastCalculationsWidgetData;\r\n breakdownWidgetData: IBreakdownWidgetData;\r\n reloadMasonry(): void;\r\n getPersonalTaxTrackerData(silentMode?: boolean): ng.IPromise;\r\n getConfirmedAsDividendsTransactions(): ng.IPromise>;\r\n getUnconfirmedTransactions(): ng.IPromise>;\r\n postUserInputData(): ng.IPromise;\r\n selectedTaxYearChanged(selectedTaxYear: any);\r\n getPersonalTaxTrackerDataByOffset(offset: number, silentMode?: boolean): ng.IPromise;\r\n }\r\n\r\n export interface IPersonalTaxData {\r\n umbrellaTaxTracker: {\r\n payYear(): number;\r\n sumGrossPay(): number;\r\n sumPaye(): number;\r\n };\r\n fixedTaxData: {\r\n grossPensionContribution(): number;\r\n basicRateThresholdPension(): number;\r\n basicRateThresholdDividends(): number;\r\n higherRateThresholdPension(): number;\r\n higherRateThresholdDividends(): number;\r\n higherRateAllowanceDividends(): number;\r\n taxFreeDividendAllowance(): number;\r\n lowerRateDividendTaxRate(): number;\r\n higherRateDividendTaxRate(): number;\r\n additionalRateDividendTaxRate(): number;\r\n personalAllowance(): number;\r\n basicRateThreshold(): number;\r\n higherRateDividendThreshold(): number;\r\n higherRateThreshold(): number;\r\n fullPersonalAllowanceUpperLimit(): number;\r\n lowerRateIncomeTax(): number;\r\n basicRateIncomeTax(): number;\r\n higherRateTax(): number;\r\n additionalRateTax(): number;\r\n employmentIncomeStudentRepayThreshold(): number;\r\n nonEmploymentIncomeStudentRepayThreshold(): number;\r\n repaymentPercentage(): number;\r\n childBenefitTaxChargeThreshold(): number;\r\n percentageIncrements(): number;\r\n };\r\n forecastCalculations: {\r\n forecastTotal(): number;\r\n forecastPSCEmployment(): number;\r\n forecastPSCDividendIncome(): number;\r\n yearToDatePSCEmployment(): number;\r\n yearToDatePSCDividendIncome(): number;\r\n monthsYearToDate(): number;\r\n monthsRemaining(): number;\r\n weeksYearToDate(): number;\r\n weeksRemaining(): number;\r\n weeksYearToDateFromTaxStart(): number;\r\n weeksRemainingFromTaxStart(): number;\r\n pscEmployment(): number;\r\n currentDirectorsFeeWeekly(): number;\r\n currentDirectorsFeeMonthly(): number;\r\n feesRemainingForYear(): number;\r\n shareholderSplit(): number;\r\n confirmedAsDividends(): number;\r\n unconfirmedTransactionsWithShareholderSplit(): number;\r\n transactionsBeingProcessedWithShareholderSplit(): number;\r\n taxDeductedFromPSCIncome(): number;\r\n };\r\n incomeCalculations: {\r\n pscEmploymentIncome: {\r\n // K28\r\n yearToDate(): number;\r\n // L28\r\n forecast(): number;\r\n },\r\n nonDividendIncome: {\r\n // K32\r\n yearToDate(): number;\r\n // L32\r\n forecast(): number;\r\n },\r\n pscDividendIncome: {\r\n // K36\r\n yearToDate(): number;\r\n // L36\r\n forecast(): number;\r\n },\r\n dividendIncome: {\r\n // K36\r\n yearToDate(): number;\r\n // L36\r\n forecast(): number;\r\n },\r\n grossTaxableIncome: {\r\n // K38\r\n yearToDate(): number;\r\n // L38\r\n forecast(): number;\r\n }\r\n };\r\n taxCalculationWorkings: {\r\n nonDividendIncome: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n dividends: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n grossTaxableIncome: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n annualPersonalAllowance: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n fullPaUpperLimit: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n grossIncomeAboveUpperLimit: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n reductionInPA: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n paAfterSalaryAndDividendIncome: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n personalAllowance: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n salaryWithinPA: {\r\n // =IF(K51>($K$87/12*L5),($K$87/12*L5),K51)\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n salaryAtBR: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n salaryAtHR: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n salaryAtAR: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n salaryAtBRTax: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n salaryAtHRTax: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n salaryAtARTax: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n totalGrossSalary: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n incomeTaxDueOnSalary: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n dividendsWithinPA: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n dividendsWithinTFDA: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n dividendsAtBR: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n dividendsAtHR: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n dividendsAtAR: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n totalDividends: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n dividendsAtBRTax: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n dividendsAtHRTax: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n dividendsAtARTax: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n additionalTaxDueOnDividends: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n totalTaxDueAtSelfAssessment: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n }\r\n };\r\n studentLoanRepayments: {\r\n earnedIncome: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n nonEarnedIncome: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n employmentIncomeStudentRepay: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n nonEmploymentIncomeStudentRepay: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n studentPaymentAmount: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n }\r\n };\r\n childBenefitTaxCharge: {\r\n grossTaxableIncome: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n relativePercentageCharge: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n childBenefitTaxCharge: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n }\r\n };\r\n taxPayments: {\r\n totalIncomeTaxPayable: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n studentLoanPaymentDue: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n childBenefitTaxCharge: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n totalPayableOnSelfAssessment: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n paymentOnAccount: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n totalTaxPayments(): number;\r\n };\r\n taxBandCapacity: {\r\n personalAllowance: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n dividendAllowance: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n },\r\n basicRate7: {\r\n yearToDate(): number;\r\n forecast(): number;\r\n }\r\n };\r\n }\r\n\r\n export class PersonalTaxTrackerService implements IPersonalTaxTrackerService {\r\n title: string = \"Personal Tax\";\r\n selectedTimeframe: ITimeframe;\r\n selectedTaxYear: string;\r\n availableTaxYears: string[];\r\n taxYearOffset: number;\r\n companyName: string = '';\r\n hasUmbrella: boolean;\r\n umbrellaTaxData: UmbrellaTaxData;\r\n msnry: IMasonry = null;\r\n isEditingDividends: boolean = false;\r\n debounceLength: number = 1000;\r\n fixedTaxData: FixedTaxData;\r\n forecastCalculations: ForecastCalculations;\r\n userInputData: UserInputData;\r\n umbrellaTaxTracker: UmbrellaTaxTracker;\r\n\r\n detailedViewToggles: IDetailedViewToggles = {\r\n all: false,\r\n incomeSummary: false,\r\n forecastCalculations: false,\r\n tracker: false,\r\n liabilityDue: false\r\n };\r\n\r\n static $inject = ['$http', '$q', '$timeout', 'personalTax.enums', 'brookson.utilities.date'];\r\n\r\n constructor(private $http: Shared.IBrooksonHttp,\r\n private $q: ng.IQService,\r\n private $timeout: ng.ITimeoutService,\r\n private personalTaxEnums: Shared.IPersonalTaxEnums,\r\n private brooksonUtilitiesDate: Shared.IBrooksonUtilitiesDate) {\r\n this.clearData();\r\n this.selectedTimeframe = this.personalTaxEnums.Timeframes.properties[this.personalTaxEnums.Timeframes.FORECAST];\r\n this.selectedTimeframe.value = this.personalTaxEnums.Timeframes.FORECAST;\r\n //default to previous tax year\r\n\r\n this.getTaxYear();\r\n }\r\n\r\n\r\n getTaxYear() {\r\n\r\n let offset = 0;\r\n let currentDate = new Date();\r\n\r\n if (currentDate >= new Date('04/06/' + currentDate.getFullYear()) &&\r\n currentDate <= new Date('05/01/' + currentDate.getFullYear())) {\r\n offset = -1;\r\n }\r\n\r\n this.taxYearOffset = offset;\r\n this.availableTaxYears = ['Current Tax Year', 'Previous Tax Year'];\r\n this.selectedTaxYear = this.availableTaxYears[offset === -1 ? 1 : offset];\r\n \r\n }\r\n\r\n selectedTaxYearChanged = (selectedTaxYear: any) => { \r\n this.clearData();\r\n this.taxYearOffset = -1 * this.availableTaxYears.indexOf(selectedTaxYear);\r\n return this.getPersonalTaxTrackerDataByOffset(this.taxYearOffset);\r\n }\r\n\r\n clearData = (): void => {\r\n\r\n this.fixedTaxData = {};\r\n this.forecastCalculations = {};\r\n this.umbrellaTaxData = {};\r\n this.userInputData = {\r\n // Income Calculations\r\n otherEmploymentIncome: 0,\r\n otherEmploymentIncomeYTD: 0,\r\n pensionIncome: 0,\r\n pensionIncomeYTD: 0,\r\n interestIncome: 0,\r\n interestIncomeYTD: 0,\r\n taxableBenefitsInKind: 0,\r\n taxableBenefitsInKindYTD: 0,\r\n\r\n dividends: 0,\r\n otherDividendIncome: 0,\r\n otherDividendIncomeYTD: 0,\r\n\r\n personalPensionPayments: 0,\r\n personalPensionPaymentsYTD: 0,\r\n childBenefitAmountReceived: 0,\r\n childBenefitAmountReceivedYTD: 0,\r\n studentLoanBalanceAtBeginningOfTaxYear: 0,\r\n studentLoanBalanceAtBeginningOfTaxYearYTD: 0,\r\n\r\n // Tax Payments\r\n taxAlreadyPaid: 0,\r\n paymentOnAccountPaidJanuary: 0,\r\n paymentOnAccountPaidJuly: 0\r\n };\r\n }\r\n private roundedDecimal = (value): number => {\r\n return _.round(value) / Math.pow(10, 2);\r\n }\r\n\r\n resetEditingDividends = (): void => {\r\n this.isEditingDividends = false;\r\n this.userInputData.dividends = 0;\r\n }\r\n\r\n personalTaxData: IPersonalTaxData = {\r\n umbrellaTaxTracker: {\r\n // payYear: number;\r\n // sumGrossPay: number;\r\n // sumPaye: number;\r\n\r\n payYear: (): number => {\r\n if(!this.personalTaxData.umbrellaTaxTracker)\r\n {\r\n return 0;\r\n }\r\n return this.personalTaxData.umbrellaTaxTracker.payYear();\r\n },\r\n sumGrossPay: (): number => {\r\n if(!this.personalTaxData.umbrellaTaxTracker)\r\n {\r\n return 0;\r\n }\r\n return this.personalTaxData.umbrellaTaxTracker.sumGrossPay();\r\n },\r\n sumPaye: (): number => {\r\n if(!this.personalTaxData.umbrellaTaxTracker)\r\n {\r\n return 0;\r\n }\r\n return this.personalTaxData.umbrellaTaxTracker.sumPaye();\r\n },\r\n },\r\n fixedTaxData: {\r\n grossPensionContribution: (): number => {\r\n // =L47/0.8\r\n return this.userInputData.personalPensionPayments / 0.8;\r\n },\r\n basicRateThresholdPension: (): number => {\r\n return this.personalTaxData.fixedTaxData.basicRateThreshold() + this.personalTaxData.fixedTaxData.grossPensionContribution();\r\n },\r\n basicRateThresholdDividends: (): number => {\r\n return this.personalTaxData.fixedTaxData.basicRateThresholdPension() - this.personalTaxData.fixedTaxData.taxFreeDividendAllowance();\r\n },\r\n higherRateThresholdPension: (): number => {\r\n return this.personalTaxData.fixedTaxData.higherRateThreshold() + this.personalTaxData.fixedTaxData.grossPensionContribution();\r\n },\r\n higherRateThresholdDividends: (): number => {\r\n return this.personalTaxData.fixedTaxData.higherRateThresholdPension() - this.personalTaxData.fixedTaxData.taxFreeDividendAllowance();\r\n },\r\n higherRateAllowanceDividends: (): number => {\r\n return this.personalTaxData.fixedTaxData.higherRateThresholdDividends() - this.personalTaxData.fixedTaxData.basicRateThresholdDividends();\r\n },\r\n taxFreeDividendAllowance: (): number => {\r\n return this.fixedTaxData.taxFreeDividendAllowance;\r\n },\r\n lowerRateDividendTaxRate: (): number => {\r\n return this.fixedTaxData.lowerRateDividendTaxRate;\r\n },\r\n higherRateDividendTaxRate: (): number => {\r\n return this.fixedTaxData.higherRateDividendTaxRate;\r\n },\r\n additionalRateDividendTaxRate: (): number => {\r\n return this.fixedTaxData.additionalRateDividendTaxRate;\r\n },\r\n personalAllowance: (): number => {\r\n return this.fixedTaxData.personalAllowance;\r\n },\r\n basicRateThreshold: (): number => {\r\n return this.fixedTaxData.basicRateThreshold;\r\n },\r\n higherRateDividendThreshold: (): number => {\r\n return this.personalTaxData.fixedTaxData.higherRateThresholdPension() - this.personalTaxData.fixedTaxData.taxFreeDividendAllowance();\r\n },\r\n higherRateThreshold: (): number => {\r\n return this.fixedTaxData.higherRateThreshold;\r\n },\r\n fullPersonalAllowanceUpperLimit: (): number => {\r\n return this.fixedTaxData.fullPersonalAllowanceUpperLimit;\r\n },\r\n lowerRateIncomeTax: (): number => {\r\n return this.fixedTaxData.lowerRateIncomeTax;\r\n },\r\n basicRateIncomeTax: (): number => {\r\n return this.fixedTaxData.basicRateIncomeTax;\r\n },\r\n higherRateTax: (): number => {\r\n return this.fixedTaxData.higherRateTax;\r\n },\r\n additionalRateTax: (): number => {\r\n return this.fixedTaxData.additionalRateTax;\r\n },\r\n employmentIncomeStudentRepayThreshold: (): number => {\r\n return this.fixedTaxData.employmentIncomeStudentRepayThreshold;\r\n },\r\n nonEmploymentIncomeStudentRepayThreshold: (): number => {\r\n return this.fixedTaxData.nonEmploymentIncomeStudentRepayThreshold;\r\n },\r\n repaymentPercentage: (): number => {\r\n return this.fixedTaxData.repaymentPercentage;\r\n },\r\n childBenefitTaxChargeThreshold: (): number => {\r\n return this.fixedTaxData.childBenefitTaxChargeThreshold;\r\n },\r\n percentageIncrements: (): number => {\r\n return this.fixedTaxData.percentageIncrements;\r\n }\r\n },\r\n forecastCalculations: {\r\n forecastTotal: (): number => {\r\n return this.personalTaxData.forecastCalculations.confirmedAsDividends() +\r\n this.personalTaxData.forecastCalculations.unconfirmedTransactionsWithShareholderSplit() +\r\n this.personalTaxData.forecastCalculations.transactionsBeingProcessedWithShareholderSplit();\r\n },\r\n forecastPSCEmployment: (): number => {\r\n return this.personalTaxData.forecastCalculations.pscEmployment() +\r\n this.personalTaxData.forecastCalculations.feesRemainingForYear();\r\n },\r\n forecastPSCDividendIncome: (): number => {\r\n if (this.userInputData.dividends > 0) {\r\n return this.userInputData.dividends;\r\n } else {\r\n return this.personalTaxData.forecastCalculations.forecastTotal() *\r\n (this.personalTaxData.forecastCalculations.weeksYearToDateFromTaxStart() +\r\n this.personalTaxData.forecastCalculations.weeksRemainingFromTaxStart()) /\r\n this.personalTaxData.forecastCalculations.weeksYearToDateFromTaxStart();\r\n }\r\n },\r\n yearToDatePSCEmployment: (): number => {\r\n return this.personalTaxData.forecastCalculations.pscEmployment();\r\n },\r\n yearToDatePSCDividendIncome: (): number => {\r\n return this.personalTaxData.forecastCalculations.confirmedAsDividends() +\r\n this.personalTaxData.forecastCalculations.unconfirmedTransactionsWithShareholderSplit() +\r\n this.personalTaxData.forecastCalculations.transactionsBeingProcessedWithShareholderSplit();\r\n },\r\n monthsYearToDate: (): number => {\r\n return this.forecastCalculations.monthsYearToDate;\r\n },\r\n monthsRemaining: (): number => {\r\n return this.forecastCalculations.monthsRemaining;\r\n },\r\n weeksYearToDate: (): number => {\r\n return this.forecastCalculations.weeksYearToDate;\r\n },\r\n weeksRemaining: (): number => {\r\n return this.forecastCalculations.weeksRemaining;\r\n },\r\n weeksYearToDateFromTaxStart: (): number => {\r\n return this.forecastCalculations.weeksYearToDateFromTaxStart;\r\n },\r\n weeksRemainingFromTaxStart: (): number => {\r\n return this.forecastCalculations.weeksRemainingFromTaxStart;\r\n },\r\n pscEmployment: (): number => {\r\n return this.forecastCalculations.pscEmployment;\r\n },\r\n currentDirectorsFeeWeekly: (): number => {\r\n return this.forecastCalculations.currentDirectorsFeeWeekly < 0 ? 0 : this.forecastCalculations.currentDirectorsFeeWeekly;\r\n },\r\n currentDirectorsFeeMonthly: (): number => {\r\n return this.forecastCalculations.pscEmployment / this.forecastCalculations.monthsYearToDate;\r\n },\r\n feesRemainingForYear: (): number => {\r\n //the weekly fee now accounts also for the months remaining for the current payroll period (this could do with changing to WeeksOrMonthsRemaining)\r\n return this.personalTaxData.forecastCalculations.currentDirectorsFeeWeekly() *\r\n this.personalTaxData.forecastCalculations.weeksRemaining();\r\n },\r\n shareholderSplit: (): number => {\r\n return this.forecastCalculations.shareholderSplit;\r\n },\r\n confirmedAsDividends: (): number => {\r\n return this.forecastCalculations.confirmedAsDividends;\r\n },\r\n unconfirmedTransactionsWithShareholderSplit: (): number => {\r\n return this.forecastCalculations.unconfirmedTransactions * (this.forecastCalculations.shareholderSplit / 100);\r\n },\r\n transactionsBeingProcessedWithShareholderSplit: (): number => {\r\n return this.forecastCalculations.transactionsBeingProcessed * (this.forecastCalculations.shareholderSplit / 100);\r\n },\r\n taxDeductedFromPSCIncome: (): number => {\r\n return this.forecastCalculations.taxDeductedFromPSCIncome;\r\n }\r\n },\r\n\r\n incomeCalculations: {\r\n pscEmploymentIncome: {\r\n // K28\r\n yearToDate: (): number => {\r\n return this.personalTaxData.forecastCalculations.yearToDatePSCEmployment();\r\n },\r\n // L28\r\n forecast: (): number => {\r\n return this.personalTaxData.forecastCalculations.forecastPSCEmployment();\r\n }\r\n },\r\n nonDividendIncome: {\r\n // =K33+SUM(K34:K37)\r\n yearToDate: (): number => {\r\n return this.personalTaxData.incomeCalculations.pscEmploymentIncome.yearToDate() +\r\n (this.userInputData.otherEmploymentIncomeYTD +\r\n this.userInputData.pensionIncomeYTD +\r\n this.userInputData.interestIncomeYTD +\r\n this.userInputData.taxableBenefitsInKindYTD);\r\n },\r\n // =L33+SUM(L34:L37)\r\n forecast: (): number => {\r\n return this.personalTaxData.incomeCalculations.pscEmploymentIncome.forecast() +\r\n (this.userInputData.otherEmploymentIncome +\r\n this.userInputData.pensionIncome +\r\n this.userInputData.interestIncome +\r\n this.userInputData.taxableBenefitsInKind);\r\n }\r\n },\r\n pscDividendIncome: {\r\n // K40\r\n yearToDate: (): number => {\r\n return this.personalTaxData.forecastCalculations.yearToDatePSCDividendIncome();\r\n },\r\n // L40\r\n forecast: (): number => {\r\n return this.personalTaxData.forecastCalculations.forecastPSCDividendIncome();\r\n }\r\n },\r\n dividendIncome: {\r\n // K36\r\n yearToDate: (): number => {\r\n return this.personalTaxData.incomeCalculations.pscDividendIncome.yearToDate() + this.userInputData.otherDividendIncome;\r\n },\r\n // L36\r\n forecast: (): number => {\r\n return this.personalTaxData.incomeCalculations.pscDividendIncome.forecast() + this.userInputData.otherDividendIncome;\r\n }\r\n },\r\n grossTaxableIncome: {\r\n // K38\r\n yearToDate: (): number => {\r\n return this.personalTaxData.incomeCalculations.nonDividendIncome.yearToDate() + this.personalTaxData.incomeCalculations.dividendIncome.yearToDate();\r\n },\r\n // L38\r\n forecast: (): number => {\r\n return this.personalTaxData.incomeCalculations.nonDividendIncome.forecast() + this.personalTaxData.incomeCalculations.dividendIncome.forecast();\r\n }\r\n }\r\n },\r\n taxCalculationWorkings: {\r\n nonDividendIncome: {\r\n yearToDate: (): number => {\r\n if(!this.umbrellaTaxTracker)\r\n {\r\n return this.personalTaxData.incomeCalculations.nonDividendIncome.yearToDate();\r\n }\r\n\r\n return this.personalTaxData.incomeCalculations.nonDividendIncome.yearToDate() + this.umbrellaTaxTracker.sumGrossPay;// + this.personalTaxData.umbrellaTaxTracker.sumGrossPay();\r\n },\r\n forecast: (): number => {\r\n if(!this.umbrellaTaxTracker)\r\n {\r\n return this.personalTaxData.incomeCalculations.nonDividendIncome.forecast();\r\n }\r\n\r\n return this.personalTaxData.incomeCalculations.nonDividendIncome.forecast() + this.umbrellaTaxTracker.sumGrossPay;// + this.personalTaxData.umbrellaTaxTracker.sumGrossPay();\r\n }\r\n },\r\n dividends: {\r\n yearToDate: (): number => {\r\n return this.personalTaxData.incomeCalculations.dividendIncome.yearToDate();\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.incomeCalculations.dividendIncome.forecast();\r\n }\r\n },\r\n grossTaxableIncome: {\r\n yearToDate: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.nonDividendIncome.yearToDate() + this.personalTaxData.incomeCalculations.dividendIncome.yearToDate();\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.incomeCalculations.nonDividendIncome.forecast() + this.personalTaxData.incomeCalculations.dividendIncome.forecast();\r\n }\r\n },\r\n annualPersonalAllowance: {\r\n yearToDate: (): number => {\r\n return this.personalTaxData.fixedTaxData.personalAllowance(); // =F10\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.fixedTaxData.personalAllowance(); // =F10\r\n }\r\n },\r\n fullPaUpperLimit: {\r\n yearToDate: (): number => {\r\n return this.personalTaxData.fixedTaxData.fullPersonalAllowanceUpperLimit(); // =F20\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.fixedTaxData.fullPersonalAllowanceUpperLimit(); // F20\r\n }\r\n },\r\n grossIncomeAboveUpperLimit: {\r\n yearToDate: (): number => {\r\n return ((this.personalTaxData.taxCalculationWorkings.grossTaxableIncome.yearToDate() - this.personalTaxData.taxCalculationWorkings.fullPaUpperLimit.yearToDate()) > 0) ?\r\n (this.personalTaxData.taxCalculationWorkings.grossTaxableIncome.yearToDate() - this.personalTaxData.taxCalculationWorkings.fullPaUpperLimit.yearToDate())\r\n : 0; // =IF(K77-K76>0,K77-K76,0)\r\n },\r\n forecast: (): number => {\r\n return ((this.personalTaxData.taxCalculationWorkings.grossTaxableIncome.forecast() - this.personalTaxData.taxCalculationWorkings.fullPaUpperLimit.forecast()) > 0) ?\r\n (this.personalTaxData.taxCalculationWorkings.grossTaxableIncome.forecast() - this.personalTaxData.taxCalculationWorkings.fullPaUpperLimit.forecast())\r\n : 0; // =IF(L77-L76>0,L77-L76,0)\r\n }\r\n },\r\n reductionInPA: {\r\n yearToDate: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.grossIncomeAboveUpperLimit.yearToDate() / 2 > this.personalTaxData.taxCalculationWorkings.annualPersonalAllowance.yearToDate() ?\r\n this.personalTaxData.taxCalculationWorkings.annualPersonalAllowance.yearToDate()\r\n : this.personalTaxData.taxCalculationWorkings.grossIncomeAboveUpperLimit.yearToDate() / 2; // =IF(K78/2>K75,K75,K78/2)\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.grossIncomeAboveUpperLimit.forecast() / 2 > this.personalTaxData.taxCalculationWorkings.annualPersonalAllowance.forecast() ?\r\n this.personalTaxData.taxCalculationWorkings.annualPersonalAllowance.forecast()\r\n : this.personalTaxData.taxCalculationWorkings.grossIncomeAboveUpperLimit.forecast() / 2; // =IF(L78/2>L75,L75,L78/2)\r\n }\r\n },\r\n paAfterSalaryAndDividendIncome: {\r\n yearToDate: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.annualPersonalAllowance.yearToDate() - this.personalTaxData.taxCalculationWorkings.reductionInPA.yearToDate(); // =K75-K79\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.annualPersonalAllowance.forecast() - this.personalTaxData.taxCalculationWorkings.reductionInPA.forecast(); // =L75-L79\r\n }\r\n },\r\n personalAllowance: {\r\n yearToDate: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.paAfterSalaryAndDividendIncome.yearToDate();\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.paAfterSalaryAndDividendIncome.forecast();\r\n }\r\n },\r\n salaryWithinPA: {\r\n // =IF(K51>($K$87/12*L5),($K$87/12*L5),K51)\r\n yearToDate: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.nonDividendIncome.yearToDate() > (this.personalTaxData.taxCalculationWorkings.paAfterSalaryAndDividendIncome.yearToDate() / 12 * this.personalTaxData.forecastCalculations.monthsYearToDate())\r\n ? (this.personalTaxData.taxCalculationWorkings.paAfterSalaryAndDividendIncome.yearToDate() / 12 * this.personalTaxData.forecastCalculations.monthsYearToDate())\r\n : this.personalTaxData.taxCalculationWorkings.nonDividendIncome.yearToDate();\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.nonDividendIncome.forecast() > this.personalTaxData.taxCalculationWorkings.paAfterSalaryAndDividendIncome.forecast() ?\r\n this.personalTaxData.taxCalculationWorkings.paAfterSalaryAndDividendIncome.forecast()\r\n : this.personalTaxData.taxCalculationWorkings.nonDividendIncome.forecast(); // =IF(L50>L80,L80,L50)\r\n }\r\n },\r\n salaryAtBR: {\r\n yearToDate: (): number => {\r\n // =IF(K51-K57>($F$15/12*L5),($F$15/12*L5),K51-K57)\r\n return (this.personalTaxData.taxCalculationWorkings.nonDividendIncome.yearToDate() - this.personalTaxData.taxCalculationWorkings.salaryWithinPA.yearToDate()) > (this.personalTaxData.fixedTaxData.basicRateThresholdPension() / 12 * this.personalTaxData.forecastCalculations.monthsYearToDate()) ?\r\n (this.personalTaxData.fixedTaxData.basicRateThresholdPension() / 12 * this.personalTaxData.forecastCalculations.monthsYearToDate())\r\n : (this.personalTaxData.taxCalculationWorkings.nonDividendIncome.yearToDate() - this.personalTaxData.taxCalculationWorkings.salaryWithinPA.yearToDate());\r\n },\r\n forecast: (): number => {\r\n return (this.personalTaxData.taxCalculationWorkings.nonDividendIncome.forecast() - this.personalTaxData.taxCalculationWorkings.salaryWithinPA.forecast()) > this.personalTaxData.fixedTaxData.basicRateThresholdPension() ?\r\n this.personalTaxData.fixedTaxData.basicRateThresholdPension()\r\n : (this.personalTaxData.taxCalculationWorkings.nonDividendIncome.forecast() - this.personalTaxData.taxCalculationWorkings.salaryWithinPA.forecast());\r\n }\r\n },\r\n salaryAtHR: {\r\n yearToDate: (): number => {\r\n // =IF(K57-SUM(K63:K64)>($F$20/12*L6)-($F$16/12*L6),($F$20/12*L6)-SUM(K63:K64),K57-SUM(K63:K64))\r\n\r\n let k57 = this.personalTaxData.taxCalculationWorkings.nonDividendIncome.yearToDate();\r\n let k63Sum = this.personalTaxData.taxCalculationWorkings.salaryWithinPA.yearToDate() + this.personalTaxData.taxCalculationWorkings.salaryAtBR.yearToDate();\r\n let f20 = this.personalTaxData.fixedTaxData.higherRateThresholdPension() / 12 * this.personalTaxData.forecastCalculations.monthsYearToDate();\r\n let f16 = this.personalTaxData.fixedTaxData.basicRateThresholdPension() / 12 * this.personalTaxData.forecastCalculations.monthsYearToDate();\r\n\r\n return k57 - k63Sum > f20 - f16 \r\n ? f20 - k63Sum\r\n : k57 - k63Sum;\r\n },\r\n forecast: (): number => {\r\n // =IF(L51-SUM(L57:L58)>$F$19-$F$15,$F$19-SUM(L57:L58),L51-SUM(L57:L58))\r\n\r\n // SUM(L57:L58)\r\n var v1 = (this.personalTaxData.taxCalculationWorkings.salaryWithinPA.forecast() + this.personalTaxData.taxCalculationWorkings.salaryAtBR.forecast());\r\n var f19 = this.personalTaxData.fixedTaxData.higherRateThresholdPension();\r\n var f15 = this.personalTaxData.fixedTaxData.basicRateThresholdPension();\r\n var l51 = this.personalTaxData.taxCalculationWorkings.nonDividendIncome.forecast();\r\n\r\n return (l51 - v1) > f19 - f15\r\n ? f19 - v1\r\n : l51 - v1;\r\n }\r\n },\r\n salaryAtAR: {\r\n yearToDate: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.nonDividendIncome.yearToDate() - (this.personalTaxData.taxCalculationWorkings.salaryWithinPA.yearToDate() + this.personalTaxData.taxCalculationWorkings.salaryAtBR.yearToDate() + this.personalTaxData.taxCalculationWorkings.salaryAtHR.yearToDate()); // =K50-SUM(K56:K58)\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.nonDividendIncome.forecast() - (this.personalTaxData.taxCalculationWorkings.salaryWithinPA.forecast() + this.personalTaxData.taxCalculationWorkings.salaryAtBR.forecast() + this.personalTaxData.taxCalculationWorkings.salaryAtHR.forecast()); // =L50-SUM(L56:L58)\r\n }\r\n },\r\n salaryAtBRTax: {\r\n yearToDate: (): number => {\r\n return this.roundedDecimal((this.personalTaxData.taxCalculationWorkings.salaryAtBR.yearToDate() * this.personalTaxData.fixedTaxData.basicRateIncomeTax()));\r\n },\r\n forecast: (): number => {\r\n return this.roundedDecimal((this.personalTaxData.taxCalculationWorkings.salaryAtBR.forecast() * this.personalTaxData.fixedTaxData.basicRateIncomeTax()));\r\n }\r\n },\r\n salaryAtHRTax: {\r\n yearToDate: (): number => {\r\n //=ROUND((K58*$F24),2)\r\n return this.roundedDecimal(this.personalTaxData.taxCalculationWorkings.salaryAtHR.yearToDate() * this.personalTaxData.fixedTaxData.higherRateTax());\r\n },\r\n forecast: (): number => {\r\n //ROUND((L58*$F24),2)\r\n return this.roundedDecimal(this.personalTaxData.taxCalculationWorkings.salaryAtHR.forecast() * this.personalTaxData.fixedTaxData.higherRateTax());\r\n }\r\n },\r\n salaryAtARTax: {\r\n yearToDate: (): number => {\r\n //=ROUND((K59*$F25),2)\r\n return this.roundedDecimal(this.personalTaxData.taxCalculationWorkings.salaryAtAR.yearToDate() * this.personalTaxData.fixedTaxData.additionalRateTax());\r\n },\r\n forecast: (): number => {\r\n //ROUND((L59*$F25),2)\r\n return this.roundedDecimal(this.personalTaxData.taxCalculationWorkings.salaryAtAR.forecast() * this.personalTaxData.fixedTaxData.additionalRateTax());\r\n }\r\n },\r\n totalGrossSalary: {\r\n yearToDate: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.salaryWithinPA.yearToDate() + this.personalTaxData.taxCalculationWorkings.salaryAtBR.yearToDate() + this.personalTaxData.taxCalculationWorkings.salaryAtHR.yearToDate() + this.personalTaxData.taxCalculationWorkings.salaryAtAR.yearToDate(); //=SUM(K56:K59)\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.salaryWithinPA.forecast() + this.personalTaxData.taxCalculationWorkings.salaryAtBR.forecast() + this.personalTaxData.taxCalculationWorkings.salaryAtHR.forecast() + this.personalTaxData.taxCalculationWorkings.salaryAtAR.forecast(); //=SUM(K56:K59)\r\n }\r\n },\r\n incomeTaxDueOnSalary: {\r\n yearToDate: (): number => {\r\n // =SUM(K69:K71)\r\n return (this.personalTaxData.taxCalculationWorkings.salaryAtBRTax.yearToDate() + this.personalTaxData.taxCalculationWorkings.salaryAtHRTax.yearToDate() + this.personalTaxData.taxCalculationWorkings.salaryAtARTax.yearToDate());\r\n },\r\n forecast: (): number => {\r\n return (this.personalTaxData.taxCalculationWorkings.salaryAtBR.forecast() * (this.personalTaxData.fixedTaxData.basicRateIncomeTax() / 100))\r\n +\r\n (this.personalTaxData.taxCalculationWorkings.salaryAtHR.forecast() * (this.personalTaxData.fixedTaxData.higherRateTax() / 100))\r\n +\r\n (this.personalTaxData.taxCalculationWorkings.salaryAtAR.forecast() * (this.personalTaxData.fixedTaxData.additionalRateTax() / 100)); // =ROUND((L57*$F23)+(L58*$F24)+(L59*$F25),2)\r\n }\r\n },\r\n dividendsWithinPA: {\r\n yearToDate: (): number => {\r\n // =IF(K52<=($K$87/12*L5)-K57,K52,IF(K52>($K$87/12*L5)-K57,($K$87/12*L5)-K57,($K$87/12*L5)))\r\n\r\n\r\n //($K$87/12*L5)\r\n var v1 = (this.personalTaxData.taxCalculationWorkings.paAfterSalaryAndDividendIncome.yearToDate() / 12 * this.personalTaxData.forecastCalculations.monthsYearToDate());\r\n var k52 = this.personalTaxData.taxCalculationWorkings.dividends.yearToDate();\r\n var k57 = this.personalTaxData.taxCalculationWorkings.salaryWithinPA.yearToDate();\r\n\r\n\r\n return (k52 <= v1 - k57)\r\n ? k52\r\n : k52 > v1 - k57\r\n ? v1 - k57\r\n : v1;\r\n },\r\n forecast: (): number => {\r\n // =IF(L52<=L87-L57,L52,IF(L52>L87-L57,L87-L57,L87))\r\n var l52 = this.personalTaxData.taxCalculationWorkings.dividends.forecast();\r\n var l87 = this.personalTaxData.taxCalculationWorkings.paAfterSalaryAndDividendIncome.forecast();\r\n var l57 = this.personalTaxData.taxCalculationWorkings.salaryWithinPA.forecast();\r\n\r\n return l52 <= (l87 - l57)\r\n ? l52\r\n : l52 > (l87 - l57)\r\n ? l87 - l57\r\n : l87;\r\n }\r\n },\r\n dividendsWithinTFDA: {\r\n yearToDate: (): number => {\r\n // =IF(K52-K68>($F$6/12*L5),($F$6/12*L5),K52-K68)\r\n\r\n // ($F$6/12*L5)\r\n var v1 = this.personalTaxData.taxCalculationWorkings.dividends.yearToDate() - this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.yearToDate();\r\n var f6 = (this.personalTaxData.fixedTaxData.taxFreeDividendAllowance() / 12 * this.personalTaxData.forecastCalculations.monthsYearToDate());\r\n\r\n return v1 > f6\r\n ? f6\r\n : v1;\r\n },\r\n forecast: (): number => {\r\n // =IF(L52-L68>$F$6,$F$6,L52-L68)\r\n var v1 = this.personalTaxData.taxCalculationWorkings.dividends.forecast() - this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.forecast();\r\n var f6 = this.personalTaxData.fixedTaxData.taxFreeDividendAllowance();\r\n\r\n return v1 > f6 ? f6 : v1;\r\n }\r\n },\r\n dividendsAtBR: {\r\n yearToDate: (): number => {\r\n // =IF(K59>0,0,IF(K52-SUM(K68:K69)>=($F$15/12*L5)-K58-K69,IF((($F$15/12*L5)-K58-K69)<0,0,(($F$15/12*L5)-K58-K69)),IF((K52-SUM(K68:K69))<0,0,(K52-SUM(K68:K69)))))\r\n\r\n // K52-SUM(K68:K69)\r\n var v1 = (this.personalTaxData.taxCalculationWorkings.dividends.yearToDate() - (this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.yearToDate() + this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.yearToDate()));\r\n // ($F$15/12*L5)-K58-K69\r\n var v2 = (this.personalTaxData.fixedTaxData.basicRateThresholdPension() / 12 * this.personalTaxData.forecastCalculations.monthsYearToDate()) - this.personalTaxData.taxCalculationWorkings.salaryAtBR.yearToDate() - this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.yearToDate();\r\n\r\n return this.personalTaxData.taxCalculationWorkings.salaryAtHR.yearToDate() > 0\r\n ? 0\r\n : v1 >= v2\r\n ? v2 < 0\r\n ? 0\r\n : v2\r\n : v1 < 0\r\n ? 0\r\n : v1;\r\n },\r\n forecast: (): number => {\r\n // =IF(L59>0,0,IF(L52-SUM(L68:L69)>=$F$15-L58-L69,IF(($F$15-L58-L69)<0,0,($F$15-L58-L69)),IF((L52-SUM(L68:L69))<0,0,(L52-SUM(L68:L69)))))\r\n\r\n\r\n // L52-SUM(L68:L69)\r\n var v1 = (this.personalTaxData.taxCalculationWorkings.dividends.forecast() - (this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.forecast() + this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.forecast()));\r\n // $F$15-L58-L69\r\n var v2 = (this.personalTaxData.fixedTaxData.basicRateThresholdPension() - this.personalTaxData.taxCalculationWorkings.salaryAtBR.forecast() - this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.forecast());\r\n\r\n return this.personalTaxData.taxCalculationWorkings.salaryAtHR.forecast() > 0\r\n ? 0\r\n : v1 >= v2\r\n ? v2 < 0\r\n ? 0\r\n : v2\r\n : v1 < 0\r\n ? 0\r\n : v1;\r\n }\r\n },\r\n dividendsAtHR: {\r\n yearToDate: (): number => {\r\n // =IF(K60>0,0,IF(K52-SUM(K68:K70)>=($F$19/12*L5)-SUM(K58:K59)-K69-K70,IF((($F$19/12*L5)-SUM(K58:K59)-SUM(K69:K70))<0,0,(($F$19/12*L5)-SUM(K58:K59)-SUM(K69:K70))),IF((K52-SUM(K68:K70))<0,0,(K52-SUM(K68:K70)))))\r\n\r\n // K52-SUM(K68:K70)\r\n const k52 = (this.personalTaxData.taxCalculationWorkings.dividends.yearToDate() - (this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.yearToDate() + this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.yearToDate() + this.personalTaxData.taxCalculationWorkings.dividendsAtBR.yearToDate()));\r\n\r\n // ($F$19/12*L5)-SUM(K58:K59)\r\n const f19 = (this.personalTaxData.fixedTaxData.higherRateThresholdPension() / 12 * this.personalTaxData.forecastCalculations.monthsYearToDate()) - (this.personalTaxData.taxCalculationWorkings.salaryAtBR.yearToDate() +\r\n this.personalTaxData.taxCalculationWorkings.salaryAtHR.yearToDate());\r\n\r\n // ($F$19/12*L5)-SUM(K58:K59)-SUM(K69:K70)\r\n const f19k68 = f19 - (this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.yearToDate() + this.personalTaxData.taxCalculationWorkings.dividendsAtBR.yearToDate());\r\n\r\n\r\n return this.personalTaxData.taxCalculationWorkings.salaryAtAR.yearToDate() > 0\r\n ? 0\r\n : k52 >= f19 - this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.yearToDate() - this.personalTaxData.taxCalculationWorkings.dividendsAtBR.yearToDate()\r\n ? f19k68 < 0\r\n ? 0\r\n : f19k68\r\n : k52 < 0\r\n ? 0\r\n : k52;\r\n\r\n },\r\n forecast: (): number => {\r\n // =IF(L60>0,0,IF(L52-SUM(L68:L70)>=$F$19-SUM(L58:L59)-L69-L70,IF(($F$19-SUM(L58:L59)-SUM(L69:L70))<0,0,($F$19-SUM(L58:L59)-SUM(L69:L70))),IF((L52-SUM(L68:L70))<0,0,(L52-SUM(L68:L70)))))\r\n\r\n // L52-SUM(L68:L70)\r\n const k52 = (this.personalTaxData.taxCalculationWorkings.dividends.forecast() - (this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.forecast() + this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.forecast() + this.personalTaxData.taxCalculationWorkings.dividendsAtBR.forecast()));\r\n\r\n // $F$19-SUM(K58:K59)\r\n const f19 = this.personalTaxData.fixedTaxData.higherRateThresholdPension() - (this.personalTaxData.taxCalculationWorkings.salaryAtBR.forecast() +\r\n this.personalTaxData.taxCalculationWorkings.salaryAtHR.forecast());\r\n\r\n // $F$19-SUM(K58:K59)-SUM(K69:K70)\r\n const f19k68 = f19 - (this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.forecast() + this.personalTaxData.taxCalculationWorkings.dividendsAtBR.forecast());\r\n\r\n\r\n return this.personalTaxData.taxCalculationWorkings.salaryAtAR.forecast() > 0\r\n ? 0\r\n : k52 >= f19 - this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.forecast() - this.personalTaxData.taxCalculationWorkings.dividendsAtBR.forecast()\r\n ? f19k68 < 0\r\n ? 0\r\n : f19k68\r\n : k52 < 0\r\n ? 0\r\n : k52;\r\n }\r\n },\r\n dividendsAtAR: {\r\n yearToDate: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.dividends.yearToDate() - (this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.yearToDate() + this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.yearToDate() + this.personalTaxData.taxCalculationWorkings.dividendsAtBR.yearToDate() + this.personalTaxData.taxCalculationWorkings.dividendsAtHR.yearToDate()); // =K51-SUM(K64:K67)\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.dividends.forecast() - (this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.forecast() + this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.forecast() + this.personalTaxData.taxCalculationWorkings.dividendsAtBR.forecast() + this.personalTaxData.taxCalculationWorkings.dividendsAtHR.forecast()); // =K51-SUM(K64:K67) // =L51-SUM(L64:L67)\r\n }\r\n },\r\n totalDividends: {\r\n yearToDate: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.yearToDate() + this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.yearToDate() + this.personalTaxData.taxCalculationWorkings.dividendsAtBR.yearToDate() + this.personalTaxData.taxCalculationWorkings.dividendsAtHR.yearToDate() + this.personalTaxData.taxCalculationWorkings.dividendsAtAR.yearToDate(); // =SUM(K64:K68)\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.forecast() + this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.forecast() + this.personalTaxData.taxCalculationWorkings.dividendsAtBR.forecast() + this.personalTaxData.taxCalculationWorkings.dividendsAtHR.forecast() + this.personalTaxData.taxCalculationWorkings.dividendsAtAR.forecast(); // =SUM(L64:L68)\r\n }\r\n },\r\n dividendsAtBRTax: {\r\n yearToDate: (): number => {\r\n // ROUND((K69*$F7),2)\r\n return this.roundedDecimal(this.personalTaxData.taxCalculationWorkings.dividendsAtBR.yearToDate() * this.personalTaxData.fixedTaxData.lowerRateDividendTaxRate());\r\n },\r\n forecast: (): number => {\r\n // =ROUND((L69*$F7),2)\r\n return this.roundedDecimal(this.personalTaxData.taxCalculationWorkings.dividendsAtBR.forecast() * this.personalTaxData.fixedTaxData.lowerRateDividendTaxRate());\r\n }\r\n },\r\n dividendsAtHRTax: {\r\n yearToDate: (): number => {\r\n // ROUND((K70*$F8),2)\r\n return this.roundedDecimal(this.personalTaxData.taxCalculationWorkings.dividendsAtHR.yearToDate() * this.personalTaxData.fixedTaxData.higherRateDividendTaxRate());\r\n },\r\n forecast: (): number => {\r\n //ROUND((L70*$F8),2)\r\n return this.roundedDecimal(this.personalTaxData.taxCalculationWorkings.dividendsAtHR.forecast() * this.personalTaxData.fixedTaxData.higherRateDividendTaxRate());\r\n }\r\n },\r\n dividendsAtARTax: {\r\n yearToDate: (): number => {\r\n // ROUND((K71*$F9),2)\r\n return this.roundedDecimal(this.personalTaxData.taxCalculationWorkings.dividendsAtAR.yearToDate() * this.personalTaxData.fixedTaxData.additionalRateDividendTaxRate());\r\n },\r\n forecast: (): number => {\r\n //ROUND((L71*$F9),2)\r\n return this.roundedDecimal(this.personalTaxData.taxCalculationWorkings.dividendsAtAR.forecast() * this.personalTaxData.fixedTaxData.additionalRateDividendTaxRate());\r\n }\r\n },\r\n additionalTaxDueOnDividends: {\r\n yearToDate: (): number => {\r\n // =SUM(K80:K82)\r\n return (this.personalTaxData.taxCalculationWorkings.dividendsAtBRTax.yearToDate() + this.personalTaxData.taxCalculationWorkings.dividendsAtHRTax.yearToDate()\r\n + this.personalTaxData.taxCalculationWorkings.dividendsAtARTax.yearToDate());\r\n },\r\n forecast: (): number => {\r\n // =SUM(L80:L82)\r\n return (\r\n this.personalTaxData.taxCalculationWorkings.dividendsAtBRTax.forecast() +\r\n this.personalTaxData.taxCalculationWorkings.dividendsAtHRTax.forecast() +\r\n this.personalTaxData.taxCalculationWorkings.dividendsAtARTax.forecast()\r\n );\r\n }\r\n },\r\n totalTaxDueAtSelfAssessment: {\r\n yearToDate: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.incomeTaxDueOnSalary.yearToDate() + this.personalTaxData.taxCalculationWorkings.additionalTaxDueOnDividends.yearToDate(); // =SUM(K62+K71)\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.incomeTaxDueOnSalary.forecast() + this.personalTaxData.taxCalculationWorkings.additionalTaxDueOnDividends.forecast(); // =SUM(L62+L71)\r\n }\r\n }\r\n },\r\n studentLoanRepayments: {\r\n earnedIncome: {\r\n yearToDate: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.nonDividendIncome.yearToDate() - this.userInputData.interestIncome; // =K56-K36\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.nonDividendIncome.forecast() - this.userInputData.interestIncome; // =L56-L36\r\n }\r\n },\r\n nonEarnedIncome: {\r\n yearToDate: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.dividends.yearToDate() + this.userInputData.interestIncome; // =K57+K36\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.dividends.forecast() + this.userInputData.interestIncome; // =L57+L36\r\n }\r\n },\r\n employmentIncomeStudentRepay: {\r\n yearToDate: (): number => {\r\n return this.personalTaxData.studentLoanRepayments.earnedIncome.yearToDate();\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.studentLoanRepayments.earnedIncome.forecast();\r\n }\r\n },\r\n nonEmploymentIncomeStudentRepay: {\r\n yearToDate: (): number => {\r\n //=IF(K99<(F30/12*L6),0,K99)\r\n return this.personalTaxData.studentLoanRepayments.nonEarnedIncome.yearToDate() < (this.personalTaxData.fixedTaxData.nonEmploymentIncomeStudentRepayThreshold() / 12 * this.personalTaxData.forecastCalculations.monthsRemaining())\r\n ? 0\r\n : this.personalTaxData.studentLoanRepayments.nonEarnedIncome.yearToDate();\r\n },\r\n forecast: (): number => {\r\n // =IF(L99 {\r\n // =IF((K100+K101)K49,K49,(K100+K101-(F29/12*L6))*F31))\r\n let k100K101 = ((this.personalTaxData.studentLoanRepayments.employmentIncomeStudentRepay.yearToDate() + this.personalTaxData.studentLoanRepayments.nonEmploymentIncomeStudentRepay.yearToDate()));\r\n let f29 = this.personalTaxData.fixedTaxData.employmentIncomeStudentRepayThreshold() / 12 * this.personalTaxData.forecastCalculations.monthsYearToDate();\r\n let f31 = this.personalTaxData.fixedTaxData.repaymentPercentage();\r\n let k49 = this.userInputData.studentLoanBalanceAtBeginningOfTaxYearYTD;\r\n\r\n return k100K101 < f29\r\n ? 0\r\n : (k100K101 - f29) * f31 > k49\r\n ? k49\r\n : (k100K101 - f29) * f31;\r\n },\r\n forecast: (): number => {\r\n // =IF((L100+L101)L49,L49,(L100+L101-F29)*F31))\r\n let l100 = this.personalTaxData.studentLoanRepayments.employmentIncomeStudentRepay.forecast();\r\n let l101 = this.personalTaxData.studentLoanRepayments.nonEmploymentIncomeStudentRepay.forecast();\r\n let f29 = this.personalTaxData.fixedTaxData.employmentIncomeStudentRepayThreshold();\r\n let f31 = this.personalTaxData.fixedTaxData.repaymentPercentage() / 100;\r\n let l49 = this.userInputData.studentLoanBalanceAtBeginningOfTaxYear;\r\n\r\n return (l100 + l101) < f29\r\n ? 0\r\n : (l100 + l101 - f29) * f31 > l49\r\n ? l49\r\n : (l100 + l101 - f29) * f31;\r\n }\r\n } \r\n },\r\n childBenefitTaxCharge: {\r\n grossTaxableIncome: {\r\n yearToDate: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.grossTaxableIncome.yearToDate(); // =K52\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.grossTaxableIncome.forecast(); // =L52\r\n }\r\n },\r\n relativePercentageCharge: {\r\n yearToDate: (): number => {\r\n // =IF(K108>=(F33+F34*100),1,IF(K108= (this.personalTaxData.fixedTaxData.childBenefitTaxChargeThreshold() + this.personalTaxData.fixedTaxData.percentageIncrements() * 100)\r\n ? 1\r\n : this.personalTaxData.childBenefitTaxCharge.grossTaxableIncome.yearToDate() < this.personalTaxData.fixedTaxData.childBenefitTaxChargeThreshold() ?\r\n 0\r\n : (this.personalTaxData.childBenefitTaxCharge.grossTaxableIncome.yearToDate() - this.personalTaxData.fixedTaxData.childBenefitTaxChargeThreshold()) / this.personalTaxData.fixedTaxData.percentageIncrements(); // =IF(K96>=($F32+$F33*100),1,IF(K96<$F32,0,(K96-$F32)/$F33/100))\r\n },\r\n forecast: (): number => {\r\n // =IF(L108>=(F33+F34*100),1,IF(L108=\r\n (this.personalTaxData.fixedTaxData.childBenefitTaxChargeThreshold() + this.personalTaxData.fixedTaxData.percentageIncrements() * 100)\r\n ) {\r\n return 1;\r\n } else {\r\n if (\r\n this.personalTaxData.childBenefitTaxCharge.grossTaxableIncome.forecast()\r\n <\r\n this.personalTaxData.fixedTaxData.childBenefitTaxChargeThreshold()\r\n ) {\r\n return 0;\r\n } else {\r\n return (this.personalTaxData.childBenefitTaxCharge.grossTaxableIncome.forecast() - this.personalTaxData.fixedTaxData.childBenefitTaxChargeThreshold())\r\n /\r\n this.personalTaxData.fixedTaxData.percentageIncrements()\r\n /\r\n 100;\r\n }\r\n }\r\n }\r\n },\r\n childBenefitTaxCharge: {\r\n yearToDate: (): number => {\r\n return this.personalTaxData.childBenefitTaxCharge.relativePercentageCharge.yearToDate() * this.userInputData.childBenefitAmountReceivedYTD; //=K97*L42\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.childBenefitTaxCharge.relativePercentageCharge.forecast() * this.userInputData.childBenefitAmountReceived; // =L97*L42\r\n }\r\n }\r\n },\r\n taxPayments: {\r\n totalIncomeTaxPayable: {\r\n yearToDate: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.totalTaxDueAtSelfAssessment.yearToDate(); // K73\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.totalTaxDueAtSelfAssessment.forecast(); // L73\r\n }\r\n },\r\n studentLoanPaymentDue: {\r\n yearToDate: (): number => {\r\n return this.personalTaxData.studentLoanRepayments.studentPaymentAmount.yearToDate(); // K90\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.studentLoanRepayments.studentPaymentAmount.forecast(); // L102\r\n }\r\n },\r\n childBenefitTaxCharge: {\r\n yearToDate: (): number => {\r\n return this.personalTaxData.childBenefitTaxCharge.childBenefitTaxCharge.yearToDate(); // K98\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.childBenefitTaxCharge.childBenefitTaxCharge.forecast(); // L98\r\n }\r\n },\r\n totalPayableOnSelfAssessment: {\r\n yearToDate: (): number => {\r\n // =K117+K118+K119\r\n return this.personalTaxData.taxPayments.totalIncomeTaxPayable.yearToDate() +\r\n this.personalTaxData.taxPayments.studentLoanPaymentDue.yearToDate() +\r\n this.personalTaxData.taxPayments.childBenefitTaxCharge.yearToDate();\r\n },\r\n forecast: (): number => {\r\n // =L117+L118+L119\r\n return this.personalTaxData.taxPayments.totalIncomeTaxPayable.forecast() +\r\n this.personalTaxData.taxPayments.studentLoanPaymentDue.forecast() +\r\n this.personalTaxData.taxPayments.childBenefitTaxCharge.forecast();\r\n }\r\n },\r\n paymentOnAccount: {\r\n yearToDate: (): number => {\r\n\r\n /*\r\n L126 : tax deducted from PSC income : this.personalTaxData.forecastCalculations.taxDeductedFromPSCIncome()\r\n L127 : tax already paid/deducted from income : this.userInputData.taxAlreadyPaid\r\n K118 : total income tax payable YTD : this.personalTaxData.taxPayments.totalIncomeTaxPayable.yearToDate()\r\n\r\n =IF((L126+L127)/K118>0.8,0,IF(K118>1000,K118/2,0))\r\n\r\n =IF(\r\n (L126 + L127)/K118>0.8,\r\n 0,\r\n IF(\r\n K118>1000,\r\n K118/2,\r\n 0\r\n )\r\n )\r\n */\r\n\r\n if (\r\n (this.personalTaxData.forecastCalculations.taxDeductedFromPSCIncome() + this.userInputData.taxAlreadyPaid) / this.personalTaxData.taxPayments.totalIncomeTaxPayable.yearToDate() > 0.8\r\n ) {\r\n return 0;\r\n } else {\r\n if (this.personalTaxData.taxPayments.totalIncomeTaxPayable.yearToDate() > 1000) {\r\n return this.personalTaxData.taxPayments.totalIncomeTaxPayable.yearToDate() / 2;\r\n } else {\r\n return 0;\r\n }\r\n }\r\n },\r\n forecast: (): number => {\r\n\r\n /*\r\n L117 : total income tax payable : this.personalTaxData.taxPayments.totalIncomeTaxPayable.forecast()\r\n L119 : child benefit tax charge : this.personalTaxData.taxPayments.childBenefitTaxCharge.forecast()\r\n L125 : tax deducted from PSC income : this.personalTaxData.forecastCalculations.taxDeductedFromPSCIncome()\r\n L126 : tax already paid/deducted from income : this.userInputData.taxAlreadyPaid\r\n\r\n =IF(L126/L117>0.8,0,IF(L117+L119-L125-L126>1000,(L117+L119-L125-L126)/2,0))\r\n\r\n =IF(\r\n L126/L117>0.8,\r\n 0,\r\n IF(\r\n L117+L119-L125-L126>1000,\r\n (L117+L119-L125-L126)/2,\r\n 0\r\n )\r\n )\r\n */\r\n\r\n if (\r\n (this.userInputData.taxAlreadyPaid/this.personalTaxData.taxPayments.totalIncomeTaxPayable.forecast()) > 0.8\r\n ) {\r\n return 0;\r\n } else {\r\n if (\r\n (this.personalTaxData.taxPayments.totalIncomeTaxPayable.forecast() + this.personalTaxData.taxPayments.childBenefitTaxCharge.forecast() - this.personalTaxData.forecastCalculations.taxDeductedFromPSCIncome() - this.userInputData.taxAlreadyPaid) > 1000\r\n ) {\r\n return (this.personalTaxData.taxPayments.totalIncomeTaxPayable.forecast() + this.personalTaxData.taxPayments.childBenefitTaxCharge.forecast() - this.personalTaxData.forecastCalculations.taxDeductedFromPSCIncome() - this.userInputData.taxAlreadyPaid) /2;\r\n } else {\r\n return 0;\r\n }\r\n }\r\n }\r\n },\r\n totalTaxPayments: (): number => {\r\n // =SUM(L125:L128)\r\n return this.personalTaxData.forecastCalculations.taxDeductedFromPSCIncome() +\r\n this.userInputData.taxAlreadyPaid +\r\n this.userInputData.paymentOnAccountPaidJanuary +\r\n this.userInputData.paymentOnAccountPaidJuly;\r\n }\r\n },\r\n taxBandCapacity: {\r\n personalAllowance: {\r\n yearToDate: (): number => {\r\n // =(K92*L6/12)-K62-K73\r\n return (\r\n this.personalTaxData.taxCalculationWorkings.paAfterSalaryAndDividendIncome.yearToDate() *\r\n this.personalTaxData.forecastCalculations.monthsYearToDate() / 12) -\r\n this.personalTaxData.taxCalculationWorkings.salaryWithinPA.yearToDate() -\r\n this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.yearToDate();\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.taxCalculationWorkings.paAfterSalaryAndDividendIncome.forecast() - this.personalTaxData.taxCalculationWorkings.salaryWithinPA.forecast() - this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.forecast(); // =L80-L56-L64\r\n }\r\n },\r\n dividendAllowance: {\r\n yearToDate: (): number => {\r\n // =if(($F$7*L6/12)-K74<0,0,($F$7*L6/12)-K74)\r\n let sum = this.personalTaxData.fixedTaxData.taxFreeDividendAllowance() *\r\n this.personalTaxData.forecastCalculations.monthsYearToDate() / 12 -\r\n this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.yearToDate();\r\n\r\n return sum < 0\r\n ? 0\r\n : sum;\r\n },\r\n forecast: (): number => {\r\n return this.personalTaxData.fixedTaxData.taxFreeDividendAllowance() - this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.forecast(); // =$F$6-L65\r\n }\r\n },\r\n basicRate7: {\r\n yearToDate: (): number => {\r\n // =IF((F16*L6/12)-(F7*L6/12)-K63-K75<0,0,(F16*L6/12)-(F7*L6/12)-K63-K75)\r\n let sum =\r\n (this.personalTaxData.fixedTaxData.basicRateThresholdPension() * // F16\r\n this.personalTaxData.forecastCalculations.monthsYearToDate() / 12) - // L6\r\n (this.personalTaxData.fixedTaxData.taxFreeDividendAllowance() * // F7\r\n this.personalTaxData.forecastCalculations.monthsYearToDate() / 12) -// L6\r\n this.personalTaxData.taxCalculationWorkings.salaryAtBR.yearToDate() - // K63\r\n this.personalTaxData.taxCalculationWorkings.dividendsAtBR.yearToDate(); // K75\r\n\r\n return (sum < 0) ? 0 : sum;\r\n },\r\n forecast: (): number => {\r\n // =IF(F16-F7-L63-L74-L75<0, 0, F16-F7-L63-L74-L75)\r\n let sum =\r\n this.personalTaxData.fixedTaxData.basicRateThresholdPension() - // F16\r\n this.personalTaxData.fixedTaxData.taxFreeDividendAllowance() - // F7\r\n this.personalTaxData.taxCalculationWorkings.salaryAtBR.forecast() - // L63\r\n this.personalTaxData.taxCalculationWorkings.dividendsAtBR.forecast(); // L75\r\n\r\n return (sum < 0) ? 0 : sum;\r\n }\r\n }\r\n }\r\n };\r\n\r\n // Widget Data\r\n incomeSummaryWidgetData: IIncomeSummaryWidgetData = {\r\n hasUmbrella: (): boolean => {\r\n return this.hasUmbrella;\r\n },\r\n directorsFees: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K28\r\n return this.personalTaxData.incomeCalculations.pscEmploymentIncome.yearToDate();\r\n } else {\r\n // L28\r\n return this.personalTaxData.incomeCalculations.pscEmploymentIncome.forecast();\r\n } \r\n },\r\n grossSalaryFromUmbrella: (): number => {\r\n if(this.umbrellaTaxTracker)\r\n {\r\n return this.umbrellaTaxTracker.sumGrossPay;\r\n }\r\n \r\n return 0;//this.personalTaxData.umbrellaTaxTracker.sumGrossPay(); \r\n },\r\n nonDividendIncome: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n return (\r\n this.incomeSummaryWidgetData.directorsFees() +\r\n this.incomeSummaryWidgetData.grossSalaryFromUmbrella() +\r\n this.userInputData.otherEmploymentIncomeYTD +\r\n this.userInputData.pensionIncomeYTD +\r\n this.userInputData.interestIncomeYTD +\r\n this.userInputData.taxableBenefitsInKindYTD\r\n );\r\n } else {\r\n // E9:E12\r\n return (\r\n this.incomeSummaryWidgetData.directorsFees() +\r\n this.incomeSummaryWidgetData.grossSalaryFromUmbrella() +\r\n this.userInputData.otherEmploymentIncome +\r\n this.userInputData.pensionIncome +\r\n this.userInputData.interestIncome +\r\n this.userInputData.taxableBenefitsInKind\r\n );\r\n }\r\n },\r\n dividends: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n return this.personalTaxData.incomeCalculations.pscDividendIncome.yearToDate();\r\n } else {\r\n // L40\r\n return this.personalTaxData.incomeCalculations.pscDividendIncome.forecast();\r\n }\r\n },\r\n dividendIncome: (): number => {\r\n // F16+F17\r\n return (\r\n this.incomeSummaryWidgetData.dividends() +\r\n this.userInputData.otherDividendIncome\r\n );\r\n },\r\n totalIncome: (): number => {\r\n // F14+F18\r\n return (\r\n this.incomeSummaryWidgetData.nonDividendIncome() +\r\n this.incomeSummaryWidgetData.dividendIncome()\r\n );\r\n }\r\n };\r\n\r\n taxTrackerWidgetData: ITaxTrackerWidgetData = {\r\n nonDividendIncome: {\r\n personalAllowance: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K56\r\n return this.personalTaxData.taxCalculationWorkings.salaryWithinPA.yearToDate();\r\n } else {\r\n // L56\r\n return this.personalTaxData.taxCalculationWorkings.salaryWithinPA.forecast();\r\n }\r\n },\r\n basicRate: {\r\n income: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K57\r\n return this.personalTaxData.taxCalculationWorkings.salaryAtBR.yearToDate();\r\n } else {\r\n // L57\r\n return this.personalTaxData.taxCalculationWorkings.salaryAtBR.forecast();\r\n }\r\n },\r\n tax: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K62\r\n return this.personalTaxData.taxCalculationWorkings.salaryAtBRTax.yearToDate();\r\n } else {\r\n // L62\r\n return this.personalTaxData.taxCalculationWorkings.salaryAtBRTax.forecast();\r\n }\r\n }\r\n },\r\n higherRate: {\r\n income: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K58\r\n return this.personalTaxData.taxCalculationWorkings.salaryAtHR.yearToDate();\r\n } else {\r\n // L58\r\n return this.personalTaxData.taxCalculationWorkings.salaryAtHR.forecast();\r\n }\r\n },\r\n tax: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K63\r\n return this.personalTaxData.taxCalculationWorkings.salaryAtHRTax.yearToDate();\r\n } else {\r\n // L63\r\n return this.personalTaxData.taxCalculationWorkings.salaryAtHRTax.forecast();\r\n }\r\n }\r\n },\r\n additionalRate: {\r\n income: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K59\r\n return this.personalTaxData.taxCalculationWorkings.salaryAtAR.yearToDate();\r\n } else {\r\n // L59\r\n return this.personalTaxData.taxCalculationWorkings.salaryAtAR.forecast();\r\n }\r\n },\r\n tax: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K64\r\n return this.personalTaxData.taxCalculationWorkings.salaryAtARTax.yearToDate();\r\n } else {\r\n // L64\r\n return this.personalTaxData.taxCalculationWorkings.salaryAtARTax.forecast();\r\n }\r\n }\r\n },\r\n totalNonDividendIncome: {\r\n income: (): number => {\r\n // K10:K13\r\n return (\r\n this.taxTrackerWidgetData.nonDividendIncome.personalAllowance() +\r\n this.taxTrackerWidgetData.nonDividendIncome.basicRate.income() +\r\n this.taxTrackerWidgetData.nonDividendIncome.higherRate.income() +\r\n this.taxTrackerWidgetData.nonDividendIncome.additionalRate.income()\r\n );\r\n },\r\n tax: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K71\r\n return this.personalTaxData.taxCalculationWorkings.incomeTaxDueOnSalary.yearToDate();\r\n } else {\r\n // L71\r\n return this.personalTaxData.taxCalculationWorkings.incomeTaxDueOnSalary.forecast();\r\n }\r\n }\r\n }\r\n },\r\n dividendIncome: {\r\n personalAllowance: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K64\r\n return this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.yearToDate();\r\n } else {\r\n // L64\r\n return this.personalTaxData.taxCalculationWorkings.dividendsWithinPA.forecast();\r\n }\r\n },\r\n dividendAllowance: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K65\r\n return this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.yearToDate();\r\n } else {\r\n // L65\r\n return this.personalTaxData.taxCalculationWorkings.dividendsWithinTFDA.forecast();\r\n }\r\n },\r\n basicRate: {\r\n income: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K66\r\n return this.personalTaxData.taxCalculationWorkings.dividendsAtBR.yearToDate();\r\n } else {\r\n // L66\r\n return this.personalTaxData.taxCalculationWorkings.dividendsAtBR.forecast();\r\n }\r\n },\r\n tax: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K74\r\n return this.personalTaxData.taxCalculationWorkings.dividendsAtBRTax.yearToDate();\r\n } else {\r\n // L74\r\n return this.personalTaxData.taxCalculationWorkings.dividendsAtBRTax.forecast();\r\n }\r\n }\r\n },\r\n higherRate: {\r\n income: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K67\r\n return this.personalTaxData.taxCalculationWorkings.dividendsAtHR.yearToDate();\r\n } else {\r\n // L67\r\n return this.personalTaxData.taxCalculationWorkings.dividendsAtHR.forecast();\r\n }\r\n },\r\n tax: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K75\r\n return this.personalTaxData.taxCalculationWorkings.dividendsAtHRTax.yearToDate();\r\n } else {\r\n // L75\r\n return this.personalTaxData.taxCalculationWorkings.dividendsAtHRTax.forecast();\r\n }\r\n }\r\n },\r\n taxableDividends: {\r\n income: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K68\r\n return this.personalTaxData.taxCalculationWorkings.dividendsAtAR.yearToDate();\r\n } else {\r\n // L68\r\n return this.personalTaxData.taxCalculationWorkings.dividendsAtAR.forecast();\r\n }\r\n },\r\n tax: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K76\r\n return this.personalTaxData.taxCalculationWorkings.dividendsAtARTax.yearToDate();\r\n } else {\r\n // L76\r\n return this.personalTaxData.taxCalculationWorkings.dividendsAtARTax.forecast();\r\n }\r\n }\r\n },\r\n totalDividendIncome: {\r\n income: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n return this.personalTaxData.taxCalculationWorkings.totalDividends.yearToDate();\r\n } else {\r\n return this.personalTaxData.taxCalculationWorkings.totalDividends.forecast();\r\n }\r\n },\r\n tax: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K77\r\n return this.personalTaxData.taxCalculationWorkings.additionalTaxDueOnDividends.yearToDate();\r\n } else {\r\n // L77\r\n return this.personalTaxData.taxCalculationWorkings.additionalTaxDueOnDividends.forecast();\r\n }\r\n }\r\n }\r\n },\r\n totalIncome: {\r\n income: (): number => {\r\n // K22+K14\r\n return (\r\n this.taxTrackerWidgetData.nonDividendIncome.totalNonDividendIncome.income() +\r\n this.taxTrackerWidgetData.dividendIncome.totalDividendIncome.income()\r\n );\r\n },\r\n tax: (): number => {\r\n // L79\r\n return this.personalTaxData.taxCalculationWorkings.totalTaxDueAtSelfAssessment.forecast();\r\n }\r\n },\r\n incomeLeftInEachTaxBand: {\r\n personalAllowance: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n return this.personalTaxData.taxBandCapacity.personalAllowance.yearToDate();\r\n } else {\r\n return this.personalTaxData.taxBandCapacity.personalAllowance.forecast();\r\n }\r\n },\r\n dividendIncome: {\r\n dividendAllowance: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K129\r\n return this.personalTaxData.taxBandCapacity.dividendAllowance.yearToDate();\r\n } else {\r\n // L129\r\n return this.personalTaxData.taxBandCapacity.dividendAllowance.forecast();\r\n }\r\n },\r\n basicRate: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K130\r\n return this.personalTaxData.taxBandCapacity.basicRate7.yearToDate();\r\n } else {\r\n // L130\r\n return this.personalTaxData.taxBandCapacity.basicRate7.forecast();\r\n }\r\n },\r\n higherRate: (): number => {\r\n return this.taxTrackerWidgetData.incomeLeftInEachTaxBand.personalAllowance() + this.taxTrackerWidgetData.incomeLeftInEachTaxBand.dividendIncome.dividendAllowance() + this.taxTrackerWidgetData.incomeLeftInEachTaxBand.dividendIncome.basicRate();\r\n }\r\n },\r\n incomeAvailableBeforeHigherRateTax: (): number => {\r\n return this.taxTrackerWidgetData.incomeLeftInEachTaxBand.personalAllowance() + this.taxTrackerWidgetData.incomeLeftInEachTaxBand.dividendIncome.dividendAllowance() + this.taxTrackerWidgetData.incomeLeftInEachTaxBand.dividendIncome.basicRate();\r\n }\r\n }\r\n };\r\n\r\n taxLiabilityDueWidgetData: ITaxLiabilityDueWidgetData = {\r\n taxDeductedUmbrellaEarnings: (): number => {\r\n if(this.umbrellaTaxTracker)\r\n {\r\n return this.umbrellaTaxTracker.sumPaye;\r\n }\r\n \r\n return 0;\r\n },\r\n totalTaxPayable: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K105\r\n return this.personalTaxData.taxCalculationWorkings.totalTaxDueAtSelfAssessment.yearToDate();\r\n } else {\r\n // L105\r\n return this.personalTaxData.taxCalculationWorkings.totalTaxDueAtSelfAssessment.forecast();\r\n }\r\n },\r\n studentLoanPaymentDue: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K106\r\n return this.personalTaxData.taxPayments.studentLoanPaymentDue.yearToDate();\r\n } else {\r\n // L106\r\n return this.personalTaxData.taxPayments.studentLoanPaymentDue.forecast();\r\n }\r\n },\r\n childBenefitTaxCharge: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K107\r\n return this.personalTaxData.taxPayments.childBenefitTaxCharge.yearToDate();\r\n } else {\r\n // L107\r\n return this.personalTaxData.taxPayments.childBenefitTaxCharge.forecast();\r\n }\r\n },\r\n taxBillForThisYear: (): number => {\r\n // SUM(E30:E32)\r\n return this.taxLiabilityDueWidgetData.totalTaxPayable() + this.taxLiabilityDueWidgetData.studentLoanPaymentDue() + this.taxLiabilityDueWidgetData.childBenefitTaxCharge();\r\n },\r\n taxDeductedFromDirectorsFees: (): number => {\r\n // L113\r\n return this.personalTaxData.forecastCalculations.taxDeductedFromPSCIncome();\r\n },\r\n taxAlreadyPaid: (): number => {\r\n // L114\r\n return this.userInputData.taxAlreadyPaid;\r\n },\r\n paymentsOnAccountPaidforJan: (): number => {\r\n // L115\r\n return this.userInputData.paymentOnAccountPaidJanuary;\r\n },\r\n paymentOnAccountPaidForJuly: (): number => {\r\n // L116\r\n return this.userInputData.paymentOnAccountPaidJuly;\r\n },\r\n paymentsMadeAgainstTaxBill: (): number => {\r\n // =SUM(F37:F40)\r\n return this.taxLiabilityDueWidgetData.taxDeductedFromDirectorsFees() + this.userInputData.taxAlreadyPaid + this.userInputData.paymentOnAccountPaidJanuary + this.userInputData.paymentOnAccountPaidJuly;\r\n },\r\n balancingPaymentDueJan: (): number => {\r\n // =E33-E39\r\n return this.taxLiabilityDueWidgetData.taxBillForThisYear() - this.taxLiabilityDueWidgetData.paymentOnAccountPaidForJuly() - this.taxLiabilityDueWidgetData.paymentsOnAccountPaidforJan() - this.taxLiabilityDueWidgetData.taxAlreadyPaid() - this.taxLiabilityDueWidgetData.taxDeductedFromDirectorsFees() - this.taxLiabilityDueWidgetData.taxDeductedUmbrellaEarnings();\r\n },\r\n unpaidTaxForTaxYear: (): number => {\r\n return this.taxLiabilityDueWidgetData.paymentsMadeAgainstTaxBill() - this.taxLiabilityDueWidgetData.balancingPaymentDueJan() - this.taxLiabilityDueWidgetData.paymentOnAccountPaidForJuly();\r\n },\r\n paymentOnAccountDueJan: (): number => {\r\n return this.taxLiabilityDueWidgetData.balancingPaymentDueJan() + this.taxLiabilityDueWidgetData.paymentOnAccountDueJuly();\r\n },\r\n paymentOnAccountDueJuly: (): number => {\r\n if (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) {\r\n // K110\r\n return this.personalTaxData.taxPayments.paymentOnAccount.yearToDate();\r\n } else {\r\n // L110\r\n return this.personalTaxData.taxPayments.paymentOnAccount.forecast();\r\n }\r\n },\r\n totalPaymentDueJanThisYear: () : number => {\r\n // =SUM(S18+S15-S16)\r\n return this.taxLiabilityDueWidgetData.paymentOnAccountDueJuly() +\r\n this.taxLiabilityDueWidgetData.taxBillForThisYear() -\r\n this.taxLiabilityDueWidgetData.paymentsMadeAgainstTaxBill();\r\n } \r\n };\r\n\r\n forecastCalculationsWidgetData: IForecastCalculationsWidgetData = {\r\n monthsYearToDate: (): number => {\r\n // L5\r\n return this.personalTaxData.forecastCalculations.monthsYearToDate();\r\n },\r\n monthsRemaining: (): number => {\r\n // L6\r\n return this.personalTaxData.forecastCalculations.monthsRemaining();\r\n },\r\n weeksYearToDate: (): number => {\r\n return this.personalTaxData.forecastCalculations.weeksYearToDate();\r\n },\r\n weeksRemaining: (): number => {\r\n return this.personalTaxData.forecastCalculations.weeksRemaining();\r\n },\r\n weeksYearToDateFromTaxStart: (): number => {\r\n return this.forecastCalculations.weeksYearToDateFromTaxStart;\r\n },\r\n weeksRemainingFromTaxStart: (): number => {\r\n return this.forecastCalculations.weeksRemainingFromTaxStart;\r\n },\r\n pscEmployment: (): number => {\r\n // L8\r\n return this.personalTaxData.forecastCalculations.pscEmployment();\r\n },\r\n currentDirectorsFeeWeekly: (): number => {\r\n // L9\r\n return this.personalTaxData.forecastCalculations.currentDirectorsFeeWeekly();\r\n },\r\n forecastPSCEmployment: (): number => {\r\n // K44+(K45*K46)\r\n return this.personalTaxData.forecastCalculations.forecastPSCEmployment();\r\n },\r\n confirmedAsDividends: (): number => {\r\n // L13\r\n return this.personalTaxData.forecastCalculations.confirmedAsDividends();\r\n },\r\n unconfirmedTransactions: (): number => {\r\n // L14\r\n return this.personalTaxData.forecastCalculations.unconfirmedTransactionsWithShareholderSplit();\r\n },\r\n transactionsBeingProcessed: (): number => {\r\n // L15\r\n return this.personalTaxData.forecastCalculations.transactionsBeingProcessedWithShareholderSplit();\r\n },\r\n totalPSCDividendIncome: (): number => {\r\n // SUM(K50:K52)\r\n return (\r\n this.forecastCalculationsWidgetData.confirmedAsDividends() +\r\n this.forecastCalculationsWidgetData.unconfirmedTransactions() +\r\n this.forecastCalculationsWidgetData.transactionsBeingProcessed()\r\n );\r\n },\r\n forecastPSCDividendIncome: (): number => {\r\n // L19\r\n return this.personalTaxData.forecastCalculations.forecastPSCDividendIncome();\r\n }\r\n };\r\n\r\n breakdownWidgetData: IBreakdownWidgetData = {\r\n pscEmployment: (): number => { return this.incomeSummaryWidgetData.directorsFees(); },\r\n otherEmploymentIncome: (): number => { return (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) ? this.userInputData.otherEmploymentIncomeYTD : this.userInputData.otherEmploymentIncome; },\r\n pensionIncome: (): number => { return (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) ? this.userInputData.pensionIncomeYTD : this.userInputData.pensionIncome; },\r\n interestIncome: (): number => { return (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) ? this.userInputData.interestIncomeYTD : this.userInputData.interestIncome; },\r\n taxableBenefitsInKind: (): number => { return (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) ? this.userInputData.taxableBenefitsInKindYTD : this.userInputData.taxableBenefitsInKind; },\r\n pscDividendIncome: (): number => { return this.incomeSummaryWidgetData.dividends(); },\r\n otherDividendIncome: (): number => { return (this.selectedTimeframe.value === this.personalTaxEnums.Timeframes.YEARTODATE) ? this.userInputData.otherDividendIncomeYTD : this.userInputData.otherDividendIncome; },\r\n };\r\n\r\n // Masonry\r\n reloadMasonry = (): void => {\r\n this.$timeout(() => {\r\n if (this.msnry) {\r\n this.msnry.layout();\r\n this.msnry.reloadItems();\r\n }\r\n }, 1);\r\n }\r\n\r\n // Requests\r\n getPersonalTaxTrackerData = (silentMode?: boolean): ng.IPromise => {\r\n return this.$http.get('api/PersonalTaxTracker/GetPersonalTaxTrackerData', {\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg) => {\r\n if (response.data) {\r\n if (response.data.fixedTaxData) {\r\n this.fixedTaxData = response.data.fixedTaxData;\r\n }\r\n\r\n if (response.data.forecastCalculations) {\r\n this.forecastCalculations = response.data.forecastCalculations;\r\n // This commented section is used for testing purposes to replicate the values seen on the spreadsheet\r\n // this.forecastCalculations = {\r\n // monthsYearToDate: 5,\r\n // monthsRemaining: 7,\r\n\r\n // pscEmployment: 3432.56,\r\n // currentDirectorsFeeWeekly: 156.98,\r\n\r\n // unconfirmedTransactions: 24000,\r\n // transactionsBeingProcessed: 0,\r\n // shareholderSplit: 100,\r\n // confirmedAsDividends: 9436,\r\n\r\n // taxDeductedFromPSCIncome: 565.80\r\n // };\r\n }\r\n\r\n if(response.data.umbrellaTaxTracker)\r\n {\r\n this.umbrellaTaxTracker = response.data.umbrellaTaxTracker;\r\n }\r\n\r\n if (response.data.companyName) {\r\n this.companyName = response.data.companyName;\r\n }\r\n\r\n if (response.data.hasUmbrella) {\r\n this.hasUmbrella = response.data.hasUmbrella;\r\n }\r\n\r\n\r\n if (response.data.userInputData) {\r\n _.assign(this.userInputData, response.data.userInputData);\r\n }\r\n }\r\n\r\n return response.data;\r\n });\r\n }\r\n\r\n getPersonalTaxTrackerDataByOffset = (offset: number, silentMode?: boolean): ng.IPromise => {\r\n return this.$http.get('api/PersonalTaxTracker/GetPersonalTaxTrackerDataByOffset', {\r\n params: { offset:offset },\r\n silentMode: silentMode ? silentMode : false\r\n }).then((response: ng.IHttpPromiseCallbackArg) => {\r\n if (response.data) {\r\n \r\n if (response.data.fixedTaxData) {\r\n this.fixedTaxData = response.data.fixedTaxData;\r\n }\r\n\r\n if (response.data.forecastCalculations) {\r\n this.forecastCalculations = response.data.forecastCalculations;\r\n // This commented section is used for testing purposes to replicate the values seen on the spreadsheet\r\n // this.forecastCalculations = {\r\n // monthsYearToDate: 5,\r\n // monthsRemaining: 7,\r\n\r\n // pscEmployment: 3432.56,\r\n // currentDirectorsFeeWeekly: 156.98,\r\n\r\n // unconfirmedTransactions: 24000,\r\n // transactionsBeingProcessed: 0,\r\n // shareholderSplit: 100,\r\n // confirmedAsDividends: 9436,\r\n\r\n // taxDeductedFromPSCIncome: 565.80\r\n // };\r\n }\r\n\r\n if (response.data.companyName) {\r\n this.companyName = response.data.companyName;\r\n }\r\n\r\n if (response.data.hasUmbrella) {\r\n this.hasUmbrella = response.data.hasUmbrella;\r\n }\r\n \r\n if (response.data.umbrellaTaxTracker) {\r\n this.umbrellaTaxTracker = response.data.umbrellaTaxTracker;\r\n }\r\n \r\n if (response.data.userInputData) {\r\n _.assign(this.userInputData, response.data.userInputData);\r\n }\r\n }\r\n\r\n return response.data;\r\n });\r\n }\r\n\r\n getConfirmedAsDividendsTransactions = (): ng.IPromise> => {\r\n return this.$http.get('api/PersonalTaxTracker/GetConfirmedAsDividendsTransactions/',\r\n {\r\n params: { offset: this.taxYearOffset }\r\n }).then((response: ng.IHttpPromiseCallbackArg>) => response.data);\r\n }\r\n\r\n getUnconfirmedTransactions = (): ng.IPromise> => {\r\n return this.$http.get('api/PersonalTaxTracker/GetUnconfirmedTransactions').then((response: ng.IHttpPromiseCallbackArg>) => response.data);\r\n }\r\n\r\n postUserInputData = (): ng.IPromise => {\r\n return this.$http.post('api/PersonalTaxTracker/PostPersonalTaxTrackerUserInputData', this.userInputData, {\r\n silentMode: true\r\n }).then((response: ng.IHttpPromiseCallbackArg) => response.data);\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .service('personalTaxTrackerSrv', Shared.PersonalTaxTrackerService);\r\n","module Shared {\r\n export module questionnaire{\r\n export interface IQuestionaireFormItem {\r\n formId: number;\r\n formQuestionId: string;\r\n label: string;\r\n dataType: string;\r\n sortOrder: number;\r\n answer: string;\r\n otherRightToWorkAnswer: string;\r\n section: string;\r\n }\r\n\r\n export class QuestionaireFormItem implements IQuestionaireFormItem {\r\n formId: number;\r\n formQuestionId: string;\r\n label: string;\r\n dataType: string;\r\n sortOrder: number;\r\n answer: string;\r\n otherRightToWorkAnswer: string;\r\n section: string;\r\n }\r\n\r\n export class QuestionnaireSubmission {\r\n submissionForm: QuestionaireFormItem[];\r\n }\r\n\r\n export class AuditTrail {\r\n formId: number;\r\n submittedBy: string;\r\n }\r\n export class QuestionnaireMonthlySalaryPayments {\r\n year: number;\r\n connectUser: string;\r\n paymentDate: string;\r\n grossPay: number;\r\n tax: number;\r\n ni: number;\r\n net: number;\r\n empNi: number;\r\n }\r\n }\r\n}","/// \r\n\r\nmodule Shared {\r\n\r\n export interface IQuestionnaireService {\r\n getQuestionnaireForm(): ng.IPromise;\r\n saveQuestionnaireForm(questionnaire: any): ng.IPromise;\r\n saveQuestionnaireUpdateForm(questionnaire: any): ng.IPromise;\r\n hasCustomerSubmittedForm(): ng.IPromise;\r\n\r\n getDirectorFeesQuestionnaireForm(): ng.IPromise;\r\n getMortgageQuestionnaireForm(): ng.IPromise;\r\n getDirectorFeesMonthlySalaryPayments(): ng.IPromise; \r\n hasCustomerSubmittedDirectorFeesForm(): ng.IPromise;\r\n hasCustomerSubmittedMortgageForm(): ng.IPromise;\r\n \r\n showDirectorFeeFormBanner(): ng.IPromise;\r\n\r\n recordAuditTrail(auditTrail: Shared.questionnaire.AuditTrail): ng.IPromise;\r\n }\r\n\r\n export class QuestionnaireService implements IQuestionnaireService {\r\n static $inject = [\"$http\", \"$q\"];\r\n\r\n constructor(private $http: IBrooksonHttp,\r\n private $q: ng.IQService) {\r\n\r\n }\r\n\r\n getQuestionnaireForm(): ng.IPromise {\r\n const deferred = this.$q.defer();\r\n const url = \"api/Questionnaire/GetQuestionnaireForm\";\r\n\r\n this.$http.get(url)\r\n .then((response: any): void => {\r\n deferred.resolve(response.data);\r\n });\r\n\r\n return deferred.promise;\r\n }\r\n\r\n getDirectorFeesQuestionnaireForm(): ng.IPromise {\r\n const deferred = this.$q.defer();\r\n const url = \"api/Questionnaire/GetDirectorFeesQuestionnaireForm\";\r\n\r\n this.$http.get(url)\r\n .then((response: any): void => {\r\n deferred.resolve(response.data);\r\n });\r\n\r\n return deferred.promise;\r\n }\r\n\r\n getMortgageQuestionnaireForm(): ng.IPromise {\r\n const deferred = this.$q.defer();\r\n const url = \"api/Questionnaire/GetMortgageQuestionnaireForm\";\r\n\r\n this.$http.get(url)\r\n .then((response: any): void => {\r\n deferred.resolve(response.data);\r\n });\r\n\r\n return deferred.promise;\r\n }\r\n\r\n getDirectorFeesMonthlySalaryPayments(): ng.IPromise {\r\n const deferred = this.$q.defer();\r\n const url = \"api/Questionnaire/GetDirectorFeesMonthlySalaryPayments\";\r\n\r\n this.$http.get(url)\r\n .then((response: any): void => {\r\n deferred.resolve(response.data);\r\n });\r\n\r\n return deferred.promise;\r\n }\r\n\r\n saveQuestionnaireForm(questionnaire: Shared.questionnaire.QuestionaireFormItem[]): ng.IPromise {\r\n const deferred = this.$q.defer();\r\n const url = \"api/Questionnaire/SaveForm\";\r\n\r\n this.$http.post(url, questionnaire)\r\n .then((response: any): void => {\r\n deferred.resolve(response.data);\r\n });\r\n return deferred.promise;\r\n }\r\n\r\n saveQuestionnaireUpdateForm(questionnaire: Shared.questionnaire.QuestionaireFormItem[]): ng.IPromise {\r\n const deferred = this.$q.defer();\r\n const url = \"api/Questionnaire/SaveUpdateForm\";\r\n\r\n this.$http.post(url, questionnaire)\r\n .then((response: any): void => {\r\n deferred.resolve(response.data);\r\n });\r\n return deferred.promise;\r\n }\r\n\r\n hasCustomerSubmittedForm(): ng.IPromise {\r\n const deferred = this.$q.defer();\r\n const url = \"api/Questionnaire/HasCustomerSubmittedFlexFormForm\";\r\n this.$http.get(url)\r\n .then((response: any): void => {\r\n deferred.resolve(response.data);\r\n });\r\n\r\n return deferred.promise;\r\n }\r\n\r\n\r\n showDirectorFeeFormBanner(): ng.IPromise {\r\n const deferred = this.$q.defer();\r\n const url = \"api/Questionnaire/ShowDirectorFeesFormBanner\";\r\n this.$http.get(url)\r\n .then((response: any): void => {\r\n deferred.resolve(response.data);\r\n });\r\n\r\n return deferred.promise;\r\n }\r\n\r\n\r\n hasCustomerSubmittedDirectorFeesForm(): ng.IPromise {\r\n const deferred = this.$q.defer();\r\n const url = \"api/Questionnaire/HasCustomerSubmittedDirectorFeesForm\";\r\n this.$http.get(url)\r\n .then((response: any): void => {\r\n deferred.resolve(response.data);\r\n });\r\n\r\n return deferred.promise;\r\n }\r\n\r\n hasCustomerSubmittedMortgageForm(): ng.IPromise {\r\n const deferred = this.$q.defer();\r\n const url = \"api/Questionnaire/HasCustomerSubmittedMortgageForm\";\r\n this.$http.get(url)\r\n .then((response: any): void => {\r\n deferred.resolve(response.data);\r\n });\r\n\r\n return deferred.promise;\r\n }\r\n recordAuditTrail(auditTrail: Shared.questionnaire.AuditTrail): ng.IPromise {\r\n const deferred = this.$q.defer();\r\n const url = \"api/Questionnaire/RecordAuditTrail\";\r\n this.$http.post(url, auditTrail)\r\n .then((response: any): void => {\r\n deferred.resolve(response.data);\r\n });\r\n return deferred.promise;\r\n }\r\n\r\n }\r\n\r\n}\r\nangular.module(\"app.shared\").service('questionnaireSrv', Shared.QuestionnaireService);","/// \r\n/// \r\n\r\nmodule Shared {\r\n export interface IRemusRewardSrv {\r\n getRemusRewardsUrlParameters(): ng.IPromise;\r\n isUserUmbrellaPlus(): ng.IPromise;\r\n getSelectedPackage(): ng.IPromise;\r\n getAgencyMargin(): ng.IPromise;\r\n setSelectedPackage(selectedPackage: SelectedPackageEnum): boolean;\r\n setSelectedPackageNav(selectedPackage: SelectedPackageEnum): ng.IPromise;\r\n setPackageNavUmbrellaProtect(): ng.IPromise;\r\n }\r\n\r\n export class RemusRewardSrv implements IRemusRewardSrv {\r\n\r\n static $inject: Array = [\"$http\", \"shared.config\"];\r\n \r\n private selectedUmbrellaPackage = SelectedPackageEnum.umbrella;\r\n\r\n constructor(private $http: ng.IHttpService) { \r\n\r\n }\r\n \r\n getRemusRewardsUrlParameters(): ng.IPromise {\r\n return this.$http.get('api/RemusRewards/GetParameters')\r\n .then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n isUserUmbrellaPlus(): ng.IPromise {\r\n return this.$http.get('api/RemusRewards/IsUserUmbrellaPlus')\r\n .then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n \r\n public setSelectedPackage(selectedPackage: SelectedPackageEnum): boolean {\r\n this.setSelectedPackageNav(selectedPackage).then((result) => { \r\n this.selectedUmbrellaPackage = selectedPackage;\r\n return result;\r\n });\r\n return false;\r\n }\r\n \r\n public getAgencyMargin(): ng.IPromise {\r\n return this.$http.get('api/Intro/GetCurrentUmbrellaService')\r\n .then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n } \r\n\r\n public getSelectedPackage(): ng.IPromise {\r\n return this.$http.get('api/RemusRewards/IsUserUmbrellaPlus')\r\n .then((response: ng.IHttpPromiseCallbackArg) => {\r\n if(response.data)\r\n {\r\n return this.selectedUmbrellaPackage = SelectedPackageEnum.umbrellaProtect;\r\n } else \r\n {\r\n return this.selectedUmbrellaPackage = SelectedPackageEnum.umbrella;\r\n }\r\n });\r\n } \r\n\r\n \r\n setPackageNavUmbrellaProtect = (): ng.IPromise => { \r\n let SelectedPackageRequestData = {\r\n umbrellaPlusService: true\r\n };\r\n\r\n return this.$http.post('api/Intro/UpdateUmbrellaPlusService', SelectedPackageRequestData)\r\n .then((response: ng.IHttpPromiseCallbackArg): boolean => {\r\n return response.data;\r\n });\r\n \r\n }\r\n\r\n setSelectedPackageNav = (selectedPackage: SelectedPackageEnum): ng.IPromise => { \r\n let SelectedPackageRequestData = {\r\n umbrellaPlusService: ((selectedPackage === SelectedPackageEnum.umbrellaProtect) ? true : false)\r\n };\r\n\r\n return this.$http.post('api/Intro/UpdateUmbrellaPlusService', SelectedPackageRequestData)\r\n .then((response: ng.IHttpPromiseCallbackArg): boolean => {\r\n return response.data;\r\n });\r\n \r\n }\r\n}\r\n\r\nangular\r\n .module(\"app.shared\")\r\n .service(\"remusRewardSrv\", Shared.RemusRewardSrv);\r\n}","/// \r\nmodule Shared {\r\n export interface ISmeManagementSrv {\r\n getActionsToTakeSummary(): ng.IPromise;\r\n }\r\n\r\n export class SmeManagementSrv implements ISmeManagementSrv {\r\n\r\n static $inject = [\"$http\", \"shared.config\"];\r\n\r\n private serviceBase: any;\r\n\r\n constructor(private $http: ng.IHttpService, private sharedConfig: any) {\r\n this.serviceBase = sharedConfig.baseApiUrl;\r\n }\r\n\r\n getActionsToTakeSummary(): angular.IPromise {\r\n let url = this.serviceBase + \"api/SmeManagement/GetActionsToTakeSummary\";\r\n\r\n return this.$http.get(url).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"app.shared\").service(\"smeManagementSrv\", Shared.SmeManagementSrv);","/// \r\n\r\nmodule Shared {\r\n\texport interface IWelcomeScreenSrv {\r\n\t\tgetWelcomeScreenMessageHtml(): ng.IPromise;\r\n\t\tGetAccountantVideoId(): ng.IPromise;\r\n\t\tgetWelcomeVideos(): ng.IPromise;\r\n youtubeIds: Array;\r\n\t\taccountantYoutubeId: string;\r\n\t\tsetWelcomeScreenSeen(): ng.IPromise;\r\n\t\tgetWelcomeScreen() : ng.IPromise;\r\n\t\tgetWelcomeScreenEnabled() : ng.IPromise;\r\n\t\tGetAccountantVideoId() : ng.IPromise;\r\n\t\tgetWelcomeVideos() : ng.IPromise;\r\n\t\tsetWelcomeScreenSeen() : ng.IPromise;\r\n setHideWelcomeScreen(): ng.IPromise; \r\n\t\tmicroCalendlyBooking: Shared.MicroCalendlyBooking;\r\n advisoryDocumentCalendlyBooking: Shared.MicroCalendlyBooking;\r\n financialHealthCheckCalendlyBooking: Shared.MicroCalendlyBooking;\r\n\r\n\t}\r\n\r\n\texport class WelcomeScreenSrv implements IWelcomeScreenSrv {\r\n\t\tpublic youtubeIds: any[];\r\n public accountantYoutubeId: string;\r\n\t\tpublic microCalendlyBooking: Shared.MicroCalendlyBooking;\r\n public advisoryDocumentCalendlyBooking: Shared.MicroCalendlyBooking;\r\n public financialHealthCheckCalendlyBooking: Shared.MicroCalendlyBooking;\r\n\r\n\t\tstatic $inject: Array = [\"$http\", \"shared.config\"];\r\n\r\n\t\tprivate serviceBase: any;\r\n\r\n\t\tconstructor(\r\n\t\t\tprivate $http: ng.IHttpService,\r\n\t\t\tprivate sharedConfig: any\r\n\t\t) {\r\n\t\t\tthis.serviceBase = sharedConfig.baseApiUrl;\r\n\t\t}\r\n\r\n\t\tgetWelcomeScreenMessageHtml = (): ng.IPromise => {\r\n\t\t\tlet url = this.serviceBase + \"api/WelcomeScreen/GetContentMessage\";\r\n\t\t\treturn this.$http.get(url).then(\r\n\t\t\t\tresponse => response.data\r\n\t\t\t);\r\n\t\t}\r\n\r\n getWelcomeScreen = (silentMode?: boolean): ng.IPromise => {\r\n return this.$http.get(`api/Intro/GetWelcomeScreen`, {\r\n }).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\r\n\t\tgetWelcomeScreenEnabled = (): ng.IPromise => {\r\n\t\t\tlet url = this.serviceBase + \"api/Intro/GetWelcomeScreenEnabled\";\r\n\t\t\treturn this.$http.get(url).then(\r\n\t\t\t\tresponse => response.data\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tGetAccountantVideoId = (): ng.IPromise => {\r\n\t\t\tlet url = this.serviceBase + \"api/Intro/GetAccountantVideoId\";\r\n\t\t\treturn this.$http.get(url).then(\r\n\t\t\t\tresponse => response.data\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tgetWelcomeVideos = (): ng.IPromise => {\r\n\t\t\tlet url = this.serviceBase + \"api/Intro/GetWelcomeVideos\";\r\n\t\t\treturn this.$http.get(url).then((response: ng.IHttpPromiseCallbackArg>) => {\r\n return response.data;\r\n });\r\n\t\t}\r\n\t\r\n\t\tsetWelcomeScreenSeen = () : ng.IPromise => {\r\n return this.$http.post(`api/Intro/SetWelcomeScreenSeen`, {}, {\r\n }).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n\t\t}\r\n\t\t\t\t\r\n\t\tsetHideWelcomeScreen = () : ng.IPromise => {\r\n return this.$http.post(`api/Intro/HideWelcomeScreen`, {}, {\r\n }).then((response: ng.IHttpPromiseCallbackArg) => {\r\n return response.data;\r\n });\r\n }\r\n\t}\r\n}\r\n\r\nangular\r\n .module(\"app.shared\")\r\n .service(\"welcomeSrv\", Shared.WelcomeScreenSrv);","/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n \r\n export interface ISwapServiceLineService {\r\n changeSelectedServiceLine(selectedCompanyRef: string): void;\r\n changeSelectedServiceLineLocation(selectedCompanyRef: string, href: string): void;\r\n }\r\n\r\n export class SwapUserServiceLineService implements ISwapServiceLineService {\r\n static $inject = [ '$window', \r\n '$stateParams', \r\n 'memberSrv', \r\n 'authenticationSrv', \r\n 'brookson.navigation'];\r\n public selectedServiceLine: Shared.ServiceLine;\r\n public member: Shared.MemberModel;\r\n public serviceLines: Array = [];\r\n public message: string = \"\";\r\n\r\n constructor(\r\n private $window: Window,\r\n private $stateParams: ng.ui.IStateParamsService,\r\n private memberSrv: Shared.IMemberService,\r\n private authenticationSrv: Shared.IAuthenticationService,\r\n private brooksonNavigation: Shared.IBrooksonNavigation\r\n ) { }\r\n\r\n $onInit = (): void => {\r\n this.member = this.memberSrv.getMember();\r\n this.serviceLines = this.member.serviceLines;\r\n }\r\n\r\n changeSelectedServiceLine = (selectedCompanyRef: string): void => {\r\n \r\n this.member = this.memberSrv.getMember();\r\n //update the user service active service line\r\n this.member.companyRef = selectedCompanyRef;\r\n this.memberSrv.setMember(this.member);\r\n //this.selectedServiceLine = this.serviceLines.filter(s => s.)\r\n\r\n let line: ServiceLine[] = _.filter(this.member.serviceLines, (o: ServiceLine): boolean => o.customerReference === selectedCompanyRef);\r\n\r\n this.authenticationSrv.updateAccessTokenServiceLine(this.member.memberId, line[0], this.member.refreshToken, this.member.apiKeySource)\r\n .then(\r\n (data): void => {\r\n if (this.$stateParams['ReturnUrl']) {\r\n this.$window.location.href = this.$stateParams['ReturnUrl'];\r\n } else {\r\n this.brooksonNavigation.dashboard.main();\r\n }\r\n },\r\n (err): void => {\r\n this.message = err.data.error_description;\r\n })\r\n .catch((): void => { });\r\n }\r\n\r\n changeSelectedServiceLineLocation = (selectedCompanyRef: string, href: string): void => {\r\n \r\n this.member = this.memberSrv.getMember();\r\n //update the user service active service line\r\n this.member.companyRef = selectedCompanyRef;\r\n this.memberSrv.setMember(this.member);\r\n //this.selectedServiceLine = this.serviceLines.filter(s => s.)\r\n\r\n let line: ServiceLine[] = _.filter(this.member.serviceLines, (o: ServiceLine): boolean => o.customerReference === selectedCompanyRef);\r\n\r\n this.authenticationSrv.updateAccessTokenServiceLine(this.member.memberId, line[0], this.member.refreshToken, this.member.apiKeySource)\r\n .then(\r\n (data): void => {\r\n if (href) {\r\n this.$window.location.href = href;\r\n } else {\r\n this.brooksonNavigation.dashboard.main();\r\n }\r\n },\r\n (err): void => {\r\n this.message = err.data.error_description;\r\n })\r\n .catch((): void => { });\r\n }\r\n }\r\n}\r\nangular\r\n .module(\"app.shared\")\r\n .service(\"swapServiceLineSrv\", Shared.SwapUserServiceLineService);","/// \r\n\r\nmodule Shared {\r\n 'use strict';\r\n\r\n export class AllocationConfirmationController {\r\n static $inject = ['$uibModalInstance', 'bankLinkFactory', 'bankLink.enums'];\r\n\r\n constructor(\r\n private $uibModalInstance: ng.ui.bootstrap.IModalServiceInstance,\r\n public data: Shared.IBankLinkFactory,\r\n public bankLinkEnums: Shared.IBankLinkEnums\r\n ) {\r\n // Loop through all the transactions, split out this.data.modifiedTransactions to 'confirmed' and 'warning', add totals up for confirmed\r\n this.splitTransactionsAndTotalUp();\r\n }\r\n\r\n private splitTransactionsAndTotalUp = () => {\r\n\r\n _.each(this.data.modifiedTransactions, (o) => {\r\n if (!this.data.selectedAssignment || !this.data.selectedAssignment.dateStarted) {\r\n o.passes24MonthRule = true;\r\n } else {\r\n o.passes24MonthRule = !this.data.check24MonthRuleApplicable(o);\r\n }\r\n });\r\n\r\n this.data.confirmedTransactions = _.filter(this.data.modifiedTransactions, (o) => o.passes24MonthRule);\r\n this.data.warningTransactions = _.filter(this.data.modifiedTransactions, (o) => !o.passes24MonthRule);\r\n\r\n let runningTotal = 0;\r\n\r\n _.each(this.data.confirmedTransactions, (o) => {\r\n runningTotal += o.debitAmount;\r\n });\r\n\r\n this.data.confirmedTransactionsTotal = runningTotal;\r\n }\r\n\r\n public cancel = () => {\r\n this.$uibModalInstance.close();\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .controller('bankAllocationConfirmationCtrl', Shared.AllocationConfirmationController);","/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n\r\n export class BrooksonBankLinkAutoAllocationSettings implements ng.IComponentOptions {\r\n controller: Function = BrooksonBankLinkAutoAllocationSettingsController;\r\n templateUrl = \"src/app/shared/views/bank/brookson.banklink.auto.allocation.settings.html\";\r\n }\r\n\r\n class BrooksonBankLinkAutoAllocationSettingsController {\r\n static $inject = [\"$window\", \"autoAllocationService\", \"bankLinkSrv\", \"serviceLineSrv\", \"brookson.utilities.date\", \"moneyManagerSrv\", \"$sanitize\"];\r\n\r\n loading: boolean;\r\n companyConfigList: Array;\r\n showDisabled: boolean;\r\n allowAddNewSetting: boolean;\r\n autoAllocationFrm;\r\n isVatReclaimable: boolean;\r\n\r\n constructor(\r\n private window,\r\n private autoAllocationService: Shared.IAutoAllocationService,\r\n private bankLinkService: Shared.IBankLinkSrv,\r\n private serviceLineSrv: Shared.ServiceLineService,\r\n private dateUtils: Shared.IBrooksonUtilitiesDate,\r\n private moneyManagerSrv: Shared.IMoneyManagerService,\r\n private $sanitize: any\r\n ) {\r\n this.showDisabled = false;\r\n this.loading = true;\r\n }\r\n\r\n $onInit = (): void => {\r\n this.bankLinkService.getCategories().then((categories) => {\r\n this.autoAllocationService.categoryList = this.getAllowedCategories(categories);\r\n this.serviceLineSrv.getBusinessDetailSummary().then((businessSummary: BusinessDetailSummary) => {\r\n this.isVatReclaimable = businessSummary.getEffectiveVatSchemeOn(this.dateUtils.convertToJsDate(moment())) === VatScheme.nonFlatRate;\r\n this.loadAutoAllocationSettings()\r\n .then(() => {\r\n this.moneyManagerSrv.getTransactions().then((data: any) => {\r\n this.autoAllocationService.transactions = data.transactions;\r\n this.loading = false;\r\n });\r\n });\r\n });\r\n });\r\n } \r\n\r\n private getAllowedCategories = (categories: Array): Array => {\r\n _.remove(categories, (category: any) => {\r\n if (category.code === \"DLA\" || category.code === \"SALARY\") {\r\n return true;\r\n }\r\n });\r\n\r\n _.forEach(categories, category => {\r\n category.transactionTypeLabel = category.transactionType === 0 ? \"Personal\" : \"Business\";\r\n if (category.code === \"EXP0185\") { category.description = \"Subsistence\"; } // Hack: don't want to change it properly in NAV so SW said to do it in the view\r\n });\r\n\r\n let nonSoleTraderCategories = _.filter(categories, (category: any) => {\r\n return !_.startsWith(category.code, \"ST\");\r\n });\r\n var categoriesWithNoCcDiv = _.filter(nonSoleTraderCategories, (category: any )=> { return category.code !== \"CC DIV\"; });\r\n var creditOrDebitCategories = _.filter(categoriesWithNoCcDiv, (category: any) => { return category.type === \"Debit\"; });\r\n return creditOrDebitCategories;\r\n }\r\n\r\n private loadAutoAllocationSettings = (): ng.IPromise> => {\r\n return this.autoAllocationService.getAutoAllocationSettings().then((autoAllocationSettings: Array) => {\r\n this.autoAllocationService.companyConfig = autoAllocationSettings;\r\n this.showDisabledMatches();\r\n this.allowAddNewSetting = true;\r\n return autoAllocationSettings;\r\n });\r\n }\r\n\r\n showDisabledMatches = (): void => {\r\n this.companyConfigList = this.autoAllocationService.getSettingsList(this.showDisabled);\r\n this.autoAllocationFrm.$setPristine();\r\n }\r\n\r\n addNew = () => {\r\n this.companyConfigList.push(this.autoAllocationService.createNewAllocationSetting());\r\n this.allowAddNewSetting = false;\r\n }\r\n\r\n saveNewAutoSetting = (newSetting: AutoAllocation.IAutoAllocationItem) => {\r\n\r\n let uniqueKeywordCheck = _.find(this.autoAllocationService.companyConfig, (config) => {\r\n return config.keyword === newSetting.keyword;\r\n });\r\n\r\n if (!_.isUndefined(uniqueKeywordCheck)) {\r\n return;\r\n }\r\n\r\n if (!_.isUndefined(newSetting)) {\r\n newSetting.categoryCode = newSetting.navCategory.code;\r\n if (_.isUndefined(newSetting.reclaimVat)) newSetting.reclaimVat = false;\r\n this.autoAllocationService\r\n .saveNewAutoAllocationSetting(newSetting as Shared.AutoAllocation.IAutoAllocationItem)\r\n .then((status: boolean) => {\r\n if (status) {\r\n this.loadAutoAllocationSettings();\r\n }\r\n });\r\n }\r\n\r\n this.allowAddNewSetting = true;\r\n }\r\n\r\n cancelNewAutoSetting = () => {\r\n this.companyConfigList.pop();\r\n this.allowAddNewSetting = true;\r\n }\r\n\r\n disableSaveButton = (newSetting: AutoAllocation.IAutoAllocationItem): boolean => {\r\n if (_.isUndefined(newSetting) || _.isUndefined(newSetting.keyword)) return true;\r\n if (this.autoAllocationService.duplicateKeyword(newSetting)) {\r\n return true;\r\n }\r\n if (_.isUndefined(newSetting.navCategory)) return true;\r\n return false;\r\n } \r\n\r\n keywordChanged = (autoSetting: AutoAllocation.IAutoAllocationItem): void => {\r\n if (_.isUndefined(autoSetting)) return;\r\n if (_.isUndefined(autoSetting.keyword)) {\r\n this.autoAllocationService.resetTransactionMatches(autoSetting);\r\n }\r\n if (autoSetting.id === -1) {\r\n if (!this.autoAllocationService.duplicateKeyword(autoSetting)) {\r\n this.autoAllocationService.searchTransactions(autoSetting);\r\n }\r\n return;\r\n }\r\n\r\n let originalValue = _.find(this.autoAllocationService.companyConfig, (setting: AutoAllocation.IAutoAllocationItem) => {\r\n return setting.id === autoSetting.id;\r\n });\r\n if (_.isUndefined(originalValue)) return;\r\n\r\n autoSetting.hasChanged = false;\r\n if (_.isUndefined(autoSetting.keyword)) {\r\n autoSetting.hasChanged = true;\r\n return;\r\n }\r\n\r\n if (autoSetting.keyword.toLowerCase() !== originalValue.keyword.toLowerCase()) {\r\n autoSetting.hasChanged = true;\r\n if (!this.autoAllocationService.duplicateKeyword(autoSetting)) {\r\n this.autoAllocationService.searchTransactions(autoSetting);\r\n }\r\n }\r\n }\r\n\r\n finishedKeyword = (autoSetting: AutoAllocation.IAutoAllocationItem) => {\r\n if (_.isUndefined(autoSetting)) return;\r\n this.autoAllocationService.resetTransactionMatches(autoSetting);\r\n }\r\n\r\n settingChanged = (autoSetting: AutoAllocation.IAutoAllocationItem): void => {\r\n if (_.isUndefined(autoSetting)) return;\r\n if (_.isUndefined(autoSetting.keyword)) return;\r\n let originalValue = _.find(this.autoAllocationService.companyConfig, (setting: AutoAllocation.IAutoAllocationItem) => {\r\n return setting.id === autoSetting.id;\r\n });\r\n\r\n if (_.isUndefined(originalValue)) { \r\n if (!_.isUndefined(autoSetting.navCategory) && !autoSetting.navCategory.isVatable) autoSetting.reclaimVat = false;\r\n return;\r\n }\r\n \r\n autoSetting.hasChanged = false;\r\n if (autoSetting.keyword.toLowerCase() !== originalValue.keyword.toLowerCase() ||\r\n !_.isUndefined(autoSetting.navCategory) && autoSetting.navCategory.code !== originalValue.categoryCode ||\r\n autoSetting.reclaimVat !== originalValue.reclaimVat ||\r\n autoSetting.enabled !== originalValue.enabled) {\r\n autoSetting.hasChanged = true;\r\n if (!_.isUndefined(autoSetting.navCategory) && autoSetting.keyword.toLowerCase() !== originalValue.keyword.toLowerCase()) {\r\n this.autoAllocationService.duplicateKeyword(autoSetting);\r\n }\r\n if (!autoSetting.navCategory.isVatable) {\r\n autoSetting.reclaimVat = false;\r\n }\r\n } \r\n }\r\n\r\n cancelUpdate = (autoSetting: AutoAllocation.IAutoAllocationItem): void => {\r\n\r\n let originalValue = _.find(this.autoAllocationService.companyConfig, (setting: AutoAllocation.IAutoAllocationItem) => {\r\n return setting.id === autoSetting.id;\r\n });\r\n\r\n if (!_.isUndefined(originalValue)) {\r\n autoSetting.keyword = originalValue.keyword;\r\n autoSetting.navCategory = _.find(this.autoAllocationService.categoryList, (category) => {\r\n if (!_.isUndefined(originalValue))\r\n return category.code === originalValue.categoryCode;\r\n });\r\n autoSetting.reclaimVat = originalValue.reclaimVat;\r\n autoSetting.enabled = originalValue.enabled;\r\n }\r\n autoSetting.validationMessage = \"\";\r\n autoSetting.hasChanged = false;\r\n }\r\n\r\n updateAutoSetting = (autoSetting: AutoAllocation.IAutoAllocationItem): void => {\r\n\r\n let createdBy = \"Customer\";\r\n if(!_.isNull(this.autoAllocationService.memberModel.isAdmin))\r\n {\r\n createdBy = \"Superuser\";\r\n } else if (!_.isNull(this.autoAllocationService.memberModel.navReferral)) \r\n {\r\n createdBy = this.autoAllocationService.memberModel.navReferral;\r\n }\r\n\r\n autoSetting.updatedBy = createdBy;\r\n autoSetting.categoryCode = autoSetting.navCategory.code;\r\n this.autoAllocationService.updateAutoAllocationSetting(autoSetting).then(() => {\r\n let config = _.find(this.autoAllocationService.companyConfig, (config: AutoAllocation.IAutoAllocationItem) => {\r\n return config.id === autoSetting.id;\r\n });\r\n\r\n config.keyword = autoSetting.keyword;\r\n config.categoryCode = autoSetting.categoryCode;\r\n config.reclaimVat = autoSetting.reclaimVat;\r\n config.enabled = autoSetting.enabled;\r\n config.hasChanged = false;\r\n\r\n if (!this.showDisabled && !config.enabled) {\r\n _.remove(this.companyConfigList, c => c.id === config.id);\r\n }\r\n\r\n this.settingChanged(autoSetting);\r\n });\r\n }\r\n\r\n invokeBackButton = (): void => {\r\n this.window.history.back();\r\n }\r\n\r\n }\r\n\r\n}\r\n\r\nangular.module(\"app.shared\")\r\n .component(\"brooksonAutoAllocationSettings\", new Shared.BrooksonBankLinkAutoAllocationSettings());","/// \r\n/// \r\n/// \r\n/// \r\n\r\nmodule Shared {\r\n \r\n interface Transaction {\r\n date: string;\r\n amount: number;\r\n balance: number;\r\n type: string;\r\n payee: string;\r\n description: string;\r\n reference: string;\r\n selected: boolean;\r\n }\r\n\r\n interface Step {\r\n title: string;\r\n isOpen: boolean;\r\n }\r\n\r\n export class BrooksonBankFileImport implements ng.IComponentOptions {\r\n controller: Function = BrooksonBankFileImportController;\r\n templateUrl = \"src/app/shared/views/bank/brookson.banklink.bankfilupload.html\";\r\n onComplete: Function;\r\n }\r\n\r\n class BrooksonBankFileImportController {\r\n static $inject = [\"$window\", \"autoAllocationService\", \"bankLinkSrv\", \"serviceLineSrv\", \"brookson.utilities.date\", \"moneyManagerSrv\", \"$sanitize\", \"$scope\", \"$timeout\", \"flowFactory\", \"bankLinkFactory\", 'openbankingWidgetService','$q', 'authenticationSrv', '$window','$sce', '$log', \"growl\"];\r\n public dropboxUploadOptions: flowjs.IFlow;\r\n loading: boolean;\r\n companyConfigList: Array;\r\n showDisabled: boolean;\r\n allowAddNewSetting: boolean;\r\n autoAllocationFrm;\r\n showTransactionDateFrm: boolean;\r\n todaysDate: Date;\r\n \r\n public steps: Step[];\r\n public selectedBankAccount: any;\r\n public updatedTransactionDate: Date;\r\n public bankAccounts: any[];\r\n public fileContent: string;\r\n public transactions: Transaction[];\r\n public progress: number;\r\n public uploadStatus: string;\r\n public uploadMessage: string;\r\n public selectAll: boolean;\r\n public submissionSuccess: boolean;\r\n public dateTransactionSuccess: boolean;\r\n public submittedRowCount: number;\r\n public submittedDateRange: string;\r\n public submittedTotalAmount: number;\r\n\r\n public showSpinner: boolean;\r\n public bankAccountList: Array;\r\n public error: boolean;\r\n public isSubmitError: boolean;\r\n public submitMessage: string;\r\n public onComplete;\r\n currentFileId: string;\r\n public options: any;\r\n public summary: any;\r\n public selectedPendingStatement: boolean;\r\n public navBankTransactions: any = {}; \r\n\r\n constructor(\r\n private window,\r\n \r\n private autoAllocationService: Shared.IAutoAllocationService,\r\n private bankLinkService: Shared.IBankLinkSrv,\r\n private serviceLineSrv: Shared.ServiceLineService,\r\n private dateUtils: Shared.IBrooksonUtilitiesDate,\r\n private moneyManagerSrv: Shared.IMoneyManagerService,\r\n private $sanitize: any,\r\n private $scope: ng.IScope,\r\n private $timeout: ng.ITimeoutService,\r\n private flowFactory: ng.flow.IFlowFactory,\r\n private data: Shared.IBankLinkFactory,\r\n private openbankingWidgetService: Shared.OpenbankingWidgetService,\r\n private $q: ng.IQService,\r\n\r\n public authenticationSrv: Shared.IAuthenticationService,\r\n public $window: ng.IWindowService,\r\n public $sce: ng.ISCEService,\r\n private $log: ng.ILogService,\r\n private growl: ng.growl.IGrowlService,\r\n ) {\r\n this.showDisabled = false;\r\n this.loading = true;\r\n $scope['uploadOptions'] = this.flowFactory.create({\r\n permanentErrors: ['404', '500', '501'],\r\n target: '/api/BankLink/UploadStatementFile',\r\n headers: {\r\n '__RequestVerificationToken': $window.brookson.antiForgeryToken,\r\n \"Accept\": \"application/json\"\r\n },\r\n testChunks: false,\r\n chunkSize: 9007199254740991,\r\n singleFile: true\r\n });\r\n\r\n $scope['cancel'] = this.cancel;\r\n $scope['flowFilesSubmitted'] = this.flowFilesSubmitted;\r\n $scope['flowFileError'] = this.flowFileError;\r\n $scope['flowFileSuccess'] = this.flowFileSuccess;\r\n $scope['fileErrors'] = [];\r\n $scope['sentSuccessfully'] = false;\r\n $scope['title'] = \"Upload Bank Statement\";\r\n $scope['successfullMessage'] = \"Uploaded\";\r\n $scope['uploadMessage'] = \"\";\r\n $scope['additionalHtml'] = this.$sce.trustAsHtml(\"\");\r\n $scope['authenticationSrv'] = authenticationSrv;\r\n\r\n }\r\n\r\n $onInit = (): void => {\r\n this.todaysDate = new Date();\r\n this.showSpinner = true;\r\n this.$q.all([\r\n this.openbankingWidgetService.getGetBankStatementData(true)\r\n ]).then((data) => {\r\n this.bankAccountList = data[0];\r\n this.setupAccounts(this.bankAccountList);\r\n this.showSpinner = false;\r\n }, () => {\r\n this.error = true;\r\n }).then(() => {\r\n this.showSpinner = false;\r\n });\r\n\r\n this.data.getBankAccounts();\r\n \r\n this.currentFileId = this.uuid();\r\n \r\n this.steps = [\r\n { title: 'Select Bank Account', isOpen: true },\r\n { title: 'Upload Bank Statement', isOpen: false },\r\n // Add Step 3 for column mapping\r\n { title: 'Review Transactions', isOpen: false },\r\n { title: 'Submission Summary', isOpen: false },\r\n ];\r\n\r\n this.transactions = [];\r\n this.progress = 0;\r\n this.uploadStatus = '';\r\n this.uploadMessage = '';\r\n this.selectAll = false;\r\n this.submissionSuccess = false;\r\n } \r\n\r\n public cancel = (): void => {\r\n \r\n }\r\n\r\n fileDeletetedClicked(flow) {\r\n flow.cancel();\r\n }\r\n\r\n public flowFilesSubmitted = (files, event, flow, path) => {\r\n this.$log.debug(\"Submitted\");\r\n // Clear any previous upload errors\r\n this.$scope['fileErrors'] = [];\r\n this.$scope['sentSuccessfully'] = false;\r\n this.$scope['authenticationSrv'].refreshToken().then(data => {\r\n flow.opts.query.dropboxUploadPath = path;\r\n flow.opts.headers.Authorization = \"Bearer \" + data.access_token;\r\n flow.opts.headers.BankAccountId = this.selectedBankAccount.key;\r\n flow.opts.headers.BankAccountKey = this.selectedBankAccount.bankAccountKey;\r\n flow.upload();\r\n });\r\n }\r\n\r\n public flowFileError($file, $message, $flow) {\r\n this.growl.error(\"There was an error uploading this bank file \" + $file.name);\r\n this.$log.debug(\"Error\");\r\n this.uploadStatus = 'error';\r\n this.$scope['fileErrors'].push($file);\r\n this.error = true;\r\n\r\n }\r\n\r\n public flowFileSuccess = ($file, $message, $flow) => {\r\n if($message!==\"\")\r\n {\r\n this.$scope['sentSuccessfully'] = true; \r\n this.summary = JSON.parse($message);\r\n this.uploadStatus = 'uploaded';\r\n this.openNextStep(1);\r\n } else \r\n {\r\n this.$scope['sentSuccessfully'] = true; \r\n this.uploadStatus = 'progress'; \r\n }\r\n }\r\n\r\n showTransactionDate = (): void =>\r\n {\r\n this.showTransactionDateFrm = true;\r\n }\r\n\r\n hideTransactionDate = (): void =>\r\n {\r\n this.showTransactionDateFrm = false;\r\n }\r\n\r\n /**\r\n * Flowjs event when the the upload has been completed\r\n * \r\n * @param {flowjs.IFlow} $flow\r\n * \r\n * @memberOf BrooksonExpensesAddReceiptController\r\n */\r\n flowComplete = ($flow: flowjs.IFlow): void => {\r\n this.$log.debug(\"Complete\");\r\n \r\n this.$timeout((flow) => {\r\n flow.files = [];\r\n // this.fileTypeValidationErrors = [];\r\n // this.fileSizeValidationErrors = [];\r\n\r\n }, 4000, true, $flow);\r\n }\r\n\r\n uuid = () => {\r\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\r\n var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);\r\n return v.toString(16);\r\n });\r\n } \r\n\r\n private setupAccounts = (bankAccounts : Shared.openbankingWidget.WidgetAccount[]): void => {\r\n _.each(bankAccounts, (bankAccount): void => {\r\n bankAccount.type = Shared.openbankingWidget.bankType[bankAccount.type].replace('_', ' ');\r\n bankAccount.accountType = Shared.openbankingWidget.accountType[bankAccount.accountType];\r\n if (bankAccount.consentStatus === Shared.openbankingWidget.ConsentStatus.AccessTokenReceived && !bankAccount.consentExpired) {\r\n bankAccount.success = true;\r\n }\r\n\r\n if (bankAccount.viewAccess === false) {\r\n bankAccount.className = 'redBox';\r\n } else {\r\n if (bankAccount.viewAccessDescription.toLowerCase().indexOf('view access') > -1) {\r\n bankAccount.className = 'orangeBox';\r\n }\r\n if (bankAccount.viewAccessDescription.toLowerCase().indexOf('open banking') > -1) {\r\n bankAccount.className = 'greenBox';\r\n }\r\n }\r\n\r\n });\r\n }\r\n \r\n getLastFiveBankTransaction = (): void => {\r\n this.bankLinkService.getLastFiveBankTransaction(this.selectedBankAccount.bankAccountKey).then((navBankTransactions) => {\r\n navBankTransactions = _.sortBy(navBankTransactions, 'entryNo');\r\n this.navBankTransactions = navBankTransactions.reverse();\r\n });\r\n }\r\n\r\n selectBankAccount(account: any, $flow: flowjs.IFlow): void {\r\n if($flow){\r\n $flow.cancel();\r\n }\r\n if($flow && $flow.files)\r\n {\r\n $flow.removeFile($flow.files[0]);\r\n $flow.files = [];\r\n }\r\n this.$scope['sentSuccessfully'] = false; \r\n this.selectedPendingStatement = false;\r\n\r\n if(account.hasPendingBankStatement)\r\n {\r\n this.selectedPendingStatement = true;\r\n\r\n } else {\r\n this.selectedPendingStatement = false;\r\n }\r\n\r\n this.selectedBankAccount = account;\r\n this.getLastFiveBankTransaction();\r\n\r\n this.openNextStep(0);\r\n }\r\n\r\n openNextStep(stepIndex: number): void {\r\n this.steps[stepIndex].isOpen = false;\r\n this.steps[stepIndex+1].isOpen = true;\r\n }\r\n\r\n openBackStep(stepIndex: number): void {\r\n this.steps[stepIndex].isOpen = false;\r\n this.steps[stepIndex-1].isOpen = true;\r\n }\r\n\r\n fileUploaded(flow: flowjs.IFlow, file: any, message: string): void {\r\n this.uploadStatus = '';\r\n this.uploadMessage = 'Uploading file...';\r\n this.progress = 0;\r\n\r\n flow.upload();\r\n\r\n \r\n flow.on('progress', (flowProgress: number) => {\r\n this.$timeout(() => {\r\n this.progress = Math.floor(flowProgress * 100);\r\n });\r\n });\r\n\r\n flow.on('fileSuccess', (file: any, message: string) => {\r\n \r\n this.$timeout(() => {\r\n this.fileContent = message;\r\n this.uploadStatus = 'Success';\r\n this.uploadMessage = 'File uploaded successfully!';\r\n });\r\n });\r\n\r\n flow.on('fileError', (file: any, message: string) => {\r\n this.growl.error(\"There was an error uploading this bank file \" + file.name);\r\n this.$timeout(() => {\r\n this.uploadStatus = 'Error';\r\n this.uploadMessage = 'File upload error: ' + message;\r\n this.error = true;\r\n });\r\n });\r\n }\r\n \r\n toggleAll(): void {\r\n this.summary.summary.bankStatementRows.forEach((transaction: Transaction) => {\r\n transaction.selected = this.selectAll;\r\n });\r\n }\r\n\r\n toggleRow(transaction: Transaction): void {\r\n transaction.selected = !transaction.selected;\r\n this.selectAll = this.summary.summary.bankStatementRows.every((t) => t.selected);\r\n }\r\n\r\n numberOfSelectedRows(): number {\r\n return this.summary.summary.bankStatementRows.filter((t) => t.selected).length;\r\n }\r\n\r\n totalAmountOfSelectedRows(): number {\r\n return this.summary.summary.bankStatementRows.reduce((sum: number, t) => {\r\n return t.selected ? sum + t.amount : sum;\r\n }, 0);\r\n }\r\n \r\n newBalanceAmount(): number {\r\n this.updatedTransactionDate = this.summary !== undefined && this.summary.summary.postingDate;\r\n return this.summary !== undefined && this.summary.summary.totalAmount + this.selectedBankAccount.availableBalance;\r\n }\r\n\r\n hasSelectedTransactions(): boolean {\r\n return this.summary !== undefined && this.summary.summary.totalCount > 0;\r\n } \r\n\r\n updateTransactions(): void {\r\n this.submittedRowCount = this.numberOfSelectedRows();\r\n this.submittedTotalAmount = this.totalAmountOfSelectedRows();\r\n\r\n const selectedTransactions = this.summary.summary.bankStatementRows.filter((t) => t.selected);\r\n const minDate = Math.min(...selectedTransactions.map(t => new Date(t.date).getTime()));\r\n const maxDate = Math.max(...selectedTransactions.map(t => new Date(t.date).getTime()));\r\n this.submittedDateRange = new Date(minDate).toLocaleDateString() + ' - ' + new Date(maxDate).toLocaleDateString();\r\n //API Submit\r\n }\r\n\r\n submitTransactions = () => {\r\n this.updateTransactions();\r\n this.bankLinkService.submitBankStatementBatch(this.summary.summary.batchId, this.selectedBankAccount.key, new Date(this.updatedTransactionDate)).then(\r\n data => {\r\n this.submissionSuccess = data.success;\r\n this.isSubmitError = !data.success;\r\n this.submitMessage = data.message;\r\n }\r\n );\r\n }\r\n\r\n submitTransactionDate = () => {\r\n this.bankLinkService.updateBankStatementDate(this.selectedBankAccount.key, new Date(this.updatedTransactionDate)).then(\r\n data => {\r\n this.dateTransactionSuccess = data;\r\n }\r\n );\r\n }\r\n\r\n cancelBatch(): void {\r\n this.bankLinkService.cancelBankStatementBatch(this.selectedBankAccount.batchId);\r\n }\r\n\r\n clearBatch(batchId: number): void {\r\n this.showSpinner = true;\r\n\r\n this.$q.all([this.bankLinkService.clearBankStatementBatch(batchId) \r\n ]).then((data) => {\r\n this.$window.location.href = `${this.$window.location.origin}/banklink/bank-file`;\r\n }, () => {\r\n this.error = true;\r\n }).then(() => {\r\n this.showSpinner = false;\r\n });\r\n\r\n this.data.getBankAccounts(); \r\n }\r\n\r\n addNew = () => {\r\n this.companyConfigList.push(this.autoAllocationService.createNewAllocationSetting());\r\n this.allowAddNewSetting = false;\r\n }\r\n\r\n invokeBackButton = (): void => {\r\n this.window.history.back();\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"app.shared\")\r\n .component(\"brooksonBankFileImport\", new Shared.BrooksonBankFileImport());","/// \r\n\r\nmodule Shared {\r\n\r\n interface IBrooksonBankLinkTransactionsMobileBindings {\r\n getData: Array;\r\n hideAside: Array;\r\n }\r\n\r\n export class BrooksonBankLinkTransactionsMobile implements ng.IComponentOptions {\r\n public controller: Function = BrooksonBankLinkTransactionsMobileController;\r\n public templateUrl: string = 'src/app/shared/views/bank/brookson.bankLink.transactions.mobile.html';\r\n public bindings: { [binding: string]: string } = {\r\n getData: '@',\r\n hideAside: '@'\r\n };\r\n }\r\n\r\n class BrooksonBankLinkTransactionsMobileController implements IBrooksonBankLinkTransactionsMobileBindings {\r\n static $inject = ['bankLinkFactory', 'bankLink.enums', 'AssignmentSrv', 'brookson.utilities.date', \"$location\", \"orderByFilter\",\"$state\"];\r\n\r\n public getData;\r\n public hideAside;\r\n\r\n vatRateConfig: Array;\r\n\r\n constructor(\r\n public data: Shared.IBankLinkFactory,\r\n public bankLinkEnums: Shared.IBankLinkEnums,\r\n public assignmentSrv: Shared.IAssignmentService,\r\n public dateUtils: Shared.IBrooksonUtilitiesDate,\r\n private $location: ng.ILocationService,\r\n private orderByFilter: ng.IFilterOrderBy,\r\n private $state: ng.ui.IStateService,\r\n ) { }\r\n\r\n $onInit = () => {\r\n if (this.getData && this.data.transactionTypes.length === 0) {\r\n this.data.getTransactionTypes();\r\n this.data.getBankAccounts();\r\n this.data.getTransactions(true);\r\n this.data.getCategories();\r\n this.data.getReceipts();\r\n this.data.getMoneyManagerData();\r\n }\r\n this.data.getAllVatRatesConfig().then((result) => {\r\n this.vatRateConfig = this.orderByFilter(result, \"-effectiveDate\");\r\n });\r\n\r\n this.getAssignments();\r\n }\r\n\r\n vatChanged = (transaction): void => {\r\n if (transaction.vat > 0) {\r\n transaction.vat = -transaction.vat;\r\n }\r\n\r\n transaction.net = (-transaction.gross || 0) - (transaction.vat || 0);\r\n }\r\n\r\n viewAutoAllocationSettings = (expense: Shared.ExpenseHeader): void => {\r\n this.$state.go(\"brookson.banklink-auto-allocation-settings\");\r\n }\r\n\r\n viewBankFileUpload = (expense: Shared.ExpenseHeader): void => {\r\n this.$state.go(\"brookson.bank-file-upload\");\r\n }\r\n\r\n clearVat = (transaction): void => {\r\n transaction.vat = 0;\r\n this.vatChanged(transaction);\r\n transaction.maxVat = 0;\r\n transaction.maxVatMessage = \"VAT must be 0\";\r\n }\r\n\r\n getVatAmount = (transaction) => {\r\n const vatRate = this.getApplicableVatRate(transaction);\r\n return -Math.floor((vatRate * (transaction.gross || 0)) / (100 + vatRate) * 100) / 100;\r\n }\r\n\r\n setMaxVat = (transaction) => {\r\n var vat = this.getVatAmount(transaction);\r\n const vatRate = this.getApplicableVatRate(transaction);\r\n var vat20precent = -Math.floor((20 * (transaction.gross || 0)) / (100 + 20) * 100) / 100;\r\n transaction.maxVat = vatRate > 0 && vatRate < 20 ? vat20precent : vat; \r\n transaction.maxVatMessage = `VAT must be less than or equal to ${-transaction.maxVat}`;\r\n }\r\n\r\n grossChanged = (transaction): void => {\r\n if (transaction.hasValidVatReceipt) {\r\n transaction.vat = this.getVatAmount(transaction);\r\n this.setMaxVat(transaction);\r\n this.vatChanged(transaction);\r\n } else {\r\n this.clearVat(transaction);\r\n }\r\n }\r\n\r\n hasValidVatReceiptChanged = (transaction): void => {\r\n if (!transaction.hasValidVatReceipt) {\r\n this.clearVat(transaction);\r\n } else if (transaction.gross) {\r\n this.grossChanged(transaction);\r\n }\r\n }\r\n\r\n getApplicableVatRate = (transaction): number => {\r\n const transactionDate = transaction.transactionDate ? this.dateUtils.convertToJsDate(transaction.transactionDate) : new Date();\r\n \r\n const applicableRateConfig = this.vatRateConfig ? _.find(this.vatRateConfig, (rateConfig: VatRateConfig) => {\r\n if (transaction)\r\n {\r\n return transactionDate >= rateConfig.effectiveDate && transactionDate <= rateConfig.endDate && rateConfig.expenseCode === transaction.transactionCategory.code;\r\n }\r\n }) : new VatRateConfig();\r\n\r\n\r\n const applicableRate = transaction.vatRates ? _.find(transaction.vatRates, (rate: VatRate) => {\r\n return rate.startDate <= transactionDate;\r\n }).amount : 20;\r\n\r\n if(applicableRateConfig && applicableRateConfig.vatRate)\r\n {\r\n return applicableRateConfig.vatRate;\r\n }\r\n\r\n return applicableRate;\r\n }\r\n\r\n public getAssignments = () => {\r\n return this.assignmentSrv.getAssignments()\r\n .then(data => {\r\n\r\n if (data.length === 0 && this.$location.path().indexOf(\"Business\")) {\r\n let blankAssignment: Shared.InvoicingAssignment = new Shared.InvoicingAssignment();\r\n blankAssignment.fullAssignmentName = 'No Active Assignments';\r\n data.push(blankAssignment);\r\n\r\n this.data.selectedAssignment = data[0];\r\n }\r\n\r\n //supply the assignments in reverse date order\r\n let orderAssignmentsByDateStarted: any = _.sortBy(data, [(o) => this.toDate(o)]);\r\n this.data.assignments = orderAssignmentsByDateStarted.reverse();\r\n\r\n // If the year is 1753 or the top assignment is still current, then assign it in the dropdown as the selected assignment\r\n if (\r\n (orderAssignmentsByDateStarted.length !== 0) &&\r\n (orderAssignmentsByDateStarted[0].dateEnded !== undefined)\r\n ) {\r\n if (\r\n (\r\n this.dateUtils.isSame(orderAssignmentsByDateStarted[0].dateEnded, '1753-01-01') || this.dateUtils.isAfter(orderAssignmentsByDateStarted[0].dateEnded, moment().startOf('day'))\r\n ) && orderAssignmentsByDateStarted.length === 1\r\n ) {\r\n this.data.selectedAssignment = orderAssignmentsByDateStarted[0];\r\n }\r\n }\r\n\r\n return data;\r\n });\r\n }\r\n\r\n public toDate = (item: Shared.Assignment): Date => {\r\n return this.dateUtils.convertToJsDate(item.dateStarted);\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .component('brooksonBankLinkTransactionsMobile', new Shared.BrooksonBankLinkTransactionsMobile());","/// \r\n\r\nmodule Shared {\r\n \r\n interface IBrooksonBankLinkTransactionsPaginationBindings {\r\n bankAccounts: Array;\r\n }\r\n\r\n export class BrooksonBankLinkTransactionsPagination implements ng.IComponentOptions {\r\n public controller: Function = BrooksonBankLinkTransactionsPaginationController;\r\n public templateUrl: string = 'src/app/shared/views/bank/brookson.bankLink.transactions.pagination.html';\r\n public bindings: { [binding: string]: string } = {\r\n bankAccounts: '='\r\n };\r\n }\r\n\r\n class BrooksonBankLinkTransactionsPaginationController implements IBrooksonBankLinkTransactionsPaginationBindings {\r\n static $inject = ['bankLinkFactory'];\r\n\r\n public bankAccounts;\r\n\r\n constructor (\r\n public data\r\n ) { }\r\n }\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .component('brooksonBankLinkTransactionsPagination', new Shared.BrooksonBankLinkTransactionsPagination());","/// \r\n/// \r\n/// \r\n/// \r\n\r\n\r\nmodule Shared {\r\n\r\n interface IBrooksonBankLinkTransactionsBindings {\r\n getData: Array;\r\n businessOnly: Array;\r\n }\r\n\r\n export class BrooksonBankLinkTransactions implements ng.IComponentOptions {\r\n public controller: Function = BrooksonBankLinkTransactionsController;\r\n public templateUrl: string = 'src/app/shared/views/bank/brookson.bankLink.transactions.html';\r\n public bindings: { [binding: string]: string } = {\r\n getData: '@',\r\n businessOnly: '@'\r\n };\r\n }\r\n\r\n class BrooksonBankLinkTransactionsController implements IBrooksonBankLinkTransactionsBindings {\r\n static $inject = ['bankLinkFactory', 'bankLink.enums', 'AssignmentSrv', 'brookson.utilities.date', \"$location\", '$state', 'orderByFilter'];\r\n\r\n public getData;\r\n public businessOnly;\r\n\r\n vatRateConfig: Array;\r\n\r\n constructor(\r\n public data: Shared.IBankLinkFactory,\r\n public bankLinkEnums: Shared.IBankLinkEnums,\r\n public assignmentSrv: Shared.IAssignmentService,\r\n public dateUtils: Shared.IBrooksonUtilitiesDate,\r\n private $location: ng.ILocationService,\r\n private $state: ng.ui.IStateService,\r\n private orderByFilter: ng.IFilterOrderBy,\r\n ) { }\r\n\r\n $onInit = () => {\r\n if (this.getData && this.data.transactionTypes.length === 0) {\r\n this.data.getTransactionTypes();\r\n this.data.getBankAccounts();\r\n this.data.isCsvUploadRequired();\r\n this.data.getTransactions(true);\r\n this.data.getCategories();\r\n this.data.getReceipts();\r\n this.data.getMoneyManagerData();\r\n \r\n }\r\n this.data.getAllVatRatesConfig().then((result) => {\r\n this.vatRateConfig = this.orderByFilter(result, \"-effectiveDate\");\r\n });\r\n\r\n this.getAssignments().then(() => { });\r\n\r\n this.data.businessOnly = this.businessOnly;\r\n }\r\n\r\n viewAutoAllocationSettings = (expense: Shared.ExpenseHeader): void => {\r\n this.$state.go(\"brookson.banklink-auto-allocation-settings\");\r\n }\r\n\r\n viewBankFileUpload = (expense: Shared.ExpenseHeader): void => {\r\n this.$state.go(\"brookson.bank-file-upload\");\r\n }\r\n\r\n vatChanged = (transaction: BankLink.Transaction): void => {\r\n if (!transaction.vat) {\r\n transaction.vat = 0;\r\n }\r\n if (transaction.vat > 0) {\r\n transaction.vat = -transaction.vat;\r\n }\r\n\r\n transaction.net = (-transaction.gross || 0) - (transaction.vat || 0);\r\n }\r\n\r\n clearVat = (transaction): void => {\r\n transaction.vat = 0;\r\n this.vatChanged(transaction);\r\n transaction.maxVat = 0;\r\n transaction.maxVatMessage = \"VAT must be 0\";\r\n }\r\n\r\n getVatAmount = (transaction) => {\r\n const vatRate = this.getApplicableVatRate(transaction);\r\n return -Math.floor((vatRate * (transaction.gross || 0)) / (100 + vatRate) * 100) / 100;\r\n }\r\n\r\n setMaxVat = (transaction) => {\r\n var vat = this.getVatAmount(transaction);\r\n const vatRate = this.getApplicableVatRate(transaction);\r\n var vat20precent = -Math.floor((20 * (transaction.gross || 0)) / (100 + 20) * 100) / 100;\r\n transaction.maxVat = vatRate > 0 && vatRate < 20 ? vat20precent : vat; \r\n transaction.maxVatMessage = `VAT must be less than or equal to ${-transaction.maxVat}`;\r\n }\r\n\r\n grossChanged = (transaction): void => {\r\n if (transaction.hasValidVatReceipt) {\r\n transaction.vat = this.getVatAmount(transaction);\r\n this.setMaxVat(transaction);\r\n this.vatChanged(transaction);\r\n } else {\r\n this.clearVat(transaction);\r\n }\r\n }\r\n\r\n hasValidVatReceiptChanged = (transaction): void => {\r\n if (!transaction.hasValidVatReceipt) {\r\n this.clearVat(transaction);\r\n } else if (transaction.gross) {\r\n this.grossChanged(transaction);\r\n }\r\n }\r\n\r\n getApplicableVatRate = (transaction): number => {\r\n const transactionDate = transaction.transactionDate ? this.dateUtils.convertToJsDate(transaction.transactionDate) : new Date();\r\n \r\n const applicableRateConfig = this.vatRateConfig ? _.find(this.vatRateConfig, (rateConfig: VatRateConfig) => {\r\n if (transaction)\r\n {\r\n return transactionDate >= rateConfig.effectiveDate && transactionDate <= rateConfig.endDate && rateConfig.expenseCode === transaction.transactionCategory.code;\r\n }\r\n }) : new VatRateConfig();\r\n\r\n\r\n const applicableRate = transaction.vatRates ? _.find(transaction.vatRates, (rate: VatRate) => {\r\n return rate.startDate <= transactionDate;\r\n }).amount : 20;\r\n\r\n if(applicableRateConfig && applicableRateConfig.vatRate)\r\n {\r\n return applicableRateConfig.vatRate;\r\n }\r\n\r\n return applicableRate;\r\n }\r\n\r\n public getAssignments = () => {\r\n return this.assignmentSrv.getAssignments()\r\n .then(data => {\r\n\r\n if (data.length === 0 && this.$location.path().indexOf(\"Business\")) {\r\n let blankAssignment: Shared.InvoicingAssignment = new Shared.InvoicingAssignment();\r\n blankAssignment.fullAssignmentName = 'No Active Assignments';\r\n data.push(blankAssignment);\r\n\r\n this.data.selectedAssignment = data[0];\r\n }\r\n\r\n //supply the assignments in reverse date order\r\n let orderAssignmentsByDateStarted: any = _.sortBy(data, [(o) => this.toDate(o)]);\r\n this.data.assignments = orderAssignmentsByDateStarted.reverse();\r\n\r\n // If the year is 1753 or the top assignment is still current, then assign it in the dropdown as the selected assignment\r\n if (\r\n (orderAssignmentsByDateStarted.length !== 0) &&\r\n (orderAssignmentsByDateStarted[0].dateEnded !== undefined)\r\n ) {\r\n if (\r\n (\r\n this.dateUtils.isSame(orderAssignmentsByDateStarted[0].dateEnded, '1753-01-01') || this.dateUtils.isAfter(orderAssignmentsByDateStarted[0].dateEnded, moment().startOf('day'))\r\n ) && orderAssignmentsByDateStarted.length === 1\r\n ) {\r\n this.data.selectedAssignment = orderAssignmentsByDateStarted[0];\r\n }\r\n }\r\n\r\n return data;\r\n });\r\n }\r\n\r\n public toDate = (item: Shared.Assignment): Date => {\r\n return this.dateUtils.convertToJsDate(item.dateStarted);\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .component('brooksonBankLinkTransactions', new Shared.BrooksonBankLinkTransactions());","/// \r\n\r\nnamespace Shared {\r\n 'use strict';\r\n\r\n export class BrooksonInputJobIndustry implements ng.IComponentOptions {\r\n public bindings: { [binding: string]: string };\r\n public controller: Function;\r\n public templateUrl: string;\r\n public require: {[controller: string]: string};\r\n\r\n constructor() {\r\n this.bindings = {\r\n ngModel: '=',\r\n isRequired: '=',\r\n label: '@',\r\n field: '@',\r\n ngDisabled: '='\r\n };\r\n this.require = {\r\n form: '^form'\r\n };\r\n this.controller = BrooksonInputJobIndustryController;\r\n this.templateUrl = 'src/app/shared/views/inputs/brookson.input.job-industry.html';\r\n }\r\n }\r\n\r\n export class BrooksonInputJobIndustryController {\r\n public industryList: Array;\r\n\r\n static $inject: Array = ['sdcFactory'];\r\n\r\n constructor(\r\n private sdcFactory: Shared.ISdcFactory\r\n ) { }\r\n\r\n $onInit = () => {\r\n this.industryList = Shared.IndustryList.getArray();\r\n }\r\n }\r\n}\r\n\r\nangular.module('app.shared')\r\n .component('brooksonInputJobIndustry', new Shared.BrooksonInputJobIndustry());","/// \r\n\r\nmodule Shared {\r\n export class BrooksonExpensesInputSelectAssignment implements ng.IComponentOptions {\r\n public bindings: any;\r\n public templateUrl: any;\r\n\r\n constructor() {\r\n this.bindings = {\r\n ngModel: '=',\r\n ngChange: '=',\r\n ngDisabled: '=',\r\n optionsData: '=',\r\n classes: '@'\r\n };\r\n this.templateUrl = 'src/app/shared/views/inputs/expenses.input.select-assignment.html';\r\n }\r\n }\r\n}\r\n\r\nangular.module('app.shared')\r\n .component('brooksonExpensesInputSelectAssignment', new Shared.BrooksonExpensesInputSelectAssignment());\r\n","namespace Shared {\r\n \"use strict\";\r\n\r\n export class BrooksonInputExpenseAmount implements ng.IComponentOptions {\r\n bindings: { [binding: string]: string };\r\n controller: Function;\r\n templateUrl: string;\r\n require: {[controller: string]: string};\r\n\r\n constructor() {\r\n this.bindings = {\r\n expense: \"=\",\r\n index: \"=\"\r\n };\r\n this.require = {\r\n \r\n };\r\n this.controller = BrooksonInputExpenseAmountController;\r\n this.templateUrl = \"src/app/shared/views/inputs/brookson.input.expense-amount.html\";\r\n }\r\n }\r\n\r\n export class BrooksonInputExpenseAmountController {\r\n \r\n expense: RegularExpense;\r\n maxVat = 0;\r\n vatRates: Array;\r\n vatRateConfig: Array;\r\n\r\n static $inject = [\"$scope\", \"orderByFilter\", \"brookson.utilities.date\", \"brooksonFactoriesExpenses\"];\r\n\r\n constructor(\r\n private $scope: ng.IScope,\r\n private orderByFilter: ng.IFilterOrderBy,\r\n private dateUtils: IBrooksonUtilitiesDate,\r\n private expensesFactory: IExpensesFactory,\r\n private expensesEnums: IExpensesEnums\r\n ) { }\r\n\r\n $onInit = () => {\r\n this.$scope.$watch(\"$ctrl.expense.isVatReclaimable\",\r\n (newValue, oldValue) => {\r\n if (oldValue && !newValue) {\r\n this.expense.hasValidVatReceipt = false;\r\n this.clearVat();\r\n }\r\n });\r\n\r\n this.expensesFactory.getAllVatRates(true).then((result) => {\r\n this.vatRates = this.orderByFilter(result, \"-startDate\");\r\n this.setMaxVat();\r\n });\r\n \r\n this.expensesFactory.getAllVatRatesConfig(true).then((result) => {\r\n this.vatRateConfig = this.orderByFilter(result, \"-effectiveDate\");\r\n });\r\n }\r\n\r\n vatChanged = (): void => {\r\n this.expense.net = (this.expense.gross || 0) - (this.expense.vat || 0);\r\n }\r\n\r\n clearVat = (): void => {\r\n this.expense.vat = 0;\r\n this.vatChanged();\r\n this.maxVat = 0;\r\n }\r\n\r\n getVatAmount = () => {\r\n const vatRate = this.getApplicableVatRate();\r\n return Math.floor((vatRate * (this.expense.gross || 0)) / (100 + vatRate) * 100) / 100;\r\n }\r\n\r\n setMaxVat = () => {\r\n\r\n var vat = this.getVatAmount();\r\n const vatRate = this.getApplicableVatRate();\r\n var vat20precent = Math.floor((20 * (this.expense.gross || 0)) / (100 + 20) * 100) / 100; \r\n this.maxVat = vatRate > 0 && vatRate < 20 ? vat20precent : vat; \r\n }\r\n\r\n grossChanged = (): void => {\r\n if (this.expense.hasValidVatReceipt) {\r\n this.expense.vat = this.getVatAmount();\r\n this.setMaxVat();\r\n this.vatChanged();\r\n } else {\r\n this.clearVat();\r\n }\r\n }\r\n\r\n checkForExpenseWarning = (index: number): void => {\r\n let expenseLine = this.expensesFactory.regularExpenses[index];\r\n if (expenseLine && expenseLine.typeObject && expenseLine.expenseWarning) {\r\n let expenseWarning = this.expensesFactory.getExpenseWarning(expenseLine.typeObject);\r\n if (expenseWarning) {\r\n if (expenseLine.expenseWarning && expenseLine.expenseWarning.warning && !expenseLine.expenseWarning.warning.highRisk) {\r\n if (expenseLine.net) {\r\n this.expensesFactory.addExpenseWarningMessage(expenseWarning, expenseLine);\r\n if (expenseLine.expenseWarning.showWarningAmount) {\r\n this.expensesFactory.removeExpenseWarnings(expenseWarning, expenseLine);\r\n } else {\r\n let exp = _.find(this.expensesFactory.regularExpenses, (e: Shared.RegularExpense) => !e.expenseWarning.warning && e.typeObject.paymentCode === expenseLine.typeObject.paymentCode);\r\n if (exp) {\r\n this.expensesFactory.addExpenseWarningMessage(expenseWarning, expenseLine);\r\n }\r\n }\r\n }\r\n }\r\n\r\n } \r\n }\r\n }\r\n\r\n hasValidVatReceiptChanged = (): void => {\r\n if (!this.expense.hasValidVatReceipt) {\r\n this.clearVat();\r\n } else if (this.expense.gross) {\r\n this.grossChanged();\r\n }\r\n }\r\n\r\n private getApplicableVatRate = (): number => {\r\n const expenseDate = this.expense.date ? this.dateUtils.convertToJsDate(this.expense.date) : new Date();\r\n\r\n const applicableRateConfig = this.vatRateConfig ? _.find(this.vatRateConfig, (rateConfig: VatRateConfig) => {\r\n if (this.expense.typeObject && this.expense.typeObject)\r\n {\r\n return expenseDate >= rateConfig.effectiveDate && expenseDate <= rateConfig.endDate && rateConfig.expenseCode === this.expense.typeObject.paymentCode;\r\n }\r\n }) : new VatRateConfig();\r\n \r\n const applicableRateAmount = this.vatRates ? _.find(this.vatRates, (rate: VatRate) => {\r\n return rate.startDate <= expenseDate;\r\n }).amount : 20;\r\n\r\n if(applicableRateConfig && applicableRateConfig.vatRate)\r\n {\r\n return applicableRateConfig.vatRate;\r\n }\r\n\r\n return applicableRateAmount;\r\n }\r\n }\r\n}\r\n\r\nangular.module(\"app.shared\")\r\n .component(\"brooksonInputExpenseAmount\", new Shared.BrooksonInputExpenseAmount());","namespace Shared {\r\n \"use strict\";\r\n\r\n export class BrooksonInputExpenseAttach implements ng.IComponentOptions {\r\n bindings: { [binding: string]: string };\r\n controller: Function;\r\n templateUrl: string;\r\n require: { [controller: string]: string };\r\n\r\n constructor() {\r\n this.bindings = {\r\n flow: '=',\r\n expense: \"=\",\r\n index: \"=\",\r\n parentController: \"=\",\r\n listener: \"=\",\r\n };\r\n this.require = {\r\n };\r\n this.controller = BrooksonInputExpenseAttachController;\r\n this.templateUrl = \"src/app/shared/views/inputs/brookson.input.expense-attach.html\";\r\n }\r\n }\r\n\r\n export class BrooksonInputExpenseAttachController {\r\n expense: RegularExpense;\r\n static $inject = [\"$scope\", \"orderByFilter\", \"brookson.utilities.date\", \"brooksonFactoriesExpenses\"];\r\n\r\n constructor(\r\n private $scope: ng.IScope,\r\n private orderByFilter: ng.IFilterOrderBy,\r\n private dateUtils: IBrooksonUtilitiesDate,\r\n private expensesFactory: IExpensesFactory\r\n ) { }\r\n }\r\n}\r\n\r\nangular.module(\"app.shared\")\r\n .component(\"brooksonInputExpenseAttach\", new Shared.BrooksonInputExpenseAttach());","namespace Shared {\r\n 'use strict';\r\n\r\n export class BrooksonInputJobTitle implements ng.IComponentOptions {\r\n public bindings: { [binding: string]: string };\r\n public controller: Function;\r\n public templateUrl: string;\r\n public require: {[controller: string]: string};\r\n\r\n constructor() {\r\n this.bindings = {\r\n ngModel: '=',\r\n isRequired: '=',\r\n label: '@',\r\n field: '@',\r\n ngReadonly: '=',\r\n ngDisabled: '=',\r\n placeholder: '@',\r\n ngPattern: '=',\r\n ngPatternMessage: '@',\r\n viewOnly: '='\r\n };\r\n this.require = {\r\n form: '^form'\r\n };\r\n this.controller = BrooksonInputJobTitleController;\r\n this.templateUrl = 'src/app/shared/views/inputs/brookson.input.job-title.html';\r\n }\r\n }\r\n\r\n export class BrooksonInputJobTitleController {\r\n public showSpinner: boolean = false;\r\n public listOfJobTitles: Array;\r\n\r\n static $inject: Array = ['sdcFactory'];\r\n\r\n constructor(\r\n private sdcFactory: Shared.ISdcFactory\r\n ) { }\r\n\r\n // Job Title Search\r\n searchJobTitle = (query: string) => {\r\n if (query) {\r\n this.showSpinner = true;\r\n\r\n this.sdcFactory.searchJobTitle(query, true).then((data) => {\r\n this.showSpinner = false;\r\n this.listOfJobTitles = data;\r\n });\r\n } else {\r\n this.listOfJobTitles = [];\r\n }\r\n }\r\n }\r\n}\r\n\r\nangular.module('app.shared')\r\n .component('brooksonInputJobTitle', new Shared.BrooksonInputJobTitle());","/// \r\n\r\nmodule Shared {\r\n\r\n interface IBrooksonBankLinkTransactionsBindings {\r\n getData: Array;\r\n businessOnly: Array;\r\n }\r\n\r\n export class BrooksonPaymentCreatePayment implements ng.IComponentOptions {\r\n public controller: Function = BrooksonPaymentCreatePaymentController;\r\n public templateUrl: string = 'src/app/shared/views/bank/brookson.bankLink.transactions.html';\r\n }\r\n\r\n class BrooksonPaymentCreatePaymentController implements IBrooksonBankLinkTransactionsBindings {\r\n static $inject = [\"$window\", \"$location\", '$state'];\r\n\r\n public getData;\r\n public businessOnly;\r\n\r\n vatRateConfig: Array;\r\n\r\n constructor(\r\n private window,\r\n private $location: ng.ILocationService,\r\n private $state: ng.ui.IStateService,\r\n ) { }\r\n\r\n $onInit = () => {\r\n }\r\n\r\n invokeBackButton = (): void => {\r\n this.window.history.back();\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .component('brooksonPaymentCreatePayment', new Shared.BrooksonPaymentCreatePayment());","/// \r\n\r\nmodule Shared {\r\n 'use strict';\r\n\r\n export interface IBrooksonAuthCodeInputBindings {\r\n }\r\n\r\n const BrooksonAuthCodeInput: ng.IComponentOptions = {\r\n bindings: {\r\n },\r\n controller: 'BrooksonAuthCodeInputController',\r\n templateUrl: 'src/app/shared/views/ui/brookson.ui.auth-code.input.html',\r\n transclude: true\r\n };\r\n\r\n angular\r\n .module('app.shared')\r\n .component('brooksonAuthCodeInput', BrooksonAuthCodeInput);\r\n}\r\n\r\nmodule Shared {\r\n 'use strict';\r\n\r\n export interface IBrooksonAuthCodeInputComponentController extends IBrooksonAuthCodeInputBindings {\r\n authCode: string;\r\n authCodePattern: any;\r\n \r\n }\r\n\r\n export class BrooksonAuthCodeInputController implements IBrooksonAuthCodeInputComponentController {\r\n\r\n authCode: string;\r\n authCodePattern: any = /^SA\\d{8}$/i;\r\n\r\n static $inject: Array = ['taskPlannerSrv', 'growl'];\r\n\r\n constructor(\r\n private taskPlannerSrv: Shared.ITaskPlannerSrv,\r\n private growl: angular.growl.IGrowlService)\r\n { }\r\n\r\n public updateAuthCode = (): void => {\r\n\r\n if (!this.authCodePattern.test(this.authCode))\r\n {\r\n let config: angular.growl.IGrowlMessageConfig = { title: \"Task Planner\" };\r\n this.growl.error(\"Authorisation code must be 10 digits\", config);\r\n return;\r\n }\r\n this.taskPlannerSrv.updateAuthCode(this.authCode);\r\n }\r\n }\r\n\r\n angular\r\n .module('app.shared')\r\n .controller('BrooksonAuthCodeInputController', BrooksonAuthCodeInputController);\r\n}\r\n","/// \r\n/// \r\n\r\nmodule Shared {\r\n 'use strict';\r\n\r\n export interface IBrooksonConfirmAccountsController extends IConfirmAccounts {\r\n yearEndStatus: number;\r\n yearEndStage: Shared.MemberCurrentStage;\r\n }\r\n\r\n export class BrooksonConfirmAcccountsController implements IBrooksonConfirmAccountsController {\r\n\r\n public action: Shared.TaskAction;\r\n public yearEndStatus: number;\r\n public yearEndStage: Shared.MemberCurrentStage = new Shared.MemberCurrentStage();\r\n\r\n static $inject: Array = ['$location', 'taskPlannerSrv', 'brookson.navigation', 'brookson.file.download'];\r\n\r\n constructor(\r\n private $location: ng.ILocationService,\r\n private data: Shared.TaskPlannerSrv,\r\n private navigation: Shared.IBrooksonNavigation,\r\n private brooksonFileDownload: any\r\n ) {\r\n data.getYearEndStatus().then((status: number) => {\r\n this.yearEndStatus = status;\r\n });\r\n data.getYearEndStage().then((data: Shared.MemberCurrentStage) => {\r\n this.yearEndStage = data;\r\n });\r\n }\r\n\r\n public get step1Confirmed(): boolean {\r\n return this.yearEndStatus >= 2;\r\n }\r\n\r\n public get step2Confirmed(): boolean {\r\n return this.yearEndStatus >= 3;\r\n }\r\n\r\n public confirmStep = (step: number) => {\r\n this.data.confirmAccountsStep(step).then((result) => {\r\n if (result) {\r\n this.data.getYearEndStatus().then((status: number) => {\r\n this.yearEndStatus = status;\r\n });\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Takes the user to the IR35 section\r\n * \r\n * \r\n * @memberOf BrooksonConfirmAcccountsController\r\n */\r\n public goToIR35() {\r\n this.navigation.employmentStatus.main(this.$location.url(), 'Back to Task Planner');\r\n }\r\n\r\n public downloadDocuments() { \r\n var url = \"api/DocumentStorage/GetZipDocuments\";\r\n var expectedMediaType = \"application/zip\";\r\n var requestData = this.action.documents;\r\n this.brooksonFileDownload.downloadAndSave(url, requestData, \"Brookson.Documents.zip\", expectedMediaType);\r\n }\r\n }\r\n\r\n export interface IConfirmAccounts {\r\n action: any;\r\n }\r\n\r\n export const BrooksonConfirmAccounts: ng.IComponentOptions = {\r\n bindings: {\r\n action: '='\r\n },\r\n controller: BrooksonConfirmAcccountsController,\r\n templateUrl: 'src/app/shared/views/ui/brookson.ui.confirm.accounts.html',\r\n transclude: true\r\n };\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .component('brooksonConfirmAccounts', Shared.BrooksonConfirmAccounts);","/// \r\n/// \r\n\r\nmodule Shared {\r\n 'use strict';\r\n\r\n export interface IBrooksonConfirmSelfAssessmentController extends IConfirmTaxPack {\r\n taxPackStatus: number;\r\n payBeforeApproval: boolean; \r\n }\r\n\r\n export interface AppSettings extends ng.IWindowService {\r\n appSettings: any;\r\n }\r\n\r\n\r\n export class BrooksonConfirmSelfAssessmentController implements IBrooksonConfirmSelfAssessmentController {\r\n\r\n public action: Shared.TaskAction;\r\n public approved: boolean = false;\r\n public taxPackStatus: number;\r\n public payBeforeApproval: boolean = false;\r\n public utrNumber: UtrNumber;\r\n public utrNumberUpdated: boolean = true;\r\n public disableWorldPay: boolean = false;\r\n\r\n static $inject: Array = ['taskPlannerSrv','brookson.navigation','$window'];\r\n\r\n constructor(\r\n private data: Shared.TaskPlannerSrv,\r\n private brooksonNavigation: Shared.IBrooksonNavigation,\r\n private $window: AppSettings\r\n ) {\r\n this.disableWorldPay = this.$window.appSettings.disableWorldPay;\r\n\r\n data.getTaxPackStatus().then((status: number) => {\r\n this.taxPackStatus = status;\r\n });\r\n data.getIsPayBeforeSubmit().then((result: boolean) => {\r\n this.payBeforeApproval = result;\r\n });\r\n data.getUtrNumber().then((result: UtrNumber) => {\r\n this.utrNumber = result;\r\n });\r\n }\r\n\r\n public confirmTax = () => {\r\n this.data.updatePackStatus().then(() => {\r\n this.approved = true;\r\n });\r\n }\r\n\r\n public confirmStep = (step: number) => {\r\n this.data.confirmAccountsStep(step).then((result) => {\r\n if (result) {\r\n this.data.getTaxPackStatus().then((status: number) => {\r\n this.taxPackStatus = status;\r\n });\r\n }\r\n });\r\n }\r\n\r\n public get taxPackAvailableToComplete(): boolean {\r\n return this.taxPackStatus === -1 || this.taxPackStatus ===0 || this.taxPackStatus === -3 ;\r\n }\r\n\r\n public get taxPackAvailableToConfirm(): boolean {\r\n return this.taxPackStatus === 3;\r\n }\r\n\r\n public get taxPackConfirmed(): boolean {\r\n return this.taxPackStatus === 1;\r\n }\r\n\r\n public get taxPackFiled(): boolean {\r\n return this.taxPackStatus === 99;\r\n }\r\n\r\n public get hasApproved(): boolean {\r\n return this.taxPackStatus === 2;\r\n }\r\n\r\n showUtrSection = (): boolean => {\r\n if(!this.taxPackFiled) \r\n {\r\n if(this.showAwaitingUtrNumber() || this.showInvalidUtrNumber()) return true;\r\n }\r\n return false;\r\n }\r\n\r\n showAwaitingUtrNumber = (): boolean => {\r\n if (!this.utrNumber) return false;\r\n return !this.utrNumber.utrNumber;\r\n }\r\n\r\n showInvalidUtrNumber = (): boolean => {\r\n if (!this.utrNumber) return false;\r\n return !new RegExp(\"^[0-9]{10}$\").test(this.utrNumber.utrNumber);\r\n }\r\n\r\n public gotoSelfAssessment = () => {\r\n this.brooksonNavigation.personalTax.selfAssessment();\r\n }\r\n\r\n public gotoComfirmAndPay = () => {\r\n this.brooksonNavigation.personalTax.selfAssessmentTAndCs();\r\n }\r\n }\r\n\r\n export interface IConfirmTaxPack {\r\n action: any;\r\n }\r\n\r\n export const BrooksonConfirmSelfAssessment: ng.IComponentOptions = {\r\n bindings: {\r\n action: '='\r\n },\r\n controller: BrooksonConfirmSelfAssessmentController,\r\n templateUrl: 'src/app/shared/views/ui/brookson.ui.confirm.self.assessment.html',\r\n transclude: true\r\n };\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .component('brooksonConfirmSelfAssessment', Shared.BrooksonConfirmSelfAssessment);","module Shared {\r\n\r\n export interface IBrooksonConfirmFinancialHealthCheckController extends IConfirmFinancialHealthCheck {\r\n \r\n }\r\n\r\n export class BrooksonConfirmFinancialHealthCheckController implements IBrooksonConfirmFinancialHealthCheckController {\r\n public action: Shared.TaskAction;\r\n public welcomeScreenData: Shared.WelcomeScreen;\r\n public financialHealthCheckUrl: string;\r\n //default to false otherwise will show on load.\r\n public showCalendarScreen: boolean = false;\r\n\r\n static $inject = ['$sce', 'calendlySrv', 'welcomeSrv', 'brookson.utilities.date'];\r\n constructor(\r\n public $sce: ng.ISCEService,\r\n public calendlySrv: Shared.CalendlyService,\r\n public welcomeSrv: Shared.WelcomeScreenSrv,\r\n public dateUtils: Shared.IBrooksonUtilitiesDate\r\n ) { }\r\n\r\n $onInit = (): void => {\r\n var financialCalendarUrl = this.welcomeScreenData.calendars.some(f => f.eventType === \"Financial Health Check\") ? this.welcomeScreenData.calendars.filter(f => f.eventType === \"Financial Health Check\")[0].calendarUrl : null;\r\n var financialHealthCheckUrl = !financialCalendarUrl ? null : this.$sce.trustAsResourceUrl(financialCalendarUrl);\r\n if (financialHealthCheckUrl) {\r\n this.calendlySrv.getCalendlyFinancialHealthCheckBooking().then((data: MicroCalendlyBooking): void => {\r\n if (data) {\r\n var financialHealthCheckCalendlyBooking = data;\r\n var endDate = this.dateUtils.convertToJsDate(data.endDate);\r\n var todaysDate = new Date();\r\n var minimumPreviousDate = new Date();\r\n minimumPreviousDate.setDate(minimumPreviousDate.getDate() - 30);\r\n\r\n if (financialHealthCheckCalendlyBooking.uuid && endDate >= todaysDate) {\r\n this.welcomeSrv.financialHealthCheckCalendlyBooking = financialHealthCheckCalendlyBooking;\r\n this.financialHealthCheckUrl = this.$sce.trustAsResourceUrl('https://calendly.com/reschedulings/' + financialHealthCheckCalendlyBooking.uuid);\r\n }\r\n if (endDate <= minimumPreviousDate) {\r\n this.welcomeSrv.financialHealthCheckCalendlyBooking = financialHealthCheckCalendlyBooking;\r\n this.financialHealthCheckUrl = financialHealthCheckUrl;\r\n this.welcomeSrv.financialHealthCheckCalendlyBooking.uuid = null;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n openBookingScreen(): void {\r\n this.showCalendarScreen = true;\r\n }\r\n }\r\n export const BrooksonConfirmFinancialHealthCheck: ng.IComponentOptions = {\r\n bindings: {\r\n action: '=',\r\n welcomeScreenData: '='\r\n },\r\n controller: BrooksonConfirmFinancialHealthCheckController,\r\n templateUrl: 'src/app/shared/views/ui/brookson.ui.confirm.financial-health-check.html',\r\n transclude: true\r\n };\r\n\r\n export interface IConfirmFinancialHealthCheck {\r\n action: any;\r\n welcomeScreenData: Shared.WelcomeScreen;\r\n }\r\n}\r\n\r\nangular.module('app.shared')\r\n .component('brooksonConfirmFinancialHealthCheck', Shared.BrooksonConfirmFinancialHealthCheck);","/// \r\n/// \r\n\r\nmodule Shared {\r\n export class HeaderController {\r\n public showCalenderLink: boolean;\r\n public showAccountantCalenderLink: boolean;\r\n public showCalenderScreen: boolean;\r\n public calenderLink: string;\r\n public displaySourceUrl: string;\r\n public advisoryDocUrl: string;\r\n public accountantIntroductionUrl: string;\r\n public financialHealthCheckUrl: string;\r\n public accountantName: string;\r\n public todaysDate: Date;\r\n //public calendlyButtonText: string = 'Book an appointment';\r\n public showAdvisoryDoc: boolean;\r\n // Data\r\n public member: MemberModel;\r\n public memberDetails: Member;\r\n public microCalendlyBooking: MicroCalendlyBooking;\r\n assignmentOutcomes: Array;\r\n\r\n static $inject = ['$window', 'memberSrv', 'authenticationSrv', 'brookson.notifications.manager',\r\n 'taskPlanner.enums', 'brookson.navigation', 'notification.enums', 'brookson.modal.sdc',\r\n 'brookson.modal.ir35DetailCapture', 'appSettings', 'ir35DetailCaptureService', 'sdcService',\r\n 'umbrellaTrustModalService', \"member.enums\",\r\n 'publicSectorAssignmentCheckModalService', 'publicSectorAssignmentCheckService',\r\n '$sce', 'brooksonFactoriesCalendly', 'welcomeSrv', 'calendlySrv', 'brookson.utilities.date',\r\n 'swapServiceLineSrv'];\r\n\r\n constructor(\r\n private $window: ng.IWindowService,\r\n private memberSrv: IMemberService,\r\n private authenticationSrv: any,\r\n private brooksonNotificationsManager: IBrooksonNotificationManager,\r\n private taskPlannerEnums: ITaskPlannerEnums,\r\n private brooksonNavigation: IBrooksonNavigation,\r\n private notificationEnums: INotificationEnums,\r\n private sdcModalService: IBrooksonSdcModalService,\r\n private ir35DetailCaptureModalService: IBrooksonIR35DetailCaptureModalService,\r\n private appSettings: Shared.AppSettings,\r\n private ir35DetailCaptureService: Shared.IIR35DetailCaptureService,\r\n private sdcService: Shared.ISdcService,\r\n private umbrellaTrustModalService: Shared.IUmbrellaTrustModalService,\r\n private memberEnums: Shared.IMemberEnums,\r\n private publicSectorAssignmentCheckModalService: IBrooksonPublicSectorAssignmentCheckModalService,\r\n private publicSectorAssignmentCheckService: Shared.IPublicSectorAssignmentCheckService,\r\n public $sce: ng.ISCEService,\r\n public calendlyFactory: Shared.IBrooksonFactoriesCalendly,\r\n public welcomeSrv: Shared.WelcomeScreenSrv,\r\n public calendlySrv: Shared.CalendlyService,\r\n public dateUtils: Shared.IBrooksonUtilitiesDate,\r\n public swapServiceLineSrv: Shared.SwapUserServiceLineService\r\n ) { }\r\n\r\n $onInit = () => {\r\n this.todaysDate = new Date();\r\n this.brooksonNotificationsManager.getNotifications();\r\n this.member = this.memberSrv.getMember();\r\n this.memberSrv.getMemberDetails(true, false).then((data) => {\r\n\r\n this.memberDetails = data;\r\n\r\n // Check whether the user needs to see the 'umbrella only don't show this to your trust' splash screen enabled\r\n this.checkUmbrellaTrustOutcome();\r\n });\r\n this.checkSdcModal();\r\n this.checkIR35DetailCapture();\r\n this.checkPublicSectorAssignmentCheck();\r\n this.checkWelcomeScreen();\r\n }\r\n\r\n logout(): void {\r\n this.authenticationSrv.logout();\r\n }\r\n\r\n // Account Details Methods\r\n goToAccountDetails(): void {\r\n this.brooksonNavigation.account.main();\r\n }\r\n\r\n // Task Planner Methods\r\n containsOverdueTasks(): boolean {\r\n return _.some(this.brooksonNotificationsManager.notifications.planner, { 'status': this.taskPlannerEnums.TaskStatus.OVERDUE });\r\n }\r\n\r\n // Notifications Methods\r\n closeAlerts(): void {\r\n this.brooksonNotificationsManager.closeAlerts();\r\n }\r\n\r\n /**\r\n * Returns whether or not the connect 2 button should be shown based\r\n * on whether the user joined after 03/10/2016\r\n * \r\n * @returns {boolean}\r\n * \r\n * @memberOf HeaderController\r\n */\r\n showConnect2Button(): boolean {\r\n if (!this.memberDetails) return false;\r\n\r\n return this.memberDetails.connect2Enabled;\r\n }\r\n\r\n /**\r\n * BEGIN: SDC\r\n */\r\n // Returns whether the SDC modal should be displayed for this member\r\n private shouldDisplaySdcModal = (): boolean => {\r\n return this.appSettings.displaySdcQuestionnaireCompletionPopup === true && !_.startsWith(window.location.pathname, \"/Assignments\");\r\n }\r\n // Opens the SDC modal - Disabled UMBR-30\r\n //private displaySdcModal = (): void => {\r\n // this.sdcModalService.show();\r\n //}\r\n // Checks whether the SDC modal should be displayed for this member and displays it if applicable\r\n private checkSdcModal = (): void => {\r\n if (this.shouldDisplaySdcModal()) {\r\n this.getAssignmentOutcomes();\r\n }\r\n }\r\n // Returns a list of assignment outcomes from the API\r\n private getAssignmentOutcomes = (): ng.IPromise> => {\r\n return this.sdcService.getAssignmentOutcomes().then(this.handleGetAssignmentOutcomesResponse);\r\n }\r\n\r\n // Sets the appropiate properties when the reponse has returned from the API GetAssignnmentOutcome response\r\n private handleGetAssignmentOutcomesResponse = (data: Array): Array => {\r\n this.assignmentOutcomes = data.filter(x => x.outcome === Shared.SdcOutcomeType.NotAssessed);\r\n\r\n // Disable SDC (UMBR-30)\r\n //if (this.assignmentOutcomes.length) {\r\n // this.displaySdcModal();\r\n //}\r\n\r\n return this.assignmentOutcomes;\r\n }\r\n /**\r\n * END: SDC\r\n */\r\n\r\n /**\r\n * BEGIN: IR35 detail capture\r\n * \r\n * Methods:\r\n * - enableIR35DetailCaptureModal\r\n * - displayIR35DetailCaptureModal\r\n * - checkIR35DetailCaptureModal\r\n */\r\n\r\n // Returns whether the IR35 Detail Capture modal is set to be displayed via web.config\r\n private ir35DetailCaptureModalEnabled = (): boolean => {\r\n return this.appSettings.displayIR35DetailCapturePopup === true;\r\n }\r\n\r\n // Opens the IR35 Detail Capture modal\r\n private displayIR35DetailCaptureModal = (): void => {\r\n this.ir35DetailCaptureModalService.show();\r\n }\r\n\r\n // Checks whether the IR35 detail capture modal needs triggering\r\n private checkIR35DetailCapture = (): void => {\r\n this.getIR35DetailCaptureOutcome();\r\n }\r\n\r\n private checkWelcomeScreen = (): void => {\r\n this.getWelcomeScreenDetails();\r\n }\r\n\r\n private getWelcomeScreenDetails = (): void => {\r\n {\r\n this.welcomeSrv.getWelcomeScreen().then((welcomeScreen: Shared.WelcomeScreen): void => {\r\n this.showCalenderLink = false;\r\n if (welcomeScreen.hasWelcomeScreen) {\r\n this.accountantName = welcomeScreen.accountantFirstName;\r\n var accountantIntroductionCalendarUrl = welcomeScreen.calendars.some(f => f.eventType === \"Introduction call\") ? welcomeScreen.calendars.filter(f => f.eventType === \"Introduction call\")[0].calendarUrl : null;\r\n this.accountantIntroductionUrl = !accountantIntroductionCalendarUrl ? null : this.$sce.trustAsResourceUrl(accountantIntroductionCalendarUrl);\r\n if (this.accountantIntroductionUrl) {\r\n this.calendlySrv.getCalendlyIntroductionBooking().then((data: any): void => {\r\n if (data) {\r\n var microCalendlyBooking = data;\r\n var endDate = this.dateUtils.convertToJsDate(microCalendlyBooking.endDate);\r\n var date = new Date();\r\n date.setDate(date.getDate());\r\n if (microCalendlyBooking.uuid && endDate >= date) {\r\n this.welcomeSrv.microCalendlyBooking = microCalendlyBooking;\r\n this.accountantIntroductionUrl = this.$sce.trustAsResourceUrl('https://calendly.com/reschedulings/' + microCalendlyBooking.uuid);\r\n this.showCalenderLink = true;\r\n } else if (microCalendlyBooking.uuid && endDate < date) {\r\n this.showCalenderLink = false;\r\n this.accountantIntroductionUrl = null;\r\n }\r\n else {\r\n this.welcomeSrv.microCalendlyBooking = microCalendlyBooking;\r\n this.showCalenderLink = true;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n\r\n var advisoryDocCalendarUrl = welcomeScreen.calendars.some(f => f.eventType === \"Advisory Doc\") ? welcomeScreen.calendars.filter(f => f.eventType === \"Advisory Doc\")[0].calendarUrl : null;\r\n var advisoryDocUrl = !advisoryDocCalendarUrl ? null : this.$sce.trustAsResourceUrl(advisoryDocCalendarUrl);\r\n if (advisoryDocUrl) {\r\n this.calendlySrv.getCalendlyAdvisoryBooking().then((advisoryDocumentCalendlyBooking: any): void => {\r\n if (advisoryDocumentCalendlyBooking) {\r\n var endDate = this.dateUtils.convertToJsDate(advisoryDocumentCalendlyBooking.endDate);\r\n var date = new Date();\r\n date.setDate(date.getDate());\r\n var minimumPreviousDate = new Date();\r\n minimumPreviousDate.setDate(minimumPreviousDate.getDate() - 30);\r\n\r\n if (advisoryDocumentCalendlyBooking.uuid && endDate >= date) {\r\n this.welcomeSrv.advisoryDocumentCalendlyBooking = advisoryDocumentCalendlyBooking;\r\n this.advisoryDocUrl = this.$sce.trustAsResourceUrl('https://calendly.com/reschedulings/' + advisoryDocumentCalendlyBooking.uuid);\r\n this.showCalenderLink = true;\r\n }\r\n if (endDate <= minimumPreviousDate) {\r\n this.welcomeSrv.advisoryDocumentCalendlyBooking = advisoryDocumentCalendlyBooking;\r\n this.advisoryDocUrl = advisoryDocUrl;\r\n this.showCalenderLink = true;\r\n this.welcomeSrv.advisoryDocumentCalendlyBooking.uuid = null;\r\n }\r\n }\r\n });\r\n }\r\n\r\n var financialCalendarUrl = welcomeScreen.calendars.some(f => f.eventType === \"Financial Health Check\") ? welcomeScreen.calendars.filter(f => f.eventType === \"Financial Health Check\")[0].calendarUrl : null;\r\n var financialHealthCheckUrl = !financialCalendarUrl ? null : this.$sce.trustAsResourceUrl(financialCalendarUrl);\r\n if (financialHealthCheckUrl) {\r\n this.calendlySrv.getCalendlyFinancialHealthCheckBooking().then((financialHealthCheckCalendlyBooking: MicroCalendlyBooking): void => {\r\n if (financialHealthCheckCalendlyBooking) {\r\n var endDate = this.dateUtils.convertToJsDate(financialHealthCheckCalendlyBooking.endDate);\r\n var todaysDate = new Date();\r\n var minimumPreviousDate = new Date();\r\n minimumPreviousDate.setDate(minimumPreviousDate.getDate() - 30);\r\n\r\n if (financialHealthCheckCalendlyBooking.uuid && endDate >= todaysDate) {\r\n this.welcomeSrv.financialHealthCheckCalendlyBooking = financialHealthCheckCalendlyBooking;\r\n this.financialHealthCheckUrl = this.$sce.trustAsResourceUrl('https://calendly.com/reschedulings/' + financialHealthCheckCalendlyBooking.uuid);\r\n this.showCalenderLink = true;\r\n\r\n }\r\n if (endDate <= minimumPreviousDate) {\r\n this.welcomeSrv.financialHealthCheckCalendlyBooking = financialHealthCheckCalendlyBooking;\r\n this.showCalenderLink = true;\r\n this.financialHealthCheckUrl = financialHealthCheckUrl;\r\n this.welcomeSrv.financialHealthCheckCalendlyBooking.uuid = null;\r\n }\r\n }\r\n });\r\n }\r\n\r\n });\r\n }\r\n }\r\n\r\n public displayIntroductionCalenderScreen = (): void => {\r\n this.showCalenderScreen = true;\r\n this.displaySourceUrl = this.accountantIntroductionUrl;\r\n }\r\n\r\n public displayFinancialHealthCheckScreen = (): void => {\r\n this.showCalenderScreen = true;\r\n this.displaySourceUrl = this.financialHealthCheckUrl;\r\n }\r\n\r\n public displayAdvisoryDocScreen = (): void => {\r\n this.showCalenderScreen = true;\r\n this.displaySourceUrl = this.advisoryDocUrl;\r\n }\r\n\r\n public hideCalenderScreen = (): void => {\r\n this.showCalenderScreen = false;\r\n }\r\n\r\n // Returns a list of assignment outcomes from the API\r\n private getIR35DetailCaptureOutcome = (): ng.IPromise => {\r\n return this.ir35DetailCaptureService.getIR35DetailCaptureOutcome().then(this.handleRequiresCompletionResponse);\r\n }\r\n\r\n // Sets the appropiate properties when the reponse has returned from the API GetAssignnmentOutcome response\r\n private handleRequiresCompletionResponse = (data: Shared.IR35DetailCaptureRequiresCompletion): Shared.IR35DetailCaptureRequiresCompletion => {\r\n\r\n if (this.ir35DetailCaptureModalEnabled() && data.requiresCompletion) {\r\n this.displayIR35DetailCaptureModal();\r\n }\r\n\r\n return data;\r\n }\r\n\r\n /**\r\n * END: IR35 detail capture\r\n */\r\n\r\n /**\r\n * BEGIN: UmbrellaTrustTimesheetModal\r\n */\r\n // Returns true if the member's company ref is UM1004U\r\n private isMemberCompanyRefUM1004U = (): boolean => {\r\n return this.memberDetails.companyRef === \"UM1004U\";\r\n }\r\n\r\n private isUmbrellaTrustModalConfigEnabled = (): boolean => {\r\n return this.appSettings.displayUmbrellaTrustModal === true;\r\n }\r\n\r\n private getUmbrellaTrustModalOutcome = (): boolean => {\r\n return this.isMemberCompanyRefUM1004U() && this.isUmbrellaTrustModalConfigEnabled();\r\n }\r\n\r\n private checkUmbrellaTrustOutcome = (): void => {\r\n // if getUmbrellaTrustModalOutcome === true, display the modal\r\n if (this.getUmbrellaTrustModalOutcome()) {\r\n this.displayUmbrellaTrustOutcome();\r\n }\r\n }\r\n\r\n private displayUmbrellaTrustOutcome = (): void => {\r\n this.umbrellaTrustModalService.show();\r\n }\r\n /**\r\n * END: UmbrellaTrustTimesheetModal\r\n */\r\n\r\n // Returns whether the assignemnts check modal is set to be displayed or not via web.config\r\n private publicSectorAssignmentCheckModalEnabled = (): boolean => {\r\n return this.appSettings.displayPublicSectorAssignmentCheckPopup === true;\r\n }\r\n\r\n // Opens the assignment check modal\r\n private displayPublicSectorAssignmentCheckModal = (): void => {\r\n this.publicSectorAssignmentCheckModalService.show();\r\n }\r\n\r\n // Checks whether the assignment check modal needs triggering\r\n private checkPublicSectorAssignmentCheck = (): void => {\r\n this.getPublicSectorAssignmentCheckOutcome();\r\n }\r\n\r\n // Returns a list of flagged assignments from the API\r\n private getPublicSectorAssignmentCheckOutcome = (): ng.IPromise> => {\r\n return this.publicSectorAssignmentCheckService.getPublicSectorAssignmentCheckOutcome().then(this.handlePublicSectorAssignmentCheckCompletionResponse);\r\n }\r\n\r\n // Sets the appropriate properties when the response has return from the API GetAllOpenUnknownSectorAssignments response\r\n private handlePublicSectorAssignmentCheckCompletionResponse = (data: Array): Array => {\r\n if (this.publicSectorAssignmentCheckModalEnabled() && data.length) {\r\n this.displayPublicSectorAssignmentCheckModal();\r\n }\r\n\r\n return data;\r\n }\r\n\r\n /**\r\n * END: Public sector assignment check\r\n */\r\n }\r\n}\r\n\r\nangular.module('app.shared').component('brooksonSharedHeader', {\r\n controller: Shared.HeaderController,\r\n templateUrl: 'src/app/shared/views/header.html'\r\n});","/// \r\n/// \r\n\r\nmodule Shared {\r\n\r\n export interface AppSettings extends ng.IWindowService {\r\n appSettings: any;\r\n }\r\n\r\n export interface StateParamsWithLocation extends ng.ui.IStateParamsService {\r\n hideBreadcrumb: boolean;\r\n }\r\n\r\n export class BrooksonSharedNavigation implements ng.IComponentOptions {\r\n public controller: Function = BrooksonSharedNavigationController;\r\n public templateUrl: string = \"src/app/shared/views/navigation.html\";\r\n }\r\n\r\n class BrooksonSharedNavigationController {\r\n static $inject = [\r\n \"$window\", \"$state\", \"$rootScope\", \"$location\", \"$stateParams\",\r\n \"memberSrv\", \"dashboardService\", \"brookson.factory.privacy\",\r\n \"brooksonFactoriesIntro\", \"screenSize\", \"appSettings\", \"member.enums\",\r\n \"swapServiceLineSrv\", \"serviceLineSrv\"\r\n ];\r\n\r\n public pscOpen: boolean = false;\r\n public pfOpen: boolean = false;\r\n public ptOpen: boolean = false;\r\n public managerZoneOpen: boolean = false;\r\n public employeeZoneOpen: boolean = false;\r\n public window: AppSettings;\r\n public member: MemberModel;\r\n public togglePrivacy: any;\r\n public serviceLines: Array;\r\n public hasAdvisorySection: boolean;\r\n public hasAdvisorySectionUmb: boolean;\r\n public memberBusinessType: string;\r\n\r\n constructor(\r\n private $window: AppSettings,\r\n private $state: ng.ui.IStateService,\r\n private $rootScope: ng.IRootScopeService,\r\n private $location: ng.ILocationService,\r\n private stateParams: StateParamsWithLocation,\r\n private memberSrv: Shared.IMemberService,\r\n private dashboardService: Shared.IDashboardService,\r\n private privacyFactory: Shared.IBrooksonFactoryPrivacy,\r\n private introFactory: Shared.IBrooksonFactoriesIntro,\r\n private screenSize: any,\r\n private appSettings: Shared.AppSettings,\r\n private memberEnums: Shared.IMemberEnums,\r\n public swapServiceLineSrv: Shared.SwapUserServiceLineService,\r\n private serviceLineSrv: Shared.IServiceLineService\r\n ) {\r\n this.window = $window;\r\n this.member = this.getMember();\r\n this.togglePrivacy = this.privacyFactory.togglePrivacy;\r\n this.memberBusinessType = this.memberSrv.getMemberBusinessType();\r\n\r\n let umbrellaAssignmentSdcStatusChangeListener = this.$rootScope.$on(\"UmbrellaAssignmentSDCStatusChange\", (event, memberSdcStatus) => {\r\n if (this.window.appSettings.pscExpensesEnabledGlobally) {\r\n if (!this.member.serviceLines[0].isEligible) { // Do not add expenses if the customer is a leaver\r\n if (memberSdcStatus.SDCStatus === 4) { // If an assignment has passed SDC checks then enable the expenses menu option.\r\n this.window.appSettings.pscExpensesEnabled = true;\r\n return;\r\n }\r\n }\r\n this.window.appSettings.pscExpensesEnabled = false;\r\n }\r\n });\r\n\r\n this.$rootScope.$on(\"$destroy\", () => {\r\n umbrellaAssignmentSdcStatusChangeListener(); // Deregister umbrellaAssignmentSDCStatusChangeListener on destroy\r\n }); \r\n\r\n this.getMemberBusinessTypes();\r\n\r\n memberSrv.getHasAdvisoryKeyInformation().then((response): void => {\r\n this.hasAdvisorySection = response;\r\n });\r\n \r\n memberSrv.getHasAdvisoryKeyInformationUmbrella().then((response): void => {\r\n this.hasAdvisorySectionUmb = response;\r\n });\r\n }\r\n\r\n\r\n\r\n public $onInit = (): void => {\r\n this.checkNavigationDropdowns();\r\n this.$rootScope.$on(\"$stateChangeSuccess\", () => { this.checkNavigationDropdowns(); });\r\n }\r\n\r\n getMemberBusinessTypes = (): void => {\r\n this.member.ltdCustomerReference = this.$window.appSettings.ltdCustomerReference;\r\n this.member.hasLtdBusinessType = this.$window.appSettings.hasLtdBusinessType;\r\n this.member.umbCustomerReference = this.$window.appSettings.umbCustomerReference;\r\n this.member.hasUmbBusinessType = this.$window.appSettings.hasUmbBusinessType;\r\n this.member.hasMulipleLtdCompanies = this.$window.appSettings.hasMulipleLtdCompanies;\r\n }\r\n\r\n public showHamburger = (): boolean => {\r\n return this.screenSize.is('xs');\r\n }\r\n \r\n public changeUserServiceLine = (): void => {\r\n this.swapServiceLineSrv.changeSelectedServiceLine(this.member.umbCustomerReference);\r\n }\r\n\r\n public showDashboardButtons = (): boolean => {\r\n return this.$state.includes(\"*.dashboard\");\r\n }\r\n\r\n public deleteDashboards = (): void => {\r\n this.dashboardService.showDelete().then((dashboards) => {\r\n if (dashboards.length) {\r\n this.dashboardService.deleteDashboards(dashboards);\r\n }\r\n });\r\n }\r\n\r\n public setCustomiseOn = (value: boolean): void => {\r\n this.dashboardService.customiseOn = value;\r\n }\r\n\r\n public getCustomiseOn = (): boolean => {\r\n return this.dashboardService.customiseOn;\r\n }\r\n\r\n public deleteEnabled = (): boolean => {\r\n return _.some(this.dashboardService.userDashboards, { 'isBrookson': false });\r\n }\r\n\r\n public getMember = (): MemberModel => {\r\n return this.memberSrv.getMember();\r\n }\r\n\r\n public checkNavigationDropdowns = (): void => {\r\n this.checkNavigationDropdown(\"personalTax\");\r\n this.checkNavigationDropdown(\"personalFinance\");\r\n this.checkNavigationDropdown(\"psc\");\r\n this.checkNavigationDropdown(\"financialCenter\");\r\n this.checkNavigationDropdown(\"sme\");\r\n this.checkNavigationDropdown(\"employeeSme\");\r\n this.checkNavigationDropdown(\"smePersonalTax\");\r\n this.checkNavigationDropdown(\"advisory\");\r\n /*this.checkNavigationDropdown(\"jobsboard\");*/\r\n // this.checkNavigationDropdown(\"knowledgeBase\");\r\n this.checkNavigationDropdown(\"flexUmbrella\");\r\n this.checkNavigationDropdown(\"flexCompany\");\r\n this.checkNavigationDropdown(\"financialServices\");\r\n \r\n }\r\n\r\n public togglePSC = (value: boolean): void => {\r\n if (!this.showHamburger())\r\n this.pscOpen = value;\r\n }\r\n\r\n public togglePF = (value: boolean): void => {\r\n if (!this.showHamburger())\r\n this.pfOpen = value;\r\n }\r\n\r\n public togglePT = (value: boolean): void => {\r\n if (!this.showHamburger())\r\n this.ptOpen = value;\r\n }\r\n\r\n public toggleManagerZone = (value: boolean): void => {\r\n this.managerZoneOpen = value;\r\n }\r\n\r\n public toggleEmployeeZone = (value: boolean): void => {\r\n this.employeeZoneOpen = value;\r\n }\r\n\r\n public checkNavigationDropdown = (id: string): void => {\r\n let dropdown = angular.element(`#${id}`);\r\n let dropdownLinks = dropdown.find(\".dropdownmenu a\");\r\n\r\n dropdownLinks = dropdownLinks.length ? dropdownLinks : dropdown.find(\"a\");\r\n dropdown.removeClass(\"current\");\r\n dropdownLinks.removeClass(\"active\");\r\n\r\n //Remove\r\n dropdown.removeClass(\"active\");\r\n\r\n if(this.$location.path().indexOf(\"StarterZone/WorkFlex\") === 1 && id === \"flexCompany\")\r\n {\r\n dropdown.addClass(\"current\");\r\n //Remove\r\n dropdown.addClass(\"active\");\r\n }\r\n\r\n // Ensure that the document storage link is highlighted if any of the document storage states are activated\r\n if (this.$location.path().indexOf(\"DocumentStorage\") !== -1 &&\r\n this.$location.path().indexOf(\"DocumentStorage/4\") !== 1 &&\r\n id === \"psc\") {\r\n dropdown.addClass(\"current\");\r\n dropdown.find('a[href*=\"/DocumentStorage/RecentlyAdded\"]').addClass(\"current\");\r\n //Remove\r\n dropdown.addClass(\"active\");\r\n dropdown.find('a[href*=\"/DocumentStorage/RecentlyAdded\"]').addClass(\"active\");\r\n } else {\r\n _.forEach(dropdownLinks,\r\n (link: HTMLAnchorElement) => {\r\n var angularLink = angular.element(link);\r\n var ignorePathsAttribute = link.attributes[\"ignore-paths\"];\r\n var ignorePaths = ignorePathsAttribute ? _.split(ignorePathsAttribute.value, \",\") : [];\r\n var pathShouldBeIgnored = _.some(ignorePaths, value => _.startsWith(this.$location.path(), value));\r\n\r\n if (_.startsWith(this.$location.path(), link.pathname) && !pathShouldBeIgnored) {\r\n angularLink.addClass(\"active\");\r\n dropdown.addClass(\"current\");\r\n //Remove\r\n dropdown.addClass(\"active\");\r\n }\r\n }\r\n );\r\n }\r\n }\r\n\r\n public hideBreadcrumb = (): boolean => {\r\n return (this.stateParams.hideBreadcrumb && this.stateParams.hideBreadcrumb === true);\r\n }\r\n\r\n public isActive = (location: string, explicit: string): string => {\r\n const activeClass = \"current\";\r\n\r\n if (explicit) {\r\n return location === this.$location.path() ? activeClass : \"\";\r\n }\r\n\r\n return _.startsWith(this.$location.path(), location) ? \"active\" : \"\";\r\n }\r\n\r\n public isActivePsc = (): string => {\r\n return \"current\";\r\n }\r\n\r\n }\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .component('brooksonSharedNavigation', new Shared.BrooksonSharedNavigation());","module Shared {\r\n 'use strict';\r\n\r\n export interface IBrooksonUmbrellaFlexFormController {\r\n actionTile: any;\r\n }\r\n\r\n export class BrooksonUmbrellaFlexFormController implements IBrooksonUmbrellaFlexFormController{\r\n public actionTile: Notification;\r\n }\r\n\r\n export const BrooksonUmbrellaFlexForm: ng.IComponentOptions = {\r\n bindings: {\r\n actionTile: '='\r\n },\r\n controller: BrooksonUmbrellaFlexFormController,\r\n templateUrl: 'src/app/shared/views/ui/brookson.ui.flex.form.html',\r\n transclude: true\r\n };\r\n\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .component('brooksonUmbrellaFlexForm', Shared.BrooksonUmbrellaFlexForm);","/// \r\n\r\nmodule Shared {\r\n 'use strict';\r\n\r\n export interface IBrooksonUtrInputBindings {\r\n }\r\n const BrooksonUtrInput: ng.IComponentOptions = {\r\n bindings: {\r\n },\r\n controller: 'BrooksonUtrInputController',\r\n templateUrl: 'src/app/shared/views/ui/brookson.ui.utr.input.html',\r\n transclude: true\r\n };\r\n\r\n angular\r\n .module('app.shared')\r\n .component('brooksonUtrInput', BrooksonUtrInput);\r\n}\r\n\r\nmodule Shared {\r\n 'use strict';\r\n\r\n export interface IBrooksonUtrInputComponentController extends IBrooksonUtrInputBindings {\r\n utrNumber:string;\r\n branchId:string;\r\n branchPattern:any;\r\n utrPattern:any;\r\n }\r\n\r\n export class BrooksonUtrInputController implements IBrooksonUtrInputComponentController {\r\n public utrNumber:string;\r\n public branchId:string;\r\n public utrPattern:any= /^\\d{10}$/;\r\n public branchPattern:any= /^\\d{3}$/;\r\n\r\n static $inject: Array = ['taskPlannerSrv'];\r\n constructor(private taskPlannerSrv: Shared.ITaskPlannerSrv) {}\r\n\r\n public updateUTR =():void=>{\r\n this.taskPlannerSrv.updateUTR(this.utrNumber,this.branchId);\r\n }\r\n }\r\n\r\n angular\r\n .module('app.shared')\r\n .controller('BrooksonUtrInputController', BrooksonUtrInputController);\r\n}\r\n","/// \r\n\r\nmodule Shared {\r\n 'use strict';\r\n\r\n export interface IBrooksonYearEndTileController {\r\n actionTile: any;\r\n }\r\n\r\n export class BrooksonYearEndTileController implements IBrooksonYearEndTileController{\r\n public actionTile: Notification;\r\n\r\n public yearEndTileDetails: CompanyYearEndTile;\r\n public isConfirming: boolean;\r\n public confirmationError: boolean;\r\n\r\n static $inject: Array = ['brooksonServicesCompanyYearEnd'];\r\n\r\n constructor(\r\n private data: Shared.BrooksonServicesCompanyYearEnd,\r\n ) {\r\n data.getCompanyYearEndTileDetails().then((result: CompanyYearEndTile) => {\r\n this.yearEndTileDetails = result;\r\n });\r\n }\r\n\r\n public setAsConfirming = (value: boolean): void => {\r\n this.isConfirming = value;\r\n this.confirmationError = false;\r\n }\r\n \r\n public setAccountsConfirmed = (): void => {\r\n this.data.setDraftAccountsConfirmed(this.yearEndTileDetails.currentYearEnd, \"\").then((result: boolean) => {\r\n if(result)\r\n {\r\n this.yearEndTileDetails.draftAccountsConfirmed = true;\r\n this.confirmationError = false;\r\n this.isConfirming = false;\r\n }\r\n else\r\n {\r\n this.confirmationError = true;\r\n this.isConfirming = false;\r\n }\r\n });\r\n }\r\n }\r\n\r\n export const BrooksonYearEndTile: ng.IComponentOptions = {\r\n bindings: {\r\n actionTile: '='\r\n },\r\n controller: BrooksonYearEndTileController,\r\n templateUrl: 'src/app/shared/views/ui/brookson.ui.confirm.year.end.html',\r\n transclude: true\r\n };\r\n\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .component('brooksonYearEndTile', Shared.BrooksonYearEndTile);","/// \r\n\r\nmodule Shared {\r\n export class AcceptCheckbox implements ng.IComponentOptions {\r\n public bindings: any;\r\n public templateUrl: any;\r\n public controller: any;\r\n\r\n constructor() {\r\n this.bindings = {\r\n ngModel: '=',\r\n acceptText: '@'\r\n };\r\n this.templateUrl = 'src/app/shared/views/ui/brookson.ui.accept-checkbox.html';\r\n this.controller = ['$scope', AcceptCheckboxController];\r\n }\r\n }\r\n\r\n export class AcceptCheckboxController {\r\n constructor(private $scope: ng.IScope){}\r\n }\r\n}\r\n\r\nangular.module('app.shared')\r\n .component(\"brooksonUiAcceptCheckbox\", new Shared.AcceptCheckbox());","/// \r\n\r\nmodule Shared {\r\n export class AcceptTermsAndConditions implements ng.IComponentOptions {\r\n public bindings: any;\r\n public templateUrl: any;\r\n public controller: any;\r\n public transclude: boolean;\r\n\r\n constructor() {\r\n this.bindings = {\r\n ngModel: '=',\r\n headingText: '@',\r\n acceptText: '@'\r\n };\r\n this.templateUrl = 'src/app/shared/views/ui/brookson.ui.accept-terms-and-conditions.html';\r\n this.controller = ['$scope', AcceptTermsAndConditionsController];\r\n this.transclude = true;\r\n }\r\n }\r\n\r\n export class AcceptTermsAndConditionsController {\r\n constructor(private $scope: ng.IScope){}\r\n }\r\n}\r\n\r\nangular.module('app.shared')\r\n .component(\"brooksonUiAcceptTermsAndConditions\", new Shared.AcceptTermsAndConditions());","/// \r\n/// \r\n\r\nmodule Shared {\r\n \r\n export class BrooksonUiAccountDetailsContactInformation implements ng.IComponentOptions {\r\n public controller: any;\r\n public templateUrl: any;\r\n public bindings: any;\r\n\r\n constructor() {\r\n this.bindings = {\r\n personalInformation: '='\r\n };\r\n this.controller = BrooksonUiAccountDetailsContactInformationController;\r\n this.templateUrl = 'src/app/shared/views/ui/brookson.ui.account-details.contact-information.html';\r\n }\r\n }\r\n \r\n class BrooksonUiAccountDetailsContactInformationController {\r\n personalInformation: Shared.NavPersonalInformation;\r\n\r\n constructor() { }\r\n\r\n }\r\n}\r\nangular\r\n .module('app.shared')\r\n .component('brooksonUiAccountDetailsContactInformation', new Shared.BrooksonUiAccountDetailsContactInformation());","/// \r\n/// \r\n/// \r\nmodule Shared {\r\n \r\n export class BrooksonUiAccountDetailsPersonalInformation implements ng.IComponentOptions {\r\n public controller: any;\r\n public templateUrl: any;\r\n public bindings: any;\r\n\r\n constructor() {\r\n this.bindings = {\r\n personalInformation: '='\r\n };\r\n this.controller = BrooksonUiAccountDetailsPersonalInformationController;\r\n this.templateUrl = 'src/app/shared/views/ui/brookson.ui.account-details.personal-information.html';\r\n }\r\n }\r\n \r\n class BrooksonUiAccountDetailsPersonalInformationController {\r\n personalInformation: Shared.NavPersonalInformation;\r\n nationalities: Array;\r\n showNationalitySpinner: boolean;\r\n\r\n static $inject = ['$scope', 'accountSrv', '$window', 'memberSrv'];\r\n public member: Shared.MemberModel;\r\n\r\n constructor(private $scope: ng.IScope, private accountSrv: IAccountService, private $window: Window, private memberSrv: Shared.IMemberService) { }\r\n\r\n $onInit = () => {\r\n this.showNationalitySpinner = true;\r\n this.accountSrv.getNationalities(true).then((data) => {\r\n this.showNationalitySpinner = false;\r\n this.nationalities = data;\r\n this.findNationality();\r\n });\r\n\r\n this.$scope.$watch('$ctrl.personalInformation.nationality', (newValue, oldValue) => {\r\n if (!oldValue) {\r\n this.findNationality();\r\n }\r\n }, true);\r\n }\r\n\r\n findNationality = () => {\r\n if (this.personalInformation && this.personalInformation.nationality) {\r\n this.personalInformation.nationalityOption = _.find(this.nationalities, (nationality) => nationality.code === this.personalInformation.nationality);\r\n }\r\n }\r\n\r\n showTfa = (): boolean => {\r\n if (this.$window.appSettings.enable2FAForAllMembers === 'True' && (this.memberSrv.member.isAdmin || this.memberSrv.member.apiKeySource === 'D365' || this.memberSrv.member.apiKeySource === 'Nav')) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n tfaTemporaryDisabled = (): boolean => {\r\n if (this.personalInformation !== undefined) {\r\n return this.personalInformation.twoFactorDisabledExpiryDate !== null;\r\n }\r\n return false;\r\n }\r\n\r\n tfaPermanentlyDisabled = (): boolean => {\r\n if (this.personalInformation !== undefined) {\r\n return this.personalInformation.twoFactorOverrideDate !== null;\r\n }\r\n return false;\r\n }\r\n\r\n tfaNotYetEnabled = (): boolean => {\r\n if (this.personalInformation !== undefined) {\r\n return this.personalInformation.tfaEnabled === false &&\r\n this.personalInformation.twoFactorDisabledExpiryDate === null &&\r\n this.personalInformation.twoFactorOverrideDate === null;\r\n }\r\n return false;\r\n }\r\n\r\n twoFactorDisabledExpiryDate = (): string => {\r\n if (this.personalInformation !== undefined) {\r\n return moment(this.personalInformation.twoFactorDisabledExpiryDate).format('Do MMMM YYYY hh:mm a');\r\n }\r\n return null;\r\n }\r\n\r\n twoFactorOverrideDate = (): string => {\r\n if (this.personalInformation !== undefined) {\r\n return moment(this.personalInformation.twoFactorOverrideDate).format('Do MMMM YYYY hh:mm a');\r\n }\r\n return null;\r\n }\r\n\r\n tfaEnabledChanged = (): void => {\r\n this.personalInformation.tfaEnabledAmended = true;\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .component('brooksonUiAccountDetailsPersonalInformation', new Shared.BrooksonUiAccountDetailsPersonalInformation());","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular.module('app.shared').component('brooksonUiAttachReceipt', {\r\n templateUrl: 'src/app/shared/views/ui/brookson.ui.attach-receipt.html',\r\n bindings: {\r\n flow: '=',\r\n receiptId: '=',\r\n receiptThumbnail: '=',\r\n showReceiptBank: '=',\r\n receiptAttached: '&',\r\n receiptDeleted: '&',\r\n dropupClass: '@?',\r\n\t\t\tisReadonly: '@?'\r\n },\r\n controller: brooksonUiAttachReceipt\r\n });\r\n\r\n brooksonUiAttachReceipt.$inject = ['$scope', '$uibModal', 'brooksonFactoriesExpenses', 'brookson.modal.receipt-bank', 'brookson.modal.receipt-preview', 'receiptSrv', 'brookson.ui.popup'];\r\n\r\n function brooksonUiAttachReceipt($scope, $uibModal, expensesSrv, brooksonModalReceiptBank, brooksonModalReceiptPreview, receiptSrv: Shared.IReceiptsService, brooksonUiPopup: Shared.IBrooksonUiPopup) {\r\n var vm = this;\r\n\r\n // Data\r\n var $ctrl = $scope.$ctrl;\r\n $scope.$flow = $ctrl.flow; // Needs to be $scope so the $flow directive can access it correctly\r\n vm.receipts = [];\r\n\r\n // Methods\r\n vm.showAttachReceiptModal = showAttachReceiptModal;\r\n vm.previewReceipt = previewReceipt;\r\n vm.deleteReceipt = deleteReceipt;\r\n\r\n // Attach receipt\r\n function showAttachReceiptModal() {\r\n if (!vm.receipts.length) {\r\n expensesSrv.getReceipts().then(data => {\r\n vm.receipts = data;\r\n\r\n _.forEach(vm.receipts, n => {\r\n n.isSelected = false;\r\n });\r\n\r\n openAttachReceiptModal(vm.receipts);\r\n });\r\n } else {\r\n _.map(vm.receipts,\r\n (n: any) => {\r\n n.isSelected = false;\r\n });\r\n openAttachReceiptModal(vm.receipts);\r\n }\r\n }\r\n\r\n function openAttachReceiptModal(receipts) {\r\n brooksonModalReceiptBank.attachReceipt(receipts, $ctrl.receiptId).then(receipt => {\r\n if ($ctrl.receiptAttached) {\r\n $ctrl.receiptAttached()(receipt);\r\n }\r\n });\r\n }\r\n\r\n // Preview receipt\r\n function previewReceipt() {\r\n brooksonModalReceiptPreview.show($ctrl.receiptId);\r\n }\r\n\r\n function deleteReceipt() {\r\n $scope.$flow.files = [];\r\n\r\n if ($ctrl.receiptDeleted) {\r\n $ctrl.receiptDeleted();\r\n }\r\n }\r\n }\r\n})();\r\n","module Shared {\r\n export interface ICalendarOverlayController {\r\n calendarUrl: string;\r\n showCalendarScreen: boolean;\r\n }\r\n export class CalendarOverlayController implements ICalendarOverlayController {\r\n public calendarUrl: string;\r\n public showCalendarScreen: boolean;\r\n\r\n public hideCalendarScreen = (): void => {\r\n this.showCalendarScreen = false;\r\n }\r\n }\r\n\r\n export const BrooksonCalendarOverlay: ng.IComponentOptions = {\r\n bindings: {\r\n calendarUrl: '=',\r\n showCalendarScreen: '='\r\n },\r\n controller: CalendarOverlayController,\r\n templateUrl: 'src/app/shared/views/ui/brookson.ui.calendar-overlay.html'\r\n };\r\n}\r\n\r\nangular.module('app.shared')\r\n .component('brooksonCalendarOverlay', Shared.BrooksonCalendarOverlay);","/// \r\n/// \r\n\r\nmodule Shared {\r\n \r\n export class BrooksonUiFeedback implements ng.IComponentOptions {\r\n public controller: any;\r\n public templateUrl: any;\r\n\r\n constructor() {\r\n this.controller = [\"brooksonUiFeedbackFactory\", BrooksonUiFeedbackController];\r\n this.templateUrl = 'src/app/shared/views/ui/brookson.ui.feedback.html';\r\n }\r\n }\r\n \r\n class BrooksonUiFeedbackController {\r\n\r\n static $inject = ['$window'];\r\n \r\n constructor(private factory: IBrooksonUiFeedbackFactory,\r\n private $window: Window) { }\r\n\r\n openModal() {\r\n this.factory.openModal();\r\n }\r\n\r\n cancelScreenshotPressed() {\r\n this.factory.isScreenshotMode = false;\r\n this.factory.showModal();\r\n this.factory.destroyCanvas();\r\n }\r\n\r\n takeScreenshotPressed() {\r\n this.factory.takeScreenshot();\r\n }\r\n }\r\n}\r\nangular\r\n .module('app.shared')\r\n .component('brooksonUiFeedback', new Shared.BrooksonUiFeedback());","/// \r\n\r\nmodule Shared {\r\n\r\n /**\r\n * \r\n * The privacy button component for disabling privacy mode.\r\n * This button is used when privacy mode is enabled\r\n * @export\r\n * @class BrooksonUiPrivacyButton\r\n * @implements {ng.IComponentOptions}\r\n */\r\n export class BrooksonUiPrivacyButton implements ng.IComponentOptions {\r\n /**\r\n * \r\n * Privacy button component\r\n * @type {*}\r\n */\r\n public controller: any;\r\n /**\r\n * \r\n * Privacy button template url \r\n * @type {*}\r\n */\r\n public templateUrl: any;\r\n\r\n /**\r\n * Creates an instance of BrooksonUiPrivacyButton.\r\n * \r\n */\r\n constructor() {\r\n this.controller = BrooksonUiPrivacyButtonController;\r\n this.templateUrl = \"src/app/shared/views/ui/brookson.ui.privacy.button.html\";\r\n }\r\n }\r\n\r\n /**\r\n * \r\n * The controller for the privacy button\r\n * @class BrooksonUiPrivacyButtonController\r\n */\r\n class BrooksonUiPrivacyButtonController {\r\n\r\n /**\r\n * \r\n * \r\n * @static\r\n */\r\n static $inject = ['brookson.factory.privacy'];\r\n\r\n /**\r\n * Creates an instance of BrooksonUiPrivacyButtonController.\r\n * \r\n * @param {Shared.IBrooksonFactoryPrivacy} privacyFactory\r\n */\r\n constructor(\r\n private privacyFactory: Shared.IBrooksonFactoryPrivacy\r\n ) { }\r\n }\r\n}\r\nangular\r\n .module('app.shared')\r\n .component('brooksonUiPrivacyButton', new Shared.BrooksonUiPrivacyButton());","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular.module('app.shared').component('brooksonUiProgressBar', {\r\n templateUrl: 'src/app/shared/views/ui/brookson.ui.progress-bar.html',\r\n bindings: {\r\n file: '='\r\n }\r\n });\r\n})();\r\n","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular.module('app.shared').component('brooksonUiReceiptPanel', {\r\n templateUrl: 'src/app/shared/views/ui/brookson.ui.receipt-panel.html',\r\n bindings: {\r\n ngModel: '=',\r\n checkable: '=',\r\n hideCheckbox: '=',\r\n receipt: '=',\r\n checkboxSelected: '=',\r\n receiptClick: '='\r\n },\r\n controller: brooksonUiReceiptPanel\r\n });\r\n\r\n brooksonUiReceiptPanel.$inject = ['expenses.enums'];\r\n\r\n function brooksonUiReceiptPanel(enums) {\r\n var vm = this;\r\n\r\n // Data\r\n vm.status = enums.ReceiptStatus;\r\n }\r\n})();\r\n","/// \r\n\r\nmodule Shared {\r\n export class BrooksonExpensesInputValidVatReceipt implements ng.IComponentOptions {\r\n public bindings: any;\r\n public templateUrl: any;\r\n public controller: any;\r\n\r\n constructor() {\r\n this.bindings = {\r\n ngModel: '=',\r\n inputName: '=',\r\n ngChange: '&',\r\n ngDisabled: '=',\r\n showLabel: '='\r\n };\r\n this.templateUrl = 'src/app/shared/views/inputs/expenses.input.valid-vat-receipt.html';\r\n this.controller = BrooksonExpensesInputValidVatReceiptController;\r\n }\r\n }\r\n\r\n export class BrooksonExpensesInputValidVatReceiptController {\r\n ngChange: any;\r\n\r\n static $inject = ['$timeout'];\r\n\r\n constructor(\r\n private $timeout: ng.ITimeoutService\r\n ) {\r\n }\r\n\r\n changeInternal = () => {\r\n if (this.ngChange) {\r\n this.$timeout(() => {\r\n this.ngChange();\r\n });\r\n }\r\n }\r\n }\r\n}\r\n\r\nangular.module('app.shared')\r\n .component(\"brooksonExpensesInputValidVatReceipt\", new Shared.BrooksonExpensesInputValidVatReceipt());","/// \r\n\r\nmodule Shared {\r\n 'use strict';\r\n\r\n export interface IWidgetActionsBindings {\r\n }\r\n\r\n export class BrooksonWidgetActions implements ng.IComponentOptions {\r\n public bindings: any;\r\n public controller: any;\r\n public templateUrl: any;\r\n\r\n constructor() {\r\n this.bindings = {\r\n onComplete: '&'\r\n };\r\n\r\n this.controller = WidgetActionsCtrl;\r\n this.templateUrl = 'src/app/shared/views/widgets/brookson.widgets.actions.html';\r\n }\r\n }\r\n\r\n export interface IWidgetActionsCtrl extends IWidgetActionsBindings {\r\n tasks: Array;\r\n }\r\n\r\n export class WidgetActionsCtrl implements IWidgetActionsCtrl {\r\n public tasks: Array = [];\r\n public showSpinner: boolean = true;\r\n public onComplete: Function;\r\n public widgetName: string = \"brookson-widget-actions\";\r\n public panelDisplayed: number = 0;\r\n public transactionsToAllocate: number = 0;\r\n public error: boolean = false;\r\n public transactionsList = [];\r\n\r\n public dashboardService: Shared.IDashboardService = this._dashboardService;\r\n\r\n static $inject: Array = ['bankLink.enums', '$q', '$timeout', '$scope', 'taskPlannerSrv', 'brookson.navigation', 'taskPlanner.enums', 'dashboardService', 'bankLinkFactory'];\r\n\r\n constructor(\r\n private bankLinkEnums: Shared.IBankLinkEnums,\r\n private $q: ng.IQService,\r\n private $timeout: ng.ITimeoutService,\r\n private $scope: ng.IScope,\r\n private taskPlannerSrv: Shared.TaskPlannerSrv,\r\n private brooksonNavigation: Shared.IBrooksonNavigation,\r\n private enums: Shared.ITaskPlannerEnums,\r\n private _dashboardService: Shared.IDashboardService,\r\n private bankLinkFactory: Shared.IBankLinkFactory\r\n ) {\r\n\r\n $q.all([\r\n taskPlannerSrv.buildMonths(),\r\n bankLinkFactory.getBankAccounts(), \r\n bankLinkFactory.getTransactions(false)\r\n ]).then((data) => {\r\n // TASKS\r\n this.tasks = _.chain(taskPlannerSrv.flatActions)\r\n .filter((action) => {\r\n return (action.status === 1 || action.status === 3) &&\r\n action.responsibility === this.enums.TaskResponsibility.ME;\r\n })\r\n .orderBy('dueDate', 'asc')\r\n .take(5)\r\n .map((n) => {\r\n n.camelCase = _.camelCase(n.taskGroup);\r\n return n;\r\n })\r\n .value();\r\n // /TASKS\r\n\r\n // BANK\r\n if (bankLinkFactory.transactions && bankLinkFactory.transactions.length > 0) {\r\n let transactions = bankLinkFactory.transactions;\r\n let transactionType = {value: 2};\r\n\r\n this.transactionsToAllocate = _.filter(transactions, {\r\n transactionType: bankLinkEnums.TransactionType.UNALLOCATED\r\n }).length;\r\n\r\n bankLinkFactory.selectedBankAccount = {bankAccountId: \"*\"};\r\n bankLinkFactory.selectedTransactionTypeChanged(transactionType);\r\n\r\n this.transactionsList = _.take(bankLinkFactory.transactionsList, 5);\r\n }\r\n // /BANK\r\n }, () => {\r\n this.error = true;\r\n }).then(() => {\r\n this.showSpinner = false;\r\n this.$timeout(() => { this.onComplete(); });\r\n });\r\n }\r\n\r\n public gotoTask = (task) => {\r\n this.brooksonNavigation.taskPlanner.selectedActionTask(task.camelCase, task.actionId);\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .component('brooksonWidgetActions', new Shared.BrooksonWidgetActions());\r\n","/// \r\n/// \r\n/// \r\nmodule Shared {\r\n export class BrooksonWidgetsAssignment implements ng.IComponentOptions {\r\n public bindings: any;\r\n public controller: any;\r\n public templateUrl: any;\r\n\r\n constructor() {\r\n this.bindings = {\r\n onComplete: \"&\"\r\n };\r\n\r\n this.controller = [\"$filter\", \"$timeout\", \"AssignmentSrv\", \"brookson.navigation\", \"invoicing.enums\", \"brookson.utilities.date\",\"dashboardService\", BrooksonWidgetsAssignmentController];\r\n this.templateUrl = \"src/app/shared/views/widgets/brookson.widgets.assignments.html\";\r\n }\r\n }\r\n\r\n export class BrooksonWidgetsAssignmentController {\r\n error: boolean;\r\n showSpinner: boolean;\r\n onComplete: Function;\r\n assignments: Array;\r\n public widgetName:string = \"brookson-widgets-assignments\";\r\n \r\n public dashboardService:Shared.IDashboardService = this._dashboardService;\r\n constructor(private $filter, private $timeout: ng.ITimeoutService, private assignmentSrv: IAssignmentService, private brooksonNavigation: IBrooksonNavigation, private invoicingEnums: IInvoicingEnums, private dateUtils: IBrooksonUtilitiesDate,private _dashboardService:Shared.IDashboardService) {}\r\n\r\n $onInit() {\r\n this.getAssignments();\r\n }\r\n\r\n currentAssignmentPressed() {\r\n this.brooksonNavigation.invoicing.raiseInvoice();\r\n }\r\n\r\n goToIR35(assignment: AssignmentCompact) {\r\n this.brooksonNavigation.employmentStatus.ir35Assignment(assignment.assignmentID);\r\n }\r\n\r\n goToAssignments() {\r\n this.brooksonNavigation.assignments.main();\r\n }\r\n\r\n goToAssignmentDetails(assignment: AssignmentCompact) {\r\n if (assignment) this.brooksonNavigation.assignments.summary(assignment.assignmentID);\r\n else this.goToAddAssignment();\r\n }\r\n\r\n goToAddAssignment() {\r\n this.brooksonNavigation.assignments.addAssignment();\r\n }\r\n\r\n private getAssignments() {\r\n this.showSpinner = true;\r\n\r\n this.assignmentSrv.getAllAssignments(true).then((data: Array) => {\r\n const assignments = _.flatten(_.map(data, (assignment) => {\r\n return assignment.assignments;\r\n }));\r\n\r\n this.assignments = _.filter(assignments, (assignment) => {\r\n var dateIsAfterToday = this.dateUtils.isAfter(assignment.dateEnded, moment().toDate());\r\n return this.$filter(\"bkShortDate\")(assignment.dateEnded, \"DD/MM/YYYY\") === \"\" || dateIsAfterToday;\r\n });\r\n\r\n this.assignments = _.orderBy(this.assignments, (assignment) => {\r\n return new Date(assignment.dateStarted.toString());\r\n }, \"desc\");\r\n \r\n\r\n }, () => {\r\n this.error = true;\r\n }).then(() => {\r\n this.showSpinner = false;\r\n this.$timeout(() => { this.onComplete(); });\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module(\"app.shared\")\r\n .component(\"brooksonWidgetsAssignments\", new Shared.BrooksonWidgetsAssignment());\r\n","/// \r\n\r\nmodule Shared {\r\n\r\n interface IBrooksonWidgetsBankLinkBindings {\r\n onComplete: Array;\r\n }\r\n\r\n export class BrooksonWidgetsBankLink implements ng.IComponentOptions {\r\n public controller: Function = BrooksonWidgetsBankLinkController;\r\n public templateUrl: string = \"src/app/shared/views/widgets/brookson.widgets.bank-link.html\";\r\n public bindings: { [binding: string]: string } = {\r\n onComplete: '&'\r\n };\r\n }\r\n\r\n class BrooksonWidgetsBankLinkController implements IBrooksonWidgetsBankLinkBindings {\r\n static $inject = ['$q', '$timeout', 'growl', 'moneyManagerSrv', 'bankLinkSrv', 'bankLink.enums', 'brookson.navigation', 'brookson.utilities.date', 'dashboardService', 'bankLinkFactory'];\r\n\r\n public transactionsToAllocate: number = 0;\r\n public error: boolean = false;\r\n public showSpinner: boolean = false;\r\n public isBankLinkActionRequired: boolean = false;\r\n public showNewSetupText: boolean = false;\r\n public widgetName: string = \"brookson-widgets-bank-link\";\r\n public lastReconciledDate = null;\r\n public chart;\r\n\r\n public onComplete;\r\n\r\n constructor(\r\n private $q: ng.IQService,\r\n private $timeout: ng.ITimeoutService,\r\n private growl: ng.growl.IGrowlService,\r\n private moneyManagerSrv: Shared.IMoneyManagerService,\r\n private bankLinkSrv,\r\n private bankLinkEnums: Shared.IBankLinkEnums,\r\n private brooksonNavigation: Shared.IBrooksonNavigation,\r\n private dateUtils: Shared.IBrooksonUtilitiesDate,\r\n private dashboardService: Shared.IDashboardService,\r\n private data: Shared.IBankLinkFactory\r\n ) { }\r\n\r\n $onInit = (): void => {\r\n this.$q.all([\r\n this.data.getBankAccounts(),\r\n this.data.getTransactions(false),\r\n this.data.getCategories(),\r\n this.data.getTransactionTypes(),\r\n this.data.getMoneyManagerData()\r\n ]).then((data) => {\r\n\r\n if (this.data.transactions && this.data.transactions.length > 0) {\r\n let transactions = angular.copy(this.data.transactions);\r\n\r\n this.transactionsToAllocate = _.filter(transactions, {\r\n transactionType: this.bankLinkEnums.TransactionType.UNALLOCATED\r\n }).length;\r\n\r\n let xAxisPoints = ['x'];\r\n\r\n for (let i = 11; i >= 0; i--) {\r\n xAxisPoints.push(moment().add(-i, 'months').startOf('month').format('MM-YYYY'));\r\n }\r\n\r\n _.forEach(transactions, (transaction): void => {\r\n transaction.period = this.dateUtils.convertToMoment(transaction.transactionDate).format('MM-YYYY');\r\n });\r\n\r\n let groupedTransactionByBankAccount = _.groupBy(transactions, 'bankKey');\r\n\r\n let accounts = [];\r\n\r\n let chartData = _.map(groupedTransactionByBankAccount, (group: any, key) => {\r\n let data;\r\n\r\n // Account not already indexed\r\n if (accounts.indexOf(group[0].bankName) === -1) {\r\n data = [group[0].bankName];\r\n accounts.push(group[0].bankName);\r\n } else {\r\n // Account already indexed, get a count and increment\r\n let count = _.countBy(accounts)[group[0].bankName];\r\n\r\n data = [group[0].bankName + ' ' + (count + 1)];\r\n }\r\n\r\n let transactionsGroupedByPeriod = _.groupBy(group, 'period');\r\n\r\n _.forEach(xAxisPoints, (period) => {\r\n if (period === \"x\") {\r\n return;\r\n }\r\n\r\n let periodGrouping = >_.find(transactionsGroupedByPeriod, (g, key) => { return key === period; });\r\n\r\n if (periodGrouping === undefined) {\r\n if (data.length > 1) {\r\n data.push(_.last(data));\r\n } else {\r\n data.push('0.00');\r\n }\r\n } else {\r\n data.push(_.first(periodGrouping).balance.toFixed(2));\r\n }\r\n\r\n });\r\n\r\n return data;\r\n });\r\n\r\n this.$timeout(() => {\r\n this.chart = c3.generate({\r\n bindto: '#bankLinkChart',\r\n point: {\r\n r: 6\r\n },\r\n data: {\r\n columns: chartData\r\n },\r\n padding: {\r\n right: 30\r\n },\r\n axis: {\r\n x: {\r\n type: 'category',\r\n categories: xAxisPoints.splice(1, xAxisPoints.length),\r\n tick: {\r\n fit: true,\r\n rotate: 40,\r\n multiline: false\r\n }\r\n },\r\n y: {\r\n tick: {\r\n format: (d) => { return '£' + d; }\r\n }\r\n }\r\n },\r\n onrendered: () => { this.onComplete(); }\r\n });\r\n }, 10);\r\n }\r\n }, () => {\r\n this.error = true;\r\n }).then(() => {\r\n this.showSpinner = false;\r\n this.$timeout(() => { this.onComplete(); });\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .component('brooksonWidgetsBankLink', new Shared.BrooksonWidgetsBankLink());\r\n","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular.module('app.shared').component('brooksonWidgetDocumentStorageRecentDocuments', {\r\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.document-storage.recent-documents.html',\r\n bindings: {\r\n onComplete: '&'\r\n },\r\n controller: brooksonWidgetDocumentStorageRecentDocuments\r\n });\r\n\r\n brooksonWidgetDocumentStorageRecentDocuments.$inject = ['$timeout', 'documentStorageSrv', 'brooksonDocumentPreview', 'brookson.navigation','dashboardService'];\r\n\r\n function brooksonWidgetDocumentStorageRecentDocuments($timeout, documentStorageSrv, brooksonDocumentPreview, brooksonNavigation, _dashboardService) {\r\n \r\n \r\n var vm = this;\r\n\r\n vm.data = documentStorageSrv;\r\n vm.brooksonNavigation = brooksonNavigation;\r\n vm.showSpinner = true;\r\n vm.previewDocument = brooksonDocumentPreview.previewDoc;\r\n vm.error = false;\r\n vm.dashboardService = _dashboardService;\r\n vm.widgetName = \"brookson-widget-document-storage-recent-documents\";\r\n \r\n \r\n function getRecentDocuments() {\r\n documentStorageSrv.getDocumentStorageWidgetData(true).then((data) => {\r\n vm.showSpinner = false;\r\n\r\n if (data.recentDocuments) {\r\n vm.data.recentDocuments = _.take(data.recentDocuments, 10);\r\n }\r\n }, (error) => {\r\n vm.error = true;\r\n }).then(() => {\r\n vm.showSpinner = false;\r\n $timeout(() => { vm.onComplete(); });\r\n });\r\n }\r\n\r\n function activate() {\r\n getRecentDocuments();\r\n }\r\n\r\n activate();\r\n }\r\n})();\r\n","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular.module('app.shared').component('brooksonWidgetDocumentStorageUmbrellaRecentDocuments', {\r\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.document-storage.umbrella-recent-documents.html',\r\n bindings: {\r\n onComplete: '&'\r\n },\r\n controller: brooksonWidgetDocumentStorageUmbrellaRecentDocuments\r\n });\r\n\r\n brooksonWidgetDocumentStorageUmbrellaRecentDocuments.$inject = ['$timeout', 'documentStorageSrv', 'brooksonDocumentPreview', 'brookson.navigation','dashboardService','accountSrv'];\r\n\r\n function brooksonWidgetDocumentStorageUmbrellaRecentDocuments($timeout, documentStorageSrv, brooksonDocumentPreview, brooksonNavigation, _dashboardService, accountSrv: Shared.IAccountService) {\r\n \r\n \r\n var vm = this;\r\n\r\n vm.data = documentStorageSrv;\r\n vm.brooksonNavigation = brooksonNavigation;\r\n vm.showSpinner = true;\r\n vm.previewDocument = brooksonDocumentPreview.previewDoc;\r\n vm.error = false;\r\n vm.dashboardService = _dashboardService;\r\n vm.widgetName = \"brookson-widget-document-storage-umbrella-recent-documents\";\r\n vm.panelDisplayed = 0;\r\n\r\n vm.openContract = (documentType: string) => {\r\n\r\n if(documentType === undefined)\r\n {\r\n accountSrv.getAccountDetailsForUser().then((data: Shared.NavContactInformation) => {\r\n documentType = data.personalInformation.contractFileName; \r\n documentStorageSrv.downloadEmploymentFile(documentType); \r\n });\r\n\r\n } else {\r\n documentStorageSrv.downloadEmploymentFile(documentType);\r\n }\r\n };\r\n\r\n function getRecentDocuments() {\r\n documentStorageSrv.getDocumentStorageWidgetData(true).then((data) => {\r\n vm.showSpinner = false;\r\n \r\n if (data.recentDocuments) {\r\n vm.data.recentDocuments = _.take(data.recentDocuments, 5);\r\n } else {\r\n vm.panelDisplayed = 1;\r\n }\r\n }, (error) => {\r\n vm.error = true;\r\n }).then(() => {\r\n vm.showSpinner = false;\r\n $timeout(() => { vm.onComplete(); });\r\n });\r\n }\r\n\r\n function activate() {\r\n getRecentDocuments();\r\n }\r\n\r\n activate();\r\n }\r\n})();\r\n","/// \r\n\r\nmodule Shared {\r\n 'use strict';\r\n\r\n export class BrooksonWidgetEmploymentRecord implements ng.IComponentOptions {\r\n public bindings: any;\r\n public controller: any;\r\n public templateUrl: any;\r\n\r\n constructor() {\r\n this.bindings = {\r\n onComplete: '&'\r\n };\r\n\r\n this.controller = WidgetEmploymentRecordCtrl;\r\n this.templateUrl = 'src/app/shared/views/widgets/brookson.widgets.employment-record.html';\r\n }\r\n }\r\n\r\n export interface IWidgetEmploymentRecordCtrl {\r\n tasks: Array;\r\n }\r\n\r\n export class WidgetEmploymentRecordCtrl implements IWidgetEmploymentRecordCtrl {\r\n public tasks: Array = [];\r\n public showSpinner: boolean = true;\r\n public onComplete: Function;\r\n public error: boolean;\r\n public widgetName = \"brookson-widget-employment-record\";\r\n public nationalities: Array;\r\n public dashboardService: Shared.IDashboardService = this._dashboardService;\r\n\r\n static $inject: Array = ['$timeout', '$scope', 'brookson.navigation', 'accountSrv', 'dashboardService'];\r\n\r\n constructor(private $timeout: ng.ITimeoutService,\r\n private $scope: ng.IScope,\r\n private brooksonNavigation: Shared.IBrooksonNavigation,\r\n private accountSrv: Shared.IAccountService,\r\n private _dashboardService: Shared.IDashboardService) {\r\n\r\n accountSrv.getAccountDetailsForUser().then(data => {\r\n console.log(data.personalInformation);\r\n this.showSpinner = false;\r\n accountSrv.getNationalities().then(data => {\r\n this.nationalities = data;\r\n });\r\n },\r\n ex => {\r\n this.error = true;\r\n })\r\n .then(() => {\r\n this.showSpinner = false;\r\n this.$timeout(() => { this.onComplete(); }, 0);\r\n });\r\n }\r\n\r\n public openContract(documentType: string) {\r\n this._dashboardService.downloadFile(documentType);\r\n }\r\n\r\n }\r\n\r\n angular\r\n .module('app.shared')\r\n .component('brooksonWidgetEmploymentRecord', new Shared.BrooksonWidgetEmploymentRecord());\r\n\r\n}","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular.module('app.shared').component('brooksonWidgetExpensesOverview', {\r\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.expenses.overview.html',\r\n bindings: {\r\n onComplete: '&'\r\n },\r\n controller: brooksonWidgetExpensesOverview\r\n });\r\n\r\n brooksonWidgetExpensesOverview.$inject = ['$timeout', 'expensesSrv', 'brookson.navigation', 'dashboardService'];\r\n\r\n function brooksonWidgetExpensesOverview($timeout, expensesSrv, brooksonNavigation, dashboardService) {\r\n var vm = this;\r\n\r\n vm.showSpinner = true;\r\n vm.brooksonNavigation = brooksonNavigation;\r\n vm.dashboardService = dashboardService;\r\n vm.widgetName = \"brookson-widget-expenses-overview\";\r\n\r\n this.$onInit = () => {\r\n getExpenseOverview();\r\n };\r\n\r\n function getExpenseOverview() {\r\n\r\n expensesSrv.getExpenseOverView(true).then((response) => {\r\n $timeout(() => {\r\n let chart = c3.generate({\r\n bindto: '#expensesOverview',\r\n point: {\r\n r: 6\r\n },\r\n data: {\r\n x: 'x',\r\n columns: [\r\n\r\n ],\r\n types: {\r\n Allowances: 'area-spline',\r\n Receipted: 'area-spline',\r\n Mileage: 'area-spline'\r\n },\r\n colors: {\r\n Allowances: '#FFD132',\r\n Receipted: '#449d44',\r\n Mileage: '#33ADFF'\r\n },\r\n names: {\r\n Allowances: 'Allowances',\r\n Receipted: 'Receipted',\r\n Mileage: 'Mileage'\r\n }\r\n },\r\n axis: {\r\n x: {\r\n tick: {\r\n fit: true,\r\n rotate: 40,\r\n multiline: false\r\n },\r\n type: 'category',\r\n label: {\r\n text: 'Weeks',\r\n position: 'inner-right'\r\n }\r\n },\r\n y: {\r\n label: {\r\n text: 'Amount',\r\n position: 'inner-top'\r\n },\r\n tick: {\r\n format: (d) => { return '£' + d; }\r\n }\r\n }\r\n },\r\n tooltip: {\r\n format: {\r\n value: (value: any) => {\r\n return \"£\" + d3.format(\",.2f\")(value);\r\n }\r\n }\r\n },\r\n transition: {\r\n duration: 1200\r\n },\r\n padding: {\r\n right: 30\r\n }\r\n });\r\n\r\n var data = response.chartData;\r\n var columns = [];\r\n\r\n if (data) {\r\n var xAxis = ['x'];\r\n xAxis = _(xAxis).concat(_.keys(data).map((n) => {\r\n return moment(n).format('DD/MM').toString();\r\n })).value();\r\n\r\n var mileage = ['Mileage'];\r\n var mileageValues = _.map(data, 'mileageExpensesSum');\r\n mileage = >_(mileage).concat(mileageValues).value();\r\n\r\n var receipted = ['Receipted'];\r\n var receiptedValues = _.map(data, 'regularExpensesSum');\r\n receipted = >_(receipted).concat(receiptedValues).value();\r\n\r\n var allowances = ['Allowances'];\r\n var allowancesValues = _.map(data, 'allowancesExpensesSum');\r\n allowances = >_(allowances).concat(allowancesValues).value();\r\n\r\n columns.push(xAxis, mileage, receipted, allowances);\r\n\r\n if (_.sum([_.sum(mileageValues), _.sum(receiptedValues), _.sum(allowancesValues)]) > 0) {\r\n chart.load({\r\n columns: columns\r\n });\r\n } else {\r\n vm.noData = true;\r\n }\r\n } else {\r\n vm.noData = true;\r\n }\r\n }, 10);\r\n }, error => {\r\n vm.error = true;\r\n }).then(() => {\r\n vm.showSpinner = false;\r\n $timeout(() => { vm.onComplete(); });\r\n });\r\n }\r\n\r\n function activate() {\r\n // getExpenseOverview();\r\n }\r\n\r\n activate();\r\n }\r\n})();\r\n","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular.module('app.shared').component('brooksonWidgetInvoicingOverview', {\r\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.invoicing.overview.html',\r\n bindings: {\r\n onComplete: '&'\r\n },\r\n controller: brooksonWidgetInvoicingOverview\r\n });\r\n\r\n brooksonWidgetInvoicingOverview.$inject = ['$timeout', 'invoicingSrv', 'brookson.navigation','dashboardService', 'appSettings','memberSrv'];\r\n\r\n function brooksonWidgetInvoicingOverview($timeout, invoicingSrv, brooksonNavigation, dashboardService, appSettings, memberSrv) {\r\n var vm = this;\r\n\r\n vm.latestInvoices = {};\r\n vm.latestPayments = {};\r\n vm.showSpinner = true;\r\n vm.brooksonNavigation = brooksonNavigation;\r\n vm.memberSrv = memberSrv;\r\n vm.showNewSetupText = false;\r\n vm.dashboardService = dashboardService;\r\n vm.widgetName = \"brookson-widget-invoicing-overview\";\r\n vm.appSettings = appSettings;\r\n vm.memberBusinessType = '';\r\n\r\n function activate() {\r\n invoicingSrv.getInvoicingOverview().then(data => {\r\n vm.latestInvoices = data.latestInvoices;\r\n vm.latestPayments = data.latestPayments;\r\n vm.showNewSetupText = vm.latestInvoices.length === 0 && vm.latestPayments.length === 0 && false;\r\n }, error => {\r\n vm.error = true;\r\n }).then(() => {\r\n vm.showSpinner = false;\r\n $timeout(() => { vm.onComplete(); });\r\n });\r\n vm.memberBusinessType = memberSrv.getMemberBusinessType();\r\n }\r\n\r\n \r\n\r\n\r\n activate();\r\n }\r\n})();\r\n","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular.module('app.shared').component('brooksonWidgetInvoicingUmbrella', {\r\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.invoicing.umb.detail.html',\r\n bindings: {\r\n onComplete: '&'\r\n },\r\n controller: brooksonWidgetInvoicingUmbrella\r\n });\r\n\r\n brooksonWidgetInvoicingUmbrella.$inject = ['$timeout', 'invoicingSrv', 'brookson.navigation','dashboardService', 'appSettings','memberSrv'];\r\n\r\n function brooksonWidgetInvoicingUmbrella($timeout, invoicingSrv, brooksonNavigation, dashboardService, appSettings, memberSrv) {\r\n var vm = this;\r\n\r\n vm.latestTimesheets = {};\r\n vm.latestInvoices = {};\r\n vm.latestPayments = {};\r\n vm.latestPayslips = {};\r\n vm.showSpinner = true;\r\n vm.brooksonNavigation = brooksonNavigation;\r\n vm.memberSrv = memberSrv;\r\n vm.showNewSetupText = false;\r\n vm.dashboardService = dashboardService;\r\n vm.widgetName = \"brookson-widget-invoicing-umbrella\";\r\n vm.appSettings = appSettings;\r\n vm.memberBusinessType = '';\r\n\r\n function activate() { \r\n invoicingSrv.getTimesheetUmbreallaOverview().then(data => {\r\n vm.latestTimesheets = data;\r\n }, error => {\r\n vm.error = true;\r\n }).then(() => {\r\n vm.showSpinner = false;\r\n $timeout(() => { vm.onComplete(); });\r\n });\r\n \r\n\r\n invoicingSrv.getInvoicingUmbrellaOverview().then(data => {\r\n vm.latestInvoices = data.latestInvoices;\r\n vm.latestPayments = data.latestPayments;\r\n vm.latestPayslips = data.latestPayslips;\r\n vm.showNewSetupText = vm.latestInvoices.length === 0 && vm.latestPayments.length === 0 && false;\r\n }, error => {\r\n vm.error = true;\r\n }).then(() => {\r\n //vm.showSpinner = false;\r\n $timeout(() => { vm.onComplete(); });\r\n });\r\n vm.memberBusinessType = memberSrv.getMemberBusinessType();\r\n }\r\n activate();\r\n }\r\n})();\r\n","/// \r\n\r\nmodule Shared {\r\n export class BrooksonWidgetsKeyDates implements ng.IComponentOptions {\r\n public bindings: any;\r\n public controller: any;\r\n public templateUrl: any;\r\n\r\n constructor() {\r\n this.bindings = {\r\n onComplete: '&'\r\n };\r\n\r\n this.controller = ['$timeout', 'taskPlannerSrv', 'brookson.navigation', 'brookson.utilities.date', 'taskPlanner.enums','dashboardService', BrooksonWidgetsKeyDatesController];\r\n this.templateUrl = 'src/app/shared/views/widgets/brookson.widgets.key-dates.html';\r\n }\r\n }\r\n\r\n export class BrooksonWidgetsKeyDatesController {\r\n error: boolean;\r\n showSpinner: boolean;\r\n onComplete: Function;\r\n tasksActions: Array;\r\n\r\n public widgetName = \"brookson-widgets-key-dates\";\r\n\r\n public dashboardService:Shared.IDashboardService = this._dashboardService;\r\n\r\n constructor(private $timeout: ng.ITimeoutService, private taskPlannerSrv: ITaskPlannerSrv, private brooksonNavigation: IBrooksonNavigation, private dateUtils: IBrooksonUtilitiesDate, private taskPlannerEnums: ITaskPlannerEnums,private _dashboardService:Shared.IDashboardService) { }\r\n\r\n $onInit() {\r\n this.getTasks();\r\n }\r\n\r\n goToTaskPlanner() {\r\n this.brooksonNavigation.taskPlanner.calendar();\r\n }\r\n\r\n keyDatesWidgetPressed() {\r\n this.brooksonNavigation.taskPlanner.calendar();\r\n }\r\n\r\n private getTasks() {\r\n this.showSpinner = true;\r\n this.taskPlannerSrv.getTaskActions(true).then(data => {\r\n if (data) {\r\n this.tasksActions = data;\r\n \r\n this.tasksActions = _.filter(this.tasksActions, (task) => {\r\n return task.status === this.taskPlannerEnums.TaskStatus.OVERDUE || this.dateUtils.isAfter(task.deadline, moment().toDate());\r\n });\r\n\r\n this.tasksActions = _.orderBy(this.tasksActions, (task) => {\r\n return new Date(task.dueDate.toString());\r\n }, 'asc');\r\n }\r\n }, () => {\r\n this.error = true;\r\n }).then(() => {\r\n this.showSpinner = false;\r\n this.$timeout(() => { this.onComplete(); });\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .component('brooksonWidgetsKeyDates', new Shared.BrooksonWidgetsKeyDates());","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular.module('app.shared').component('brooksonWidgetMoneyManagerMoneyAvailable', {\r\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.money-manager.money-available.html',\r\n bindings: {\r\n onComplete: '&'\r\n },\r\n controller: brooksonWidgetMoneyManagerMoneyAvailable\r\n });\r\n\r\n brooksonWidgetMoneyManagerMoneyAvailable.$inject = ['$uibModal', '$timeout', '$q', 'moneyManagerSrv', 'brookson.navigation','dashboardService'];\r\n\r\n function brooksonWidgetMoneyManagerMoneyAvailable($uibModal, $timeout, $q, moneyManagerSrv, brooksonNavigation,dashboardService) {\r\n var vm = this;\r\n\r\n vm.data = moneyManagerSrv;\r\n vm.showSpinner = true;\r\n vm.error = false;\r\n vm.showNewSetupText = false;\r\n vm.dashboardService = dashboardService;\r\n vm.widgetName = \"brookson-widget-money-manager-money-available\";\r\n vm.brooksonNavigation = brooksonNavigation;\r\n vm.showUnpaidInvoicesModal = showUnpaidInvoicesModal;\r\n \r\n function activate() {\r\n var moneyManagerFinancialData = moneyManagerSrv.getMoneyManagerFinancialData(true);\r\n\r\n $q.all([moneyManagerFinancialData]).then((data) => {\r\n vm.showSpinner = false;\r\n moneyManagerSrv.getLastReconciledDate = '';\r\n moneyManagerSrv.moneyManagerFinancialData = data[0];\r\n }, (error) => {\r\n vm.error = true;\r\n }).then(() => {\r\n vm.showSpinner = false;\r\n $timeout(() => { vm.onComplete(); }, 0);\r\n });\r\n }\r\n\r\n function showUnpaidInvoicesModal() {\r\n $uibModal.open({\r\n animation: true,\r\n templateUrl: 'src/app/shared/views/modals/brookson.modals.unpaidInvoices.html',\r\n size: 'md',\r\n controller: ['$scope', '$uibModalInstance', ($scope, $uibModalInstance) => {\r\n $scope.cancel = cancel;\r\n\r\n function cancel() {\r\n $uibModalInstance.dismiss('cancel');\r\n }\r\n }]\r\n });\r\n }\r\n\r\n activate();\r\n }\r\n})();\r\n","/// \r\n/// \r\n\r\nmodule Shared {\r\n\r\n interface IBrooksonWidgetsOpenBankingBindings {\r\n onComplete: Array;\r\n }\r\n\r\n export class BrooksonWidgetsOpenBanking implements ng.IComponentOptions {\r\n public controller: Function = BrooksonWidgetsOpenBankingController;\r\n public templateUrl: string = \"src/app/shared/views/widgets/brookson.widgets.open-banking.html\";\r\n public bindings: { [binding: string]: string } = {\r\n onComplete: '&'\r\n };\r\n }\r\n\r\n class BrooksonWidgetsOpenBankingController implements IBrooksonWidgetsOpenBankingBindings {\r\n\r\n public error: boolean;\r\n public onComplete;\r\n public widgetName: string = \"brookson-widgets-open-banking\";\r\n public showSpinner: boolean;\r\n public hasCsvUpload: boolean;\r\n public bankAccountList: Array;\r\n static $inject = ['$q', '$timeout', 'openbankingWidgetService', '$window', '$scope', 'brookson.file.download', 'memberSrv', 'growl', 'dashboardService', 'localStorageService', '$state'];\r\n public disableButtons: boolean = false;\r\n\r\n constructor(\r\n private $q: ng.IQService,\r\n private $timeout: ng.ITimeoutService,\r\n private openbankingWidgetService: Shared.OpenbankingWidgetService,\r\n public $window: ng.IWindowService,\r\n public $scope: ng.IScope,\r\n private fileDownloadSrv: any,\r\n private memberSrv: Shared.IMemberService,\r\n private growl: ng.growl.IGrowlService,\r\n private dashboardService: Shared.IDashboardService,\r\n public localStorageService: ng.local.storage.ILocalStorageService,\r\n private $state: ng.ui.IStateService\r\n ) { }\r\n\r\n $onInit = (): void => {\r\n this.showSpinner = true;\r\n this.$q.all([\r\n this.openbankingWidgetService.getOpenBankingWidgetData(true)\r\n ]).then((data) => {\r\n this.bankAccountList = data[0];\r\n this.setupAccounts(this.bankAccountList);\r\n this.showSpinner = false;\r\n }, () => {\r\n this.error = true;\r\n }).then(() => {\r\n this.showSpinner = false;\r\n this.$timeout(() => { this.onComplete(); });\r\n this.$timeout(() => { this.onComplete(); }, 5000);\r\n });\r\n\r\n this.$scope.$on(\"OPENBANKING_WIDGET_POPUP_WINDOW_EVENT_CHANGE\", this.trueLayerPopupWindowEventChange);\r\n this.$scope.$on(\"OPENBANKING_WIDGET_TOKEN_EXCHANGE_RESPONSE\", this.WidgetTokenExchangeResponse);\r\n }\r\n\r\n private setupAccounts = (bankAccounts : Shared.openbankingWidget.WidgetAccount[]): void => {\r\n _.each(bankAccounts, (bankAccount): void => {\r\n bankAccount.type = Shared.openbankingWidget.bankType[bankAccount.type].replace('_', ' ');\r\n bankAccount.accountType = Shared.openbankingWidget.accountType[bankAccount.accountType];\r\n if (bankAccount.consentStatus === Shared.openbankingWidget.ConsentStatus.AccessTokenReceived && !bankAccount.consentExpired) {\r\n bankAccount.success = true;\r\n }\r\n\r\n if (bankAccount.viewAccess === false) {\r\n bankAccount.className = 'redBox';\r\n } else {\r\n if (bankAccount.viewAccessDescription.toLowerCase().indexOf('view access') > -1) {\r\n bankAccount.className = 'orangeBox';\r\n }\r\n if (bankAccount.viewAccessDescription.toLowerCase().indexOf('open banking') > -1) {\r\n bankAccount.className = 'greenBox';\r\n }\r\n }\r\n\r\n });\r\n this.hasCsvUpload = bankAccounts.some(x => x.csvUploadEnabled);\r\n }\r\n\r\n public openTrueLayerBankPopup = (event, authLink: string) : void => {\r\n\r\n if (this.disableButtons) {\r\n event.preventDefault();\r\n return;\r\n }\r\n this.openbankingWidgetService.disableWidgetButtons(true);\r\n var title = \"Open Banking\";\r\n var w = 814;\r\n var h = 778;\r\n\r\n var dualScreenLeft = this.$window.screenLeft;\r\n var dualScreenTop = this.$window.screenTop;\r\n\r\n var width = this.$window.innerWidth ? this.$window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : this.$window.screen.width;\r\n var height = this.$window.innerHeight ? this.$window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : this.$window.screen.height;\r\n\r\n var left = dualScreenLeft < 0 ? ((width / 2) - (w / 2)) - dualScreenLeft : ((width / 2) - (w / 2)) + dualScreenLeft;\r\n var top = dualScreenTop < 0 ? ((height / 2) - (h / 2)) - dualScreenTop : ((height / 2) - (h / 2)) + dualScreenTop;\r\n var newWindow = this.$window.open(authLink, title, 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);\r\n\r\n var timer = setInterval(() => {\r\n if (newWindow.closed) {\r\n clearInterval(timer);\r\n this.openbankingWidgetService.disableWidgetButtons(false);\r\n }\r\n }, 1000);\r\n\r\n if (this.$window.focus) {\r\n newWindow.focus();\r\n }\r\n }\r\n\r\n public openExendingConnection = (event, bankaccount: Shared.openbankingWidget.WidgetAccount): void => {\r\n if (this.disableButtons) {\r\n event.preventDefault();\r\n return;\r\n }\r\n this.localStorageService.set(\"OpenBankingReconsent\", bankaccount.key);\r\n this.openbankingWidgetService.disableWidgetButtons(true);\r\n var title = \"Open Banking - Reconfirm Consent\";\r\n var w = 814;\r\n var h = 778;\r\n var dualScreenLeft = this.$window.screenLeft;\r\n var dualScreenTop = this.$window.screenTop;\r\n\r\n var width = this.$window.innerWidth ? this.$window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : this.$window.screen.width;\r\n var height = this.$window.innerHeight ? this.$window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : this.$window.screen.height;\r\n\r\n var left = dualScreenLeft < 0 ? ((width / 2) - (w / 2)) - dualScreenLeft : ((width / 2) - (w / 2)) + dualScreenLeft;\r\n var top = dualScreenTop < 0 ? ((height / 2) - (h / 2)) - dualScreenTop : ((height / 2) - (h / 2)) + dualScreenTop;\r\n var newWindow = this.$window.open(bankaccount.authLink, title, 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);\r\n\r\n var timer = setInterval(() => {\r\n if (newWindow.closed) {\r\n clearInterval(timer);\r\n this.openbankingWidgetService.disableWidgetButtons(false);\r\n }\r\n }, 1000);\r\n\r\n if (this.$window.focus) {\r\n newWindow.focus();\r\n }\r\n }\r\n\r\n public trueLayerPopupWindowEventChange = (event, notification): void => {\r\n this.disableButtons = Boolean(notification.DisableButtons);\r\n }\r\n\r\n\r\n\r\n viewBankFileUpload = (expense: Shared.ExpenseHeader): void => {\r\n this.$state.go(\"brookson.bank-file-upload\");\r\n }\r\n\r\n public WidgetTokenExchangeResponse = (event, notification): void => {\r\n let bankAccount = _.find(this.bankAccountList, (bankAccount: Shared.openbankingWidget.WidgetAccount) => {\r\n return bankAccount.key === notification.State;\r\n });\r\n if (bankAccount !== undefined) {\r\n if (Number(notification.OpenBankingStatus) === Shared.openbankingWidget.ConsentStatus.AccessTokenReceived &&\r\n bankAccount.consentStatus !== Shared.openbankingWidget.ConsentStatus.AccessTokenReceived\r\n ) {\r\n // The following timeout functions are to render a smooth transition when the widget messages are changed.\r\n this.$timeout(() => {\r\n bankAccount.pendingStatus = false;\r\n bankAccount.consentStatus = Number(notification.OpenBankingStatus);\r\n bankAccount.consentDateDue = notification.ReConsentDate;\r\n bankAccount.consentExpired = false;\r\n bankAccount.consentReminder = false;\r\n bankAccount.hasAccessToken = true;\r\n if (!bankAccount.success) {\r\n this.$timeout(() => {\r\n if (bankAccount.viewAccessDescription !== 'Open Banking Access' || bankAccount.className !== 'greenBox') {\r\n bankAccount.viewAccessDescription = 'Open Banking Access';\r\n bankAccount.className = 'greenBox';\r\n }\r\n bankAccount.success = true;\r\n this.$timeout(() => { this.onComplete(); }, 500);\r\n }, 1000);\r\n }\r\n }, 4000);\r\n }\r\n\r\n if (Number(notification.OpenBankingStatus) === Shared.openbankingWidget.ConsentStatus.AccessTokenError) {\r\n this.$timeout(() => {\r\n bankAccount.pendingStatus = false;\r\n bankAccount.hasAccessToken = false;\r\n bankAccount.consentExpired = false;\r\n if (!bankAccount.success) {\r\n this.$timeout(() => {\r\n bankAccount.consentStatus = Number(notification.OpenBankingStatus);\r\n this.$timeout(() => { this.onComplete(); }, 500);\r\n }, 1000);\r\n }\r\n }, 4000);\r\n \r\n }\r\n\r\n if (Number(notification.OpenBankingStatus) === Shared.openbankingWidget.ConsentStatus.AccessTokenPending) {\r\n this.$timeout(() => {\r\n bankAccount.consentStatus = Number(notification.OpenBankingStatus);\r\n if (!bankAccount.success) {\r\n this.$timeout(() => {\r\n bankAccount.pendingStatus = true;\r\n this.$timeout(() => { this.onComplete(); }, 1000);\r\n }, 1000);\r\n }\r\n }, 1000);\r\n }\r\n\r\n if (Number(notification.OpenBankingStatus) === Shared.openbankingWidget.ConsentStatus.NotConsented) {\r\n this.$timeout(() => {\r\n bankAccount.consentStatus = Number(notification.OpenBankingStatus);\r\n if (!bankAccount.success) {\r\n this.$timeout(() => {\r\n bankAccount.consentExpired = false;\r\n bankAccount.pendingStatus = false;\r\n bankAccount.hasAccessToken = false;\r\n bankAccount.consentStatus = Shared.openbankingWidget.ConsentStatus.NotConsented;\r\n bankAccount.viewAccessDescription = 'View Access';\r\n bankAccount.className = 'orangeBox';\r\n this.$timeout(() => { this.onComplete(); }, 1000);\r\n }, 1000);\r\n }\r\n }, 1000);\r\n }\r\n }\r\n }\r\n\r\n public switchToOpenBanking = (bankAccount: Shared.openbankingWidget.WidgetAccount): boolean => {\r\n if (!bankAccount.authorisedProvider) return false;\r\n if (bankAccount.consentStatus === Shared.openbankingWidget.ConsentStatus.NotConsented ||\r\n bankAccount.consentStatus === Shared.openbankingWidget.ConsentStatus.AccessTokenError ||\r\n bankAccount.consentStatus === Shared.openbankingWidget.ConsentStatus.ConsentError && !bankAccount.hasAccessToken) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n public reconsentOpenBanking = (bankAccount: Shared.openbankingWidget.WidgetAccount): boolean => {\r\n if (!bankAccount.authorisedProvider) return false;\r\n if (bankAccount.consentStatus === Shared.openbankingWidget.ConsentStatus.ConsentError && bankAccount.hasAccessToken ||\r\n (bankAccount.consentExpired && bankAccount.consentStatus !== Shared.openbankingWidget.ConsentStatus.AccessTokenPending)\r\n ) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n public maskedBankAccountNumber = (bankAccount: Shared.openbankingWidget.WidgetAccount): string => {\r\n return '****' + bankAccount.accountNumber.substr(bankAccount.accountNumber.length - 4);\r\n }\r\n\r\n public showReconsentMessage = (bankAccount: Shared.openbankingWidget.WidgetAccount): boolean => {\r\n return bankAccount.consentStatus === Shared.openbankingWidget.ConsentStatus.ConsentError && bankAccount.hasAccessToken ||\r\n (bankAccount.consentExpired && bankAccount.consentStatus !== Shared.openbankingWidget.ConsentStatus.AccessTokenPending);\r\n }\r\n\r\n public showTechIssueMessage = (bankAccount: Shared.openbankingWidget.WidgetAccount): boolean => {\r\n return bankAccount.authorisedProvider && bankAccount.consentStatus === Shared.openbankingWidget.ConsentStatus.ConsentError\r\n && !bankAccount.hasAccessToken;\r\n }\r\n\r\n public showAccessTokenErrorMessage = (bankAccount: Shared.openbankingWidget.WidgetAccount): boolean => {\r\n return bankAccount.authorisedProvider && (!bankAccount.success && bankAccount.consentStatus === Shared.openbankingWidget.ConsentStatus.AccessTokenError);\r\n }\r\n\r\n public showNotConsentMessage = (bankAccount: Shared.openbankingWidget.WidgetAccount): boolean => {\r\n return bankAccount.authorisedProvider && bankAccount.consentStatus === Shared.openbankingWidget.ConsentStatus.NotConsented;\r\n }\r\n\r\n public showAccessTokenPendingMessage = (bankAccount: Shared.openbankingWidget.WidgetAccount): boolean => {\r\n return bankAccount.authorisedProvider && bankAccount.pendingStatus && bankAccount.consentStatus === Shared.openbankingWidget.ConsentStatus.AccessTokenPending;\r\n }\r\n\r\n public showReconsentDueMessage = (bankAccount: Shared.openbankingWidget.WidgetAccount): boolean => {\r\n return bankAccount.authorisedProvider && bankAccount.hasAccessToken\r\n && bankAccount.consentStatus !== Shared.openbankingWidget.ConsentStatus.AccessTokenPending\r\n && bankAccount.success && moment(bankAccount.consentDateDue).isAfter(moment());\r\n }\r\n\r\n public downloadMandateForm = (bankName: string) => {\r\n if (bankName.toLowerCase() === 'metro') { bankName = 'Metro Bank'; }\r\n if (bankName.toLowerCase() === 'cashplus' || bankName.toLowerCase() === 'Cashplus') { bankName = 'Zempler'; }\r\n \r\n var url = \"api/BankLink/DownloadMandateForm?id=\" + bankName;\r\n var expectedMediaType = \"application/octet-stream\";\r\n var memberId = this.memberSrv.getMember().memberId;\r\n\r\n this.fileDownloadSrv.downloadAndSave(url, null, 'Mandate - ' + bankName + ' - ' + memberId + '.pdf', expectedMediaType);\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module(\"app.shared\")\r\n .component(\"brooksonWidgetsOpenBanking\", new Shared.BrooksonWidgetsOpenBanking());","/// \r\n\r\nmodule Shared {\r\n export class BrooksonWidgetsReceiptBank implements ng.IComponentOptions {\r\n public bindings: any;\r\n public controller: any;\r\n public templateUrl: any;\r\n\r\n constructor() {\r\n this.bindings = {\r\n onComplete: '&'\r\n };\r\n\r\n this.controller = [\"$timeout\", \"brooksonFactoriesExpenses\", 'brookson.navigation', 'expenses.enums', 'dashboardService', BrooksonWidgetsReceiptBankController];\r\n this.templateUrl = 'src/app/shared/views/widgets/brookson.widgets.receipt-bank.html';\r\n }\r\n }\r\n\r\n export class BrooksonWidgetsReceiptBankController {\r\n error: boolean;\r\n showSpinner: boolean;\r\n numberOfReceipts: number;\r\n public widgetName = \"brookson-widgets-receipt-bank\";\r\n onComplete: Function;\r\n public dashboardService = this._dashboardService;\r\n constructor(private $timeout: ng.ITimeoutService, private expensesSrv: IExpensesFactory, private brooksonNavigation: IBrooksonNavigation, private expensesEnums: IExpensesEnums, private _dashboardService: Shared.IDashboardService) { }\r\n\r\n $onInit() {\r\n this.getReceipts();\r\n }\r\n\r\n goToReceiptBankPressed() {\r\n this.brooksonNavigation.expenses.expensesReceiptBank();\r\n }\r\n\r\n private getReceipts() {\r\n this.showSpinner = true;\r\n this.expensesSrv.getReceipts(true).then(data => {\r\n if (data) {\r\n this.numberOfReceipts = _.filter(data, (receipt) => {\r\n return receipt.status === this.expensesEnums.ReceiptStatus.UNATTACHED;\r\n }).length;\r\n }\r\n }, () => {\r\n this.error = true;\r\n }).then(() => {\r\n this.showSpinner = false;\r\n this.$timeout(() => { this.onComplete(); });\r\n });\r\n }\r\n }\r\n}\r\n\r\n\r\nangular\r\n .module('app.shared')\r\n .component('brooksonWidgetsReceiptBank', new Shared.BrooksonWidgetsReceiptBank());","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular.module('app.shared').component('brooksonWidgetRemusRewardsButton', {\r\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.remus-rewards-button.html',\r\n bindings: {\r\n onComplete: '&'\r\n },\r\n controller: brooksonWidgetRemusRewardsButton\r\n });\r\n\r\n brooksonWidgetRemusRewardsButton.$inject = ['remusRewardSrv', '$timeout', 'brookson.navigation', 'dashboardService'];\r\n\r\n function brooksonWidgetRemusRewardsButton(remusRewardSrv, $timeout, brooksonNavigation, _dashboardService) {\r\n\r\n var vm = this;\r\n\r\n vm.brooksonNavigation = brooksonNavigation;\r\n vm.showSpinner = true;\r\n vm.error = false;\r\n vm.dashboardService = _dashboardService;\r\n vm.cidValue = '';\r\n vm.dataValue = '';\r\n vm.isUmbrellaPlus = false;\r\n vm.widgetName = \"brookson-widget-remus-rewards\";\r\n \r\n\r\n vm.submitRemusRewardForm = () => {\r\n var form = angular.element('#remusRewardForm');\r\n form.submit();\r\n };\r\n\r\n function getRemusRewards() {\r\n vm.showSpinner = false;\r\n remusRewardSrv.getRemusRewardsUrlParameters().then((data) => {\r\n vm.showSpinner = false;\r\n vm.cidValue = data.cidValue;\r\n vm.dataValue = data.dataValue;\r\n }, () => {\r\n vm.error = true;\r\n }).then(() => {\r\n vm.showSpinner = false;\r\n $timeout(() => { vm.onComplete(); });\r\n });\r\n }\r\n\r\n function isUserUmbrellaPlus() {\r\n console.log('isUserUmbrellaPlus');\r\n remusRewardSrv.isUserUmbrellaPlus().then((data) => {\r\n vm.isUmbrellaPlus = data;\r\n });\r\n }\r\n\r\n function activate() {\r\n getRemusRewards();\r\n isUserUmbrellaPlus();\r\n }\r\n\r\n activate();\r\n }\r\n})();\r\n","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular.module('app.shared').component('brooksonWidgetRemusRewards', {\r\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.remus-rewards.html',\r\n bindings: {\r\n onComplete: '&'\r\n },\r\n controller: brooksonWidgetRemusRewards\r\n });\r\n\r\n brooksonWidgetRemusRewards.$inject = ['remusRewardSrv', '$timeout', 'brookson.navigation', 'dashboardService'];\r\n\r\n function brooksonWidgetRemusRewards(remusRewardSrv, $timeout, brooksonNavigation, _dashboardService) {\r\n\r\n var vm = this;\r\n\r\n vm.brooksonNavigation = brooksonNavigation;\r\n vm.showSpinner = true;\r\n vm.error = false;\r\n vm.dashboardService = _dashboardService;\r\n vm.cidValue = '';\r\n vm.dataValue = '';\r\n vm.isUmbrellaPlus = false;\r\n vm.widgetName = \"brookson-widget-remus-rewards\";\r\n \r\n\r\n vm.submitRemusRewardForm = () => {\r\n var form = angular.element('#remusRewardForm');\r\n form.submit();\r\n };\r\n\r\n function getRemusRewards() {\r\n vm.showSpinner = false;\r\n remusRewardSrv.getRemusRewardsUrlParameters().then((data) => {\r\n vm.showSpinner = false;\r\n vm.cidValue = data.cidValue;\r\n vm.dataValue = data.dataValue;\r\n }, () => {\r\n vm.error = true;\r\n }).then(() => {\r\n vm.showSpinner = false;\r\n $timeout(() => { vm.onComplete(); });\r\n });\r\n }\r\n\r\n function isUserUmbrellaPlus() {\r\n console.log('isUserUmbrellaPlus');\r\n remusRewardSrv.isUserUmbrellaPlus().then((data) => {\r\n vm.isUmbrellaPlus = data;\r\n });\r\n }\r\n\r\n function activate() {\r\n getRemusRewards();\r\n isUserUmbrellaPlus();\r\n }\r\n\r\n activate();\r\n }\r\n})();\r\n","/// \r\nmodule Shared {\r\n export class BrooksonWidgetSmeActionsToTake implements ng.IComponentOptions {\r\n public bindings: any;\r\n public controller: any;\r\n public templateUrl: any;\r\n\r\n constructor() {\r\n this.bindings = {\r\n onComplete: \"&\"\r\n };\r\n\r\n this.controller = [\"$timeout\", \"$window\", \"$q\", \"smeManagementSrv\", \"brookson.navigation\", \"brookson.utilities.date\", \"dashboardService\", BrooksonWidgetsSmeActionsToTakeController];\r\n this.templateUrl = \"src/app/shared/views/widgets/brookson.widgets.sme.actions-to-take.html\";\r\n }\r\n }\r\n\r\n export class BrooksonWidgetsSmeActionsToTakeController {\r\n error: boolean;\r\n showSpinner: boolean = true;\r\n onComplete: Function;\r\n actionsToTakeSummary: ActionsToTakeSummary;\r\n hasActionsToTake: boolean = false;\r\n\r\n public widgetName: string = \"brookson-widget-sme-actions-to-take\";\r\n\r\n constructor(\r\n private $timeout: ng.ITimeoutService,\r\n private $window: ng.IWindowService,\r\n private $q: ng.IQService,\r\n private smeManagementSrv: ISmeManagementSrv,\r\n private brooksonNavigation: IBrooksonNavigation,\r\n private dateUtils: IBrooksonUtilitiesDate,\r\n private dashboardService: Shared.IDashboardService) { }\r\n\r\n $onInit() {\r\n this.getActionsToTakeSummary();\r\n }\r\n\r\n private getActionsToTakeSummary() {\r\n return this.smeManagementSrv.getActionsToTakeSummary()\r\n .then(data => {\r\n this.actionsToTakeSummary = data;\r\n this.hasActionsToTake = this.actionsToTakeSummary.expensesToAuthorize + this.actionsToTakeSummary.holidaysToAuthorize + this.actionsToTakeSummary.overtimeToAuthorize > 0;\r\n return data;\r\n },\r\n ex => {\r\n this.error = true;\r\n })\r\n .then(() => {\r\n this.showSpinner = false;\r\n this.$timeout(() => { this.onComplete(); }, 0);\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module(\"app.shared\")\r\n .component(\"brooksonWidgetSmeActionsToTake\", new Shared.BrooksonWidgetSmeActionsToTake());\r\n","/// \r\nmodule Shared {\r\n export class BrooksonWidgetSmeEmployeesOnHoliday implements ng.IComponentOptions {\r\n public bindings: any;\r\n public controller: any;\r\n public templateUrl: any;\r\n\r\n constructor() {\r\n this.bindings = {\r\n onComplete: \"&\"\r\n };\r\n\r\n this.controller = [\"$timeout\", \"$window\", \"$q\", \"holidaysSrv\", \"brookson.navigation\", \"brookson.utilities.date\", \"dashboardService\", BrooksonWidgetSmeEmployeesOnHolidayController];\r\n this.templateUrl = \"src/app/shared/views/widgets/brookson.widgets.sme.employees-on-holiday.html\";\r\n }\r\n }\r\n\r\n export class BrooksonWidgetSmeEmployeesOnHolidayController {\r\n error: boolean;\r\n showSpinner: boolean = true;\r\n onComplete: Function;\r\n holidayRequests: HolidayRequest[];\r\n\r\n public widgetName: string = \"brookson-widget-sme-employees-on-holiday\";\r\n\r\n public dashboardService: Shared.IDashboardService = this._dashboardService;\r\n\r\n constructor(\r\n private $timeout,\r\n private $window,\r\n private $q,\r\n private holidaySrv: IHolidaysSrv,\r\n private brooksonNavigation: IBrooksonNavigation,\r\n private dateUtils: IBrooksonUtilitiesDate,\r\n private _dashboardService: Shared.IDashboardService) { }\r\n\r\n $onInit() {\r\n this.getActiveHolidayRequests();\r\n }\r\n\r\n private getActiveHolidayRequests() {\r\n return this.holidaySrv.getCompanyActiveHolidayRequests()\r\n .then(data => {\r\n this.holidayRequests = data;\r\n return data;\r\n },\r\n ex => {\r\n this.error = true;\r\n })\r\n .then(() => {\r\n this.showSpinner = false;\r\n this.$timeout(() => { this.onComplete(); }, 0);\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module(\"app.shared\")\r\n .component(\"brooksonWidgetSmeEmployeesOnHoliday\", new Shared.BrooksonWidgetSmeEmployeesOnHoliday());\r\n","/// \r\nmodule Shared {\r\n export class BrooksonWidgetsSmeLastPayslip implements ng.IComponentOptions {\r\n public bindings: any;\r\n public controller: any;\r\n public templateUrl: any;\r\n\r\n constructor() {\r\n this.bindings = {\r\n onComplete: \"&\"\r\n };\r\n\r\n this.controller = [\"$timeout\", \"$q\", \"brookson.navigation\", \"brookson.utilities.date\", \"dashboardService\", BrooksonWidgetsSmeLastPayslipController];\r\n this.templateUrl = \"src/app/shared/views/widgets/brookson.widgets.sme.last-payslip.html\";\r\n }\r\n }\r\n\r\n export class BrooksonWidgetsSmeLastPayslipController {\r\n error: boolean = false;\r\n showSpinner: boolean = true;\r\n onComplete: Function;\r\n\r\n public widgetName: string = \"brookson-widget-sme-last-payslip\";\r\n\r\n public dashboardService: Shared.IDashboardService = this._dashboardService;\r\n constructor(private $timeout, private $q, private brooksonNavigation: IBrooksonNavigation, private dateUtils: IBrooksonUtilitiesDate, private _dashboardService: Shared.IDashboardService) { }\r\n\r\n $onInit() {\r\n this.onComplete();\r\n this.showSpinner = false;\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module(\"app.shared\")\r\n .component(\"brooksonWidgetSmeLastPayslip\", new Shared.BrooksonWidgetsSmeLastPayslip());\r\n","/// \r\nmodule Shared {\r\n export class BrooksonWidgetSmeNextHoliday implements ng.IComponentOptions {\r\n public bindings: any;\r\n public controller: any;\r\n public templateUrl: any;\r\n\r\n constructor() {\r\n this.bindings = {\r\n onComplete: \"&\"\r\n };\r\n\r\n this.controller = [\"$timeout\", \"$q\", \"$window\", \"holidaysSrv\", \"brookson.navigation\", \"brookson.utilities.date\", \"dashboardService\", \"memberSrv\", BrooksonWidgetsSmeNextHolidayController];\r\n this.templateUrl = \"src/app/shared/views/widgets/brookson.widgets.sme.next-holiday.html\";\r\n }\r\n }\r\n\r\n export class BrooksonWidgetsSmeNextHolidayController {\r\n error: boolean = false;\r\n showSpinner: boolean = true;\r\n onComplete: Function;\r\n nextHoliday: HolidayRequest;\r\n remainingHolidayAllowance: string;\r\n\r\n public widgetName: string = \"brookson-widget-sme-next-holiday\";\r\n\r\n public dashboardService: Shared.IDashboardService = this._dashboardService;\r\n constructor(private $timeout, private $q, private $window, private holidaysSrv: IHolidaysSrv, private brooksonNavigation: IBrooksonNavigation, private dateUtils: IBrooksonUtilitiesDate, private _dashboardService: Shared.IDashboardService, private memberSrv: IMemberService) { }\r\n\r\n $onInit() {\r\n this.getNextHoliday();\r\n this.getRemainingHolidayAllowance();\r\n }\r\n\r\n public goToHolidays() {\r\n var member = this.getMember();\r\n if (member.businessType === \"SME\" && member.role === \"EMPLOYEE\") {\r\n this.$window.location.href = \"/EmployeeZone/EmployeeHolidays\";\r\n }\r\n else if (member.businessType === \"SME\" && member.role === \"DIRECTOR\") {\r\n this.$window.location.href = \"/Sme/Holidays\";\r\n }\r\n }\r\n\r\n private getNextHoliday() {\r\n this.holidaysSrv.getNextHoliday()\r\n .then(data => {\r\n this.nextHoliday = data;\r\n },\r\n ex => {\r\n this.error = true;\r\n })\r\n .then(() => {\r\n this.showSpinner = false;\r\n this.$timeout(() => { this.onComplete(); }, 0);\r\n });\r\n }\r\n\r\n private getRemainingHolidayAllowance() {\r\n this.holidaysSrv.getRemainingHolidayAllowance()\r\n .then(data => {\r\n var stringData = data.toString();\r\n stringData = stringData.split(\":\")[0];\r\n var days = stringData.split(\".\")[0];\r\n var hours = stringData.split(\".\")[1];\r\n this.remainingHolidayAllowance = days + \" days\" + (hours !== '00' ? \", \" + hours + \" hours\" : \"\");\r\n });\r\n }\r\n\r\n private getMember() {\r\n return this.memberSrv.getMember();\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module(\"app.shared\")\r\n .component(\"brooksonWidgetSmeNextHoliday\", new Shared.BrooksonWidgetSmeNextHoliday());\r\n","/// \r\nmodule Shared {\r\n export class BrooksonWidgetsSmeProfitAndLoss implements ng.IComponentOptions {\r\n public bindings: any;\r\n public controller: any;\r\n public templateUrl: any;\r\n\r\n constructor() {\r\n this.bindings = {\r\n onComplete: \"&\"\r\n };\r\n\r\n this.controller = [\"$timeout\", \"$q\", \"financialCenterSrv\", \"brookson.navigation\", \"brookson.utilities.date\", \"dashboardService\", BrooksonWidgetsSmeProfitAndLossController];\r\n this.templateUrl = \"src/app/shared/views/widgets/brookson.widgets.sme.profit-loss.html\";\r\n }\r\n }\r\n\r\n export class BrooksonWidgetsSmeProfitAndLossController {\r\n error: boolean;\r\n showSpinner: boolean = true;\r\n onComplete: Function;\r\n previousMonth: ProfitAndLossSummary;\r\n currentMonth: ProfitAndLossSummary;\r\n startOfPreviousPeriods: string;\r\n endOfPreviousPeriods: string;\r\n startOfCurrentPeriod: string;\r\n endOfPeriod: string;\r\n\r\n public widgetName: string = \"brookson-widget-sme-profit-loss\";\r\n\r\n public dashboardService: Shared.IDashboardService = this._dashboardService;\r\n constructor(private $timeout, private $q, private financialCenterSrv: IFinancialCenterService, private brooksonNavigation: IBrooksonNavigation, private dateUtils: IBrooksonUtilitiesDate, private _dashboardService: Shared.IDashboardService) { }\r\n\r\n $onInit() {\r\n this.getSummary();\r\n }\r\n\r\n private getSummary() {\r\n var endOfCurrentPeriod = moment().add(1, 'months').set('date', 1).add(-1, 'days');\r\n var startOfCurrentPeriod = moment().set('date', 1).add(-3, 'months');\r\n var startOfPreviousPeriods = moment().set('date', 1).add(-12, 'months');\r\n var endOfPreviousPeriods = moment().add(1, 'months').set('date', 1).add(-1, 'days');\r\n \r\n\r\n this.startOfCurrentPeriod = this.dateUtils.convertToViewString(startOfCurrentPeriod);\r\n this.startOfPreviousPeriods = this.dateUtils.convertToViewString(startOfPreviousPeriods);\r\n this.endOfPreviousPeriods = this.dateUtils.convertToViewString(endOfPreviousPeriods);\r\n this.endOfPeriod = this.dateUtils.convertToViewString(endOfCurrentPeriod);\r\n\r\n var getPreviousMonthSummary = this.financialCenterSrv.getProfitAndLossSummary(startOfPreviousPeriods.toDate(), endOfPreviousPeriods.toDate());\r\n var getCurrentMonthSummary = this.financialCenterSrv.getProfitAndLossSummary(startOfCurrentPeriod.toDate(), endOfCurrentPeriod.toDate());\r\n\r\n this.$q.all([getPreviousMonthSummary, getCurrentMonthSummary])\r\n .then(data => {\r\n this.previousMonth = data[0];\r\n this.currentMonth = data[1];\r\n },\r\n ex => {\r\n this.error = true;\r\n })\r\n .then(() => {\r\n this.showSpinner = false;\r\n this.$timeout(() => { this.onComplete(); }, 0);\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module(\"app.shared\")\r\n .component(\"brooksonWidgetSmeProfitLoss\", new Shared.BrooksonWidgetsSmeProfitAndLoss());\r\n","/// \r\n\r\nmodule Shared {\r\n 'use strict';\r\n\r\n export interface IWidgetTaskPlannerBindings {\r\n }\r\n\r\n export class BrooksonWidgetTaskPlanner implements ng.IComponentOptions {\r\n public bindings: any;\r\n public controller: any;\r\n public templateUrl: any;\r\n\r\n constructor() {\r\n this.bindings = {\r\n onComplete: '&'\r\n };\r\n\r\n this.controller = WidgetTaskPlannerCtrl;\r\n this.templateUrl = 'src/app/shared/views/widgets/brookson.widgets.task-planner.html';\r\n }\r\n }\r\n\r\n export interface IWidgetTaskPlannerCtrl extends IWidgetTaskPlannerBindings {\r\n tasks: Array;\r\n }\r\n\r\n export class WidgetTaskPlannerCtrl implements IWidgetTaskPlannerCtrl {\r\n public tasks: Array = [];\r\n public showSpinner: boolean = true;\r\n public onComplete: Function;\r\n public widgetName = \"brookson-widget-task-planner\";\r\n\r\n public dashboardService: Shared.IDashboardService = this._dashboardService;\r\n\r\n static $inject: Array = ['$timeout', '$scope', 'taskPlannerSrv', 'brookson.navigation', 'taskPlanner.enums', 'dashboardService'];\r\n\r\n constructor(private $timeout: ng.ITimeoutService,\r\n private $scope: ng.IScope,\r\n private taskPlannerSrv: Shared.TaskPlannerSrv,\r\n private brooksonNavigation: Shared.IBrooksonNavigation,\r\n private enums: Shared.ITaskPlannerEnums,\r\n private _dashboardService: Shared.IDashboardService) {\r\n taskPlannerSrv.buildMonths()\r\n .then(() => {\r\n this.tasks = _.chain(taskPlannerSrv.flatActions)\r\n .filter((action) => {\r\n return (action.status === 1 || action.status === 3) &&\r\n action.responsibility === this.enums.TaskResponsibility.ME;\r\n })\r\n .orderBy('dueDate', 'asc')\r\n .take(5)\r\n .map((n) => {\r\n n.camelCase = _.camelCase(n.taskGroup);\r\n return n;\r\n })\r\n .value();\r\n this.showSpinner = false;\r\n this.$timeout(() => { this.onComplete(); });\r\n },\r\n ex => {\r\n this.showSpinner = false;\r\n this.$timeout(() => { this.onComplete(); });\r\n });\r\n }\r\n\r\n public gotoTask = (task) => {\r\n this.brooksonNavigation.taskPlanner.selectedActionTask(task.camelCase, task.actionId);\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module('app.shared')\r\n .component('brooksonWidgetTaskPlanner', new Shared.BrooksonWidgetTaskPlanner());\r\n","/// \r\n\r\nmodule Shared {\r\n 'use strict';\r\n\r\n interface IBrooksonWidgetsPersonalTaxTrackerBindings {\r\n onComplete: Array;\r\n }\r\n\r\n export class BrooksonWidgetsPersonalTaxTracker implements ng.IComponentOptions {\r\n public controller: Function = BrooksonWidgetsPersonalTaxTrackerController;\r\n public templateUrl: string = \"src/app/shared/views/widgets/brookson.widgets.personal-tax.tracker.html\";\r\n public bindings: { [binding: string]: string } = {\r\n onComplete: \"&\"\r\n };\r\n }\r\n\r\n class BrooksonWidgetsPersonalTaxTrackerController implements IBrooksonWidgetsPersonalTaxTrackerBindings {\r\n static $inject = [\"$timeout\", \"personalTaxTrackerSrv\", \"brookson.navigation\", \"dashboardService\"];\r\n\r\n public showSpinner: boolean = true;\r\n public showNewSetupText: boolean = false;\r\n public error: boolean = false;\r\n public widgetName: string = \"brookson-widget-personal-tax-tracker\";\r\n\r\n public onComplete;\r\n\r\n constructor(\r\n private $timeout: ng.ITimeoutService,\r\n private personalTaxSrv: Shared.IPersonalTaxTrackerService,\r\n private brooksonNavigation: Shared.IBrooksonNavigation,\r\n private dashboardService: Shared.IDashboardService\r\n ) { }\r\n\r\n $onInit = (): void => {\r\n this.personalTaxSrv.selectedTaxYearChanged(\"Previous Tax Year\")\r\n .then((data) => {\r\n this.showNewSetupText = _.sum([\r\n data.forecastCalculations.confirmedAsDividends,\r\n data.forecastCalculations.pscEmployment,\r\n data.forecastCalculations.taxDeductedFromPSCIncome,\r\n data.forecastCalculations.transactionsBeingProcessed,\r\n data.forecastCalculations.unconfirmedTransactions\r\n ]) === 0 && false;\r\n }, error => {\r\n this.error = true;\r\n })\r\n .then(() => {\r\n this.showSpinner = false;\r\n this.$timeout(() => { this.onComplete(); });\r\n });\r\n }\r\n }\r\n}\r\n\r\nangular\r\n .module(\"app.shared\")\r\n .component(\"brooksonWidgetPersonalTaxTracker\", new Shared.BrooksonWidgetsPersonalTaxTracker());","/// \r\n/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular.module('app.shared').component('brooksonWidgetUmbrellaBrooksonAdverts', {\r\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.umbrella-brookson-adverts.html',\r\n bindings: {\r\n onComplete: '&'\r\n },\r\n controller: brooksonWidgetUmbrellaBrooksonAdverts\r\n });\r\n\r\n brooksonWidgetUmbrellaBrooksonAdverts.$inject = ['$timeout', 'brookson.navigation', 'dashboardService', 'brookson.ui.popup', 'remusRewardSrv'];\r\n\r\n function brooksonWidgetUmbrellaBrooksonAdverts($timeout, brooksonNavigation, _dashboardService, _brooksonUiPopup: Shared.IBrooksonUiPopup, remusRewardSrv) {\r\n\r\n var vm = this;\r\n\r\n vm.brooksonUiPopup = _brooksonUiPopup;\r\n vm.brooksonNavigation = brooksonNavigation;\r\n vm.widgetName = \"brookson-widget-umbrella-brookson-adverts\";\r\n vm.isUmbrellaPlus = false;\r\n vm.isUmbrellaPlusSelected = false;\r\n vm.agencyMargin = Shared.Models.AgencyMarginCompact;\r\n \r\n vm.selectUmbrellaProtect = () => { \r\n // pop confirm modal\r\n vm.brooksonUiPopup.showConfirmationPopup(\r\n 'CHOOSE YOUR PACKAGE',\r\n '

      If you wish to downgrade your package in the future, please contact customer services.

      Upgrade my service to Umbrella Protect?

      ',\r\n 'Confirm',\r\n 'Dismiss'\r\n ).then(\r\n () => {\r\n remusRewardSrv.setPackageNavUmbrellaProtect();\r\n vm.selectedPackage = Shared.SelectedPackageEnum.umbrellaProtect;\r\n vm.isUmbrellaPlusSelected = true;\r\n },\r\n () => { }\r\n );\r\n };\r\n\r\n\r\n \r\n function isUserUmbrellaPlus() {\r\n console.log('isUserUmbrellaPlus');\r\n remusRewardSrv.isUserUmbrellaPlus().then((data) => {\r\n vm.isUmbrellaPlus = data;\r\n });\r\n }\r\n\r\n function getAgencyMargin() {\r\n remusRewardSrv.getAgencyMargin().then((data) => {\r\n vm.agencyMargin = data;\r\n });\r\n }\r\n\r\n function activate() {\r\n isUserUmbrellaPlus();\r\n getAgencyMargin();\r\n }\r\n\r\n activate();\r\n\r\n }\r\n})();\r\n","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular.module('app.shared').component('brooksonWidgetUmbrellaFinancialAdverts', {\r\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.umbrella-financial-adverts.html',\r\n bindings: {\r\n onComplete: '&'\r\n },\r\n controller: brooksonWidgetUmbrellaFinancialAdverts\r\n });\r\n\r\n brooksonWidgetUmbrellaFinancialAdverts.$inject = ['$timeout', 'brookson.navigation', 'dashboardService'];\r\n\r\n function brooksonWidgetUmbrellaFinancialAdverts($timeout, brooksonNavigation, _dashboardService) {\r\n\r\n var vm = this;\r\n\r\n vm.brooksonNavigation = brooksonNavigation;\r\n vm.widgetName = \"brookson-widget-umbrella-financial-adverts\";\r\n \r\n }\r\n})();\r\n","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular.module('app.shared').component('brooksonWidgetUmbrellaWhatsApp', {\r\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.umbrella-whats-app.html',\r\n bindings: {\r\n onComplete: '&'\r\n },\r\n controller: brooksonWidgetUmbrellaWhatsApp\r\n });\r\n\r\n brooksonWidgetUmbrellaWhatsApp.$inject = ['$timeout', 'brookson.navigation', 'dashboardService'];\r\n\r\n function brooksonWidgetUmbrellaWhatsApp($timeout, brooksonNavigation, _dashboardService) {\r\n\r\n var vm = this;\r\n\r\n vm.brooksonNavigation = brooksonNavigation;\r\n vm.widgetName = \"brookson-widget-umbrella-whats-app\";\r\n \r\n }\r\n})();\r\n","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular.module('app.shared').component('brooksonWidgetUmbrellaFaq', {\r\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.umbrella.faq.html',\r\n bindings: {\r\n onComplete: '&'\r\n },\r\n controller: brooksonWidgetUmbrellaFaq\r\n });\r\n\r\n brooksonWidgetUmbrellaFaq.$inject = ['$timeout', 'invoicingSrv', 'brookson.navigation','appSettings','memberSrv'];\r\n\r\n function brooksonWidgetUmbrellaFaq($timeout, invoicingSrv, brooksonNavigation, dashboardService, appSettings, memberSrv) {\r\n var vm = this;\r\n\r\n vm.latestInvoices = {};\r\n vm.latestPayments = {};\r\n vm.showSpinner = false;\r\n vm.brooksonNavigation = brooksonNavigation;\r\n vm.memberSrv = memberSrv;\r\n vm.showNewSetupText = false;\r\n vm.dashboardService = dashboardService;\r\n vm.widgetName = \"brookson-widget-umbrella-faq\";\r\n vm.appSettings = appSettings;\r\n vm.memberBusinessType = '';\r\n }\r\n})();\r\n","/// \r\n\r\n(() => {\r\n 'use strict';\r\n\r\n angular.module('app.shared').component('brooksonWidgetUmbrellaPayalerts', {\r\n templateUrl: 'src/app/shared/views/widgets/brookson.widgets.umbrella.payalerts.html',\r\n bindings: {\r\n onComplete: '&'\r\n },\r\n controller: brooksonWidgetUmbrellaPayalerts\r\n });\r\n\r\n brooksonWidgetUmbrellaPayalerts.$inject = ['$timeout', 'invoicingSrv', 'brookson.navigation','dashboardService', 'appSettings','memberSrv'];\r\n\r\n function brooksonWidgetUmbrellaPayalerts($timeout, invoicingSrv, brooksonNavigation, dashboardService, appSettings, memberSrv) {\r\n var vm = this;\r\n\r\n vm.latestInvoices = {};\r\n vm.latestPayments = {};\r\n vm.showSpinner = false;\r\n vm.brooksonNavigation = brooksonNavigation;\r\n vm.memberSrv = memberSrv;\r\n vm.showNewSetupText = false;\r\n vm.dashboardService = dashboardService;\r\n vm.widgetName = \"brookson-widget-umbrella-payalerts\";\r\n vm.appSettings = appSettings;\r\n vm.memberBusinessType = '';\r\n }\r\n})();\r\n","module Shared {\r\n export class AccountsTable {\r\n companyNo: string;\r\n periodNo: string;\r\n companiesHouseDeadline: string;\r\n cTPaymentDate: string;\r\n hMRCFilingDate: string;\r\n draftsPosted: string;\r\n finalsProduced: string;\r\n draftsConfirmed: string;\r\n businessID: string;\r\n personID: string;\r\n connectUser: string;\r\n createdDate: string;\r\n section: string;\r\n subSetion: string;\r\n order: number;\r\n }\r\n}","module Shared {\r\n export class AdviceTable {\r\n section: string;\r\n advice: string;\r\n subSection: string;\r\n subSectionOrder: string;\r\n businessID: string;\r\n personID: string;\r\n connectUser: string;\r\n createdDate: string;\r\n } \r\n}","module Shared {\r\n export class AdvisoryAdvice {\r\n section: string;\r\n advice: string;\r\n colour: string;\r\n subSection: string;\r\n subSectionOrder: string;\r\n businessID: string;\r\n personID: string;\r\n connectUser: string;\r\n createdDate: string;\r\n }\r\n}","module Shared {\r\n export class AmountAvailableTable {\r\n public businessID: string;\r\n public personID: string;\r\n public connectUser: string;\r\n public availableFunds: number;\r\n public bank: number;\r\n public corporation_tax: number;\r\n public other: number;\r\n public paye: number;\r\n public unpaid_Invoices: number;\r\n public vat: number;\r\n public createdDate: string;\r\n public section: string;\r\n public subSection: string;\r\n public order: string;\r\n }\r\n}","module Shared {\r\n export class BankTable {\r\n name: string;\r\n bankID: string;\r\n reconciliationDate: string;\r\n bankAccountNo_: string;\r\n dDEReferenceNo_: string;\r\n lastImportBalance: number;\r\n type: number;\r\n viewAccessStatus: string;\r\n recStatus: string;\r\n businessID: string;\r\n personID: string;\r\n connectUser: string;\r\n createdDate: string;\r\n section: string;\r\n subSection: string;\r\n order: number;\r\n}\r\n}","module Shared {\r\n export class DividendsTable {\r\n dividendsdeclared: number;\r\n unconfirmedcashpaymentsassumedtobedividends: number;\r\n totalofdeclaredandassumeddividendsalreadytaken: number;\r\n businessID: string;\r\n personID: string;\r\n connectUser: string;\r\n createdDate: string;\r\n section: string;\r\n subsection: string;\r\n order: number;\r\n }\r\n}","module Shared {\r\n export class ExpensesTable {\r\n businessID: string;\r\n personID: string;\r\n connectUser: string;\r\n accommodation: number;\r\n accommodationDisallowable: number;\r\n accountLegalProf: number;\r\n accountLegalProfFees: number;\r\n advertising: number;\r\n airRailTravelParking: number;\r\n businessEntertain: number;\r\n businessEntertainment: number;\r\n compensationPenalties: number;\r\n goodsForResale: number;\r\n hireOfEquipment: number;\r\n insurance: number;\r\n InsuranceDisallowable: number;\r\n itMaintSupport: number;\r\n lightHeat: number;\r\n mileageFuel: number;\r\n motorExpenses: number;\r\n motorExpensesDisallowable: number;\r\n officeExpenses: number;\r\n officeExpensesDisallowable: number;\r\n otherBusinessExp: number;\r\n otherBusinessExpenses: number;\r\n printStationeryPost: number;\r\n privateMedicalIns: number;\r\n ratesWater: number;\r\n relocationExpensesAllow: number;\r\n rent: number;\r\n rent__disallowable_: number;\r\n repairsPropertyEquip: number;\r\n staffEntertainment: number;\r\n subcontractors: number;\r\n subsistence: number;\r\n telephoneFax: number;\r\n training_: number;\r\n createdDate: string;\r\n } \r\n}","/// \r\n\r\nmodule Shared {\r\n export class ExpenseTableDetail {\r\n CurrentYearExpenses: Shared.ExpensesTable;\r\n LastYearExpenses: Shared.ExpensesTable;\r\n } \r\n}","module Shared {\r\n export class HRTThresholdTable {\r\n weeksRemaining: number;\r\n pointHigherRateTaxispayable: number;\r\n yeartodatetaxableincome: number;\r\n hrtThresholdlessYTDincome: number;\r\n estweekstoexceedthreshold: number;\r\n businessID: string;\r\n personID: string;\r\n connectUser: string;\r\n createdDate: string;\r\n section: string;\r\n subSection: string;\r\n order: number;\r\n }\r\n}","module Shared {\r\n export class IntroductionSection {\r\n accountantName: string;\r\n introduction1: string;\r\n businessID: string;\r\n personID: string;\r\n createdDate: string;\r\n section: string;\r\n subSection: string;\r\n order: number;\r\n redCount: number;\r\n greenCount: number;\r\n amberCount: number;\r\n calendlyLink: string;\r\n showLink: string;\r\n }\r\n}","module Shared {\r\n export class KeyInformation {\r\n companyName: string;\r\n createdDate: string;\r\n }\r\n}","module Shared {\r\n export class PersonalTaxCalcTable {\r\n connectUser: string;\r\n businessID: string;\r\n personID: string;\r\n primaryDividend: number;\r\n pscPayeIncomeYtd: number;\r\n estimated_PSC_income_still_to_be_declared_by_5th_April: number;\r\n totalPscPayeIncome: number;\r\n umbrella_Gross_Pay_YTD: number;\r\n estimated_UMB_income_still_to_be_declared_by_5th_April: number;\r\n total_UMB_PAYE_income: number;\r\n totalPayeIncome: number;\r\n dividends_declared_in_management_accounts: number;\r\n unconfirmed_cash_payments_assumed_to_be_dividends: number;\r\n total_of_declared_and_assumed_dividends_already_taken: number;\r\n number_of_weeks_past: number;\r\n number_of_weeks_left: number;\r\n estimated_dividends_still_to_be_declared: number;\r\n total_Dividends: number;\r\n total_other_income: number;\r\n estimated_Total_Gross_Income: number;\r\n your_personal_allowance_: number;\r\n basic_rate_tax_band: number;\r\n personal_pension_contributions: number;\r\n reductionInPersonalAllowance: number;\r\n your_estimated_income_point_where_higher_rate_tax_becomes_payable_: number;\r\n estimated_total_income_: number;\r\n income_subject_to_higher_rate_tax: number;\r\n income_subject_to_additional_rate_tax: number;\r\n total_Income_subject_to_higher_and_additional_rate_tax: number;\r\n createdDate: string;\r\n section: string;\r\n subSection: string;\r\n order: number;\r\n }\r\n}","module Shared {\r\n export class ProfitTable {\r\n connectUser: string;\r\n thisYearsExpensesClaimed: number;\r\n thisYearsInvoices: number;\r\n thisYearsProfitBeforeTax: number;\r\n lastYearsExpensesClaimed: number;\r\n lastYearsInvoices: number;\r\n lastYearsProfitBeforeTax: number;\r\n createdDate: string;\r\n section: string;\r\n subSection: string;\r\n order: string;\r\n }\r\n}","module Shared {\r\n export class PscPayeTable {\r\n monthlyDirectorsFee: string;\r\n pscPayeIncomeYTD: string;\r\n totalPscPayeincome: string;\r\n businessID: string;\r\n personID: string;\r\n connectUser: string;\r\n createdDate: string;\r\n section: string;\r\n subSection: string;\r\n order: string;\r\n }\r\n}","module Shared {\r\n export class SectionHeader {\r\n businessID: string;\r\n personId: string;\r\n section: string;\r\n subSection: string;\r\n body: string;\r\n connectUser: string;\r\n createdDate: string;\r\n }\r\n}","module Shared {\r\n export class SectionMenuItem {\r\n businessID: string;\r\n personId: string;\r\n section: string;\r\n sectionOrder: number;\r\n subSectionCount: number;\r\n }\r\n}","module Shared {\r\n export class UmbPayslipTable {\r\n payYear: number;\r\n payPeriod: number;\r\n totalFunds: number;\r\n eMPNI: number;\r\n appLevy: number;\r\n margin: number;\r\n grossPay: number;\r\n pAYE: number;\r\n eENI: number;\r\n eEPen: number;\r\n studentLoan: number;\r\n netPay: number;\r\n businessID: string;\r\n personID: string;\r\n employer_Pension_Recovery: number;\r\n pen_er_con: number;\r\n pENERDR: number;\r\n pENSION_EE: number;\r\n pension_ER: number;\r\n rounding: number;\r\n eE_NEST_Refund: number;\r\n er_salsac: number;\r\n standard_day: number;\r\n lOAN: number;\r\n other_pay: number;\r\n unrecovered_NI: number;\r\n nEST_Penson_Employers_Refund: number;\r\n sSP: number;\r\n aegon_ae_er: number;\r\n aegone_ae_ee: number;\r\n cOVID_19_PAY: number;\r\n exp_umbrella: number;\r\n fur_app_levy: number;\r\n furlough_lel: number;\r\n nET_ADDITION: number;\r\n paid_Expenses: number;\r\n unpaid_Claimed_Expense: number;\r\n p45_GROSS: number;\r\n connectUser: string;\r\n createdDate: string;\r\n section: string;\r\n subSection: string;\r\n order: number;\r\n }\r\n}","module Shared {\r\n export class UnconfirmedTable {\r\n unconfirmedTransactions: number;\r\n reconciledto: string;\r\n businessID: string;\r\n personID: string;\r\n connectUser: string;\r\n createdDate: string;\r\n section: string;\r\n subSection: string;\r\n order: number;\r\n }\r\n}","module Shared {\r\n export class Agency {\r\n public billingAddressAddressLine1: string = null;\r\n public billingAddressAddressLine2: string = null;\r\n public billingAddressAddressLine3: string = null;\r\n public billingAddressPostcode: string = null;\r\n public billingAddressTown: string = null;\r\n public billingAddressCounty: string = null;\r\n public billingAddressCountry: string = null;\r\n\r\n public customerAddressAddressLine1: string = null;\r\n public customerAddressAddressLine2: string = null;\r\n public customerAddressAddressLine3: string = null;\r\n public customerAddressPostcode: string = null;\r\n public customerAddressTown: string = null;\r\n public customerAddressCounty: string = null;\r\n public customerAddressCountry: string = null;\r\n\r\n public agencyReference: string = null;\r\n public isSelfBilling: boolean = false;\r\n public selfBillingMethod: number = null;\r\n public customerNumber: string = null;\r\n public crmAgencyId: string = null;\r\n public isDirectEngagement: boolean = false;\r\n }\r\n}\r\n","/// \r\n/// \r\n\r\nmodule Shared {\r\n export class SaveAssignmentRequest {\r\n assignment: Shared.SaveAssignment;\r\n rates: Array;\r\n agency: Shared.Agency;\r\n }\r\n\r\n // Brookson.Connect3.Web.Models.Requests.Assignment.Assignment\r\n export class SaveAssignment {\r\n assignmentId: string;\r\n agencyReference: string;\r\n assignmentName: string;\r\n dateStarted: Shared.BrooksonDate;\r\n dateEnded: Shared.BrooksonDate;\r\n uniqueId: string;\r\n preferredEmailAddresses: Array;\r\n isSelfBilling: boolean;\r\n publicSector: Sectors;\r\n publicSectorFromDate: Shared.BrooksonDate;\r\n jobTitle: string;\r\n industry: string;\r\n ir35Capture: boolean;\r\n ir35AssignmentStatus: Shared.IIR35Captured;\r\n timesheetFrequencySelector: EnumObj;\r\n\r\n public fromAssignmentCompact = (data: Shared.AssignmentCompact) : this => {\r\n if (!data) return this;\r\n\r\n this.assignmentId = data.assignmentID;\r\n this.agencyReference = data.agencyReference;\r\n this.assignmentName = data.assignmentName;\r\n this.dateStarted = data.dateStarted;\r\n this.dateEnded = data.dateEnded;\r\n this.uniqueId = data.uniqueIdentifierNumber;\r\n this.preferredEmailAddresses = data.preferredEmailAddresses;\r\n this.isSelfBilling = data.isSelfBilling;\r\n this.publicSector = data.publicSector;\r\n this.publicSectorFromDate = data.publicSectorFromDate;\r\n this.jobTitle = data.jobTitleOption ? data.jobTitleOption.titleText : '';\r\n this.industry = data.industry;\r\n this.ir35Capture = data.ir35Capture;\r\n this.ir35AssignmentStatus = data.ir35AssessmentCaptured;\r\n this.timesheetFrequencySelector = data.timesheetFrequency === 0 ? null : data.timesheetFrequency;\r\n \r\n return this;\r\n }\r\n }\r\n}","/// \r\n\r\nmodule Shared {\r\n export class SaveUmbrellaAssignmentRequest extends SaveAssignmentRequest {\r\n sdcQuestionnaire: Shared.SdcQuestionnaireInput;\r\n }\r\n}","module Shared {\r\n export module Invoicing {\r\n export class InvoiceLine {\r\n description: string;\r\n qty: number;\r\n rate: string;\r\n amount: number;\r\n assignmentRate: Shared.InvoicingAssignmentRate;\r\n adhocRate: number;\r\n }\r\n }\r\n}"]}