{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/components/taxpayer/TaxpayerOwnership.vue?acdd","webpack:///./src/components/fa/FAConsolidator.vue?4887","webpack:///./src/components/calculator/CalculatorPeriodNavigation.vue?ab1d","webpack:///./src/components/fa/FAConsolidatorOutput.vue?6bed","webpack:///./src/components/taxpayer/TaxpayerForm.vue?4e7b","webpack:///./src/components/taxpayer/TaxpayerList.vue?ff74","webpack:///./src/components/Disclaimer.vue?232d","webpack:///./src/components/calculator/schedules/DividendTiers.vue?ba6d","webpack:///./node_modules/moment/locale sync ^\\.\\/.*$","webpack:///./src/App.vue?926f","webpack:///./src/components/periods/PeriodLockForm.vue?ed9d","webpack:///./src/components/calculator/CommentSidebar.vue?b479","webpack:///./src/components/fa/FACopyOptionsRPCard.vue?08b0","webpack:///./src/components/calculator/schedules/CommentActivityCard.vue?c15f","webpack:///./src/components/fa/FACopyConfiguration.vue?acd8","webpack:///./src/components/calculator/Calculator.vue?c572","webpack:///./src/components/calculator/ReviewSection.vue?d855","webpack:///./src/components/calculator/CalculatorRow.vue?8c78","webpack:///./src/components/calculator/ProfileSelector.vue?e913","webpack:///./src/components/calculator/CalculatorOutput.vue?8d3b","webpack:///./src/components/EditTaxpayer.vue?5708","webpack:///./src/components/calculator/CalculatorSchedule.vue?ef40","webpack:///./src/components/calculator/CommentSection.vue?a877","webpack:///./src/components/fa/FALockdown.vue?4cc4","webpack:///./src/components/calculator/FANavigationSidebar.vue?7a1a","webpack:///./src/components/Navigation.vue?24bb","webpack:///./src/components/calculator/schedules/FitrSchedule.vue?6b5a","webpack:///./src/components/calculator/CalculatorSection.vue?9268","webpack:///./src/App.vue?f696","webpack:///./src/components/Navigation.vue?9786","webpack:///./src/mixins/UserMixin.ts","webpack:///./src/mixins/EnvMixin.ts","webpack:///./src/components/Navigation.vue?456a","webpack:///./src/components/Navigation.vue?baa0","webpack:///./src/components/Navigation.vue?555a","webpack:///./src/components/Breadcrumbs.vue?76a5","webpack:///./src/services/token/index.ts","webpack:///./src/fixtures/fields.ts","webpack:///./src/store/calculator/getters.ts","webpack:///./src/store/calculator/types.ts","webpack:///./src/util/round.ts","webpack:///./src/services/transaction/Transaction.ts","webpack:///./src/services/calculator/Alteration.ts","webpack:///./src/util/getDate.ts","webpack:///./src/util/getDeepProperty.ts","webpack:///./src/services/calculator/CalculatorOutput.ts","webpack:///./src/services/calculator/Calculator.ts","webpack:///./src/services/calculator/CalculatorHelpers.ts","webpack:///./src/services/api/acbAdjustmentTypes.ts","webpack:///./src/services/api/acbAdjustments.ts","webpack:///./src/services/api/acbPeriods.ts","webpack:///./src/store/calculator/actions.ts","webpack:///./src/store/user/types.ts","webpack:///./src/store/calculator/mutations.ts","webpack:///./src/store/calculator/index.ts","webpack:///./src/store/user/getters.ts","webpack:///./src/views/Home.vue?e9ed","webpack:///./src/components/taxpayer/TaxpayerList.vue?85b6","webpack:///./src/components/taxpayer/TaxpayerList.vue?6c79","webpack:///./src/components/taxpayer/TaxpayerList.vue?0a63","webpack:///./src/components/taxpayer/TaxpayerList.vue","webpack:///./src/components/taxpayer/TaxpayerForm.vue?bb59","webpack:///./src/mixins/LoadingMixin.ts","webpack:///./src/components/LoadingButton.vue?d452","webpack:///./src/components/LoadingButton.vue?d23b","webpack:///./src/components/LoadingButton.vue?d6d7","webpack:///./src/components/LoadingButton.vue","webpack:///./src/components/CurrencyDropdown.vue?2caa","webpack:///./src/components/CurrencyDropdown.vue?c568","webpack:///./src/components/CurrencyDropdown.vue?724a","webpack:///./src/components/CurrencyDropdown.vue","webpack:///./src/components/utils/ErrorAlert.vue?d708","webpack:///./src/components/utils/ErrorAlert.vue?1e33","webpack:///./src/components/utils/ErrorAlert.vue?8aa5","webpack:///./src/components/utils/ErrorAlert.vue","webpack:///./src/components/taxpayer/TaxpayerForm.vue?2c68","webpack:///./src/components/taxpayer/TaxpayerForm.vue?853d","webpack:///./src/components/taxpayer/TaxpayerForm.vue","webpack:///./src/components/taxpayer/TaxpayerCopy.vue?2d7c","webpack:///./src/components/taxpayer/TaxpayerCopy.vue?fe8b","webpack:///./src/components/taxpayer/TaxpayerCopy.vue?1927","webpack:///./src/components/taxpayer/TaxpayerCopy.vue","webpack:///./src/components/utils/Loader.vue?5ef7","webpack:///./src/components/utils/Loader.vue?5715","webpack:///./src/components/utils/Loader.vue?6e3c","webpack:///./src/components/utils/Loader.vue","webpack:///./src/views/Home.vue?42b8","webpack:///./src/views/Home.vue?102e","webpack:///./src/views/Home.vue","webpack:///./src/views/Login.vue?cd5e","webpack:///./src/components/LoginForm.vue?dd39","webpack:///./src/components/LoginForm.vue?e35f","webpack:///./src/components/LoginForm.vue?4b06","webpack:///./src/components/LoginForm.vue","webpack:///./src/views/Login.vue?bb6b","webpack:///./src/views/Login.vue?5134","webpack:///./src/views/Login.vue","webpack:///./src/views/Taxpayer.vue?14d6","webpack:///./src/components/EditTaxpayer.vue?ce05","webpack:///./src/components/taxpayer/TaxpayerOwnership.vue?be05","webpack:///./src/mixins/ConfirmBoxMixin.ts","webpack:///./src/components/utils/Table.vue?ef06","webpack:///./src/components/utils/Table.vue?0684","webpack:///./src/components/utils/Table.vue?2326","webpack:///./src/components/utils/Table.vue","webpack:///./src/components/taxpayer/TaxpayerOwnership.vue?f5ce","webpack:///./src/components/taxpayer/TaxpayerOwnership.vue?41e1","webpack:///./src/components/taxpayer/TaxpayerOwnership.vue","webpack:///./src/components/EditTaxpayer.vue?1114","webpack:///./src/components/EditTaxpayer.vue?50de","webpack:///./src/components/EditTaxpayer.vue","webpack:///./src/components/fa/FAForm.vue?c594","webpack:///./src/util/formatMoney.ts","webpack:///./src/components/fa/FAForm.vue?45e3","webpack:///./src/components/fa/FAForm.vue?b3fb","webpack:///./src/components/fa/FAForm.vue","webpack:///./src/components/fa/FAConsolidator.vue?530f","webpack:///./src/util/sortPeriods.ts","webpack:///./src/mixins/CalculatorMixin.ts","webpack:///./src/fixtures/strings.ts","webpack:///./src/mixins/StringsMixin.ts","webpack:///./src/components/fa/FALockdown.vue?c97f","webpack:///./src/components/fa/FALockdown.vue?2b3f","webpack:///./src/components/fa/FALockdown.vue?9a4f","webpack:///./src/components/fa/FALockdown.vue?cd39","webpack:///./src/components/fa/FAConsolidatorOutput.vue?87fc","webpack:///./src/components/utils/ModalButton.vue?8b7a","webpack:///./src/components/utils/ModalButton.vue?a7a8","webpack:///./src/components/utils/ModalButton.vue?81ab","webpack:///./src/components/utils/ModalButton.vue","webpack:///./src/mixins/PDFMixin.ts","webpack:///./src/components/fa/FAConsolidator.config.ts","webpack:///./src/mixins/FAConsolidatorMixin.ts","webpack:///./src/components/fa/FAConsolidatorSettings.vue?df4b","webpack:///./src/components/fa/FAConsolidatorSettings.vue?7436","webpack:///./src/components/fa/FAConsolidatorSettings.vue?c007","webpack:///./src/components/fa/FAConsolidatorSettings.vue","webpack:///./src/components/calculator/ProfileSelector.vue?7d51","webpack:///./src/components/calculator/ProfileEditor.vue?36e0","webpack:///./src/components/calculator/ProfileEditor.vue?afb3","webpack:///./src/components/calculator/ProfileEditor.vue?070b","webpack:///./src/components/calculator/ProfileEditor.vue","webpack:///./src/components/calculator/ProfileSelector.vue?b4e4","webpack:///./src/components/calculator/ProfileSelector.vue?d821","webpack:///./src/components/calculator/ProfileSelector.vue","webpack:///./src/components/fa/FAConsolidatorOutput.vue?8403","webpack:///./src/components/fa/FAConsolidatorOutput.vue?1a98","webpack:///./src/components/fa/FAConsolidatorOutput.vue","webpack:///./src/util/debug.ts","webpack:///./src/util/PubSub.ts","webpack:///./src/services/calculator/TaxpayerCalculator.ts","webpack:///./src/components/fa/FAConsolidator.vue?dba1","webpack:///./src/components/fa/FAConsolidator.vue?f15c","webpack:///./src/components/fa/FAConsolidator.vue","webpack:///./src/components/fa/FACopy.vue?52ce","webpack:///./src/components/fa/FACopyOptions.vue?6bfd","webpack:///./src/components/fa/FACopyConfiguration.vue?fcc5","webpack:///./src/components/fa/FACopyConfigurationOptionField.vue?d234","webpack:///./src/components/fa/FACopyConfigurationOptionField.vue?eb25","webpack:///./src/components/fa/FACopyConfigurationOptionField.vue?5e07","webpack:///./src/components/fa/FACopyConfigurationOptionField.vue","webpack:///./src/components/fa/FACopyConfiguration.vue?f9df","webpack:///./src/components/fa/FACopyConfiguration.vue?24f4","webpack:///./src/components/fa/FACopyConfiguration.vue","webpack:///./src/components/fa/FACopyOptionsRPCard.vue?10d8","webpack:///./src/components/fa/FACopyOptionsRPCard.vue?97fa","webpack:///./src/components/fa/FACopyOptionsRPCard.vue?6f2c","webpack:///./src/components/fa/FACopyOptionsRPCard.vue","webpack:///./src/components/fa/FACopyOptionsSummary.vue?0650","webpack:///./src/components/fa/FACopyOptionsSummary.vue?213a","webpack:///./src/components/fa/FACopyOptionsSummary.vue?ec02","webpack:///./src/components/fa/FACopyOptionsSummary.vue","webpack:///./src/components/fa/FACopyPeriodOptionPanel.vue?aab5","webpack:///./src/components/periods/PeriodOptionPanel.vue?b7a2","webpack:///./src/components/periods/PeriodOptionPanel.vue?a5ea","webpack:///./src/components/periods/PeriodOptionPanel.vue?9f04","webpack:///./src/components/periods/PeriodOptionPanel.vue","webpack:///./src/components/fa/FACopyBridgePeriodOptionPanel.vue?b5a6","webpack:///./src/components/fa/FACopyBridgePeriodOptionPanel.vue?c210","webpack:///./src/components/fa/FACopyBridgePeriodOptionPanel.vue?c60d","webpack:///./src/components/fa/FACopyBridgePeriodOptionPanel.vue","webpack:///./src/components/periods/PeriodCallout.vue?d7a4","webpack:///./src/components/periods/PeriodCallout.vue?6ef5","webpack:///./src/components/periods/PeriodCallout.vue?44b1","webpack:///./src/components/periods/PeriodCallout.vue","webpack:///./src/components/fa/FACopyPeriodOptionPanel.vue?1d5b","webpack:///./src/components/fa/FACopyPeriodOptionPanel.vue?4921","webpack:///./src/components/fa/FACopyPeriodOptionPanel.vue","webpack:///./src/components/fa/FACopyOptions.vue?646c","webpack:///./src/components/fa/FACopyOptions.vue?814c","webpack:///./src/components/fa/FACopyOptions.vue","webpack:///./src/components/fa/FACopy.vue?9c6c","webpack:///./src/components/fa/FACopy.vue?b310","webpack:///./src/components/fa/FACopy.vue","webpack:///./src/components/utils/OptionsDropdown.vue?ca10","webpack:///./src/components/utils/OptionsDropdown.vue?9aa6","webpack:///./src/components/utils/OptionsDropdown.vue?a4bc","webpack:///./src/components/utils/OptionsDropdown.vue","webpack:///./src/views/Taxpayer.vue?0878","webpack:///./src/views/Taxpayer.vue?1d89","webpack:///./src/views/Taxpayer.vue","webpack:///./src/views/ForeignAffiliate.vue?a452","webpack:///./src/components/calculator/Calculator.vue?b604","webpack:///./src/components/calculator/CalculatorSection.vue?3262","webpack:///./src/components/calculator/CalculatorSubSection.vue?11c6","webpack:///./src/components/calculator/CalculatorRow.vue?ae47","webpack:///./src/components/calculator/CalculatorInput.vue?194d","webpack:///./src/components/calculator/calc-event-bus.ts","webpack:///./src/components/calculator/ReviewSection.vue?6be1","webpack:///./src/mixins/OptionTypesMixin.ts","webpack:///./src/components/calculator/schedules/ScheduleHeader.vue?39b5","webpack:///./src/components/calculator/schedules/ScheduleHeader.vue?65b9","webpack:///./src/components/calculator/schedules/ScheduleHeader.vue?a0ab","webpack:///./src/components/calculator/schedules/ScheduleHeader.vue","webpack:///./src/mixins/ScheduleMixin.ts","webpack:///./src/components/calculator/ReviewSection.vue?c07c","webpack:///./src/components/calculator/ReviewSection.vue?d08c","webpack:///./src/components/calculator/ReviewSection.vue","webpack:///./src/components/calculator/CalculatorInput.vue?9196","webpack:///./src/components/calculator/CalculatorInput.vue?d87f","webpack:///./src/components/calculator/CalculatorInput.vue","webpack:///./src/components/calculator/CalculatorSchedule.vue?c2e4","webpack:///./src/components/calculator/schedules/DividendsPaidSchedule.vue?2574","webpack:///./src/interfaces.ts","webpack:///./src/components/utils/AddForm.vue?f180","webpack:///./src/mixins/ValidatorMixin.ts","webpack:///./src/components/utils/AddForm.vue?cab3","webpack:///./src/components/utils/AddForm.vue?ac56","webpack:///./src/components/utils/AddForm.vue","webpack:///./src/components/calculator/schedules/DividendTiers.vue?f61b","webpack:///./src/components/calculator/schedules/DividendTiers.vue?fccb","webpack:///./src/components/calculator/schedules/DividendTiers.vue?652b","webpack:///./src/components/calculator/schedules/DividendTiers.vue","webpack:///./src/components/utils/PromptWindow.vue?bb5c","webpack:///./src/components/utils/PromptWindow.vue?4ce8","webpack:///./src/components/utils/PromptWindow.vue?27ca","webpack:///./src/components/utils/PromptWindow.vue","webpack:///./src/components/calculator/schedules/DividendPaidBreakdown.vue?7b13","webpack:///./src/components/calculator/schedules/DividendPaidBreakdown.vue?29bf","webpack:///./src/components/calculator/schedules/DividendPaidBreakdown.vue?3abc","webpack:///./src/components/calculator/schedules/DividendPaidBreakdown.vue","webpack:///./src/components/calculator/schedules/DividendsPaidSchedule.vue?2c71","webpack:///./src/components/calculator/schedules/DividendsPaidSchedule.vue?831b","webpack:///./src/components/calculator/schedules/DividendsPaidSchedule.vue","webpack:///./src/components/calculator/schedules/DividendsReceivedSchedule.vue?0152","webpack:///./src/components/calculator/schedules/DividendsReceivedSchedule.vue?cf93","webpack:///./src/components/calculator/schedules/DividendsReceivedSchedule.vue?1ec7","webpack:///./src/components/calculator/schedules/DividendsReceivedSchedule.vue","webpack:///./src/components/calculator/schedules/SepAdjustmentsSchedule.vue?37ee","webpack:///./src/components/calculator/schedules/SepAdjustmentsSchedule.vue?a96a","webpack:///./src/components/calculator/schedules/SepAdjustmentsSchedule.vue?f23e","webpack:///./src/components/calculator/schedules/SepAdjustmentsSchedule.vue","webpack:///./src/components/calculator/schedules/OtherInclusionsSchedule.vue?ed79","webpack:///./src/components/calculator/schedules/OtherInclusionsSchedule.vue?fdfb","webpack:///./src/components/calculator/schedules/OtherInclusionsSchedule.vue?ae14","webpack:///./src/components/calculator/schedules/OtherInclusionsSchedule.vue","webpack:///./src/components/calculator/schedules/ForeignTaxConsolidationSchedule.vue?6726","webpack:///./src/components/calculator/schedules/ForeignTaxConsolidationSchedule.vue?80ec","webpack:///./src/components/calculator/schedules/ForeignTaxConsolidationSchedule.vue?4d90","webpack:///./src/components/calculator/schedules/ForeignTaxConsolidationSchedule.vue","webpack:///./src/components/calculator/schedules/FieldCreationSchedule.vue?b1d9","webpack:///./src/components/calculator/schedules/FieldCreationSchedule.vue?479f","webpack:///./src/components/calculator/schedules/FieldCreationSchedule.vue?ff57","webpack:///./src/components/calculator/schedules/FieldCreationSchedule.vue","webpack:///./src/components/calculator/schedules/FitrSchedule.vue?b27f","webpack:///./src/components/calculator/schedules/FitrSchedule.vue?ce32","webpack:///./src/components/calculator/schedules/FitrSchedule.vue?a319","webpack:///./src/components/calculator/schedules/FitrSchedule.vue","webpack:///./src/components/calculator/schedules/HybridDispositionSchedule.vue?5286","webpack:///./src/components/calculator/schedules/HybridDispositionSchedule.vue?8f93","webpack:///./src/components/calculator/schedules/HybridDispositionSchedule.vue?5930","webpack:///./src/components/calculator/schedules/HybridDispositionSchedule.vue","webpack:///./src/components/calculator/schedules/CyDifferenceReconciliationSchedule.vue?dd89","webpack:///./src/components/calculator/schedules/CyDifferenceReconciliationSchedule.vue?0eab","webpack:///./src/components/calculator/schedules/CyDifferenceReconciliationSchedule.vue?d35a","webpack:///./src/components/calculator/schedules/CyDifferenceReconciliationSchedule.vue","webpack:///./src/components/calculator/schedules/AcbAdjustmentsSchedule.vue?f1a6","webpack:///./src/components/calculator/ACBBreakdown.vue?aa7f","webpack:///./src/components/calculator/ACBBreakdown.vue?8de0","webpack:///./src/components/calculator/ACBBreakdown.vue?a289","webpack:///./src/components/calculator/ACBBreakdown.vue","webpack:///./src/components/calculator/schedules/AcbAdjustmentsSchedule.vue?2a41","webpack:///./src/components/calculator/schedules/AcbAdjustmentsSchedule.vue?0545","webpack:///./src/components/calculator/schedules/AcbAdjustmentsSchedule.vue","webpack:///./src/components/calculator/schedules/index.ts","webpack:///./src/util/pascalCase.ts","webpack:///./src/components/calculator/CommentSection.vue?f711","webpack:///./src/components/calculator/CommentRow.vue?8c3f","webpack:///./src/components/calculator/CommentRow.vue?f626","webpack:///./src/components/calculator/CommentRow.vue?a7ed","webpack:///./src/components/calculator/CommentRow.vue","webpack:///./src/components/calculator/CommentResolutionStatus.vue?293c","webpack:///./src/util/id.ts","webpack:///./src/components/calculator/CommentResolutionStatus.vue?8569","webpack:///./src/components/calculator/CommentResolutionStatus.vue?f8be","webpack:///./src/components/calculator/CommentResolutionStatus.vue","webpack:///./src/components/calculator/CommentSection.vue?156d","webpack:///./src/components/calculator/CommentSection.vue?5ab8","webpack:///./src/components/calculator/CommentSection.vue","webpack:///./src/components/calculator/CalculatorSchedule.vue?bb45","webpack:///./src/components/calculator/CalculatorSchedule.vue?490d","webpack:///./src/components/calculator/CalculatorSchedule.vue","webpack:///./src/components/calculator/CalculatorReadOnly.vue?a773","webpack:///./src/components/calculator/CalculatorReadOnly.vue?1226","webpack:///./src/components/calculator/CalculatorReadOnly.vue?9f00","webpack:///./src/components/calculator/CalculatorReadOnly.vue","webpack:///./src/components/calculator/CalculatorRow.vue?cdf1","webpack:///./src/components/calculator/CalculatorRow.vue?7e11","webpack:///./src/components/calculator/CalculatorRow.vue","webpack:///./src/components/calculator/CalculatorRowSubtotal.vue?6579","webpack:///./src/components/calculator/CalculatorRowSubtotal.vue?2370","webpack:///./src/components/calculator/CalculatorRowSubtotal.vue?5a1e","webpack:///./src/components/calculator/CalculatorRowSubtotal.vue","webpack:///./src/components/calculator/CalculatorSubSection.vue?0f1a","webpack:///./src/components/calculator/CalculatorSubSection.vue?3302","webpack:///./src/components/calculator/CalculatorSubSection.vue","webpack:///./src/components/calculator/CalculatorSection.vue?b641","webpack:///./src/components/calculator/CalculatorSection.vue?9cce","webpack:///./src/components/calculator/CalculatorSection.vue","webpack:///./src/components/calculator/CalculatorBreakdown.vue?072d","webpack:///./src/components/calculator/CalculatorBreakdown.vue?4603","webpack:///./src/components/calculator/CalculatorBreakdown.vue?2cc5","webpack:///./src/components/calculator/CalculatorBreakdown.vue","webpack:///./src/components/calculator/CalculatorPeriodNavigation.vue?60ca","webpack:///./src/components/calculator/CalculatorPeriodNavigation.vue?2c8d","webpack:///./src/components/calculator/CalculatorPeriodNavigation.vue?f898","webpack:///./src/components/calculator/CalculatorPeriodNavigation.vue","webpack:///./src/components/calculator/CalculatorOutput.vue?deff","webpack:///./src/fixtures/outputFields.ts","webpack:///./src/fixtures/outputACBCalculator.ts","webpack:///./src/components/calculator/CalculatorOutput.vue?746f","webpack:///./src/components/calculator/CalculatorOutput.vue?b5a4","webpack:///./src/components/calculator/CalculatorOutput.vue","webpack:///./src/components/calculator/FANavigationSidebar.vue?62df","webpack:///./src/components/calculator/FANavigationSidebar.vue?26aa","webpack:///./src/components/calculator/FANavigationSidebar.vue?7826","webpack:///./src/components/calculator/FANavigationSidebar.vue","webpack:///./src/components/calculator/CommentSidebar.vue?6e2f","webpack:///./src/components/calculator/schedules/CommentActivityCard.vue?23b8","webpack:///./src/components/calculator/schedules/CommentActivityCard.vue?cc45","webpack:///./src/components/calculator/schedules/CommentActivityCard.vue?e089","webpack:///./src/components/calculator/schedules/CommentActivityCard.vue","webpack:///./src/components/calculator/CommentSidebar.vue?efec","webpack:///./src/components/calculator/CommentSidebar.vue?ae70","webpack:///./src/components/calculator/CommentSidebar.vue","webpack:///./src/components/calculator/Calculator.vue?b313","webpack:///./src/components/calculator/Calculator.vue?9923","webpack:///./src/components/calculator/Calculator.vue","webpack:///./src/components/periods/PeriodForm.vue?bdcb","webpack:///./src/util/periodDateHelper.ts","webpack:///./src/components/periods/PeriodDate.vue?eb74","webpack:///./src/components/periods/PeriodDate.vue?3167","webpack:///./src/components/periods/PeriodDate.vue?ba4b","webpack:///./src/components/periods/PeriodDate.vue","webpack:///./src/components/periods/PeriodEditPanel.vue?bb26","webpack:///./src/components/periods/PeriodEditPanel.vue?5af2","webpack:///./src/components/periods/PeriodEditPanel.vue?2810","webpack:///./src/components/periods/PeriodEditPanel.vue","webpack:///./src/components/periods/PeriodDividendTierCheckerPanel.vue?710a","webpack:///./src/components/periods/PeriodDividendTierCheckerPanel.vue?f2d2","webpack:///./src/components/periods/PeriodDividendTierCheckerPanel.vue?4a23","webpack:///./src/components/periods/PeriodDividendTierCheckerPanel.vue","webpack:///./src/components/periods/PeriodOutOfRangePanel.vue?ab10","webpack:///./src/components/periods/PeriodOutOfRangePanel.vue?ea3a","webpack:///./src/components/periods/PeriodOutOfRangePanel.vue?57cd","webpack:///./src/components/periods/PeriodOutOfRangePanel.vue","webpack:///./src/components/periods/PeriodBalanceRefreshPanel.vue?1ece","webpack:///./src/components/periods/PeriodBalanceRefreshPanel.vue?1da5","webpack:///./src/components/periods/PeriodBalanceRefreshPanel.vue?d35a","webpack:///./src/components/periods/PeriodBalanceRefreshPanel.vue","webpack:///./src/components/periods/PeriodForm.vue?e800","webpack:///./src/components/periods/PeriodForm.vue?d1c7","webpack:///./src/components/periods/PeriodForm.vue","webpack:///./src/components/periods/ImportDiagnostics.vue?f58a","webpack:///./src/components/periods/ImportDiagnostics.vue?6895","webpack:///./src/components/periods/ImportDiagnostics.vue?e8ce","webpack:///./src/components/periods/ImportDiagnostics.vue","webpack:///./src/components/periods/EditPeriod.vue?91b3","webpack:///./src/services/api/period.ts","webpack:///./src/components/periods/EditPeriod.vue?aae1","webpack:///./src/components/periods/EditPeriod.vue?8e67","webpack:///./src/components/periods/EditPeriod.vue","webpack:///./src/components/periods/PeriodLockForm.vue?c207","webpack:///./src/components/periods/PeriodLockForm.vue?c81e","webpack:///./src/components/periods/PeriodLockForm.vue?6ad0","webpack:///./src/components/periods/PeriodLockForm.vue","webpack:///./src/components/calculator/ACBSettings.vue?ac8a","webpack:///./src/components/calculator/ACBSettingsForm.vue?52ad","webpack:///./src/components/calculator/ACBSettingsForm.vue?6d7c","webpack:///./src/components/calculator/ACBSettingsForm.vue?9738","webpack:///./src/components/calculator/ACBSettingsForm.vue","webpack:///./src/components/calculator/ACBSettings.vue?bdb2","webpack:///./src/components/calculator/ACBSettings.vue?b913","webpack:///./src/components/calculator/ACBSettings.vue","webpack:///./src/views/ForeignAffiliate.vue?e35a","webpack:///./src/views/ForeignAffiliate.vue?d914","webpack:///./src/views/ForeignAffiliate.vue","webpack:///./src/views/Profile.vue?1023","webpack:///./src/views/Profile.vue?c4ea","webpack:///./src/views/Profile.vue?7842","webpack:///./src/views/Profile.vue","webpack:///./src/views/PageNotFound.vue?1a64","webpack:///./src/views/PageNotFound.vue?a482","webpack:///./src/views/PageNotFound.vue?3411","webpack:///./src/views/PageNotFound.vue","webpack:///./src/views/ForgotPassword.vue?7b33","webpack:///./src/components/ForgotPasswordForm.vue?48d5","webpack:///./src/components/ForgotPasswordForm.vue?e24a","webpack:///./src/components/ForgotPasswordForm.vue?f292","webpack:///./src/components/ForgotPasswordForm.vue","webpack:///./src/views/ForgotPassword.vue?3d6a","webpack:///./src/views/ForgotPassword.vue?c2ae","webpack:///./src/views/ForgotPassword.vue","webpack:///./src/views/Expiry.vue?6b9c","webpack:///./src/views/Expiry.vue?2230","webpack:///./src/views/Expiry.vue?4c9d","webpack:///./src/views/Expiry.vue","webpack:///./src/router.ts","webpack:///./src/store/user/actions.ts","webpack:///./src/store/user/mutations.ts","webpack:///./src/store/user/index.ts","webpack:///./src/store/index.ts","webpack:///./src/services/api/api.ts","webpack:///./src/services/api/bocApi.ts","webpack:///./src/services/api/auth.ts","webpack:///./src/services/api/taxpayer.ts","webpack:///./src/services/api/fa.ts","webpack:///./src/services/api/calculator.ts","webpack:///./src/services/api/sep.ts","webpack:///./src/services/api/dividends.ts","webpack:///./src/services/api/adjustments.ts","webpack:///./src/services/api/fields.ts","webpack:///./src/services/api/dispositionAdjustments.ts","webpack:///./src/services/api/outputProfile.ts","webpack:///./src/services/api/users.ts","webpack:///./src/services/api/fx.ts","webpack:///./src/services/api/comment.ts","webpack:///./src/services/api/review.ts","webpack:///./src/components/Breadcrumbs.vue?77e3","webpack:///./src/components/Breadcrumbs.vue?c424","webpack:///./src/components/Breadcrumbs.vue","webpack:///./src/components/Disclaimer.vue?4bfe","webpack:///./src/components/Disclaimer.vue?ea57","webpack:///./src/components/Disclaimer.vue?ed50","webpack:///./src/components/Disclaimer.vue","webpack:///./src/components/utils/IdleAlert.vue?2395","webpack:///./src/components/utils/IdleAlert.vue?b595","webpack:///./src/components/utils/IdleAlert.vue?0ed6","webpack:///./src/components/utils/IdleAlert.vue","webpack:///./src/App.vue?ec60","webpack:///./src/App.vue?640d","webpack:///./src/App.vue","webpack:///./src/main.ts","webpack:///./src/components/calculator/CommentRow.vue?004a","webpack:///./src/assets/logo.png","webpack:///./src/views/ForeignAffiliate.vue?fb2a","webpack:///./src/components/fa/FAConsolidatorSettings.vue?ec19","webpack:///./src/components/calculator/CalculatorInput.vue?7d36","webpack:///./src/components/periods/PeriodCallout.vue?39fe"],"names":["i","chunkIds","length","deferredModules","j","deferredModule","chunkId","existingLinkTags","existingStyleTags","then","type","target","script","enumerable","get","getter","value","key","bind","module","Object","prototype","hasOwnProperty","call","object","property","console","error","err","jsonpArray","webpackJsonpCallback","map","webpackContext","req","id","webpackContextResolve","__webpack_require__","e","Error","code","keys","resolve","exports","_vm","this","_h","$createElement","_c","_self","attrs","scopedSlots","_u","fn","slotProps","activeTaxpayer","activeForeignAffiliate","staticRenderFns","name","staticClass","_v","_e","isAuthenticated","isKIU","on","toggleStaff","_s","isClient","proxy","$event","preventDefault","handleOnClick","namespace","variable","$store","dispatch","getters","state","user","component","items","TOKEN_NAME","getToken","localStorage","getItem","setToken","setItem","deleteToken","removeItem","OPENING","showClient","complexCopySettings","show","subGroups","balances","fields","exemptBalance","hybridBalance","taxableBalance","hutBalance","uftBalance","opening_sep","acbBalance","A","required","description","entireSection","optionField","label","meta_id","A1","desc","sep_adjustments","altName","B","C0","openingReDeficit","C1","zeroToggle","book_income_before_taxes","deferred_income_taxes","current_income_taxes","subtotal","C2","dividends_declared","sign","currency_adjustments","prior_year_adjustments","other_items_affecting_re","C3","closing_re","C4","cy_difference_reconciliation","remaining_unreconciled_total","C","D0","taxable_income_per_foreign_tax_return","D1","dividends_from_other_fas","income_of_other_companies","foreign_imputed_income","other_adjustments_not_earnings_nil","D2","income_tax_deducted_from_earnings","deductions_claimed_for_tax","losses_from_non_abi_or_property","capital_loss_deducted","losses_deducted_from_prior","income_not_included","government_assistance_not_taxed","D3","income_tax_refunded_and_included_in_earnings","capital_gain_included","fapi_included_in_earnings","expenses_deducated_for_book","government_assistance_repaid","sale_of_property_from_other_fa","D4","depreciation_for_tax_purposes","depreciation_per_financial_statement","cumulative_reg_5907_prior_year","cumulative_reg_5907_property_disposal","D5","income_recharacterized_foreign_tax_rules","D","E0","ctr_amounts_increase_exempt","ctr_amounts_increase_taxable","E1","E2","non_excluded_property_facl","active_business_assets_non_dtc","active_business_assets_dtc","other_excluded_property","shares_of_fa_or_partnership_interest_before_hybrid","capital_gain_inclusion_rate","precision","hybrid_disposition","E3","fapi_before_deductible_loss","E","F1","fitr","altFields","fitr_other_foreign_income_tax","fitr_foreign_active_earnings_before_reg5907","fitr_capital_gain_loss","fitr_capital_gain_loss_taxable","fitr_capital_gain_loss_fapi","fitr_fapi","fitr_income_loss_recharacterized_952a","fitr_income_loss_recharacterized_952a_taxable","fitr_items_not_earnings_nil","F3","foreign_tax_consolidation","F","G1","dividends_paid","dividends_received","G","H1","other_inclusions","ACB","I1","acb_adjustments","inputFieldNames","sections","forEach","sectionKey","section","subGroupKey","subGroup","fieldKey","field","readonly","push","inputFields","metaId","getChildrenFields","parentFieldMetaId","reportingPeriod","parentField","find","f","field_name","filter","user_created","parent","foreignAffiliate","taxpayer","activeTaxpayerForeignAffiliates","foreign_affiliates","reportingPeriods","reporting_periods","periodFieldValue","reportingPeriodId","original","periodField","periodFieldName","periodFieldReviews","reviews","initialForeignAffiliate","rp","fieldMatch","selectedReportingPeriod","priorReportingPeriods","priorYears","chain","isBefore","end_date","start_date","orderBy","nextReportingPeriods","nextYears","isAfter","nextReportingPeriod","nextPeriods","forwardShuffle","displayedPriorPeriods","priorPeriods","start","lookbackShuffle","end","priorYearDisplay","slice","fieldChangesMade","reduceFilter","acc","current","includes","initialFields","reduce","JSON","stringify","selectedReportingPeriodMetadata","metadata","parse","importDiagnostics","diagnostics","isAcbEnabled","acb_enabled","SET_CALCULATOR_FA","SET_CALCULATOR_TAXPAYER","SET_SELECTED_RP","CHANGE_LOOKBACK_SHUFFLE","CALCULATOR_VALUE_CHANGE","ERROR_CALCULATOR_FA","REVERT_CALCULATOR_VALUES","CALCULATE_SURPLUS","RESET_STORE","ADD_SEP","EDIT_SEP","DELETE_SEP","ADD_DIVIDEND","EDIT_DIVIDEND","DELETE_DIVIDEND","ADD_ADJUSTMENT","EDIT_ADJUSTMENT","DELETE_ADJUSTMENT","ADD_FIELD","EDIT_FIELD","DELETE_FIELD","ACCUMULATE_FIELDS","ADD_DISPOSITION_ADJUSTMENT","EDIT_DISPOSITION_ADJUSTMENT","DELETE_DISPOSITION_ADJUSTMENT","ADD_OUTPUT_PROFILE","EDIT_OUTPUT_PROFILE","DELETE_OUTPUT_PROFILE","UPDATE_METADATA","EDIT_RP","ADD_COMMENT","DELETE_COMMENT","UPDATE_COMMENT_RESOLVE","ADD_REVIEW","DELETE_REVIEW","EDIT_PRIOR_YEAR_DISPLAY","SET_ACB_ADJUSTMENT_TYPES","ADD_ACB_ADJUSTMENT","EDIT_ACB_ADJUSTMENT","DELETE_ACB_ADJUSTMENT","ADD_ACB_PERIOD","EDIT_ACB_PERIOD","DELETE_ACB_PERIOD","TOGGLE_ACB","round","num","Math","action","actionType","multiplier","relatedAlterations","alteration","balance","values","valuesClone","clone","adjustment","SEPAdjustment","amount","movement","date","localOrder","Alteration","order","getDate","Date","replace","getDeepProperty","p","o","xs","x","calculator","_calculator","runningOutput","calculatedOutput","summaryOutput","calculatedEarningsFromAnActiveBusiness","summaryExemptSurplusOutput","summaryHybridSurplusOutput","summaryTaxableSurplusOutput","summaryHutSurplusOutput","summaryUftSurplusOutput","summaryDividendsOutput","summaryACBOutput","calculatedExemptEarningsOutput","calculatedTaxableEarningsOutput","calculatedExemptSurplusOutput","calculatedHybridSurplusOutput","calculatedTaxableSurplusOutput","calculatedHutSurplusOutput","calculatedUftSurplusOutput","calculatedAllocationOfIncomeAndTaxes","calculatedCapitalGainsOutput","output","openings","recharacterizedAmounts","closings","adjustedOpening","dividendsReceived","dividendsReceivedFrom","dividendsPaid","dividendsPaidFrom","otherAdjustments","closingBalancesBeforeRechar","closingExemptEarnings","sepPeriods","capitalGains","sumSepValues","closingTaxableEarnings","hutApplicable","abs","last","closing_surplus","uftApplicable","taxesPaidOnTaxableEarnings","preAcqRechar","preAcqBalance","alterations","getType","dividend","getMetadata","rules","from","schedule_93","acbPreAcqAlterations","alterationsByType","a","getMovement","acbPreAcqAmount","curr","acbRecharAlterations","to","acbRecharAmount","totalCGExcludingHybrid","hybridSurplusGainLoss","incomeLossRecharUnder95a","incomeLossRecharCtr","otherInclusions","earningsInclusions","FITRCapitalgainExempt","FITRAllocation","taxesPaidRecharActive","taxesApplicableTo952a","designatedTreatyCountry","netEarningsFromActiveBusiness","capitalGainsPortions","exempt","fapi","fapiIncludingCapitalGainsPortion","FITRFAPI","FITRCapitalgainFapi","FITRCapitalgainTaxable","taxable","adjustedTaxableIncomeLossBeforeReg5907","adjustmentsItemsNotEarningsOrNil","adjustedEarningsBeforeDepreciationElection","reg5907andAdjustment","totalAdjustmentForDepreciationElection","totalEarningsPerReg5907","foreignIncomeTaxRefunded","taxAllocationFactors","toFixed","refundAllocationFactors","FITRTaxableIncome","accrueAlterations","alterationsExemptSurplusOutput","sepMultplier","runningSEPPeriods","closingAfterLastSep","sepPeriodsDone","dividendPaid","dividendReceived","category","alterationsHybridSurplusOutput","alterationsTaxableSurplusOutput","alterationsHutSurplusOutput","closing","alterationsUftSurplusOutput","sectionHelper","sepTransactions","transactions","t","getActionType","runningMultiplier","sepOpening","sepTransaction","index","sepAdjustment","getAction","dateThreshold","alterationsPriorSep","toString","savedClosingsBeforeEarnings","preAcqRecharBalance","formatValues","calculatorOutput","sep","balanceSnapshot","dateKey","format","balanceSnapshots","earningsType","getAmount","FITRMember","exceptions","incomeItem","fitr_manually_allocate","hybridDispositionTaxes","calculateFITRProration","relatedTransaction","newAlteration","addRelatedAlteration","fitrAllocation","fitr_capital_gain_loss_hybrid","incomeRecharForeignTaxRules","netFapiIncludedDeducted","netCapitalGainIncludedDeducted","foreignActiveEarningsExcludingOther","amountsIncreaseExempt952a","amountsIncreaseTaxable952a","factors952a","total952aAdjustments","amounts","allocationFactors","prorationAmount","taxesToAllocate","prorateAmount","amountToProrate","prorate","some","closestAcbPeriod","sortedAcbPeriod","acbPeriod","getTime","transaction","runningBalances","isAcbAffectedByPreAcq","surplusBalances","createException","addAlteration","addDays","remainingAmount","netSurplus","getNetSurplus","ordering","rechar","preacq_designation","applyPreAcqDividendToACB","balanceNetSurplus","amountMoved","hut","uft","tax","tax_on_amount","hut_amount","uft_amount","dispositionAdjustment","adjustmentAmount","acbAdjustment","dividends","adjustments","disposition_adjustments","sort","b","acb_adjustment","transactionTypeOrder","earnings","exemptEarnings","taxableEarnings","previousAdjustment","closing_sep","addBalanceSnapshot","transactionDate","applyHybridDisposition","applyDividendRecieved","applyDividendPaid","setMultiplier","priorTransaction","getSepAdjustment","setSepAdjustment","applyACBAdjustment","setBalance","closingRe","closings90DayConsidered","recharMoved","recharAlterations","recharAmount","parentTransaction","getRelatedAlterations","closingsBeforeRechar","netBalance","min","maxToRechar","preAcqRecharAmount","amountsMoved","surplusType","amountType","message","undefined","init","createTransactions","calculateBalances","closings90DayRules","calculateBalances90DayRule","generateOutput","newDividends","transactionsByType","alterationsToAvoid","tiers","dividend_tiers","dividendTier","foreign_affiliate","tier","filteredAlterations","groupedAlterations","hybrid","groupToDividendCategory","group","newDividendReceived","createBlankDividend","percentage","fxRate","fx_rate","alterationAmount","acb_periods","bookIncomeAfterTaxes","areOtherItems","fa_business_designated_country","fa_resident_designated_country","sumValues","getFieldValue","total","totalExemptTaxesPaidRefunded","openingExemptEarnings","openingTaxableEarnings","portions","remainingCapitalGainsInclusionRate","capitalGainsInclusionRate","factors","taxes952a","taxesCG","sum","foreignIncomeDeductedIncluded","netTaxableIncomePerForeignTaxReturn","activeBusinessEarningsAdditions","activeBusinessEarningsDeductions","taxable_income_capital_gains","taxable_income_fapi","taxable_income_income_recharacterized_under_952a","taxable_income_items_not_nil_for_cdn_income_tax","taxable_income_active_earnings_before_59072_adjustments","previousCalculation","exempt_surplus_opening_balance","hybrid_surplus_opening_balance","taxable_surplus_opening_balance","pre_acquisition_surplus_opening_balance","underlying_foreign_tax_opening_balance","hybrid_underlying_tax_opening_balance","opening_re_deficit","acb_opening_balance","CalculatorHelpers","set","periodsInOrder","periodCalculations","previousRp","setUpOpenings","calc","calculate","closingBalances","calculatedValues","cv","createCalculatedValues","balance_snapshots","sep_percentage","reporting_period","createDividendsReceived","proratedValues","roundedAmounts","floorVal","floor","ceilVal","ceil","period","surplusBalance","data","ref","client_ref","localFields","fieldsGroupedByParent","groupBy","scheduleFields","userFields","FITRIncomeTaxDeducted","FITRIncomeTaxIncluded","FITROtherForeignIncomeField","d","dispostions","dispostionTax","foreignTaxConsolidationAdjustments","acbAdjustments","add","accumulator","args","field_id","date_created","last_updated","dateSort","rebalance","buckets","temp","post","adjustmentID","delete","adj","put","create","remove","edit","acbPeriodId","actions","resetStore","commit","fetchTaxpayer","payload","taxpayerId","params","res","fetchData","foreignAffiliateId","faPromise","response","taxpayerPromise","reportingPeriodCalculatorParams","acbAdjustmentTypesPromise","Promise","all","catch","setSelectedReportingPeriod","changeLookbackShuffle","calculatorValueChange","calculateSurplus","saveFieldValues","fieldsArray","update","updateData","selectedRPId","faId","handler","newFa","selectedRP","setTimeout","revertFieldValues","addSEPAdjustment","newSEPAdjustment","reject","editSEPAdjustment","editedSEP","deleteSEPAdjustment","SEPAdjustmentId","sep_adjustment","addDividend","newDividend","editDividend","editedDividend","deleteDividend","dividendId","addAdjustment","newAdjustment","editAdjustment","editedAdjustment","deleteAdjustment","adjustmentId","addDispositionAdjustment","dispositionAdjustments","editDispositionAdjustment","deleteDispositionAdjustment","addField","newField","rollforwardFields","duplicate","newFields","editField","editedField","addFields","createBulk","deleteField","fieldId","deleteFields","fieldIds","removeBulk","saveCalculatedValues","createCalculatedValuesPayload","saveBulkValues","addOutputProfile","requestPromise","createTaxpayerProfile","editOutputProfile","deleteOutputProfile","updateMetadata","updateReportingPeriod","updateReportingPeriods","updateBulk","element","addComment","deleteComment","commentId","updateCommentResolve","resolved","putResolve","addReview","model_name","entry_id","review","deleteReview","editPriorYearDisplay","fetchAcbAdjustmentType","acbAdjustmentTypes","types","addAcbAdjustment","editAcbAdjustment","deleteAcbAdjustment","toggleACB","addAcbPeriod","newAcbPeriod","acbPeriods","deleteAcbPeriod","acb_period","editAcbPeriod","SET_IS_AUTHENTICATED","SET_USER_DATA","TOGGLE_CLIENT","mutations","shuffle","direction","originalReportingPeriod","originalField","fm","accrueFields","calculateFASurplus","newSEPAdjusment","existingSEP","SEP","editedSep","existingSep","assign","SEPAdjusmentID","findIndex","splice","existingDividend","div","existingAdjustment","existingField","deletedItem","parentFieldId","newOuputProfile","output_profiles","existingOutputProfile","op","editedProfile","existingProfile","profileId","meta","targetRp","newComment","comments","existingComment","com","unshift","targetComment","newReview","selectedReportingPeriodSection","targetElement","el","object_id","existingReview","reviewEntry","reviewer","existingAcbPeriod","editedACBPeriod","namespaced","firstName","first_name","lastName","last_name","client","model","showModal","callback","$$v","$set","expression","taxpayers","closeModal","taxpayerCopied","style","display","alignItems","justifyContent","loading","taxPayerForm","taxPayerCopy","item","sortable","thClass","tdClass","handleOnSubmit","nameInvalid","nameState","reportingCurrency","handleOnChange","taxationYearBegins","taxationYearEnds","success","Load","propertyKey","descriptor","originalMethod","result","apply","finally","disabled","spinningText","getText","text","default","options","selected","slot","domProps","$emit","defaultValue","immediate","staticStyle","Boolean","_l","startCase","errors","val","initialData","reporting_currency","first_taxation_year_begins","first_taxation_year_ends","components","LoadingButton","CurrencyDropdown","Datepicker","ErrorAlert","_m","taxpayerOptions","selectedTaxpayer","selectedTaxpayerName","numberOfCopyList","numberOfCopy","outputProfiles","owners","currentCopy","assembleNumberOfCopyList","maxVal","copy","$bvToast","toast","title","variant","autoHideDelay","static","taxpayerCopy","ModelSelect","small","Stretch","TaxpayerList","TaxpayerForm","TaxpayerCopy","Loader","onSubmit","otpRequired","otp","trim","username","password","getEnv","credentials","login","status","LoginForm","onModalClose","onModalHide","foreignAffiliateForm","$route","busy","shouldRefresh","foreignAffiliateCopied","_t","editTA","latestReportingDate","client_access_expires","FACopy","directives","rawName","modifiers","width","margin","deleteTaxpayer","taxpayerName","showOwnershipModal","updateOwners","staffUserOptions","selectedStaffUser","tableFields","staffOwners","tableSlots","removeOwner","clientOwners","staffOwnerExists","saveOwners","defaultOptions","size","deleteOptions","okVariant","cancelVariant","$bvModal","msgBoxConfirm","this$1","$slots","localOptions","perPageOptions","perPage","currentPage","row","onFiltered","getCellAttr","noResultMessage","showSearch","showPerPage","showDownload","totalPages","users","ownersTableHeaders","addStaffOwner","getAllUsers","existingTaxpayerOwners","confirmBox","deleteOwner","userIndex","owner","ownerIds","userOptions","option","deep","Table","newOwners","parseInt","$refs","hide","destroy","$router","TaxpayerOwnership","faName","firstYearBegins","country","formatterDecimal","nativeOn","select","formatter","exemptOpening","hybridOpening","taxableOpening","hutOpening","uftOpening","acbOpening","importDone","uploadMessages","fa_id","file","handleOnUpload","faTemplates","formatNames","amt","formatMoney","symbol","pos","neg","zero","array","unformat","preAcqOpening","evt","formatted","faData","first_year_begins","reporting_surplus_currency","reset","chunkSize","chunkedTemplates","copied","numOfChild","forms","formData","FormData","append","upload","concat","upload_messages","files","taxpayerArr","faArr","taxpayerCalculatorProgress","progress","showPresentationCurrencyModal","rowItem","fx_currency","currency","formatterDecimal4","fa","reporting_rate","disabledDates","datePickerConstraint","strings","refreshBalances","applyFilters","faList","outputProfile","settingsChange","allForeignAffiliates","consolidateItemAmounts","headerSort","displayedForeignAffiliates","displayedHeaders","sortBy","sortDesc","headerClicked","sortChanged","consolidatedTotal","calculated","client_hidden","fontSize","cursor","client_locked","formatDateDistance","rateOverride","bocRate","calculatedValuesMap","remainingUnreconciledTotal","reconciliationValues","dividendTierId","reconciliationBuckets","cyDifferenceReconciliation","reconciliationValuesSum","faCurrency","selectedStartDate","lock_status","isReportingPeriodLocked","isSelectedPeriod","isSelectedReportingPeriod","reverse","CLIENT_LOCK_MESSAGE","CLIENT_LOCK_DESCRIPTION","CLIENT_DISCLAIMER","INTERNAL_DISCLAIMER","CONSOLIDATOR_DATE_MESSAGE","OUTPUT_DISCLAIMER","OUTPUT_DRAFT","OUTPUT_DRAFT_NORMAL","lockdownSubmit","checkboxDescriptions","clientLocked","clientHidden","confirmLockMessage","every","updateTaxpayerLock","updateFaLock","lockdown","buttonProps","modalProps","modalChange","draft","totalTableFields","_b","tableProps","_tableItems","_tableFields","defaultOutputProfile","setupProfile","printPdf","_","slotData","buttonLabel","class","Element","matches","msMatchesSelector","webkitMatchesSelector","closest","s","parentElement","parentNode","nodeType","config","y","c","document","createElement","logo","getElementById","ctx","getContext","height","drawImage","logoData","toDataURL","pdf","addImage","output_string","setFontSize","setTextColor","internal","getFontSize","scaleFactor","pageSize","getStringUnitWidth","FADefaultProfile","showHeaders","exempt_surplus","hybrid_surplus","taxable_surplus","net_surplus","hybrid_underlying_tax","underlying_foreign_tax","acb_balance","showFA","visible","headers","FAOrder","showRowNumber","header","newItem","FA","foreignAffiliates","checkNewKeys","displayedFAs","orderedList","curID","defaultProfile","taxpayerProfile","_g","$listeners","toggleAllHeaders","emitProfile","outputProfileEditable","sortByHeader","sortableHeaderOptions","changeSortDirection","toggleAllFAs","faListDraggable","drag","dragOptions","sortByFa","toggle","animation","ghostClass","draggable","ModalButton","showProfileModal","taxpayerOutputProfiles","userOutputProfiles","selectedOutputProfile","profileType","profileCreated","profile","updateProfile","deleteProfile","saveProfile","profileName","saveTaxpayer","saveUser","messages","existingProfiles","existingProfileType","canSaveToUser","canSaveToTaxpayer","promises","userPromise","results","findExistingProfileName","existingUserProfiles","existingTaxpayerProfiles","newProfile","newProfiles","taxpayerOutputProfileOptions","opt","userOutputProfileOptions","deleteFA","ProfileEditor","showSettingsModal","consolidatorDate","fixed","striped","FAConsolidatorProfile","setUpConfig","tableItems","reorderFAs","createjsPdfInstance","orientation","unit","tableConfig","theme","styles","font","cellPadding","headStyles","lineWidth","halign","bodyStyles","overflow","alternateRowStyles","fillColor","top","columnStyles","nameColIndex","cellWidth","willDrawCell","classes","cell","raw","getAttribute","setFontStyle","didParseCell","consolidatorTotalSource","newSource","cloneNode","autoTable","html","curPage","consolidatorOutputSource","didDrawPage","getCurrentPageInfo","pageNumber","leftMargin","settings","left","rightMargin","right","taxpayerNameString","currencyString","consolidatorDateString","addLogo","addDraftBlurb","pageString","footerMargin","wordBreak","disclaimerText","splitTextToSize","pdfName","save","returnPromise","baseTdClass","newTableItems","stickyColumn","numberValue","filterHeaders","thStyle","filterFA","totalConsolidator","FAConsolidatorSettings","ProfileSelector","subscribers","eventName","Array","isArray","cb","debug","dependencies","tieringDependency","remaining","hasBeenCalculated","previous_rp","depends_on","rpId","reportingPeriodCalculation","getForeignAffiliate","allDependentRps","publish","updateStatus","tiering","whileThreshold","iteration","allReportingPeriodsCalculated","copyCalculableReportingPeriods","calculableReportingPeriods","calculateReportingPeriod","incalculableReportingPeriods","remainingDependencies","statusMessage","complete","rpIds","propTaxpayer","conversions","inProgress","consol","fieldName","lastDate","toDate","firstDate","firstReportingDate","fetchExchangeRates","user_profile","setUpOrderableForeignAffiliates","taxpayerCalculator","subscribe","reportingPeriodConsolidatorParams","currencies","toUpperCase","Set","fx","startDate","endDate","observations","obs","distanceInWords","addSuffix","headerTitle","staffFields","formatterDecimal2","currencyForDate","latestReportingPeriods","latestRP","calculated_value","currentDate","usedCurrency","fxCurrency","fxString","v","closestDate","rate","sepMultiplier","latestDate","earliestDate","FALockdown","FAConsolidatorOutput","foreignAffiliateOptions","selectedForeignAffiliate","selectedForeignAffiliateName","statusComplexCopy","copyAcbPeriods","selectedPayload","statusComplexCopyPeriodProfile","reportingPeriodOptions","openModal","targetRP","periodProfileRPIndicator","deleteRPList","disableSummaryOfChanges","FAOptionsCopySummary","selectedRPList","rpCardChoice","toggleMultipleSelected","node","children","level","periodProfileModified","specific","periodProfile","reportingPeriodOptionsList","dataFATreePeriodProfile","periodProfileMultiple","depth","disabledCheckbox","bus","updateFunction","parentId","index2","nodes","fillOpacity","parentOptionField","selectedOption","getterCheckIndeterminate","updateSelected","objParentOptionField","parentSelected","event","childOptionFields","optionFieldsBranch","checkIndeterminate","recursiveCheckIndeterminate","isFalse","currentVal","currentOptionFieldsArray","grabOptionFieldsArray","currentOptionFieldsBooleanArray","disabledIndeterminate","showChildren","booleanArray","FACopyOptions","FACopyConfiguration","FACopyConfigurationOptionField","isAll","periodProfileEdited","toggleMultipleAttribute","selectedItem","selectedIndex","getSingleAttribute","toggleSingleAttribute","collapseObject","optionFieldItem","optionFieldIndex","period_profile","ppItem","ppIndex","ppDataItem","ppDataIndex","toggleObject","targetIndex","selectedEl","targetKey","targetAttr","currencyChange","faResidentDesignatedCountry","faBusinessActivity","faBusinessDesignatedCountry","faForeignTaxLawRequired","dividendsFromFa","dividendsPayTax","depreciationElection","sepChanges","recharacterizedPropertyIncome","dispositions","consolidationOrGroupRelief","dividendsTaxableSurplusFirst","dividendsAcb","componentEmit","questionnaireSource","carryforwardPeriod","taxationYearType","fa_business_activity","fa_foreign_tax_law_required","depreciation_election","dividends_taxable_surplus_first","dividends_acb","sep_changes","recharacterized_property_income","dividends_from_fa","dividends_pay_tax","consolidation_or_group_relief","selectedRPIndividual","FACopyOptionsRPCard","PeriodOptionPanel","mb","icon","assembleBlankPeriodProfile","targetPeriodProfileRP","cloneDeep","defaultPeriodProfile","FACopyBridgePeriodOptionPanel","PeriodCallout","selectedRPListPeriodProfileModified","dataFATree","dataFATreeBaseTemp","dataFATreeBase","reportingPeriodInfoList","dataFATreeBaseSectionOnly","periodProfileModifiedSpecific","FAComplexCopy","getTreeListBase","keepSectionRow","getPeriodProfile","getRPInfoList","newValue","oldValue","getTreeList","targetTreePayload","targetValue","tempPeriodProfile","grabLeafEntry","newVal","oldVal","findTarget","rpCardChoiceType","checkLeafEntryChanged","flat","criteriaOne","criteriaTwo","dataFATreeBaseTempAlt","setSelectedChildren","childrenArr","elRP","existInSelectedRP","filteredRP","subGroupLevel","assembleOptionFieldSelected","showSetting","fieldsLevel","targetFields","schedule","calculatorSections","periodProfileExist","selectedExist","FACopyPeriodOptionPanel","FACopyOptionsSummary","taxpayer_id","copy_acb_periods","faCopy","dropdownClass","fetchTaxpayers","confirm","EditTaxpayer","FAConsolidator","FAForm","OptionsDropdown","fetchCalcData","reportingPeriodForm","reportingPeriodLockForm","acbModuleSettings","periodOptions","selectedReportingPeriodModel","collapseAll","expandAll","isHoveredFooter","showing","reviewCheckboxChange","reviewed","showZeroes","isZeroRow","mapFields","isReadOnlyField","changesMade","openMenu","onBlur","localValue","menuOpened","revertChange","EventBus","componentName","reviewIconComplete","reviewIconPartial","reviewer_details","count","max","formatDate","date_reviewed","calculatorModule","FTCAdjustmentTypeOptions","adjustmentTypeOptions","categoryOptions","dividendTypeOptions","dispositionTypeOptions","acbType","localeCompare","State","editData","refValidationRules","prompt","defer","match","validatedData","fieldData","newFieldData","oldFieldData","newMetadata","periods","flatMap","ScheduleHeader","initialFlag","countReviewer","dateObj","intlObj","Intl","DateTimeFormat","timeZoneName","timeZone","formatToParts","part","modelName","obj","periodFieldReviewsFITR","userCreatedFields","te","reviewsGroupedByReviewer","descReviews","FITRmetaID","metaID","reviewAggregates","r","isReportingPeriodEditable","VueContext","unformatted","menu","open","$on","menuRef","close","editable","ReviewSection","scheduleName","tag","noConsolFields","buttonVariant","componentKey","onPromptCallback","editDividendPaid","DividendsPaid","props","getOptionText","removeDividendPaid","formatDividendTiers","dt","toggleDetails","detailsShowing","addNewDividendPaid","promise","formTitle","modalSize","modalShow","modalClose","validateForm","formValues","validator","first","onChange","dateConfig","openDate","refInFor","selectConfig","buttonClass","extend","getMessage","validate","strongRegex","RegExp","test","arg","paramNames","newRules","split","paramStr","join","watchers","formFields","originalValue","unwatch","detach","dateParamRules","$watch","isShown","attach","formSubmit","previousDividendTiers","rollforwardTiers","allowedTierOptions","selectedRecipient","createFormatter","calculateAmount","inputProps","removeRecipient","sumTotal","fxRateNeeded","lazyFormatter","allowedTiers","form","fetchAllowedTiers","createTableItem","isPayable","updateAllTableItems","addRecipient","emitChanges","rollforward","newTier","fx_amount","fx_tax_on_amount","recipientIndex","foundOption","min_date","max_date","direct_to_taxpayer","remainingPercentage","recipient","itemCurrency","dividendTiers","$parent","priorDividends","priorToDate","unselected","remainder","cancelClick","confirmClick","promptResult","getForeignAffiliateName","createTableItems","formatAmount","getPaidDividendTiers","inheritAttrs","dividendData","validateData","faTiers","AddForm","PromptWindow","DividendTiers","DividendPaidBreakdown","createFormFields","editDividendReceived","passedData","tier_owner","originalAmount","DividendsReceivedClientView","removeDividendReceived","addNewDividendReceived","tableFieldsAgg","DividendsTiersReceived","DividendsReceivedStaffView","tierEditableFields","newTableFields","amountIndex","editSEP","SEPAdjustments","removeSEPAdjustment","addNewAdjustment","SEPAdjustmentData","SEPAdjustmentItem","sepData","editAdjust","Adjusmtents","removeAdjusment","adjustmentData","adjData","editedAdjust","successMessage","editUserCreatedField","removeUserCreatedField","addUserCreatedField","rollforwardFieldsButtonClick","createField","updateField","descriptionRequired","indexOf","capitalGainsSet","fitrManuallyAllocate","FITRTotal","NilRemaining","FITRManualRemaining","fitr_income_tax_refunded","setInitialValues","saveValues","allFields","toUpper","factor","DispositionAdjustments","reconBucket","reconciliationTotal","sumReconItems","exception","filteredTableFields","acbAdjustmentTypeOptions","showAcbBreakdown","formatText","movementLabels","pre_acq_acb_adjustment","dividend_paid_rechar","movementType","getAlterations","ex","ACBBreakdown","DividendsPaidSchedule","SepAdjustmentsSchedule","DividendsReceivedSchedule","OtherInclusionsSchedule","FieldCreationSchedule","FitrSchedule","HybridDispositionSchedule","ForeignTaxConsolidationSchedule","CyDifferenceReconciliationSchedule","AcbAdjustmentsSchedule","stringToConvert","camelCase","upperFirst","commentType","changeType","textComment","filterComments","commentsToShow","comment","resolved_by","formatUsername","user_details","formatDateDistanceToNow","deleting","removeComment","resolving","resolvedChange","resolver_details","resolved_on","distanceInWordsToNow","comment_id","commentPayload","wrapper","wrapperProps","commentsCount","resolvedCommentsCount","color","ID","random","substr","addNewComment","CommentRow","CommentResolutionStatus","setTotal","$options","scheduleExists","dividend_amt","dividend_tiers_agg_amt","schedules","CommentSection","formattedValue","showOnce","valueFunction","CalculatorInput","CalculatorSchedule","CalculatorReadOnly","calculateSubtotal","allDisplayedReportingPeriods","getValue","CalculatorRowSubtotal","CalculatorRow","rpMetadata","CalculatorSubSection","transactionsTableFields","alterationsTableFields","getTransactions","getBalance","actionName","dividendType","adjustmentType","dispostionAdjustmentType","acbAdjustmentType","selectedNumberOfPriorYearOptions","selectedNumberOfPriorYear","priorReportingPeriod","showShuffleLeft","shufflePriorPeriodsLeft","lockStatusIcon","showShuffleRight","shufflePriorPeriodsRight","showNextShuffleLeft","shuffleNextPeriodsLeft","showNextShuffleRight","shuffleNextPeriodsRight","fromPeriodOptions","fromReportingPeriod","toPeriodOptions","toReportingPeriod","tabIndex","shownSections","tabName","sectionPeriodBatches","periodBatch","periodIndex","reportTabState","periodBatchSubSections","subSections","subSection","subSectionsTableContent","createTableStructure","col","showAcbOutput","getAlternationEntries","tableFieldsACBAdjustmentByDate","getOpeningBalance","tableFieldsACBAdjustmentByEntry","getACBAdjustmentEntries","sortACBAdjustmentsByEntryColumn","isDescendingACBAdjustmentsByEntryColumn","profileChangeType","toggleRecharLayout","acbByEntrySortParam","block","showDraggable","toggleAllSections","recharLayout","resetOrdering","sectionHierarchyDraggable","showSection","toggleChildren","exportPdf","exportACBPdf","outputFields","printId","cellClass","path","totalLineText","details","hideZeroRows","hideEmptySections","outputACBCalculator","tables","showSectionsModal","sectionHierarchy","reportSections","landscape","showRef","sectionKeyV1","sectionKeyV2","sectionOrder","pageBreak","periodBatchLocal","defaultShowACBOutput","sectionOrdering","secSO","sectionH","secH","sectionHchildren","secChildrenSO","secChildrenH","content","outputTables","periodBatches","has","subsectionKeys","subsection","tableContents","sec","toggleV1","toggleV2","setupSectionHierarchy","setupShowAcbOutput","ACBAdjustmentByEntrySortParams","hiddenSections","filterHiddenSections","sectionIndex","sectionId","addSection","subsectionIndex","subsectionId","sepField","sepFieldId","sepFieldMetaId","defaultSectionHierarchy","indent","formattedDesc","rows","arrFields","cellStyle","formatFieldDescription","newRow","detailedInputSections","noRecharNeeded","generatedOutput","acbDetailedRows","acbAdjustmentOutput","detailedRows","sepRows","sepPeriodSections","descPrev","cellClassPrev","printIdPrev","metaIdPrev","isBlankRow","isHeadingRow","removeSequentialBlankRows","currentRow","nextRow","outputField","itemIndent","indentMatches","newRows","totals","periodId","fieldsGroupedByDesc","snakeCase","client_description","descFieldIds","rowAdded","descFieldId","descFields","rowDescription","wprRow","periodHeaderId","periodFields","rowRefs","formatWPRow","addRows","acbFields","fieldsGroupedByType","maxSEPs","SEPs","SEPTarget","showLastClosing","omitLastLine","fieldTemp","appendToEnd","SEPData","container","targetClass","targetedClasses","getElementsByClassName","parentCell","classList","spanClass","sectionType","pageBreakToggle","currentPDF","pageBreakThresholdConfig","portrait","minY","getHeight","lastAutoTable","finalY","descColWidth","useCss","0","pdfStyleEditor","rps","rpsIndex","newRpsSection","reportIndex","headerAdded","subSectionId","source","getClassesFromCellData","indentLength","table","columns","indentContent","regex","found","repeat","column","colWidth","maxLength","spacing","newHeight","maxCellHeight","contentHeight","line","faNameString","setFont","addPage","resetOutputOrdering","dict","sortByFormatted","entries","entryIndex","tableName","tableIndex","targetId","deletePage","disassembleSectionOrderFromProfile","periodBatchesNoChunks","sortedPeriods","chunk","secChildren","returnObj","disassembleSectionOrder","assembleSectionOrder","reportSection","secR","sectionHierarchyDraggableChildren","reportSectionSubSection","secSection","secSubSectionR","reportSectionsDraggable","subSec","displayedReportSections","weakMap","WeakMap","subSectionContent","tableContent","createTableData","openingBalance","ACBOpeningBalance","newObj","ACBAdjustments","searchFilter","otherForeignAffiliates","faIndex","sortReportingPeriods","rpIndex","query","$attrs","toLowerCase","buttonSize","lastComments","findRP","findNestedObj","fieldsFixture","reportingPeriodsData","entireObj","keyToFind","foundObj","nestedValue","startEndRPs","CommentActivityCard","observer","isStickyTop","letters","CalculatorSection","CalculatorBreakdown","CalculatorPeriodNavigation","CalculatorOutput","FANavigationSidebar","CommentSidebar","isFirstYearPeriod","startDatePrepend","endDatePrepend","minEndDatePrepend","maxEndDatePrepend","canDelete","submitDisabledFromDate","minEndDate","maxEndDate","insertRPList","startDateInsert","endDateInsert","minEndDateInsert","maxEndDateInsert","initialStartDate","initialEndDate","getEditStatus","periodList","shiftedRPList","stubRP","submitDisabledFromEditPanel","editPanelOptionChange","minStartDate","maxStartDate","periodOptionPanelTitle","outOfRangeIssue","submitDisabledFromOutOfRangePanel","divTierIssue","newPeriodList","divTierIssueOverride","submitDisabledFromDTCheckerPanel","disableSave","refreshBalanceComplete","initialDate","differenceInDays","isDateDiff","diff","addYears","descriptionForm","invalidFeedback","stateDateValid","disabledDatesForm","disabledForm","periodType","splitDate","mode","emitEvent","minDate","maxDate","position","minStartDateEdit","maxStartDateEdit","minStartEndDate","maxStartEndDate","override","disabledEmitWrapper","dateWithinRange","suppressEmit","stubStartDateDisplay","stubEndDateDisplay","calculateNewPeriodList","stubOption","shiftOption","before","after","valid","stubOptionLabel","stubOptionsList","edgePeriod","checkShiftOptionA","shiftOptionAText","shiftOptionBText","stubOption2Label","stubOption2","currentReportingPeriodId","currentReportingPeriod","stubStartDate","stubEndDate","optionChangeValue","editStatus","submitDisabled","newStubStartDate","newStubEndDate","calculatedList","valueBefore","currentRPLoc","lastIndex","startIndex","emitValue","addWeeks","diffValue","checkPeriodAllowed","minLoc","getMinLoc","maxLoc","getMaxLoc","differenceInCalendarDays","reducedPeriodList","arrLastIndex","overrideValue","periodValidity","tempPeriodOptions","isShiftOptionAValid","checkNewPeriodListValidity","divTierIssueInRP","valEntry","valIndex","replaceAll","confirmation","dt_id","rpID","rp_id","entry","modelNameDictionary","isModifyChange","SEPAdjustmentPeriod","DispositionAdjustment","Adjustment","Dividend","DividendTier","indexName","go","shortenStartDateInsert","shortenEndDateInsert","stubStartDateInsert","stubEndDateInsert","outofRangeIssueOverride","refreshBalance","isSet","subWeeks","newStartDate","newEndDate","subYears","currentRPId","div_tier_issue","out_of_range","stub_RP","shifted_RP_list","affected_DT","affected_obj","prepend","toUTCString","newReportingPeriod","fetchDataProp","stub_id","pop","allDates","startDateDiff","endDateDiff","PeriodDate","PeriodEditPanel","PeriodDividendTierCheckerPanel","PeriodOutOfRangePanel","PeriodBalanceRefreshPanel","periodItem","diagnosticItems","getDiagnostics","diagnostic","groupedByField","diag","showEditModal","deletePeriod","patch","PeriodForm","applyAllChange","allLockStatus","updateLockStatus","reportingPeriodLockedState","lockOptions","statuses","next","newStatus","fallbackValues","showSuccessUpdateToast","showErrorUpdateToast","isEdit","acbEnabledChange","acbEnabled","acbPeriodItems","editACBPeriodModal","removeAcbPeriod","partnershipDate","partnershipOptions","isPartnership","isDisabled","updateAcbPeriod","saveAcbPeriod","editModified","closeModalEmit","editPeriod","isDateSame","isEqual","isValueSame","isModified","isDateDisabled","dates","checked","ap","valueLabel","ACBSettingsForm","paramReportingPeriod","Calculator","EditPeriod","ImportDiagnostics","PeriodLockForm","ACBSettings","beforeRouteUpdate","validatePasswordChange","oldPassword","newPassword","confirmNewPassword","changePassword","token","onPasswordResetSubmit","passwordResetSuccess","onResetRequestSubmit","resetRequested","email","validateTokenExpiration","validateToken","requestPasswordReset","resetPassword","ForgotPasswordForm","clientId","clientName","clients","selectedClients","extendAccess","validateExpiry","confirmed","extendExpiry","TermsOfUse","use","router","base","scrollBehavior","savedPosition","routes","auth","Taxpayer","redirect","beforeEach","store","fullPath","onReady","currentRoute","history","setIsAuthenticated","setUserData","checkIsAuthenticated","me","logout","access","verify","passwordChangePromise","createUserProfile","getAll","password_2","client_persist","sessionStorage","newClientState","newOutputProfile","Store","modules","SERVER_ERROR_MESSAGE","VALIDATION_ERROR_MESSAGE","api","baseURL","addRequestTransform","request","Authorization","addResponseTransform","ok","nonField","non_field_errors","resolveWithStatus","bocApi","old_password","new_password","new_password_2","saveClosingValues","getClosingValues","dividendID","userId","fxQuery","conversion","orderItem","newItems","setBreadcrumbs","isAppIdle","idleMinutes","logoutTimeoutSeconds","timeoutLogout","timeout","clearTimeout","Navigation","Breadcrumbs","Disclaimer","IdleAlert","moduleName","startAtIdle","idleTime","productionTip","render","h","$mount"],"mappings":"aACA,cAQA,IAPA,IAMA,IANA,OACA,OACA,OAIA,SACQA,EAAIC,EAASC,OAAQF,IAC7B,OACA,MACA,gBAEA,OAEA,WACA,4CACA,WAGA,QAEA,eACA,YAOA,OAHA,sBAGA,IAEA,aAEA,IADA,MACA,IAAkBA,EAAIG,EAAgBD,OAAQF,IAAK,CAGnD,IAFA,WACA,KACA,IAAmBI,EAAIC,EAAeH,OAAQE,IAAK,CACnD,WACA,iBAEA,IACA,gBACA,eAGA,SAIA,SAGA,GACA,OAMA,GACA,OAGA,KAGA,cACA,qBAA8CE,IAAUA,GAAW,IAAM,CAAC,iBAAiB,YAAYA,GAAW,MAIlH,cAGA,QACA,oBAGA,YACA,IACA,KACA,YAUA,OANA,mCAGA,OAGA,UAKA,gBACA,SAIA,GAAoB,iBAAiB,GACrC,kBACA,gBACA,uCAIA,IAHA,iBAA6BA,IAAUA,GAAW,IAAM,CAAC,iBAAiB,YAAYA,GAAW,OACjG,QACA,wCACA,IAAoBN,EAAIO,EAAiBL,OAAQF,IAAK,CACtD,WACA,sDACA,mDAEA,6CACA,QAAoBA,EAAIQ,EAAkBN,OAAQF,IAAK,CACvD,OACA,8BACA,2BAEA,qCACA,mBACA,kBACA,WACA,sBACA,mCACA,wDACA,+BACA,mBACA,KACA,4BACA,MAEA,SAEA,+CACA,oBACOS,MAAK,WACZ,WAMA,WACA,SAGA,KACA,iBACW,CAEX,iCACA,gBAEA,eAGA,I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A,IAAI,KAAS,CACfU,SACAyD,WAAY,OACZC,aAAa,EACbC,SAAU,OAEZ,aAAIj2E,UAAU,oBAAqB,SACnC,aAAIA,UAAU,SAAU,IACxB,aAAI2kC,OAAOuxC,eAAgB,EAE3B,IAAI,aAAI,CACNrE,OAAA,GACAS,SACA6D,OAAQ,SAAAC,GAAC,OAAIA,EAAE,OACdC,OAAO,S,yDCpIV,yBAA2jB,EAAG,G,qBCA9jBh6E,EAAOuB,QAAU,IAA0B,yB,gFCA3C,yBAAohB,EAAG,G,gFCAvhB,yBAAukB,EAAG,G,yDCA1kB,yBAAgkB,EAAG,G,kCCAnkB,yBAA8jB,EAAG,G","file":"js/app.8283cb71.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded CSS chunks\n \tvar installedCssChunks = {\n \t\t\"app\": 0\n \t}\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t\"app\": 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// script path function\n \tfunction jsonpScriptSrc(chunkId) {\n \t\treturn __webpack_require__.p + \"js/\" + ({}[chunkId]||chunkId) + \".\" + {\"chunk-e3297fdc\":\"a59dbf9d\"}[chunkId] + \".js\"\n \t}\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar promises = [];\n\n\n \t\t// mini-css-extract-plugin CSS loading\n \t\tvar cssChunks = {\"chunk-e3297fdc\":1};\n \t\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n \t\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n \t\t\tpromises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) {\n \t\t\t\tvar href = \"css/\" + ({}[chunkId]||chunkId) + \".\" + {\"chunk-e3297fdc\":\"6fd3e96b\"}[chunkId] + \".css\";\n \t\t\t\tvar fullhref = __webpack_require__.p + href;\n \t\t\t\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n \t\t\t\tfor(var i = 0; i < existingLinkTags.length; i++) {\n \t\t\t\t\tvar tag = existingLinkTags[i];\n \t\t\t\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n \t\t\t\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return resolve();\n \t\t\t\t}\n \t\t\t\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n \t\t\t\tfor(var i = 0; i < existingStyleTags.length; i++) {\n \t\t\t\t\tvar tag = existingStyleTags[i];\n \t\t\t\t\tvar dataHref = tag.getAttribute(\"data-href\");\n \t\t\t\t\tif(dataHref === href || dataHref === fullhref) return resolve();\n \t\t\t\t}\n \t\t\t\tvar linkTag = document.createElement(\"link\");\n \t\t\t\tlinkTag.rel = \"stylesheet\";\n \t\t\t\tlinkTag.type = \"text/css\";\n \t\t\t\tlinkTag.onload = resolve;\n \t\t\t\tlinkTag.onerror = function(event) {\n \t\t\t\t\tvar request = event && event.target && event.target.src || fullhref;\n \t\t\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + request + \")\");\n \t\t\t\t\terr.code = \"CSS_CHUNK_LOAD_FAILED\";\n \t\t\t\t\terr.request = request;\n \t\t\t\t\tdelete installedCssChunks[chunkId]\n \t\t\t\t\tlinkTag.parentNode.removeChild(linkTag)\n \t\t\t\t\treject(err);\n \t\t\t\t};\n \t\t\t\tlinkTag.href = fullhref;\n\n \t\t\t\tvar head = document.getElementsByTagName(\"head\")[0];\n \t\t\t\thead.appendChild(linkTag);\n \t\t\t}).then(function() {\n \t\t\t\tinstalledCssChunks[chunkId] = 0;\n \t\t\t}));\n \t\t}\n\n \t\t// JSONP chunk loading for javascript\n\n \t\tvar installedChunkData = installedChunks[chunkId];\n \t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n \t\t\t// a Promise means \"currently loading\".\n \t\t\tif(installedChunkData) {\n \t\t\t\tpromises.push(installedChunkData[2]);\n \t\t\t} else {\n \t\t\t\t// setup Promise in chunk cache\n \t\t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t\t\t});\n \t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n \t\t\t\t// start chunk loading\n \t\t\t\tvar script = document.createElement('script');\n \t\t\t\tvar onScriptComplete;\n\n \t\t\t\tscript.charset = 'utf-8';\n \t\t\t\tscript.timeout = 120;\n \t\t\t\tif (__webpack_require__.nc) {\n \t\t\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t\t}\n \t\t\t\tscript.src = jsonpScriptSrc(chunkId);\n\n \t\t\t\tonScriptComplete = function (event) {\n \t\t\t\t\t// avoid mem leaks in IE.\n \t\t\t\t\tscript.onerror = script.onload = null;\n \t\t\t\t\tclearTimeout(timeout);\n \t\t\t\t\tvar chunk = installedChunks[chunkId];\n \t\t\t\t\tif(chunk !== 0) {\n \t\t\t\t\t\tif(chunk) {\n \t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n \t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n \t\t\t\t\t\t\tvar error = new Error('Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')');\n \t\t\t\t\t\t\terror.type = errorType;\n \t\t\t\t\t\t\terror.request = realSrc;\n \t\t\t\t\t\t\tchunk[1](error);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t\t\t}\n \t\t\t\t};\n \t\t\t\tvar timeout = setTimeout(function(){\n \t\t\t\t\tonScriptComplete({ type: 'timeout', target: script });\n \t\t\t\t}, 120000);\n \t\t\t\tscript.onerror = script.onload = onScriptComplete;\n \t\t\t\tdocument.head.appendChild(script);\n \t\t\t}\n \t\t}\n \t\treturn Promise.all(promises);\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([0,\"chunk-vendors\"]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TaxpayerOwnership.vue?vue&type=style&index=0&lang=scss&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TaxpayerOwnership.vue?vue&type=style&index=0&lang=scss&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FAConsolidator.vue?vue&type=style&index=0&id=6a66cc9a&scoped=true&lang=scss&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FAConsolidator.vue?vue&type=style&index=0&id=6a66cc9a&scoped=true&lang=scss&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorPeriodNavigation.vue?vue&type=style&index=0&id=c7e27794&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorPeriodNavigation.vue?vue&type=style&index=0&id=c7e27794&lang=scss&scoped=true&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FAConsolidatorOutput.vue?vue&type=style&index=0&id=388a9c5e&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FAConsolidatorOutput.vue?vue&type=style&index=0&id=388a9c5e&lang=scss&scoped=true&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TaxpayerForm.vue?vue&type=style&index=0&id=32244ece&scoped=true&lang=scss&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TaxpayerForm.vue?vue&type=style&index=0&id=32244ece&scoped=true&lang=scss&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TaxpayerList.vue?vue&type=style&index=0&id=c1031828&scoped=true&lang=scss&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TaxpayerList.vue?vue&type=style&index=0&id=c1031828&scoped=true&lang=scss&\"","import mod from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Disclaimer.vue?vue&type=style&index=0&id=98796d06&scoped=true&lang=scss&\"; export default mod; export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Disclaimer.vue?vue&type=style&index=0&id=98796d06&scoped=true&lang=scss&\"","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DividendTiers.vue?vue&type=style&index=0&id=2c2172ca&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DividendTiers.vue?vue&type=style&index=0&id=2c2172ca&lang=scss&scoped=true&\"","var map = {\n\t\"./af\": \"2bfb\",\n\t\"./af.js\": \"2bfb\",\n\t\"./ar\": \"8e73\",\n\t\"./ar-dz\": \"a356\",\n\t\"./ar-dz.js\": \"a356\",\n\t\"./ar-kw\": \"423e\",\n\t\"./ar-kw.js\": \"423e\",\n\t\"./ar-ly\": \"1cfd\",\n\t\"./ar-ly.js\": \"1cfd\",\n\t\"./ar-ma\": \"0a84\",\n\t\"./ar-ma.js\": \"0a84\",\n\t\"./ar-sa\": \"8230\",\n\t\"./ar-sa.js\": \"8230\",\n\t\"./ar-tn\": \"6d83\",\n\t\"./ar-tn.js\": \"6d83\",\n\t\"./ar.js\": \"8e73\",\n\t\"./az\": \"485c\",\n\t\"./az.js\": \"485c\",\n\t\"./be\": \"1fc1\",\n\t\"./be.js\": \"1fc1\",\n\t\"./bg\": \"84aa\",\n\t\"./bg.js\": \"84aa\",\n\t\"./bm\": \"a7fa\",\n\t\"./bm.js\": \"a7fa\",\n\t\"./bn\": \"9043\",\n\t\"./bn.js\": \"9043\",\n\t\"./bo\": \"d26a\",\n\t\"./bo.js\": \"d26a\",\n\t\"./br\": \"6887\",\n\t\"./br.js\": \"6887\",\n\t\"./bs\": \"2554\",\n\t\"./bs.js\": \"2554\",\n\t\"./ca\": \"d716\",\n\t\"./ca.js\": \"d716\",\n\t\"./cs\": \"3c0d\",\n\t\"./cs.js\": \"3c0d\",\n\t\"./cv\": \"03ec\",\n\t\"./cv.js\": \"03ec\",\n\t\"./cy\": \"9797\",\n\t\"./cy.js\": \"9797\",\n\t\"./da\": \"0f14\",\n\t\"./da.js\": \"0f14\",\n\t\"./de\": \"b469\",\n\t\"./de-at\": \"b3eb\",\n\t\"./de-at.js\": \"b3eb\",\n\t\"./de-ch\": \"bb71\",\n\t\"./de-ch.js\": \"bb71\",\n\t\"./de.js\": \"b469\",\n\t\"./dv\": \"598a\",\n\t\"./dv.js\": \"598a\",\n\t\"./el\": \"8d47\",\n\t\"./el.js\": \"8d47\",\n\t\"./en-SG\": \"cdab\",\n\t\"./en-SG.js\": \"cdab\",\n\t\"./en-au\": \"0e6b\",\n\t\"./en-au.js\": \"0e6b\",\n\t\"./en-ca\": \"3886\",\n\t\"./en-ca.js\": \"3886\",\n\t\"./en-gb\": \"39a6\",\n\t\"./en-gb.js\": \"39a6\",\n\t\"./en-ie\": \"e1d3\",\n\t\"./en-ie.js\": \"e1d3\",\n\t\"./en-il\": \"73332\",\n\t\"./en-il.js\": \"73332\",\n\t\"./en-nz\": \"6f50\",\n\t\"./en-nz.js\": \"6f50\",\n\t\"./eo\": \"65db\",\n\t\"./eo.js\": \"65db\",\n\t\"./es\": \"898b\",\n\t\"./es-do\": \"0a3c\",\n\t\"./es-do.js\": \"0a3c\",\n\t\"./es-us\": \"55c9\",\n\t\"./es-us.js\": \"55c9\",\n\t\"./es.js\": \"898b\",\n\t\"./et\": \"ec18\",\n\t\"./et.js\": \"ec18\",\n\t\"./eu\": \"0ff2\",\n\t\"./eu.js\": \"0ff2\",\n\t\"./fa\": \"8df4\",\n\t\"./fa.js\": \"8df4\",\n\t\"./fi\": \"81e9\",\n\t\"./fi.js\": \"81e9\",\n\t\"./fo\": \"0721\",\n\t\"./fo.js\": \"0721\",\n\t\"./fr\": \"9f26\",\n\t\"./fr-ca\": \"d9f8\",\n\t\"./fr-ca.js\": \"d9f8\",\n\t\"./fr-ch\": \"0e49\",\n\t\"./fr-ch.js\": \"0e49\",\n\t\"./fr.js\": \"9f26\",\n\t\"./fy\": \"7118\",\n\t\"./fy.js\": \"7118\",\n\t\"./ga\": \"5120\",\n\t\"./ga.js\": \"5120\",\n\t\"./gd\": \"f6b4\",\n\t\"./gd.js\": \"f6b4\",\n\t\"./gl\": \"8840\",\n\t\"./gl.js\": \"8840\",\n\t\"./gom-latn\": \"0caa\",\n\t\"./gom-latn.js\": \"0caa\",\n\t\"./gu\": \"e0c5\",\n\t\"./gu.js\": \"e0c5\",\n\t\"./he\": \"c7aa\",\n\t\"./he.js\": \"c7aa\",\n\t\"./hi\": \"dc4d\",\n\t\"./hi.js\": \"dc4d\",\n\t\"./hr\": \"4ba9\",\n\t\"./hr.js\": \"4ba9\",\n\t\"./hu\": \"5b14\",\n\t\"./hu.js\": \"5b14\",\n\t\"./hy-am\": \"d6b6\",\n\t\"./hy-am.js\": \"d6b6\",\n\t\"./id\": \"5038\",\n\t\"./id.js\": \"5038\",\n\t\"./is\": \"0558\",\n\t\"./is.js\": \"0558\",\n\t\"./it\": \"6e98\",\n\t\"./it-ch\": \"6f12\",\n\t\"./it-ch.js\": \"6f12\",\n\t\"./it.js\": \"6e98\",\n\t\"./ja\": \"079e\",\n\t\"./ja.js\": \"079e\",\n\t\"./jv\": \"b540\",\n\t\"./jv.js\": \"b540\",\n\t\"./ka\": \"201b\",\n\t\"./ka.js\": \"201b\",\n\t\"./kk\": \"6d79\",\n\t\"./kk.js\": \"6d79\",\n\t\"./km\": \"e81d\",\n\t\"./km.js\": \"e81d\",\n\t\"./kn\": \"3e92\",\n\t\"./kn.js\": \"3e92\",\n\t\"./ko\": \"22f8\",\n\t\"./ko.js\": \"22f8\",\n\t\"./ku\": \"2421\",\n\t\"./ku.js\": \"2421\",\n\t\"./ky\": \"9609\",\n\t\"./ky.js\": \"9609\",\n\t\"./lb\": \"440c\",\n\t\"./lb.js\": \"440c\",\n\t\"./lo\": \"b29d\",\n\t\"./lo.js\": \"b29d\",\n\t\"./lt\": \"26f9\",\n\t\"./lt.js\": \"26f9\",\n\t\"./lv\": \"b97c\",\n\t\"./lv.js\": \"b97c\",\n\t\"./me\": \"293c\",\n\t\"./me.js\": \"293c\",\n\t\"./mi\": \"688b\",\n\t\"./mi.js\": \"688b\",\n\t\"./mk\": \"6909\",\n\t\"./mk.js\": \"6909\",\n\t\"./ml\": \"02fb\",\n\t\"./ml.js\": \"02fb\",\n\t\"./mn\": \"958b\",\n\t\"./mn.js\": \"958b\",\n\t\"./mr\": \"39bd\",\n\t\"./mr.js\": \"39bd\",\n\t\"./ms\": \"ebe4\",\n\t\"./ms-my\": \"6403\",\n\t\"./ms-my.js\": \"6403\",\n\t\"./ms.js\": \"ebe4\",\n\t\"./mt\": \"1b45\",\n\t\"./mt.js\": \"1b45\",\n\t\"./my\": \"8689\",\n\t\"./my.js\": \"8689\",\n\t\"./nb\": \"6ce3\",\n\t\"./nb.js\": \"6ce3\",\n\t\"./ne\": \"3a39\",\n\t\"./ne.js\": \"3a39\",\n\t\"./nl\": \"facd\",\n\t\"./nl-be\": \"db29\",\n\t\"./nl-be.js\": \"db29\",\n\t\"./nl.js\": \"facd\",\n\t\"./nn\": \"b84c\",\n\t\"./nn.js\": \"b84c\",\n\t\"./pa-in\": \"f3ff\",\n\t\"./pa-in.js\": \"f3ff\",\n\t\"./pl\": \"8d57\",\n\t\"./pl.js\": \"8d57\",\n\t\"./pt\": \"f260\",\n\t\"./pt-br\": \"d2d4\",\n\t\"./pt-br.js\": \"d2d4\",\n\t\"./pt.js\": \"f260\",\n\t\"./ro\": \"972c\",\n\t\"./ro.js\": \"972c\",\n\t\"./ru\": \"957c\",\n\t\"./ru.js\": \"957c\",\n\t\"./sd\": \"6784\",\n\t\"./sd.js\": \"6784\",\n\t\"./se\": \"ffff\",\n\t\"./se.js\": \"ffff\",\n\t\"./si\": \"eda5\",\n\t\"./si.js\": \"eda5\",\n\t\"./sk\": \"7be6\",\n\t\"./sk.js\": \"7be6\",\n\t\"./sl\": \"8155\",\n\t\"./sl.js\": \"8155\",\n\t\"./sq\": \"c8f3\",\n\t\"./sq.js\": \"c8f3\",\n\t\"./sr\": \"cf1e\",\n\t\"./sr-cyrl\": \"13e9\",\n\t\"./sr-cyrl.js\": \"13e9\",\n\t\"./sr.js\": \"cf1e\",\n\t\"./ss\": \"52bd\",\n\t\"./ss.js\": \"52bd\",\n\t\"./sv\": \"5fbd\",\n\t\"./sv.js\": \"5fbd\",\n\t\"./sw\": \"74dc\",\n\t\"./sw.js\": \"74dc\",\n\t\"./ta\": \"3de5\",\n\t\"./ta.js\": \"3de5\",\n\t\"./te\": \"5cbb\",\n\t\"./te.js\": \"5cbb\",\n\t\"./tet\": \"576c\",\n\t\"./tet.js\": \"576c\",\n\t\"./tg\": \"3b1b\",\n\t\"./tg.js\": \"3b1b\",\n\t\"./th\": \"10e8\",\n\t\"./th.js\": \"10e8\",\n\t\"./tl-ph\": \"0f38\",\n\t\"./tl-ph.js\": \"0f38\",\n\t\"./tlh\": \"cf75\",\n\t\"./tlh.js\": \"cf75\",\n\t\"./tr\": \"0e81\",\n\t\"./tr.js\": \"0e81\",\n\t\"./tzl\": \"cf51\",\n\t\"./tzl.js\": \"cf51\",\n\t\"./tzm\": \"c109\",\n\t\"./tzm-latn\": \"b53d\",\n\t\"./tzm-latn.js\": \"b53d\",\n\t\"./tzm.js\": \"c109\",\n\t\"./ug-cn\": \"6117\",\n\t\"./ug-cn.js\": \"6117\",\n\t\"./uk\": \"ada2\",\n\t\"./uk.js\": \"ada2\",\n\t\"./ur\": \"5294\",\n\t\"./ur.js\": \"5294\",\n\t\"./uz\": \"2e8c\",\n\t\"./uz-latn\": \"010e\",\n\t\"./uz-latn.js\": \"010e\",\n\t\"./uz.js\": \"2e8c\",\n\t\"./vi\": \"2921\",\n\t\"./vi.js\": \"2921\",\n\t\"./x-pseudo\": \"fd7e\",\n\t\"./x-pseudo.js\": \"fd7e\",\n\t\"./yo\": \"7f33\",\n\t\"./yo.js\": \"7f33\",\n\t\"./zh-cn\": \"5c3a\",\n\t\"./zh-cn.js\": \"5c3a\",\n\t\"./zh-hk\": \"49ab\",\n\t\"./zh-hk.js\": \"49ab\",\n\t\"./zh-tw\": \"90ea\",\n\t\"./zh-tw.js\": \"90ea\"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tvar id = map[req];\n\tif(!(id + 1)) { // check for number or string\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn id;\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = \"4678\";","import mod from \"-!../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=style&index=0&lang=scss&\"; export default mod; export * from \"-!../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=style&index=0&lang=scss&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PeriodLockForm.vue?vue&type=style&index=0&id=43d8f5ea&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PeriodLockForm.vue?vue&type=style&index=0&id=43d8f5ea&lang=scss&scoped=true&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CommentSidebar.vue?vue&type=style&index=0&id=2f11083c&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CommentSidebar.vue?vue&type=style&index=0&id=2f11083c&lang=scss&scoped=true&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FACopyOptionsRPCard.vue?vue&type=style&index=0&id=6bd7b523&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FACopyOptionsRPCard.vue?vue&type=style&index=0&id=6bd7b523&lang=scss&scoped=true&\"","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CommentActivityCard.vue?vue&type=style&index=0&id=8347cd1a&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CommentActivityCard.vue?vue&type=style&index=0&id=8347cd1a&lang=scss&scoped=true&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FACopyConfiguration.vue?vue&type=style&index=0&lang=scss&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FACopyConfiguration.vue?vue&type=style&index=0&lang=scss&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Calculator.vue?vue&type=style&index=0&id=60030170&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Calculator.vue?vue&type=style&index=0&id=60030170&lang=scss&scoped=true&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReviewSection.vue?vue&type=style&index=0&id=41928d4e&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReviewSection.vue?vue&type=style&index=0&id=41928d4e&lang=scss&scoped=true&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorRow.vue?vue&type=style&index=0&id=5dcb78d3&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorRow.vue?vue&type=style&index=0&id=5dcb78d3&lang=scss&scoped=true&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ProfileSelector.vue?vue&type=style&index=0&id=7a88b43a&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ProfileSelector.vue?vue&type=style&index=0&id=7a88b43a&lang=scss&scoped=true&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorOutput.vue?vue&type=style&index=0&lang=scss&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorOutput.vue?vue&type=style&index=0&lang=scss&\"","import mod from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./EditTaxpayer.vue?vue&type=style&index=0&id=43947c58&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./EditTaxpayer.vue?vue&type=style&index=0&id=43947c58&lang=scss&scoped=true&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorSchedule.vue?vue&type=style&index=0&lang=scss&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorSchedule.vue?vue&type=style&index=0&lang=scss&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CommentSection.vue?vue&type=style&index=0&id=10fb10a6&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CommentSection.vue?vue&type=style&index=0&id=10fb10a6&lang=scss&scoped=true&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FALockdown.vue?vue&type=style&index=0&id=5ea30138&scoped=true&lang=css&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FALockdown.vue?vue&type=style&index=0&id=5ea30138&scoped=true&lang=css&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FANavigationSidebar.vue?vue&type=style&index=0&id=4a38bcae&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FANavigationSidebar.vue?vue&type=style&index=0&id=4a38bcae&lang=scss&scoped=true&\"","import mod from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Navigation.vue?vue&type=style&index=0&id=416c5143&scoped=true&lang=css&\"; export default mod; export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../node_modules/css-loader/index.js??ref--6-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Navigation.vue?vue&type=style&index=0&id=416c5143&scoped=true&lang=css&\"","import mod from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FitrSchedule.vue?vue&type=style&index=0&lang=scss&\"; export default mod; export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FitrSchedule.vue?vue&type=style&index=0&lang=scss&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorSection.vue?vue&type=style&index=0&id=bead8878&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorSection.vue?vue&type=style&index=0&id=bead8878&lang=scss&scoped=true&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"app\"}},[_c('Navigation'),_c('b-container',[_c('IdleAlert')],1),_c('transition',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[_c('router-view',{attrs:{\"id\":\"router-view\"},scopedSlots:_vm._u([{key:\"breadcrumbs\",fn:function(slotProps){return [_c('Breadcrumbs',{attrs:{\"activeTaxpayer\":slotProps.activeTaxpayer,\"activeForeignAffiliate\":slotProps.activeForeignAffiliate}})]}}])})],1),_c('footer',[_c('Disclaimer')],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-navbar',{attrs:{\"toggleable\":\"lg\",\"type\":\"primary\",\"variant\":\"light\"}},[_c('b-navbar-brand',{attrs:{\"to\":{\n name: 'home',\n },\"data-cy\":\"home-button\"}},[_c('img',{staticClass:\"logo\",attrs:{\"src\":require(\"../assets/logo.png\"),\"id\":\"kpmg_logo\",\"alt\":\"\"}})]),_c('b-navbar-toggle',{attrs:{\"target\":\"nav-collapse\"}},[_c('font-awesome-icon',{staticClass:\"text-muted\",attrs:{\"icon\":\"bars\"}})],1),_c('b-collapse',{attrs:{\"id\":\"nav-collapse\",\"is-nav\":\"\"}},[(_vm.isAuthenticated)?_c('b-navbar-nav',[_c('b-nav-item',{attrs:{\"href\":\"#\",\"to\":\"/\"}},[_vm._v(\"Home\")])],1):_vm._e(),_c('b-navbar-nav',{staticClass:\"ml-auto\"},[(_vm.isAuthenticated && _vm.isKIU)?_c('b-nav-item',{attrs:{\"href\":\"#\"}},[_c('b-button',{attrs:{\"variant\":\"outline-secondary\",\"size\":\"sm\"},on:{\"click\":_vm.toggleStaff}},[_vm._v(_vm._s(!_vm.isClient ? \"Client View\" : \"Staff View\"))])],1):_vm._e(),(_vm.isAuthenticated)?_c('b-nav-item-dropdown',{attrs:{\"right\":\"\",\"data-cy\":\"user-dropdown\"},scopedSlots:_vm._u([{key:\"button-content\",fn:function(){return [_c('span',{staticClass:\"text-primary\"},[_vm._v(_vm._s(_vm.name || \"User\"))])]},proxy:true}],null,false,3116318517)},[_c('b-dropdown-item',{attrs:{\"href\":\"#\",\"to\":\"/profile\"}},[_vm._v(\"Profile\")]),_c('b-dropdown-item',{attrs:{\"href\":\"#\",\"data-cy\":\"logout-button\",\"to\":\"/login\"},on:{\"click\":function($event){$event.preventDefault();return _vm.handleOnClick($event)}}},[_vm._v(\"Sign Out\")])],1):_vm._e()],1)],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { Vue, Component } from \"vue-property-decorator\"\r\nimport { Action, Getter } from \"vuex-class\"\r\n// Project imports\r\nconst namespace: string = \"user\"\r\n\r\n@Component\r\nexport default class UserMixin extends Vue {\r\n // Actions\r\n @Action(\"setIsAuthenticated\", { namespace })\r\n protected setIsAuthenticated: any\r\n @Action(\"setUserData\", { namespace })\r\n protected setUserData: any\r\n @Action(\"setIsAuthenticated\", { namespace })\r\n protected checkIsAuthenticated: any\r\n @Action(\"logout\", { namespace })\r\n protected logout: any\r\n @Action(\"login\", { namespace })\r\n protected login: any\r\n @Action(\"verify\", { namespace })\r\n protected verify: any\r\n @Action(\"changePassword\", { namespace })\r\n protected changePassword: any\r\n @Action(\"toggleStaff\", { namespace })\r\n protected toggleStaff: any\r\n @Action(\"getAllUsers\", { namespace })\r\n protected getAllUsers: any\r\n @Action(\"resetPassword\", { namespace })\r\n protected resetPassword: any\r\n @Action(\"requestPasswordReset\", { namespace })\r\n protected requestPasswordReset: any\r\n @Action(\"validateToken\", { namespace })\r\n protected validateToken: any\r\n // Getters\r\n @Getter(\"name\", { namespace })\r\n protected name!: string\r\n @Getter(\"user\", { namespace })\r\n protected user!: any\r\n @Getter(\"isAuthenticated\", { namespace })\r\n protected isAuthenticated!: boolean\r\n @Getter(\"isClient\", { namespace })\r\n protected isClient!: boolean\r\n @Getter(\"isKIU\", { namespace })\r\n protected isKIU!: boolean\r\n}\r\n","import { Vue } from \"vue-property-decorator\"\r\nimport Component from \"vue-class-component\"\r\n\r\n@Component\r\nexport default class EnvMixin extends Vue {\r\n public getEnv(variable: string) {\r\n return process.env[variable]\r\n }\r\n}\r\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\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\n\r\nimport { Vue, Component, Mixins } from \"vue-property-decorator\"\r\nimport UserMixin from \"../mixins/UserMixin\"\r\nimport EnvMixin from \"../mixins/EnvMixin\"\r\n\r\n@Component\r\nexport default class Navigation extends Mixins(UserMixin, EnvMixin) {\r\n public get name() {\r\n return this.$store.getters[\"user/name\"]\r\n }\r\n\r\n public get isAuthenticated() {\r\n return this.$store.state.user.isAuthenticated\r\n }\r\n\r\n public handleOnClick(e: any) {\r\n e.preventDefault()\r\n this.$store.dispatch(\"user/logout\")\r\n }\r\n}\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Navigation.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Navigation.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Navigation.vue?vue&type=template&id=416c5143&scoped=true&\"\nimport script from \"./Navigation.vue?vue&type=script&lang=ts&\"\nexport * from \"./Navigation.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./Navigation.vue?vue&type=style&index=0&id=416c5143&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"416c5143\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-row',[_c('b-col',[_c('b-breadcrumb',{attrs:{\"items\":_vm.items}})],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","export const TOKEN_NAME = \"surplus_token\"\r\n\r\nexport const getToken = () => localStorage.getItem(TOKEN_NAME)\r\n\r\nexport const setToken = (value: string) =>\r\n localStorage.setItem(TOKEN_NAME, value)\r\n\r\nexport const deleteToken = () => localStorage.removeItem(TOKEN_NAME)\r\n","// tslint:disable\r\nconst fields: any = {\r\n OPENING: {\r\n name: \"OPENING BALANCES\",\r\n showClient: false,\r\n complexCopySettings: {\r\n show: false,\r\n },\r\n subGroups: {\r\n balances: {\r\n name: \"BALANCES\",\r\n fields: {\r\n exemptBalance: {\r\n name: \"Exempt surplus/(deficit)\",\r\n type: \"opening\",\r\n },\r\n hybridBalance: {\r\n name: \"Hybrid surplus/(deficit)\",\r\n type: \"opening\",\r\n },\r\n taxableBalance: {\r\n name: \"Taxable surplus/(deficit)\",\r\n type: \"opening\",\r\n },\r\n hutBalance: {\r\n name: \"Hybrid underlying tax (HUT)\",\r\n type: \"opening\",\r\n },\r\n uftBalance: {\r\n name: \"Underlying foreign tax (UFT)\",\r\n type: \"opening\",\r\n },\r\n opening_sep: {\r\n name: \"Surplus entitlement percentage (SEP)\",\r\n type: \"opening\",\r\n },\r\n acbBalance: {\r\n name: \"Adjusted Cost Base (ACB)\",\r\n type: \"opening\",\r\n },\r\n },\r\n },\r\n },\r\n },\r\n A: {\r\n name: \"SURPLUS ENTITLEMENT PERCENTAGE (SEP)\",\r\n required: [\"sep_changes\"],\r\n description: \"\",\r\n complexCopySettings: {\r\n show: true,\r\n entireSection: true,\r\n },\r\n optionField: [\r\n {\r\n label: \"New Percentage\",\r\n meta_id: \"amount\",\r\n },\r\n {\r\n label: \"Working Paper Reference\",\r\n meta_id: \"client_ref\",\r\n },\r\n {\r\n label: \"Working Paper Reference - KPMG\",\r\n meta_id: \"ref\",\r\n },\r\n ],\r\n subGroups: {\r\n A1: {\r\n name: \"\",\r\n desc: \"\",\r\n fields: {\r\n sep_adjustments: {\r\n name: \"SEP adjustment(s)\",\r\n type: \"schedule\",\r\n },\r\n },\r\n altName: \"SEP adjustment(s)\",\r\n },\r\n },\r\n },\r\n B: {\r\n name: \"ACCOUNTING RETAINED EARNINGS/(DEFICIT)\",\r\n description: \"Retained earnings or deficit\",\r\n complexCopySettings: {\r\n show: true,\r\n entireSection: true,\r\n },\r\n subGroups: {\r\n C0: {\r\n name: \"\",\r\n desc: \"\",\r\n fields: {\r\n openingReDeficit: {\r\n name: \"Opening retained earnings/(deficit)\",\r\n desc: \"\",\r\n type: \"opening\",\r\n },\r\n },\r\n },\r\n C1: {\r\n name: \"BOOK INCOME/(LOSS) AFTER TAXES\",\r\n desc: \"\",\r\n zeroToggle: true,\r\n fields: {\r\n book_income_before_taxes: {\r\n name: \"Book income/(loss) before taxes\",\r\n desc: \"\",\r\n type: \"input\",\r\n },\r\n deferred_income_taxes: {\r\n name: \"Deferred income tax expense\",\r\n desc: \"\",\r\n type: \"input\",\r\n },\r\n current_income_taxes: {\r\n name: \"Current income tax expense\",\r\n desc: \"\",\r\n type: \"input\",\r\n },\r\n },\r\n subtotal: true,\r\n },\r\n C2: {\r\n name: \"OTHER ITEMS\",\r\n desc: \"\",\r\n zeroToggle: true,\r\n fields: {\r\n dividends_declared: {\r\n name: \"Dividend(s) declared (-)\",\r\n desc: \"\",\r\n sign: \"-\",\r\n type: \"input\",\r\n },\r\n currency_adjustments: {\r\n name: \"Currency adjustment(s) (+/-)\",\r\n desc: \"\",\r\n type: \"input\",\r\n },\r\n prior_year_adjustments: {\r\n name: \"Prior year adjustment(s) (+/-)\",\r\n desc: \"\",\r\n type: \"input\",\r\n },\r\n other_items_affecting_re: {\r\n name: \"Other items affecting retained earnings\",\r\n desc: \"\",\r\n type: \"schedule\",\r\n },\r\n },\r\n subtotal: true,\r\n },\r\n C3: {\r\n name: \"\",\r\n desc: \"\",\r\n fields: {\r\n closing_re: {\r\n name: \"Closing retained earnings/(deficit)\",\r\n type: \"calculated\",\r\n },\r\n },\r\n },\r\n C4: {\r\n name: \"CURRENT YEAR DIFFERENCE - BOOK v. TAXABLE INCOME/(LOSS)\",\r\n desc: \"\",\r\n fields: {\r\n cy_difference_reconciliation: {\r\n name: \"Reconciliation adjustment(s)\",\r\n desc: \"\",\r\n type: \"schedule\",\r\n },\r\n remaining_unreconciled_total: {\r\n name: \"Unreconciled difference(s) – book v. taxable income/(loss)\",\r\n desc: \"\",\r\n type: \"calculated\",\r\n },\r\n },\r\n },\r\n },\r\n },\r\n C: {\r\n name: \"EARNINGS FROM ACTIVE BUSINESS OF A FOREIGN AFFILIATE\",\r\n description: \"\",\r\n complexCopySettings: {\r\n show: true,\r\n entireSection: false,\r\n },\r\n optionField: [\r\n {\r\n label: \"Amount\",\r\n meta_id: \"value\",\r\n },\r\n {\r\n label: \"Description\",\r\n meta_id: \"client_description\",\r\n },\r\n {\r\n label: \"Working Paper Reference\",\r\n meta_id: \"client_ref\",\r\n },\r\n {\r\n label: \"Description - KPMG\",\r\n meta_id: \"description\",\r\n },\r\n {\r\n label: \"Working Paper Reference - KPMG\",\r\n meta_id: \"ref\",\r\n },\r\n ],\r\n subGroups: {\r\n D0: {\r\n name: \"\",\r\n desc: \"\",\r\n fields: {\r\n taxable_income_per_foreign_tax_return: {\r\n name: \"Taxable income/(loss) per foreign tax return\",\r\n desc: `The starting point to the calculation of surplus pools is to determine the earnings of a foreign affiliate from an active business. Earnings is defined in subsection 5907(1) of the Regulations to include income or profits from an active business carried on by the FA in a country. Active Business is defined in subsection 95(1) to mean any business carried on by the FA other than (a) an investment business and (b) a business deemed by suection 95(2) to be a busienss other than an active business carried on by the FA.\r\n\r\n Carrying on Business in a Country - Regulation 5906\r\n \r\n Regulation 5906 provides deeming rules to determine whether an FA is carrying on a business in a particular country. For a country other than Canada, a business is deemed to be carried on in a country only to the extent that such business is carried on through a permanent establishment. Permanent establishment is defined by the meaning given that expression in the tax treaty that Canada has with that particular country or in subsection 400(2) of the Regulations if Canada does not have a tax treaty with the particular country. An active business is deemed to be carried on in Canada only to the extent that such income is taxed under Part I of the Act.`,\r\n type: \"schedule\",\r\n },\r\n },\r\n complexCopySettings: {\r\n show: true,\r\n entireSection: true,\r\n },\r\n altName: \"TAXABLE INCOME/(LOSS) PER FOREIGN TAX RETURN\",\r\n },\r\n D1: {\r\n name:\r\n \"ADJUSTMENTS FOR ITEMS THAT ARE NOT INCLUDED IN EARNINGS OR ARE NIL\",\r\n desc: \"\",\r\n zeroToggle: true,\r\n fields: {\r\n dividends_from_other_fas: {\r\n sign: \"-\",\r\n name:\r\n \"Dividend(s) from another foreign affiliate included in taxable income (-)\",\r\n desc: \"\",\r\n type: \"schedule\",\r\n },\r\n income_of_other_companies: {\r\n name: \"(Income)/loss of other companies included above\",\r\n desc: \"\",\r\n type: \"schedule\",\r\n },\r\n foreign_imputed_income: {\r\n sign: \"-\",\r\n name: \"Foreign imputed income (-)\",\r\n type: \"schedule\",\r\n },\r\n other_adjustments_not_earnings_nil: {\r\n name: \"Other adjustment(s)\",\r\n type: \"schedule\",\r\n },\r\n },\r\n subtotal: true,\r\n },\r\n D2: {\r\n name: \"ADDITIONS (+)\",\r\n desc: \"\",\r\n zeroToggle: true,\r\n fields: {\r\n income_tax_deducted_from_earnings: {\r\n name: \"Income/profits tax deducted from earnings\",\r\n desc: `Reg 5907(2)(a) - Add back any income or profits tax paid by the affiliate that was deducted in computing the \"earnings\" of the affiliate.`,\r\n sign: \"+\",\r\n type: \"schedule\",\r\n },\r\n deductions_claimed_for_tax: {\r\n sign: \"+\",\r\n name:\r\n \"Deduction(s) claimed for tax in excess of actual expenditure\",\r\n desc: `5907(2)(b) - if established by the taxpayer, the amount by which any amount so deducted in respect of an expenditure made by the affiliate exceeds the amount by which:\r\n\r\n (i) the amount of the expenditure\r\n \r\n exceeds \r\n \r\n (ii) the aggregate of all other deductions in respect of that expenditure made by the affiliate in computing the earnings amounts for precedigint taxation years.\r\n \r\n In other words, if your cumulative deductions exceed the actual expenditure, add back the difference to \"earnings\" (up to the current year deduction claimed).`,\r\n type: \"schedule\",\r\n },\r\n losses_from_non_abi_or_property: {\r\n sign: \"+\",\r\n\r\n name: \"Losses from non-active business income or property (FAPL)\",\r\n desc: `Reg 5907(2)(c) - Add back any loss from property and businesses (other than active business) as referred to in description D in the definition of FAPI in subsection 95(1).`,\r\n type: \"schedule\",\r\n },\r\n capital_loss_deducted: {\r\n sign: \"+\",\r\n\r\n name: \"Capital loss(es) deducted\",\r\n desc: `Reg 5907(2)(d) - Add back any capital loss of the foreign affiliate in respect of capital property so deducted from \"earnings\". \"Capital property\", for these purposes, includes all the property of the affiliate other than property referred to in subparagraph 39(1)(b)(i) or (ii) on the assumption for this purpose that the affiliate is a corporation resident in Canada.`,\r\n type: \"schedule\",\r\n },\r\n losses_deducted_from_prior: {\r\n sign: \"+\",\r\n\r\n name: \"Loss(es) deducted from prior or subsequent year\",\r\n desc: `Reg 5907(2)(e) - Add back any loss of the affiliate for a preceding or a subsequent taxation year so deducted from current year \"earnings\".`,\r\n type: \"schedule\",\r\n },\r\n income_not_included: {\r\n sign: \"+\",\r\n\r\n name: \"Revenue/income earned but not included\",\r\n desc:\r\n \"Reg 5907(2)(f) - Any revenue, income or profits earned but not required to be included in computing earnings for any taxation year by the income tax law that is relevent. Provision excludes paragraph (f.1), (h) and (i).\",\r\n type: \"schedule\",\r\n },\r\n government_assistance_not_taxed: {\r\n sign: \"+\",\r\n\r\n name: \"Government assistance not taxed\",\r\n desc:\r\n \"Reg 5907(2)(f.1) - Add back any government assistance received or became entitled to receive in the year and was not required to be included in computing the earnings. Do not include any assistance that would reduce the amount of an expenditure for purposes of computing the earnings for any taxation year.\",\r\n type: \"schedule\",\r\n },\r\n },\r\n subtotal: true,\r\n },\r\n D3: {\r\n name: \"DEDUCTIONS (-)\",\r\n desc: \"\",\r\n zeroToggle: true,\r\n fields: {\r\n income_tax_refunded_and_included_in_earnings: {\r\n name: \"Income or profits tax refunded and included in earnings\",\r\n desc: `Reg 5907(g) - Deduct any income or profits tax refunded that was included in \"earnings\"`,\r\n type: \"schedule\",\r\n sign: \"-\",\r\n },\r\n capital_gain_included: {\r\n sign: \"-\",\r\n name: \"Capital gain(s) included\",\r\n desc: `Reg 5907(2)(h) - Deduct any capital gain of the foreign affiliate in respect of capital property included in \"earnings\". \"Capital property\", for these purposes, includes all the property of the affiliate other than property referred to in subparagraph 39(1)(a)(i) to (iv) on the assumption for this purpose that the affiliate is a corporation resident in Canada.`,\r\n type: \"schedule\",\r\n },\r\n fapi_included_in_earnings: {\r\n sign: \"-\",\r\n name: \"FAPI of the affiliate included in earnings\",\r\n desc: `Reg 5907(2)(i) - Deduct any amount that is included in the FAPI of the affiliate and included in the earnings calculation.`,\r\n type: \"schedule\",\r\n },\r\n expenses_deducated_for_book: {\r\n sign: \"-\",\r\n name:\r\n \"Expenses deducted for book but not for tax (permanent difference)\",\r\n desc:\r\n \"Reg 5907(2)(j) - Deduct any loss, outlay or expense incurred if not permitted to be deducted in computing earnings or if it can reasonably relate to any revenue added to earnings under paragraph (f). See provision for additional details.\",\r\n type: \"schedule\",\r\n },\r\n government_assistance_repaid: {\r\n sign: \"-\",\r\n name: \"Government assistance repaid\",\r\n desc:\r\n \"Reg 5907(2)(k) - Deduct any government assistance (as described in paragraph (f.1)) repaid.\",\r\n type: \"schedule\",\r\n },\r\n sale_of_property_from_other_fa: {\r\n sign: \"-\",\r\n name: \"Sale of property acquired from another foreign affiliate\",\r\n desc:\r\n \"Reg 5907(2)(l) - Where any property is acquired from another FA of taxpayer or an FA of a taxpayer dealing NAL, and such amount was included in earnings by virtue of paragraph (f) of any FA of the taxpayer or taxpayer NAL.\",\r\n type: \"schedule\",\r\n },\r\n },\r\n subtotal: true,\r\n },\r\n D4: {\r\n name: \"REG. 5907(2.1) - DEPRECIATION ELECTION\",\r\n desc: \"\",\r\n zeroToggle: true,\r\n\r\n fields: {\r\n depreciation_for_tax_purposes: {\r\n name: \"Depreciation for tax purposes\",\r\n desc: \"Enter as positive amount.\",\r\n type: \"schedule\",\r\n },\r\n depreciation_per_financial_statement: {\r\n name: \"Depreciation per financial statements\",\r\n desc:\r\n \"Enter a positive amount for an add-back and a negative amount for a deduction.\",\r\n type: \"schedule\",\r\n },\r\n cumulative_reg_5907_prior_year: {\r\n name: \"Cumulative Reg. 5907(2.1) adjustment (prior years) (+/-)\",\r\n desc: `If you have made the depreciation election, any time you dispose of capital property or foreign resource property, you have to reverse the effects of this election for all preceding taxation years as it relates to the property being disposed.`,\r\n type: \"schedule\",\r\n },\r\n cumulative_reg_5907_property_disposal: {\r\n name:\r\n \"Reg 5907(2.1)(c) adjustment for disposition of capital property (+/-)\",\r\n desc: `If you have made the depreciation election, any time you dispose of capital property or foreign resource property, you have to reverse the effects of this election for all preceding taxation years as it relates to the property being disposed`,\r\n type: \"schedule\",\r\n },\r\n },\r\n subtotal: true,\r\n },\r\n D5: {\r\n name: \"RECHARACTERIZED (INCOME)/LOSS\",\r\n desc: \"\",\r\n fields: {\r\n income_recharacterized_foreign_tax_rules: {\r\n name: \"(Income)/loss that would be recharacterized\",\r\n desc: \"\",\r\n type: \"schedule\",\r\n },\r\n },\r\n },\r\n },\r\n },\r\n D: {\r\n name: \"INCOME/(LOSS) COMPUTED USING CANADIAN TAX RULES\",\r\n complexCopySettings: {\r\n show: true,\r\n entireSection: false,\r\n },\r\n subGroups: {\r\n E0: {\r\n name: \"ACTIVE EARNINGS CALCULATED USING CANADIAN TAX RULES\",\r\n desc: \"\",\r\n complexCopySettings: {\r\n entireSection: true,\r\n },\r\n optionField: [\r\n {\r\n label: \"Amount\",\r\n meta_id: \"value\",\r\n },\r\n {\r\n label: \"Description\",\r\n meta_id: \"client_description\",\r\n },\r\n {\r\n label: \"Description - KPMG\",\r\n meta_id: \"description\",\r\n },\r\n {\r\n label: \"Working Paper Reference\",\r\n meta_id: \"client_ref\",\r\n },\r\n {\r\n label: \"Working Paper Reference - KPMG\",\r\n meta_id: \"ref\",\r\n },\r\n ],\r\n fields: {\r\n ctr_amounts_increase_exempt: {\r\n name: \"Exempt earnings per Canadian tax rules\",\r\n desc: \"\",\r\n type: \"schedule\",\r\n },\r\n ctr_amounts_increase_taxable: {\r\n name: \"Taxable earnings per Canadian tax rules\",\r\n desc: \"\",\r\n type: \"schedule\",\r\n },\r\n },\r\n subtotal: true,\r\n },\r\n E1: {\r\n name: \"PARAGRAPH 95(2)(a) ADJUSTMENTS\",\r\n desc: \"\",\r\n complexCopySettings: {\r\n entireSection: true,\r\n },\r\n optionField: [\r\n {\r\n label: \"Amount\",\r\n meta_id: \"value\",\r\n },\r\n {\r\n label: \"Description\",\r\n meta_id: \"client_description\",\r\n },\r\n {\r\n label: \"Description - KPMG\",\r\n meta_id: \"description\",\r\n },\r\n {\r\n label: \"Working Paper Reference\",\r\n meta_id: \"client_ref\",\r\n },\r\n {\r\n label: \"Working Paper Reference - KPMG\",\r\n meta_id: \"ref\",\r\n },\r\n ],\r\n fields: {\r\n \"952a_amounts_increase_exempt\": {\r\n name: \"Amounts that increase/decrease exempt earnings\",\r\n desc: \"\",\r\n type: \"schedule\",\r\n },\r\n \"952a_amounts_increase_taxable\": {\r\n name: \"Amounts that increase/decrease taxable earnings\",\r\n desc: \"\",\r\n type: \"schedule\",\r\n },\r\n },\r\n subtotal: true,\r\n },\r\n E2: {\r\n name: \"CAPITAL GAIN(S)/(LOSSES) FROM DISPOSITION OF:\",\r\n zeroToggle: true,\r\n\r\n desc:\r\n \"For the following amounts, please enter the full amount of the capital gain(s)/(losses) computed under the basis of paragraph 95(2)(f) (i.e., computed under Canadian tax rules).\",\r\n complexCopySettings: {\r\n entireSection: true,\r\n },\r\n optionField: [\r\n {\r\n label: \"Amount\",\r\n meta_id: \"value\",\r\n },\r\n {\r\n label: \"Description\",\r\n meta_id: \"client_description\",\r\n },\r\n {\r\n label: \"Description - KPMG\",\r\n meta_id: \"description\",\r\n },\r\n {\r\n label: \"Working Paper Reference\",\r\n meta_id: \"client_ref\",\r\n },\r\n {\r\n label: \"Working Paper Reference - KPMG\",\r\n meta_id: \"ref\",\r\n },\r\n ],\r\n fields: {\r\n non_excluded_property_facl: {\r\n name: \"Non-excluded property\",\r\n desc:\r\n \"Description B and E to the definition of FAPI in subsection 95(1) requires you to generally include any taxable capital gain and deduct any allowable capital loss respectively from a disposition of non-excluded property.\",\r\n type: \"schedule\",\r\n },\r\n active_business_assets_non_dtc: {\r\n name: \"Active business assets - non-designated treaty country\",\r\n desc: `Enter the taxable capital gains/allowable capital loss of the affiliate realized from dispositions of property used or held by it principally for the purpose of gaining or producing income from an active business carried on by it in a country that is not a designated treaty country. See definition of \"net earnings\" in Reg 5907(1)(c)(i).`,\r\n type: \"schedule\",\r\n },\r\n active_business_assets_dtc: {\r\n name: \"Active business assets - designated treaty country\",\r\n desc:\r\n \"Enter all other taxable capital gains/(losses) from excluded property not included in above cells.\",\r\n type: \"schedule\",\r\n },\r\n other_excluded_property: {\r\n name: \"Other excluded property not described above\",\r\n desc: \"\",\r\n type: \"schedule\",\r\n },\r\n shares_of_fa_or_partnership_interest_before_hybrid: {\r\n name:\r\n \"Shares of another foreign affiliate/partnership interest - excluded property (before hybrid surplus application)\",\r\n desc:\r\n \"5907(1) definition of Hybrid Surplus applicable from August 20, 2011 in respect of non arm's length disposition of shares of another FA or certain partnership interest and from January 1, 2013 for arm's length disposition of shares of FA and partnership interest.\",\r\n type: \"schedule\",\r\n },\r\n },\r\n subtotal: true,\r\n },\r\n \"E2.1\": {\r\n name: \"\",\r\n desc: \"\",\r\n complexCopySettings: {\r\n entireSection: true,\r\n },\r\n fields: {\r\n capital_gain_inclusion_rate: {\r\n name: \"Capital gain inclusion rate\",\r\n desc: \"Enter as positive amount.\",\r\n precision: 2,\r\n type: \"input\",\r\n },\r\n },\r\n altName: \"Capital gain inclusion rate\",\r\n },\r\n \"E2.2\": {\r\n name: \"CAPITAL GAIN(S)/(LOSSES) FROM DISPOSITIONS - HYBRID SURPLUS\",\r\n desc: \"\",\r\n complexCopySettings: {\r\n entireSection: true,\r\n },\r\n optionField: [\r\n {\r\n label: \"Amount\",\r\n meta_id: \"value\",\r\n },\r\n {\r\n label: \"Taxes (paid)/refunded on Amount\",\r\n meta_id: \"tax_on_amount\",\r\n },\r\n {\r\n label: \"Working Paper Reference\",\r\n meta_id: \"client_ref\",\r\n },\r\n {\r\n label: \"Working Paper Reference - KPMG\",\r\n meta_id: \"ref\",\r\n },\r\n ],\r\n fields: {\r\n hybrid_disposition: {\r\n name: \"Disposition\",\r\n desc: \"\",\r\n type: \"schedule\",\r\n },\r\n },\r\n },\r\n E3: {\r\n name:\r\n \"FAPI/(FAPL) PER S. 95(1) (EXCLUDING CAPITAL GAIN(S)/(LOSS(ES)) AND BEFORE DEDUCTIBLE LOSS(ES))\",\r\n desc: \"\",\r\n optionField: [\r\n {\r\n label: \"Amount\",\r\n meta_id: \"value\",\r\n },\r\n {\r\n label: \"Description\",\r\n meta_id: \"client_description\",\r\n },\r\n {\r\n label: \"Description - KPMG\",\r\n meta_id: \"description\",\r\n },\r\n {\r\n label: \"Working Paper Reference\",\r\n meta_id: \"client_ref\",\r\n },\r\n {\r\n label: \"Working Paper Reference - KPMG\",\r\n meta_id: \"ref\",\r\n },\r\n ],\r\n complexCopySettings: {\r\n entireSection: true,\r\n },\r\n fields: {\r\n fapi_before_deductible_loss: {\r\n name: \"FAPI/(FAPL) items\",\r\n desc:\r\n \"In calculating FAPI or FAPL of the FA, consider the carve out in paragraph 95(2)(f.1) if the foreign affiliate was acquired in that taxation year.\",\r\n type: \"schedule\",\r\n },\r\n },\r\n },\r\n },\r\n },\r\n E: {\r\n name: \"INCOME OR PROFITS TAX (PAID)/REFUNDED\",\r\n complexCopySettings: {\r\n show: true,\r\n entireSection: false,\r\n },\r\n subGroups: {\r\n F1: {\r\n desc: \"\",\r\n fields: {\r\n fitr: {\r\n name: \"Foreign income tax (paid)/refunded\",\r\n desc: \"\",\r\n type: \"schedule\",\r\n },\r\n },\r\n altName: \"Foreign income tax (paid)/refunded\",\r\n altFields: {\r\n fitr_other_foreign_income_tax: {\r\n name:\r\n \"Other foreign income tax (paid)/refunded related to taxable income\",\r\n desc: \"\",\r\n type: \"input\",\r\n },\r\n fitr_foreign_active_earnings_before_reg5907: {\r\n name:\r\n \"Foreign active earnings/(loss) after Reg. 5907(2) adjustments\",\r\n desc: \"\",\r\n type: \"input\",\r\n },\r\n fitr_capital_gain_loss: {\r\n name: \"Capital Gains/(Losses) - Exempt\",\r\n desc: \"\",\r\n type: \"input\",\r\n },\r\n fitr_capital_gain_loss_taxable: {\r\n name: \"Capital Gains/(Losses) - Taxable\",\r\n desc: \"\",\r\n type: \"input\",\r\n },\r\n fitr_capital_gain_loss_fapi: {\r\n name: \"Capital Gains/(Losses) - FAPI\",\r\n desc: \"\",\r\n type: \"input\",\r\n },\r\n fitr_fapi: {\r\n name: \"FAPI/(FAPL)\",\r\n desc: \"\",\r\n type: \"input\",\r\n },\r\n fitr_income_loss_recharacterized_952a: {\r\n name:\r\n \"Income/(Loss) recharacterized under paragraph 95(2)(a) - Exempt\",\r\n desc: \"\",\r\n type: \"input\",\r\n },\r\n fitr_income_loss_recharacterized_952a_taxable: {\r\n name:\r\n \"Income/(Loss) recharacterized under paragraph 95(2)(a) - Taxable\",\r\n desc: \"\",\r\n type: \"input\",\r\n },\r\n fitr_items_not_earnings_nil: {\r\n name:\r\n \"Items which are not earnings or are NIL for Canadian income tax purposes\",\r\n desc: \"\",\r\n type: \"input\",\r\n },\r\n },\r\n complexCopySettings: {\r\n show: true,\r\n entireSection: true,\r\n },\r\n },\r\n F3: {\r\n name: \"FOREIGN TAX RE: CONSOLIDATION/GROUP RELIEF (+/-)\",\r\n desc: \"\",\r\n complexCopySettings: {\r\n entireSection: true,\r\n },\r\n fields: {\r\n foreign_tax_consolidation: {\r\n name: \"Consolidation adjustment(s)\",\r\n desc: \"\",\r\n type: \"schedule\",\r\n },\r\n },\r\n },\r\n },\r\n },\r\n F: {\r\n name: \"DIVIDENDS\",\r\n complexCopySettings: {\r\n show: true,\r\n entireSection: false,\r\n },\r\n required: [\"dividends_from_fa\", \"dividends_paid\"],\r\n subGroups: {\r\n G1: {\r\n name: \"\",\r\n desc: \"\",\r\n fields: {\r\n dividends_paid: {\r\n name: \"Dividend(s) paid\",\r\n type: \"schedule\",\r\n },\r\n dividends_received: {\r\n name: \"Dividend(s) received\",\r\n type: \"schedule\",\r\n },\r\n },\r\n altName: \"Dividends\",\r\n },\r\n },\r\n },\r\n G: {\r\n name: \"OTHER INCLUSION(S)/(DEDUCTION(S))\",\r\n complexCopySettings: {\r\n show: true,\r\n entireSection: true,\r\n },\r\n optionField: [\r\n {\r\n label: \"Amount\",\r\n meta_id: \"amount\",\r\n },\r\n {\r\n label: \"Description\",\r\n meta_id: \"client_description\",\r\n },\r\n {\r\n label: \"Working Paper Reference\",\r\n meta_id: \"client_ref\",\r\n },\r\n {\r\n label: \"Description - KPMG\",\r\n meta_id: \"description\",\r\n },\r\n {\r\n label: \"Working Paper Reference - KPMG\",\r\n meta_id: \"ref\",\r\n },\r\n ],\r\n subGroups: {\r\n H1: {\r\n name: \"\",\r\n desc: \"\",\r\n fields: {\r\n other_inclusions: {\r\n name: \"Adjustment(s)\",\r\n type: \"schedule\",\r\n },\r\n },\r\n altName: \"Adjustment(s)\",\r\n },\r\n },\r\n },\r\n ACB: {\r\n name: \"ADJUSTED COST BASE (ACB)\",\r\n complexCopySettings: {\r\n show: true,\r\n entireSection: true,\r\n },\r\n optionField: [\r\n {\r\n label: \"Amount\",\r\n meta_id: \"amount\",\r\n },\r\n {\r\n label: \"Description\",\r\n meta_id: \"client_description\",\r\n },\r\n {\r\n label: \"Working Paper Reference\",\r\n meta_id: \"client_ref\",\r\n },\r\n {\r\n label: \"Description - KPMG\",\r\n meta_id: \"description\",\r\n },\r\n {\r\n label: \"Working Paper Reference - KPMG\",\r\n meta_id: \"ref\",\r\n },\r\n ],\r\n subGroups: {\r\n I1: {\r\n name: \"\",\r\n desc: \"\",\r\n fields: {\r\n acb_adjustments: {\r\n name: \"ACB Adjustment(s)\",\r\n type: \"schedule\",\r\n },\r\n },\r\n },\r\n },\r\n },\r\n}\r\n\r\nexport default fields\r\n","import { GetterTree } from \"vuex\"\r\nimport { CalculatorState } from \"./types\"\r\nimport { RootState } from \"../types\"\r\nimport { ReportingPeriod, ForeignAffiliate, Taxpayer } from \"@/interfaces\"\r\nimport _ from \"lodash\"\r\nimport dateFns from \"date-fns\"\r\nimport fixedFields from \"../../fixtures/fields\"\r\n\r\nexport const getInputFieldNames = (type?: \"schedule\" | \"input\"): string[] => {\r\n if (!type) {\r\n type = \"input\"\r\n }\r\n const inputFieldNames: string[] = []\r\n const sections = Object.keys(fixedFields)\r\n sections.forEach(sectionKey => {\r\n const section = fixedFields[sectionKey]\r\n const subGroups = Object.keys(section.subGroups)\r\n subGroups.forEach(subGroupKey => {\r\n const subGroup = section.subGroups[subGroupKey]\r\n const fields = Object.keys(subGroup.fields)\r\n fields.forEach(fieldKey => {\r\n const field = subGroup.fields[fieldKey]\r\n if (field.type && !field.readonly && field.type === type) {\r\n inputFieldNames.push(fieldKey)\r\n }\r\n })\r\n })\r\n })\r\n return inputFieldNames\r\n}\r\n\r\nexport const getInputFields = (): any[] => {\r\n const inputFields: any[] = []\r\n const sections = Object.keys(fixedFields)\r\n sections.forEach(sectionKey => {\r\n const section = fixedFields[sectionKey]\r\n const subGroups = Object.keys(section.subGroups)\r\n subGroups.forEach(subGroupKey => {\r\n const subGroup = section.subGroups[subGroupKey]\r\n const fields = Object.keys(subGroup.fields)\r\n fields.forEach(fieldKey => {\r\n const field = subGroup.fields[fieldKey]\r\n if (field) {\r\n inputFields.push({ ...field, metaId: fieldKey })\r\n }\r\n })\r\n })\r\n })\r\n return inputFields\r\n}\r\n\r\nexport const getChildrenFields = (\r\n parentFieldMetaId: string,\r\n reportingPeriod: ReportingPeriod\r\n): any[] => {\r\n if (reportingPeriod && reportingPeriod.fields && parentFieldMetaId) {\r\n // find field\r\n const { fields } = reportingPeriod\r\n const parentField = fields.find(f => {\r\n return f.field_name.meta_id === parentFieldMetaId\r\n })\r\n if (parentField) {\r\n return fields.filter(\r\n f =>\r\n f.field_name.user_created &&\r\n f.field_name.parent == parentField.field_name.id\r\n )\r\n }\r\n }\r\n return []\r\n}\r\n\r\nexport const inputFieldNames = getInputFieldNames()\r\nexport const inputFields = getInputFields()\r\n\r\nexport const getters: GetterTree = {\r\n activeForeignAffiliate(state): ForeignAffiliate | undefined {\r\n return state.foreignAffiliate\r\n },\r\n activeTaxpayer(state): Taxpayer | undefined {\r\n return state.taxpayer\r\n },\r\n activeTaxpayerForeignAffiliates(state): ForeignAffiliate[] {\r\n if (state.taxpayer) {\r\n return state.taxpayer.foreign_affiliates\r\n }\r\n return []\r\n },\r\n reportingPeriods(state): ReportingPeriod[] {\r\n const { foreignAffiliate } = state\r\n return (foreignAffiliate && foreignAffiliate.reporting_periods) || []\r\n },\r\n periodFieldValue: (state, getter) => (\r\n metaId: string,\r\n reportingPeriodId: number,\r\n original: boolean = false\r\n ): number => {\r\n const field = getter.periodField(metaId, reportingPeriodId, original)\r\n return (field && field.value) || 0\r\n },\r\n periodFieldName: (state, getter) => (metaId: string) => {\r\n const field = inputFields.find(field => field.metaId == metaId)\r\n return field && field.name\r\n },\r\n periodFieldReviews: (state, getter) => (\r\n metaId: string,\r\n reportingPeriodId: number,\r\n original: boolean = false\r\n ): any => {\r\n const field = getter.periodField(metaId, reportingPeriodId, original)\r\n return (field && field.reviews) || []\r\n },\r\n periodField: (state, getter) => (\r\n metaId: string,\r\n reportingPeriodId: number,\r\n original: boolean = false\r\n ) => {\r\n const { initialForeignAffiliate, foreignAffiliate } = state\r\n if (!foreignAffiliate || !initialForeignAffiliate) {\r\n return null\r\n }\r\n\r\n // Pick from original or changed FA\r\n const reportingPeriods = original\r\n ? initialForeignAffiliate.reporting_periods\r\n : foreignAffiliate.reporting_periods\r\n const reportingPeriod = reportingPeriods.find((rp: ReportingPeriod) => {\r\n return rp.id === reportingPeriodId\r\n })\r\n\r\n if (reportingPeriod && reportingPeriod.fields) {\r\n const fieldMatch = reportingPeriod.fields.find(f => {\r\n return f.field_name.meta_id === metaId\r\n })\r\n return fieldMatch\r\n }\r\n return null\r\n },\r\n selectedReportingPeriod(state): ReportingPeriod | undefined {\r\n const { selectedReportingPeriod } = state\r\n return selectedReportingPeriod\r\n },\r\n priorReportingPeriods(state): ReportingPeriod[] | undefined {\r\n const { selectedReportingPeriod, foreignAffiliate } = state\r\n if (foreignAffiliate && selectedReportingPeriod) {\r\n const priorYears = _.chain(foreignAffiliate.reporting_periods)\r\n .filter(reportingPeriod => {\r\n if (selectedReportingPeriod) {\r\n return dateFns.isBefore(\r\n reportingPeriod.end_date,\r\n selectedReportingPeriod.start_date\r\n )\r\n }\r\n return false\r\n })\r\n // @ts-ignore\r\n .orderBy([\"end_date\"], [\"desc\"])\r\n .value()\r\n return priorYears\r\n }\r\n return []\r\n },\r\n nextReportingPeriods(state): ReportingPeriod[] | undefined {\r\n const { selectedReportingPeriod, foreignAffiliate } = state\r\n if (foreignAffiliate && selectedReportingPeriod) {\r\n const nextYears = _.chain(foreignAffiliate.reporting_periods)\r\n .filter(reportingPeriod => {\r\n if (selectedReportingPeriod) {\r\n return dateFns.isAfter(\r\n reportingPeriod.start_date,\r\n selectedReportingPeriod.end_date\r\n )\r\n }\r\n return false\r\n })\r\n // @ts-ignore\r\n .orderBy([\"end_date\"], [\"asc\"])\r\n .value()\r\n return nextYears\r\n }\r\n return []\r\n },\r\n nextReportingPeriod(state, getter): ReportingPeriod | undefined {\r\n const nextPeriods: ReportingPeriod[] = getter.nextReportingPeriods\r\n const { forwardShuffle } = state\r\n if (nextPeriods && forwardShuffle <= nextPeriods.length) {\r\n return nextPeriods[forwardShuffle]\r\n }\r\n return undefined\r\n },\r\n displayedPriorPeriods(state, getter): ReportingPeriod[] | undefined {\r\n const priorPeriods: ReportingPeriod[] = getter.priorReportingPeriods\r\n const start = state.lookbackShuffle\r\n const end = state.lookbackShuffle + state.priorYearDisplay\r\n return (\r\n _.chain(priorPeriods)\r\n .slice(start, end)\r\n // @ts-ignore\r\n .orderBy([\"end_date\"], [\"asc\"])\r\n .value()\r\n )\r\n },\r\n fieldChangesMade(state, getter) {\r\n if (!getter.selectedReportingPeriod) {\r\n return false\r\n }\r\n\r\n const { id } = getter.selectedReportingPeriod\r\n const { initialForeignAffiliate, foreignAffiliate } = state\r\n\r\n if (id && initialForeignAffiliate && foreignAffiliate) {\r\n const reduceFilter = (acc: any, current: ReportingPeriod) => {\r\n if (current.id === id && current.fields) {\r\n acc = current.fields.filter(field =>\r\n inputFieldNames.includes(field.field_name.meta_id)\r\n )\r\n }\r\n return acc\r\n }\r\n const initialFields = initialForeignAffiliate.reporting_periods.reduce(\r\n reduceFilter,\r\n null\r\n )\r\n const fields = foreignAffiliate.reporting_periods.reduce(\r\n reduceFilter,\r\n null\r\n )\r\n return JSON.stringify(initialFields) !== JSON.stringify(fields)\r\n }\r\n\r\n return false\r\n },\r\n selectedReportingPeriodMetadata(state) {\r\n if (\r\n state.selectedReportingPeriod &&\r\n state.selectedReportingPeriod.metadata\r\n ) {\r\n return JSON.parse(state.selectedReportingPeriod.metadata)\r\n }\r\n return null\r\n },\r\n importDiagnostics(state, getters) {\r\n return (\r\n getters.reportingPeriods.filter(\r\n (rp: ReportingPeriod) =>\r\n rp.metadata &&\r\n JSON.parse(rp.metadata).hasOwnProperty(\"diagnostics\") &&\r\n JSON.parse(rp.metadata).diagnostics.length > 0\r\n ).length != 0\r\n )\r\n },\r\n isAcbEnabled(state) {\r\n return state.foreignAffiliate && state.foreignAffiliate.acb_enabled\r\n },\r\n}\r\n","import {\r\n ACBAdjustmentType,\r\n ForeignAffiliate,\r\n ReportingPeriod,\r\n Taxpayer,\r\n} from \"@/interfaces\"\r\n\r\n//// Calculator\r\n// Types\r\nexport interface CalculatorState {\r\n taxpayer?: Taxpayer\r\n foreignAffiliate?: ForeignAffiliate\r\n initialForeignAffiliate?: ForeignAffiliate\r\n acbAdjustmentTypes: ACBAdjustmentType[]\r\n error: boolean\r\n selectedReportingPeriod?: ReportingPeriod\r\n lookbackShuffle: number\r\n forwardShuffle: number\r\n priorYearDisplay: number\r\n}\r\n\r\n// Mutations\r\nexport const SET_CALCULATOR_FA = \"SET_CALCULATOR_FA\"\r\nexport const SET_CALCULATOR_TAXPAYER = \"SET_CALCULATOR_TAXPAYER\"\r\nexport const SET_SELECTED_RP = \"SET_SELECTED_RP\"\r\nexport const CHANGE_LOOKBACK_SHUFFLE = \"CHANGE_LOOKBACK_SHUFFLE\"\r\nexport const CALCULATOR_VALUE_CHANGE = \"CALCULATOR_VALUE_CHANGE\"\r\nexport const ERROR_CALCULATOR_FA = \"ERROR_CALCULATOR_FA\"\r\nexport const RESET_CALCULATOR = \"RESET_CALCULATOR\"\r\nexport const CHANGE_CALCULATOR_VALUES = \"CHANGE_CALCULATOR_VALUES\"\r\nexport const REVERT_CALCULATOR_VALUES = \"REVERT_CALCULATOR_VALUES\"\r\nexport const CALCULATE_SURPLUS = \"CALCULATE_SURPLUS\"\r\nexport const RESET_STORE = \"RESET_STORE\"\r\nexport const ADD_SEP = \"ADD_SEP\"\r\nexport const EDIT_SEP = \"EDIT_SEP\"\r\nexport const DELETE_SEP = \"DELETE_SEP\"\r\nexport const ADD_DIVIDEND = \"ADD_DIVIDEND\"\r\nexport const EDIT_DIVIDEND = \"EDIT_DIVIDEND\"\r\nexport const DELETE_DIVIDEND = \"DELETE_DIVIDEND\"\r\nexport const ADD_ADJUSTMENT = \"ADD_ADJUSTMENT\"\r\nexport const EDIT_ADJUSTMENT = \"EDIT_ADJUSTMENT\"\r\nexport const DELETE_ADJUSTMENT = \"DELETE_ADJUSTMENT\"\r\nexport const ADD_FIELD = \"ADD_FIELD\"\r\nexport const EDIT_FIELD = \"EDIT_FIELD\"\r\nexport const DELETE_FIELD = \"DELETE_FIELD\"\r\nexport const ACCUMULATE_FIELDS = \"ACCUMULATE_FIELDS\"\r\nexport const ADD_DISPOSITION_ADJUSTMENT = \"ADD_DISPOSITION_ADJUSTMENT\"\r\nexport const EDIT_DISPOSITION_ADJUSTMENT = \"EDIT_DISPOSITION_ADJUSTMENT\"\r\nexport const DELETE_DISPOSITION_ADJUSTMENT = \"DELETE_DISPOSITION_ADJUSTMENT\"\r\nexport const SAVE_CALCULATED_VALUES = \"SAVE_CALCULATED_VALUES\"\r\nexport const ADD_OUTPUT_PROFILE = \"ADD_OUTPUT_PROFILE\"\r\nexport const EDIT_OUTPUT_PROFILE = \"EDIT_OUTPUT_PROFILE\"\r\nexport const DELETE_OUTPUT_PROFILE = \"DELETE_OUTPUT_PROFILE\"\r\nexport const UPDATE_METADATA = \"UPDATE_METADATA\"\r\nexport const EDIT_RP = \"EDIT_RP\"\r\nexport const ADD_COMMENT = \"ADD_COMMENT\"\r\nexport const DELETE_COMMENT = \"DELETE_COMMENT\"\r\nexport const UPDATE_COMMENT_RESOLVE = \"UPDATE_COMMENT_RESOLVE\"\r\nexport const ADD_REVIEW = \"ADD_REVIEW\"\r\nexport const DELETE_REVIEW = \"DELETE_REVIEW\"\r\nexport const EDIT_PRIOR_YEAR_DISPLAY = \"EDIT_PRIOR_YEAR_DISPLAY\"\r\nexport const SET_ACB_ADJUSTMENT_TYPES = \"SET_ACB_ADJUSTMENT_TYPES\"\r\nexport const ADD_ACB_ADJUSTMENT = \"ADD_ACB_ADJUSTMENT\"\r\nexport const EDIT_ACB_ADJUSTMENT = \"EDIT_ACB_ADJUSTMENT\"\r\nexport const DELETE_ACB_ADJUSTMENT = \"DELETE_ACB_ADJUSTMENT\"\r\nexport const ADD_ACB_PERIOD = \"ADD_ACB_PERIOD\"\r\nexport const EDIT_ACB_PERIOD = \"EDIT_ACB_PERIOD\"\r\nexport const DELETE_ACB_PERIOD = \"DELETE_ACB_PERIOD\"\r\nexport const TOGGLE_ACB = \"TOGGLE_ACB\"\r\n","/**\r\n * Rounds to whole number\r\n *\r\n * @param num\r\n */\r\nexport const round = (num: number) => Math.round(num)\r\n","import {\r\n Dividend,\r\n SEPAdjustment,\r\n SurplusBalanceTypes,\r\n BalanceTypes,\r\n Adjustment,\r\n DispositionAdjustment,\r\n ACBAdjustment,\r\n} from \"@/interfaces\"\r\nimport { CalculatorHelpers } from \"../calculator/CalculatorHelpers\"\r\nimport Alteration from \"../calculator/Alteration\"\r\n\r\ntype Action =\r\n | Dividend\r\n | SEPAdjustment\r\n | Adjustment\r\n | DispositionAdjustment\r\n | ACBAdjustment\r\n | any\r\nexport type ActionType =\r\n | \"dividend\"\r\n | \"sepAdjustment\"\r\n | \"adjustment\"\r\n | \"dispositionAdjustment\"\r\n | \"acbAdjustment\"\r\n\r\nexport default class Transaction {\r\n //#region Constructor\r\n private action: Action\r\n private actionType: ActionType\r\n private SEPAdjustment!: SEPAdjustment\r\n private balance!: BalanceTypes\r\n private multiplier: number = 1\r\n private relatedAlterations: Alteration[]\r\n\r\n constructor(action: Action, actionType: ActionType) {\r\n this.action = action\r\n this.actionType = actionType\r\n this.relatedAlterations = []\r\n }\r\n //#endregion\r\n\r\n //#region Getters/Setters\r\n public get getBalance() {\r\n return this.balance\r\n }\r\n\r\n public set setBalance(values: BalanceTypes) {\r\n const valuesClone = CalculatorHelpers.clone(values)\r\n this.balance = { ...this.balance, ...valuesClone }\r\n }\r\n\r\n public set setSEPAdjustment(adjustment: SEPAdjustment) {\r\n this.SEPAdjustment = adjustment\r\n }\r\n\r\n public set setMultiplier(multiplier: number) {\r\n this.multiplier = multiplier\r\n }\r\n\r\n public get modifiedAmount(): number {\r\n return this.multiplier * this.action.amount\r\n }\r\n\r\n public get getMultiplier(): number {\r\n return this.multiplier\r\n }\r\n\r\n public get getAction() {\r\n return this.action\r\n }\r\n\r\n public get getActionType() {\r\n return this.actionType\r\n }\r\n\r\n public get getSepAdjustment() {\r\n return this.SEPAdjustment\r\n }\r\n\r\n public set setSepAdjustment(value: SEPAdjustment) {\r\n this.SEPAdjustment = value\r\n }\r\n\r\n public get adjustedAmount() {\r\n if (\r\n this.SEPAdjustment &&\r\n this.SEPAdjustment.multiplier &&\r\n this.action.amount\r\n ) {\r\n return this.SEPAdjustment.multiplier * this.action.amount\r\n } else if (this.action.amount) {\r\n return this.action.amount\r\n }\r\n return 0\r\n }\r\n\r\n public get getRelatedAlterations() {\r\n return this.relatedAlterations\r\n }\r\n //#endregion\r\n\r\n //#region Methods\r\n public addRelatedAlteration(alteration: Alteration) {\r\n this.relatedAlterations.push(alteration)\r\n }\r\n //#endregion\r\n}\r\n","import { AdjustmentType } from \"@/interfaces\"\r\nimport { CalculatorHelpers } from \"./CalculatorHelpers\"\r\n\r\nexport type AlterationType =\r\n | \"dividend_paid\"\r\n | \"dividend_recieved\"\r\n | \"disposition_adjustment\"\r\n | \"adjustment\"\r\n | \"acb_adjustment\"\r\n | \"pre_acq_acb_adjustment\"\r\n | \"tax_adjustment\"\r\n | \"dividend_paid_rechar\"\r\n\r\nexport type AmountType = \"amount\" | \"tax_amount\" | \"hut_amount\" | \"uft_amount\"\r\n\r\nexport interface Movement {\r\n from: AlterationType | AdjustmentType | AmountType | null\r\n to: AlterationType | AdjustmentType | AmountType | null\r\n}\r\n\r\n/**\r\n * Stores information pertaining to the movement of amounts between surplus buckets\r\n *\r\n * FYI order probably doesnt do anything\r\n *\r\n * @export\r\n * @class Alteration\r\n */\r\nexport default class Alteration {\r\n protected static order: number = 0\r\n public amount: number\r\n public type: AlterationType\r\n public movement: Movement\r\n public metadata?: any\r\n public localOrder: number\r\n public date: Date\r\n\r\n constructor(\r\n amount: number,\r\n type: AlterationType,\r\n movement: Movement,\r\n date: Date,\r\n metadata: any = {}\r\n ) {\r\n this.amount = amount\r\n this.type = type\r\n this.movement = movement\r\n this.metadata = CalculatorHelpers.clone(metadata)\r\n this.localOrder = ++Alteration.order\r\n this.date = date\r\n }\r\n\r\n public get getMetadata() {\r\n return this.metadata\r\n }\r\n\r\n public get getOrder() {\r\n return this.localOrder\r\n }\r\n\r\n public get getAmount() {\r\n return this.amount\r\n }\r\n\r\n public get getType() {\r\n return this.type\r\n }\r\n\r\n public get getMovement() {\r\n return this.movement\r\n }\r\n}\r\n","/**\r\n * Returns the correct date object of the passed date string, by converting dashes to slashes\r\n *\r\n * @param date\r\n */\r\nexport const getDate = (date: string | Date) => {\r\n if (typeof date === \"string\") {\r\n return new Date(date.replace(/-/g, \"/\"))\r\n } else {\r\n return date\r\n }\r\n}\r\n","/**\r\n * Returns the nested property of the passed object o, following the path p\r\n * @param p\r\n * @param o\r\n */\r\nexport const getDeepProperty = (p: any, o: any) =>\r\n p.reduce((xs: any, x: any) => (xs && xs[x] ? xs[x] : null), o)\r\n","// Project Imports\r\nimport Calculator from \"./Calculator\"\r\nimport { getDeepProperty } from \"@/util/getDeepProperty\"\r\nimport { round } from \"@/util/round\"\r\nimport { CalculatorHelpers } from \"./CalculatorHelpers\"\r\nimport Alteration from \"./Alteration\"\r\nimport { Dividend, Adjustment, SEPAdjustment } from \"@/interfaces\"\r\nimport Transaction from \"../transaction/Transaction\"\r\nimport { getDate } from \"@/util/getDate\"\r\n\r\nexport default class CalculatorOutput {\r\n // tslint:disable-next-line\r\n private _calculator: Calculator\r\n\r\n public get calculator() {\r\n return this._calculator\r\n }\r\n\r\n //#region Constructors\r\n /**\r\n * Creates an instance of CalculatorOutput.\r\n * @param {Calculator} calculator\r\n * @memberof CalculatorOutput\r\n */\r\n constructor(calculator: Calculator) {\r\n this._calculator = calculator\r\n }\r\n //#endregion\r\n\r\n //#region Output\r\n\r\n /**\r\n * Generate the necessary values for the output report. The function passes tracking object to helper functions which\r\n * modify the running output.\r\n *\r\n * @memberof CalculatorOutput\r\n */\r\n public generateOutput() {\r\n const runningOutput = {}\r\n this.calculatedOutput(runningOutput)\r\n this.summaryOutput(runningOutput)\r\n this.calculatedEarningsFromAnActiveBusiness(runningOutput)\r\n return runningOutput\r\n }\r\n\r\n private summaryOutput(runningOutput: any) {\r\n this.summaryExemptSurplusOutput(runningOutput)\r\n this.summaryHybridSurplusOutput(runningOutput)\r\n this.summaryTaxableSurplusOutput(runningOutput)\r\n this.summaryHutSurplusOutput(runningOutput)\r\n this.summaryUftSurplusOutput(runningOutput)\r\n this.summaryDividendsOutput(runningOutput)\r\n this.summaryACBOutput(runningOutput)\r\n }\r\n\r\n private calculatedOutput(runningOutput: any) {\r\n this.calculatedExemptEarningsOutput(runningOutput)\r\n this.calculatedTaxableEarningsOutput(runningOutput)\r\n this.calculatedExemptSurplusOutput(runningOutput)\r\n this.calculatedHybridSurplusOutput(runningOutput)\r\n this.calculatedTaxableSurplusOutput(runningOutput)\r\n this.calculatedHutSurplusOutput(runningOutput)\r\n this.calculatedUftSurplusOutput(runningOutput)\r\n this.calculatedAllocationOfIncomeAndTaxes(runningOutput)\r\n this.calculatedCapitalGainsOutput(runningOutput)\r\n }\r\n\r\n private summaryExemptSurplusOutput(runningOutput: any) {\r\n const output: any = {}\r\n\r\n // In order of the excel\r\n output[\"rechar_preacq_dividend_paid_by\"] = 0\r\n output[\"adjusted_opening\"] = 0\r\n output[\"dividends_received_from_es_of_another_fa_or_s112\"] = 0\r\n output[\"other_adjustments\"] = 0\r\n output[\"total_adjustments_before_dividends_paid\"] = 0\r\n output[\"adjusted_surplus_before_dividends_paid\"] = 0\r\n output[\"dividends_paid\"] = 0\r\n output[\"total_surplus_before_earnings\"] = 0\r\n output[\"earnings_cy\"] = 0\r\n output[\"rechar_preacq_dividend_paid_by_2\"] = 0\r\n\r\n // Generate the calculated values\r\n output[\"rechar_preacq_dividend_paid_by\"] = this.calculator.openings\r\n .recharacterizedAmounts\r\n ? this.calculator.openings.recharacterizedAmounts.exemptBalance\r\n : 0\r\n\r\n output[\"rechar_preacq_dividend_paid_by_2\"] = this.calculator.closings\r\n .recharacterizedAmounts\r\n ? this.calculator.closings.recharacterizedAmounts.exemptBalance\r\n : 0\r\n\r\n const adjustedOpening = this.calculator.openings[\"exemptBalance\"]\r\n\r\n const dividendsReceived = this.calculator.dividendsReceivedFrom(\r\n \"exempt_surplus\"\r\n )\r\n\r\n const dividendsPaid =\r\n this.calculator.dividendsPaidFrom(\"exempt_surplus\") * -1\r\n const otherAdjustments =\r\n this.calculator.closingBalancesBeforeRechar.exemptBalance -\r\n this.calculator.closingExemptEarnings -\r\n dividendsReceived -\r\n adjustedOpening -\r\n dividendsPaid\r\n\r\n // Set the values\r\n output[\"adjusted_opening\"] = round(adjustedOpening)\r\n\r\n output[\"dividends_received_from_es_of_another_fa_or_s112\"] = round(\r\n dividendsReceived\r\n )\r\n output[\"other_adjustments\"] = round(otherAdjustments)\r\n output[\"total_adjustments_before_dividends_paid\"] =\r\n output[\"other_adjustments\"] +\r\n output[\"dividends_received_from_es_of_another_fa_or_s112\"]\r\n\r\n output[\"adjusted_surplus_before_dividends_paid\"] =\r\n output[\"total_adjustments_before_dividends_paid\"] +\r\n output[\"adjusted_opening\"]\r\n\r\n output[\"dividends_paid\"] = round(dividendsPaid)\r\n output[\"total_surplus_before_earnings\"] =\r\n output[\"adjusted_surplus_before_dividends_paid\"] +\r\n output[\"dividends_paid\"]\r\n\r\n output[\"earnings_cy\"] = this.calculator.closingExemptEarnings\r\n\r\n runningOutput[\"summary_es\"] = output\r\n }\r\n\r\n private summaryHybridSurplusOutput(runningOutput: any) {\r\n const output: any = {}\r\n\r\n // In order of the excel\r\n output[\"rechar_preacq_dividend_paid_by\"] = 0\r\n output[\"rechar_preacq_dividend_paid_by_2\"] = 0\r\n output[\"adjusted_opening\"] = 0\r\n output[\"dividends_received_from_hs\"] = 0\r\n output[\"capital_gains_net_of_tax\"] = 0\r\n output[\"other_adjustments\"] = 0\r\n output[\"total_adjustments_before_dividends_paid\"] = 0\r\n output[\"adjusted_surplus_before_dividends_paid\"] = 0\r\n output[\"dividends_paid\"] = 0\r\n output[\"earnings_cy\"] = 0\r\n\r\n // Generate the calculated values\r\n output[\"rechar_preacq_dividend_paid_by\"] = this.calculator.openings\r\n .recharacterizedAmounts\r\n ? this.calculator.openings.recharacterizedAmounts.hybridBalance\r\n : 0\r\n output[\"rechar_preacq_dividend_paid_by_2\"] = this.calculator.closings\r\n .recharacterizedAmounts\r\n ? this.calculator.closings.recharacterizedAmounts.hybridBalance\r\n : 0\r\n\r\n const sepPeriods = getDeepProperty(\r\n [\"calculated_hs\", \"sep_periods\"],\r\n runningOutput\r\n )\r\n\r\n const adjustedOpening = this.calculator.openings[\"hybridBalance\"]\r\n\r\n const dividendsReceived = this.calculator.dividendsReceivedFrom(\r\n \"hybrid_surplus\"\r\n )\r\n\r\n const dividendsPaid =\r\n this.calculator.dividendsPaidFrom(\"hybrid_surplus\") * -1\r\n\r\n const capitalGains = CalculatorHelpers.sumSepValues(sepPeriods, [\r\n \"disposition_adjustment_before_taxes\",\r\n \"disposition_adjustment_taxes\",\r\n ])\r\n\r\n const otherAdjustments =\r\n this.calculator.closingBalancesBeforeRechar.hybridBalance -\r\n adjustedOpening -\r\n // capitalGains -\r\n dividendsReceived -\r\n dividendsPaid\r\n\r\n // Set the values\r\n output[\"adjusted_opening\"] = round(adjustedOpening)\r\n\r\n output[\"dividends_received_from_hs\"] = round(dividendsReceived)\r\n\r\n output[\"capital_gains_net_of_tax\"] = round(capitalGains)\r\n\r\n output[\"other_adjustments\"] = round(otherAdjustments)\r\n output[\"total_adjustments_before_dividends_paid\"] =\r\n output[\"other_adjustments\"] + output[\"dividends_received_from_hs\"]\r\n\r\n output[\"adjusted_surplus_before_dividends_paid\"] =\r\n output[\"total_adjustments_before_dividends_paid\"] +\r\n output[\"adjusted_opening\"]\r\n\r\n output[\"dividends_paid\"] = round(dividendsPaid)\r\n output[\"total_surplus_before_earnings\"] =\r\n output[\"adjusted_surplus_before_dividends_paid\"] +\r\n output[\"dividends_paid\"]\r\n\r\n runningOutput[\"summary_hs\"] = output\r\n }\r\n\r\n private summaryTaxableSurplusOutput(runningOutput: any) {\r\n const output: any = {}\r\n\r\n // In order of the excel\r\n output[\"rechar_preacq_dividend_paid_by\"] = 0\r\n output[\"rechar_preacq_dividend_paid_by_2\"] = 0\r\n output[\"adjusted_opening\"] = 0\r\n output[\"dividends_recieved_from_ts\"] = 0\r\n output[\"other_adjustments\"] = 0\r\n output[\"total_adjustments_before_dividends_paid\"] = 0\r\n output[\"adjusted_surplus_before_dividends_paid\"] = 0\r\n output[\"dividends_paid\"] = 0\r\n output[\"total_surplus_before_earnings\"] = 0\r\n output[\"earnings_cy\"] = 0\r\n\r\n // Generate the calculated values\r\n output[\"rechar_preacq_dividend_paid_by\"] = this.calculator.openings\r\n .recharacterizedAmounts\r\n ? this.calculator.openings.recharacterizedAmounts.taxableBalance\r\n : 0\r\n\r\n output[\"rechar_preacq_dividend_paid_by_2\"] = this.calculator.closings\r\n .recharacterizedAmounts\r\n ? this.calculator.closings.recharacterizedAmounts.taxableBalance\r\n : 0\r\n\r\n const adjustedOpening = this.calculator.openings[\"taxableBalance\"]\r\n\r\n const dividendsReceived = this.calculator.dividendsReceivedFrom(\r\n \"taxable_surplus\"\r\n )\r\n\r\n const dividendsPaid =\r\n this.calculator.dividendsPaidFrom(\"taxable_surplus\") * -1\r\n\r\n const otherAdjustments =\r\n this.calculator.closingBalancesBeforeRechar.taxableBalance -\r\n this.calculator.closingTaxableEarnings -\r\n dividendsReceived -\r\n adjustedOpening -\r\n dividendsPaid\r\n\r\n // Set the values\r\n output[\"adjusted_opening\"] = round(adjustedOpening)\r\n\r\n output[\"dividends_recieved_from_ts\"] = round(dividendsReceived)\r\n output[\"other_adjustments\"] = round(otherAdjustments)\r\n output[\"total_adjustments_before_dividends_paid\"] =\r\n output[\"other_adjustments\"] + output[\"dividends_recieved_from_ts\"]\r\n\r\n output[\"adjusted_surplus_before_dividends_paid\"] =\r\n output[\"total_adjustments_before_dividends_paid\"] +\r\n output[\"adjusted_opening\"]\r\n\r\n output[\"dividends_paid\"] = round(dividendsPaid)\r\n output[\"total_surplus_before_earnings\"] =\r\n output[\"adjusted_surplus_before_dividends_paid\"] +\r\n output[\"dividends_paid\"]\r\n\r\n output[\"earnings_cy\"] = this.calculator.closingTaxableEarnings\r\n\r\n runningOutput[\"summary_ts\"] = output\r\n }\r\n\r\n private summaryHutSurplusOutput(runningOutput: any) {\r\n const output: any = {}\r\n\r\n // In order of the excel\r\n // Output 65\r\n output[\"rechar_preacq_dividend_paid_by\"] = 0\r\n // Output 66\r\n output[\"adjusted_opening\"] = 0\r\n\r\n // Output 68\r\n output[\"hut_applicable_from_dividends\"] = 0\r\n // Output 69\r\n output[\"capital_gains\"] = 0\r\n // Output 70\r\n output[\"other_adjustments\"] = 0\r\n // Output 71\r\n output[\"total_adjustments_before_dividends_paid\"] = 0\r\n\r\n // Output 73\r\n output[\"total_adjustments_before_taxable_dividends\"] = 0\r\n\r\n // Output 75\r\n output[\"dividends_paid\"] = 0\r\n\r\n output[\"rechar_preacq_dividend_paid_by_2\"] = 0\r\n\r\n // Generate the calculated values\r\n output[\"rechar_preacq_dividend_paid_by\"] = this.calculator.openings\r\n .recharacterizedAmounts\r\n ? this.calculator.openings.recharacterizedAmounts.hutBalance\r\n : 0\r\n\r\n output[\"rechar_preacq_dividend_paid_by_2\"] = this.calculator.closings\r\n .recharacterizedAmounts\r\n ? this.calculator.closings.recharacterizedAmounts.hutBalance\r\n : 0\r\n\r\n const sepPeriods = getDeepProperty(\r\n [\"calculated_hut\", \"sep_periods\"],\r\n runningOutput\r\n )\r\n\r\n const adjustedOpening = this.calculator.openings[\"hutBalance\"]\r\n\r\n const hutApplicable = round(\r\n CalculatorHelpers.sumSepValues(sepPeriods, [\r\n \"hut_applicable_to_dividends_recieved\",\r\n ])\r\n )\r\n\r\n const dividendsPaid = round(\r\n Math.abs(\r\n CalculatorHelpers.sumSepValues(sepPeriods, [\r\n \"hut_applicable_to_dividends_paid_from_hybrid\",\r\n ])\r\n ) * -1\r\n )\r\n\r\n const capitalGains = CalculatorHelpers.sumSepValues(sepPeriods, [\r\n \"tax_applicable_to_capital_gain\",\r\n ])\r\n\r\n const otherAdjustments =\r\n sepPeriods.last.closing_surplus -\r\n hutApplicable -\r\n adjustedOpening -\r\n capitalGains -\r\n dividendsPaid\r\n\r\n // Set the values\r\n output[\"adjusted_opening\"] = round(adjustedOpening)\r\n\r\n output[\"hut_applicable_from_dividends\"] = round(hutApplicable)\r\n\r\n output[\"capital_gains\"] = round(capitalGains)\r\n\r\n output[\"other_adjustments\"] = round(otherAdjustments)\r\n\r\n output[\"total_adjustments_before_hybrid_dividends\"] =\r\n output[\"other_adjustments\"] +\r\n output[\"capital_gains\"] +\r\n output[\"hut_applicable_from_dividends\"]\r\n\r\n output[\"total_adjustments_before_taxable_dividends\"] =\r\n output[\"total_adjustments_before_hybrid_dividends\"] +\r\n output[\"adjusted_opening\"]\r\n\r\n output[\"dividends_paid\"] = round(dividendsPaid)\r\n\r\n runningOutput[\"summary_hut\"] = output\r\n }\r\n\r\n private summaryUftSurplusOutput(runningOutput: any) {\r\n const output: any = {}\r\n\r\n // In order of the excel\r\n // Output 80\r\n output[\"rechar_preacq_dividend_paid_by\"] = 0\r\n // Output 81\r\n output[\"adjusted_opening\"] = 0\r\n\r\n // Output 83\r\n output[\"uft_applicable_from_dividends\"] = 0\r\n // Output 84\r\n output[\"other_adjustments\"] = 0\r\n // Output 85\r\n output[\"total_adjustments_before_dividends_paid\"] = 0\r\n\r\n // Output 87\r\n output[\"total_adjustments_before_taxable_dividends\"] = 0\r\n\r\n // Output 89\r\n output[\"adjusted_uft_before_allocations_to_taxable_dividends\"] = 0\r\n\r\n // Output 90\r\n output[\"total_uft_before_taxable_earnings\"] = 0\r\n\r\n // Output 92\r\n output[\"taxes_applicable_to_taxable_earnings\"] = 0\r\n\r\n output[\"rechar_preacq_dividend_paid_by_2\"] = 0\r\n\r\n // Generate the calculated values\r\n // @TODO Fetch rechar_preacq_dividend_paid_by\r\n output[\"rechar_preacq_dividend_paid_by\"] = this.calculator.openings\r\n .recharacterizedAmounts\r\n ? this.calculator.openings.recharacterizedAmounts.uftBalance\r\n : 0\r\n\r\n output[\"rechar_preacq_dividend_paid_by_2\"] = this.calculator.closings\r\n .recharacterizedAmounts\r\n ? this.calculator.closings.recharacterizedAmounts.uftBalance\r\n : 0\r\n\r\n const sepPeriods = getDeepProperty(\r\n [\"calculated_uft\", \"sep_periods\"],\r\n runningOutput\r\n )\r\n\r\n const adjustedOpening = this.calculator.openings[\"uftBalance\"]\r\n\r\n const uftApplicable = round(\r\n CalculatorHelpers.sumSepValues(sepPeriods, [\r\n \"uft_applicable_to_dividends_recieved\",\r\n ])\r\n )\r\n\r\n const dividendsPaid =\r\n round(\r\n Math.abs(\r\n CalculatorHelpers.sumSepValues(sepPeriods, [\r\n \"uft_applicable_to_dividends_paid_from_taxable\",\r\n ])\r\n )\r\n ) * -1\r\n\r\n const otherAdjustments = round(\r\n sepPeriods.last.closing_surplus -\r\n dividendsPaid -\r\n uftApplicable -\r\n adjustedOpening\r\n )\r\n\r\n // Set the values\r\n output[\"adjusted_opening\"] = round(adjustedOpening)\r\n\r\n output[\"uft_applicable_from_dividends\"] = round(uftApplicable)\r\n\r\n output[\"other_adjustments\"] = round(otherAdjustments)\r\n\r\n output[\"total_adjustments_before_allocation_to_taxable_dividends\"] =\r\n output[\"other_adjustments\"] + output[\"uft_applicable_from_dividends\"]\r\n\r\n output[\"adjusted_uft_before_allocations_to_taxable_dividends\"] =\r\n output[\"adjusted_opening\"] +\r\n output[\"total_adjustments_before_allocation_to_taxable_dividends\"]\r\n\r\n output[\"dividends_paid\"] = dividendsPaid\r\n\r\n output[\"total_uft_before_taxable_earnings\"] =\r\n output[\"dividends_paid\"] +\r\n output[\"adjusted_uft_before_allocations_to_taxable_dividends\"]\r\n\r\n output[\"taxes_applicable_to_taxable_earnings\"] =\r\n this.calculator.taxesPaidOnTaxableEarnings * -1\r\n\r\n runningOutput[\"summary_uft\"] = output\r\n }\r\n\r\n private summaryDividendsOutput(runningOutput: any) {\r\n const output: any = {}\r\n\r\n // Output 99\r\n output[\"dividends_paid_tax_year\"] = 0\r\n // Output 100\r\n output[\"deemed_dividends_paid_s93_or_11\"] = 0\r\n // Output 101\r\n output[\"total_dividends_paid\"] = 0\r\n // Output 103\r\n output[\"dividends_paid_90_days\"] = 0\r\n\r\n // Output 107\r\n output[\"exempt_dividends\"] = 0\r\n // Output 108\r\n output[\"hybrid_dividends\"] = 0\r\n // Output 109\r\n output[\"taxable_dividends\"] = 0\r\n // Output 110\r\n output[\"total_dividends_from_accounts\"] = 0\r\n // Output 111\r\n const preAcqRechar = this.calculator.closings.recharacterizedAmounts\r\n ? this.calculator.closings.recharacterizedAmounts.preAcqBalance\r\n : 0\r\n\r\n output[\"dividends_paid_90_days\"] = preAcqRechar\r\n\r\n output[\"total_dividends_paid_90_days\"] = 0\r\n\r\n output[\"preacq_dividends\"] =\r\n this.calculator.closings[\"preAcqBalance\"] - preAcqRechar\r\n\r\n // Output 113\r\n output[\"hut_dividends\"] = Math.abs(\r\n CalculatorHelpers.sumSepValues(\r\n getDeepProperty([\"calculated_hut\", \"sep_periods\"], runningOutput),\r\n [\"hut_applicable_to_dividends_paid_from_hybrid\"]\r\n )\r\n )\r\n // Output 114\r\n output[\"uft_dividends\"] = Math.abs(\r\n CalculatorHelpers.sumSepValues(\r\n getDeepProperty([\"calculated_uft\", \"sep_periods\"], runningOutput),\r\n [\"uft_applicable_to_dividends_paid_from_taxable\"]\r\n )\r\n )\r\n\r\n output[\"net_preacq_dividends\"] = 0\r\n\r\n // Calculate the dividends paid\r\n this.calculator.alterations\r\n .filter(\r\n (alteration: Alteration) => alteration.getType === \"dividend_paid\"\r\n )\r\n .forEach((alteration: Alteration) => {\r\n const dividend = alteration.getMetadata.dividend as Dividend\r\n const amount = round(alteration.amount)\r\n const rules: any[] = [\r\n \"exempt_surplus\",\r\n \"hybrid_surplus\",\r\n \"taxable_surplus\",\r\n \"pre_acq_surplus\",\r\n ]\r\n\r\n if (rules.includes(alteration.movement.from)) {\r\n if (dividend.schedule_93) {\r\n output[\"deemed_dividends_paid_s93_or_11\"] += amount\r\n } else {\r\n output[\"dividends_paid_tax_year\"] += amount\r\n }\r\n }\r\n\r\n switch (alteration.movement.from) {\r\n case \"exempt_surplus\":\r\n output[\"exempt_dividends\"] += amount\r\n break\r\n case \"hybrid_surplus\":\r\n output[\"hybrid_dividends\"] += amount\r\n break\r\n case \"taxable_surplus\":\r\n output[\"taxable_dividends\"] += amount\r\n break\r\n case \"pre_acq_recharacterized\":\r\n output[\"total_dividends_paid_90_days\"] += amount\r\n break\r\n }\r\n })\r\n\r\n this.calculator.alterations\r\n .filter(\r\n (alteration: Alteration) =>\r\n alteration.getType === \"dividend_paid_rechar\"\r\n )\r\n .forEach((alteration: Alteration) => {\r\n const amount = round(alteration.amount)\r\n switch (alteration.movement.from) {\r\n case \"exempt_surplus\":\r\n output[\"exempt_dividends\"] += amount\r\n break\r\n case \"hybrid_surplus\":\r\n output[\"hybrid_dividends\"] += amount\r\n break\r\n case \"taxable_surplus\":\r\n output[\"taxable_dividends\"] += amount\r\n break\r\n case \"hybrid_underlying_taxes\":\r\n output[\"hut_dividends\"] += amount\r\n break\r\n case \"underlying_foreign_taxes\":\r\n output[\"uft_dividends\"] += amount\r\n break\r\n }\r\n })\r\n\r\n output[\"total_dividends_from_accounts\"] =\r\n output[\"exempt_dividends\"] +\r\n output[\"hybrid_dividends\"] +\r\n output[\"taxable_dividends\"]\r\n\r\n output[\"net_preacq_dividends\"] =\r\n output[\"preacq_dividends\"] + output[\"dividends_paid_90_days\"]\r\n\r\n output[\"total_dividends_paid\"] =\r\n output[\"deemed_dividends_paid_s93_or_11\"] +\r\n output[\"dividends_paid_tax_year\"]\r\n\r\n // Get dividends received\r\n output[\"exempt_dividends_received\"] = this.calculator.dividendsReceivedFrom(\r\n \"exempt_surplus\"\r\n )\r\n output[\"hybrid_dividends_received\"] = this.calculator.dividendsReceivedFrom(\r\n \"hybrid_surplus\"\r\n )\r\n output[\r\n \"taxable_dividends_received\"\r\n ] = this.calculator.dividendsReceivedFrom(\"taxable_surplus\")\r\n\r\n output[\"total_dividends_received_from_accounts\"] =\r\n output[\"exempt_dividends_received\"] +\r\n output[\"hybrid_dividends_received\"] +\r\n output[\"taxable_dividends_received\"]\r\n\r\n runningOutput[\"summary_d\"] = output\r\n }\r\n\r\n private summaryACBOutput(runningOutput: any) {\r\n const output: any = {}\r\n\r\n output[\"pre_acq_acb_adjustment\"] = 0\r\n output[\"pre_acq_rechar_acb_adjustment\"] = 0\r\n\r\n const acbPreAcqAlterations = this.calculator\r\n .alterationsByType(\"acb_adjustment\")\r\n .filter((a: Alteration) => a.getMovement.from == \"pre_acq_acb_adjustment\")\r\n const acbPreAcqAmount = acbPreAcqAlterations.reduce(\r\n (acc: number, curr: Alteration) => (acc = acc + curr.amount),\r\n 0\r\n )\r\n\r\n const acbRecharAlterations = this.calculator\r\n .alterationsByType(\"acb_adjustment\")\r\n .filter(\r\n (a: Alteration) =>\r\n a.getMovement.from == \"dividend_paid_rechar\" &&\r\n a.getMovement.to == \"acb_adjustment\"\r\n )\r\n const acbRecharAmount = acbRecharAlterations.reduce(\r\n (acc: number, curr: Alteration) => (acc = acc + curr.amount),\r\n 0\r\n )\r\n\r\n output[\"pre_acq_acb_adjustment\"] = round(-acbPreAcqAmount)\r\n output[\"pre_acq_rechar_acb_adjustment\"] = round(acbRecharAmount)\r\n output[\"net_pre_acq_rechar\"] =\r\n output[\"pre_acq_acb_adjustment\"] + output[\"pre_acq_rechar_acb_adjustment\"]\r\n\r\n runningOutput[\"summary_acb\"] = output\r\n }\r\n\r\n private calculatedCapitalGainsOutput(runningOutput: any) {\r\n const output: any = {}\r\n const totalCGExcludingHybrid =\r\n this.calculator.values[\"non_excluded_property_facl\"].value +\r\n this.calculator.values[\"active_business_assets_non_dtc\"].value +\r\n this.calculator.values[\"active_business_assets_dtc\"].value +\r\n this.calculator.values[\"other_excluded_property\"].value +\r\n this.calculator.values[\r\n \"shares_of_fa_or_partnership_interest_before_hybrid\"\r\n ].value\r\n\r\n output[\"total_capital_gain_loss_excluding_hybrid\"] = round(\r\n totalCGExcludingHybrid\r\n )\r\n output[\"total_capital_gain_loss\"] =\r\n output[\"total_capital_gain_loss_excluding_hybrid\"] +\r\n round(this.calculator.hybridSurplusGainLoss)\r\n\r\n runningOutput[\"calculated_capital_gains_loss\"] = output\r\n }\r\n\r\n private calculatedExemptEarningsOutput(runningOutput: any) {\r\n const output: any = {}\r\n\r\n // Get dividends paid\r\n // Comes from 'Dividend paid'\r\n output[\"net_active_business_earnings\"] = 0\r\n output[\"capital_gains_exempt\"] = 0\r\n output[\"other_inclusions\"] = 0\r\n output[\"earnings_before_taxes\"] = 0\r\n output[\"taxes_paid_rechar_active\"] = 0\r\n output[\"taxes_paid_capital_gain\"] = 0\r\n output[\"total_taxes\"] = 0\r\n output[\"earnings_cy\"] = 0\r\n\r\n // Generate the calculated values\r\n const incomeLossRecharUnder95a = this.calculator.values[\r\n \"952a_amounts_increase_exempt\"\r\n ].value\r\n const incomeLossRecharCtr = this.calculator.values[\r\n \"ctr_amounts_increase_exempt\"\r\n ].value\r\n\r\n const otherInclusions = this.calculator.earningsInclusions(\r\n \"exempt_earnings\"\r\n )\r\n\r\n const FITRCapitalgainExempt = this.calculator.FITRAllocation(\r\n \"fitr_capital_gain_loss\"\r\n )\r\n\r\n const taxesPaidRecharActive = this.calculator.taxesApplicableTo952a(\r\n \"952a_amounts_increase_exempt\"\r\n )\r\n\r\n // Set the values\r\n output[\"net_active_business_earnings\"] = this.calculator\r\n .designatedTreatyCountry\r\n ? round(this.calculator.netEarningsFromActiveBusiness)\r\n : 0\r\n output[\"capital_gains_exempt\"] = round(\r\n this.calculator.capitalGainsPortions.exempt\r\n )\r\n output[\"other_inclusions\"] = round(otherInclusions)\r\n output[\"earnings_before_taxes\"] =\r\n output[\"capital_gains_exempt\"] +\r\n output[\"other_inclusions\"] +\r\n output[\"net_active_business_earnings\"] +\r\n round(incomeLossRecharCtr) +\r\n round(incomeLossRecharUnder95a)\r\n\r\n output[\"taxes_paid_rechar_active\"] = round(taxesPaidRecharActive)\r\n\r\n output[\"taxes_paid_capital_gain\"] = round(FITRCapitalgainExempt)\r\n\r\n output[\"total_taxes\"] =\r\n output[\"taxes_paid_rechar_active\"] + output[\"taxes_paid_capital_gain\"]\r\n\r\n output[\"earnings_cy\"] =\r\n output[\"earnings_before_taxes\"] + output[\"total_taxes\"]\r\n\r\n runningOutput[\"calculated_ee\"] = output\r\n }\r\n\r\n private calculatedTaxableEarningsOutput(runningOutput: any) {\r\n const output: any = {}\r\n\r\n // Define the fields\r\n output[\"net_active_business_earnings\"] = 0\r\n output[\"capital_gains_taxable\"] = 0\r\n output[\"other_inclusions\"] = 0\r\n output[\"earnings_before_taxes\"] = 0\r\n output[\"taxes_paid_property_income_fapi\"] = 0\r\n output[\"taxes_paid_capital_gain_fapi\"] = 0\r\n output[\"taxes_paid_rechar_active\"] = 0\r\n output[\"taxes_paid_capital_gain\"] = 0\r\n output[\"total_taxes\"] = 0\r\n output[\"earnings_cy\"] = 0\r\n // Used for both FAPI Section\r\n output[\"fapi_cg_portion\"] = this.calculator.capitalGainsPortions.fapi\r\n output[\r\n \"fapi_including_cg_portion\"\r\n ] = this.calculator.fapiIncludingCapitalGainsPortion\r\n\r\n // Generate the calculated values\r\n const incomeLossRecharUnder95a = this.calculator.values[\r\n \"952a_amounts_increase_taxable\"\r\n ].value\r\n const incomeLossRecharCtr = this.calculator.values[\r\n \"ctr_amounts_increase_taxable\"\r\n ].value\r\n\r\n const otherInclusions = this.calculator.earningsInclusions(\r\n \"taxable_earnings\"\r\n )\r\n\r\n // line 234 [output]\r\n const FITRFAPI = this.calculator.FITRAllocation(\"fitr_fapi\")\r\n // line 235 [output]\r\n const FITRCapitalgainFapi = this.calculator.FITRAllocation(\r\n \"fitr_capital_gain_loss_fapi\"\r\n )\r\n // line 236 [output]\r\n const taxesPaidRecharActive = this.calculator.taxesApplicableTo952a(\r\n \"952a_amounts_increase_taxable\"\r\n )\r\n // line 237 [output]\r\n const FITRCapitalgainTaxable = this.calculator.FITRAllocation(\r\n \"fitr_capital_gain_loss_taxable\"\r\n )\r\n\r\n // Set the values\r\n output[\"net_active_business_earnings\"] = !this.calculator\r\n .designatedTreatyCountry\r\n ? round(this.calculator.netEarningsFromActiveBusiness)\r\n : 0\r\n output[\"capital_gains_taxable\"] = round(\r\n this.calculator.capitalGainsPortions.taxable\r\n )\r\n output[\"other_inclusions\"] = round(otherInclusions)\r\n output[\"earnings_before_taxes\"] =\r\n output[\"capital_gains_taxable\"] +\r\n output[\"other_inclusions\"] +\r\n output[\"net_active_business_earnings\"] +\r\n round(incomeLossRecharUnder95a) +\r\n round(incomeLossRecharCtr) +\r\n output[\"fapi_including_cg_portion\"]\r\n\r\n output[\"taxes_paid_property_income_fapi\"] = round(FITRFAPI)\r\n output[\"taxes_paid_capital_gain_fapi\"] = round(FITRCapitalgainFapi)\r\n output[\"taxes_paid_rechar_active\"] = round(taxesPaidRecharActive)\r\n output[\"taxes_paid_capital_gain\"] = round(FITRCapitalgainTaxable)\r\n\r\n output[\"total_taxes\"] =\r\n output[\"taxes_paid_property_income_fapi\"] +\r\n output[\"taxes_paid_capital_gain_fapi\"] +\r\n output[\"taxes_paid_rechar_active\"] +\r\n output[\"taxes_paid_capital_gain\"]\r\n\r\n output[\"earnings_cy\"] =\r\n output[\"earnings_before_taxes\"] + output[\"total_taxes\"]\r\n\r\n runningOutput[\"calculated_te\"] = output\r\n }\r\n\r\n private calculatedEarningsFromAnActiveBusiness(runningOutput: any) {\r\n const output: any = {}\r\n output[\r\n \"calculated_adjusted_before_5907\"\r\n ] = this.calculator.adjustedTaxableIncomeLossBeforeReg5907\r\n output[\r\n \"calculated_efab_total_adjustments\"\r\n ] = this.calculator.adjustmentsItemsNotEarningsOrNil\r\n output[\r\n \"calculated_adjusted_earnings_before_depreciation_election\"\r\n ] = this.calculator.adjustedEarningsBeforeDepreciationElection\r\n output[\"calculated_5907_adjustment\"] = this.calculator.reg5907andAdjustment\r\n output[\r\n \"calculated_total_depreciation_adjustment\"\r\n ] = this.calculator.totalAdjustmentForDepreciationElection\r\n output[\r\n \"calculated_total_5907_earnings\"\r\n ] = this.calculator.totalEarningsPerReg5907\r\n output[\r\n \"calculated_fitr_active_earnings_before_5907\"\r\n ] = this.calculator.FITRAllocation(\r\n \"fitr_foreign_active_earnings_before_reg5907\"\r\n )\r\n output[\r\n \"calculated_net_earnings\"\r\n ] = this.calculator.netEarningsFromActiveBusiness\r\n\r\n runningOutput[\"calculated_efab\"] = output\r\n }\r\n\r\n private calculatedAllocationOfIncomeAndTaxes(runningOutput: any) {\r\n const output: any = {}\r\n\r\n output[\r\n \"foreign_income_tax_refunded\"\r\n ] = this.calculator.foreignIncomeTaxRefunded\r\n\r\n output[\r\n \"calculated_fitr_active_earnings_before_5907\"\r\n ] = this.calculator.FITRAllocation(\r\n \"fitr_foreign_active_earnings_before_reg5907\"\r\n )\r\n\r\n output[\r\n \"calculated_fitr_capital_gain_loss\"\r\n ] = this.calculator.FITRAllocation(\"fitr_capital_gain_loss\")\r\n\r\n output[\r\n \"calculated_fitr_capital_gain_loss_taxable\"\r\n ] = this.calculator.FITRAllocation(\"fitr_capital_gain_loss_taxable\")\r\n\r\n output[\r\n \"calculated_fitr_capital_gain_loss_fapi\"\r\n ] = this.calculator.FITRAllocation(\"fitr_capital_gain_loss_fapi\")\r\n\r\n output[\r\n \"calculated_fitr_capital_gain_loss_hybrid\"\r\n ] = this.calculator.FITRAllocation(\"fitr_capital_gain_loss_hybrid\")\r\n\r\n output[\"calculated_fitr_fapi\"] = this.calculator.FITRAllocation(\"fitr_fapi\")\r\n\r\n output[\r\n \"calculated_fitr_income_loss_recharacterized_952a\"\r\n ] = this.calculator.FITRAllocation(\"fitr_income_loss_recharacterized_952a\")\r\n\r\n output[\r\n \"calculated_fitr_income_loss_recharacterized_952a_taxable\"\r\n ] = this.calculator.FITRAllocation(\r\n \"fitr_income_loss_recharacterized_952a_taxable\"\r\n )\r\n\r\n output[\r\n \"calculated_fitr_items_not_earnings_nil\"\r\n ] = this.calculator.FITRAllocation(\"fitr_items_not_earnings_nil\")\r\n\r\n output[\"calculated_fitr_total\"] =\r\n output[\"calculated_fitr_active_earnings_before_5907\"] +\r\n output[\"calculated_fitr_capital_gain_loss\"] +\r\n output[\"calculated_fitr_capital_gain_loss_taxable\"] +\r\n output[\"calculated_fitr_capital_gain_loss_fapi\"] +\r\n output[\"calculated_fitr_capital_gain_loss_hybrid\"] +\r\n output[\"calculated_fitr_fapi\"] +\r\n output[\"calculated_fitr_income_loss_recharacterized_952a\"] +\r\n output[\"calculated_fitr_income_loss_recharacterized_952a_taxable\"] +\r\n output[\"calculated_fitr_items_not_earnings_nil\"]\r\n\r\n output[\r\n \"calculated_tax_exempt_allocation_factor\"\r\n ] = this.calculator.taxAllocationFactors.exempt\r\n output[\r\n \"calculated_tax_fapi_allocation_factor\"\r\n ] = this.calculator.taxAllocationFactors.fapi\r\n output[\r\n \"calculated_tax_taxable_allocation_factor\"\r\n ] = this.calculator.taxAllocationFactors.taxable\r\n\r\n output[\"calculated_tax_allocation_total\"] = (\r\n this.calculator.taxAllocationFactors.exempt +\r\n this.calculator.taxAllocationFactors.fapi +\r\n this.calculator.taxAllocationFactors.taxable\r\n ).toFixed(2)\r\n\r\n output[\r\n \"calculated_refund_exempt_allocation_factor\"\r\n ] = this.calculator.refundAllocationFactors.exempt\r\n output[\r\n \"calculated_refund_fapi_allocation_factor\"\r\n ] = this.calculator.refundAllocationFactors.fapi\r\n output[\r\n \"calculated_refund_taxable_allocation_factor\"\r\n ] = this.calculator.refundAllocationFactors.taxable\r\n\r\n output[\"calculated_refund_allocation_total\"] = (\r\n this.calculator.refundAllocationFactors.exempt +\r\n this.calculator.refundAllocationFactors.fapi +\r\n this.calculator.refundAllocationFactors.taxable\r\n ).toFixed(2)\r\n\r\n output[\r\n \"calculated_exempt_capital_gains_portion\"\r\n ] = this.calculator.capitalGainsPortions.exempt\r\n output[\r\n \"calculated_fapi_capital_gains_portion\"\r\n ] = this.calculator.capitalGainsPortions.fapi\r\n output[\r\n \"calculated_taxable_capital_gains_portion\"\r\n ] = this.calculator.capitalGainsPortions.taxable\r\n\r\n output[\"calculated_capital_gains_total\"] = round(\r\n this.calculator.capitalGainsPortions.exempt +\r\n this.calculator.capitalGainsPortions.fapi +\r\n this.calculator.capitalGainsPortions.taxable\r\n )\r\n\r\n // Taxable Income Section\r\n // line 176\r\n output[\r\n \"taxable_income_active_earnings_before_59072_adjustments\"\r\n ] = this.calculator.FITRTaxableIncome[\r\n \"taxable_income_active_earnings_before_59072_adjustments\"\r\n ]\r\n // line 177\r\n output[\"taxable_income_capital_gains\"] = this.calculator.FITRTaxableIncome[\r\n \"taxable_income_capital_gains\"\r\n ]\r\n // line 178\r\n output[\"taxable_income_fapi\"] = this.calculator.FITRTaxableIncome[\r\n \"taxable_income_fapi\"\r\n ]\r\n // line 179 = output -129\r\n output[\r\n \"taxable_income_income_recharacterized_under_952a\"\r\n ] = this.calculator.FITRTaxableIncome[\r\n \"taxable_income_income_recharacterized_under_952a\"\r\n ]\r\n // line 180 = output -137\r\n output[\r\n \"taxable_income_items_not_nil_for_cdn_income_tax\"\r\n ] = this.calculator.FITRTaxableIncome[\r\n \"taxable_income_items_not_nil_for_cdn_income_tax\"\r\n ]\r\n\r\n runningOutput[\"calculated_allocation\"] = output\r\n }\r\n\r\n private calculatedExemptSurplusOutput(runningOutput: any) {\r\n const output: any = {}\r\n\r\n // Define the fields\r\n // In order of the excel\r\n // Output 245\r\n output[\"rechar_preacq_dividend_paid_by\"] = this.calculator.openings\r\n .recharacterizedAmounts\r\n ? this.calculator.openings.recharacterizedAmounts.exemptBalance\r\n : 0\r\n\r\n output[\"rechar_preacq_dividend_paid_by_2\"] = this.calculator.closings\r\n .recharacterizedAmounts\r\n ? this.calculator.closings.recharacterizedAmounts.exemptBalance\r\n : 0\r\n // Output 246\r\n output[\"adjusted_opening\"] = 0\r\n // Output 310\r\n output[\"earnings_cy\"] = 0\r\n\r\n output[\"adjusted_opening\"] = this.calculator.openings[\"exemptBalance\"]\r\n\r\n runningOutput[\"calculated_es\"] = output\r\n\r\n // Get the values from the calculator.alterations\r\n output[\"sep_periods\"] = this.accrueAlterations(\r\n this.alterationsExemptSurplusOutput,\r\n runningOutput\r\n )\r\n\r\n // Set the values\r\n output[\"earnings_cy\"] = this.calculator.closingExemptEarnings\r\n\r\n runningOutput[\"calculated_es\"] = output\r\n }\r\n\r\n private alterationsExemptSurplusOutput(\r\n alterations: Alteration[],\r\n runningOutput: any,\r\n sepMultplier: number = 1,\r\n runningSEPPeriods: any = null\r\n ) {\r\n const output: any = {}\r\n // Calculation of Exempt Surplus\r\n output[\"sep_adjustment\"] = sepMultplier\r\n if (runningSEPPeriods) {\r\n let closingAfterLastSep = getDeepProperty(\r\n [\"calculated_es\", \"adjusted_opening\"],\r\n runningOutput\r\n )\r\n const sepPeriodsDone = Object.keys(runningSEPPeriods)\r\n\r\n // If we have other SEP periods that were already created, used their closing value\r\n if (sepPeriodsDone.length > 0) {\r\n closingAfterLastSep =\r\n runningSEPPeriods[sepPeriodsDone[sepPeriodsDone.length - 1]][\r\n \"closing_surplus\"\r\n ] * sepMultplier\r\n }\r\n output[\"closing_after_last_sep\"] = round(closingAfterLastSep)\r\n }\r\n\r\n // Create all fields necessary\r\n // Output 297\r\n output[\"dividends_received_from_surplus_of_another_fa\"] = 0\r\n // Output 298\r\n output[\"deemed_dividends_received_from_surplus_s93_or_11\"] = 0\r\n // Output 299\r\n output[\"dividends_received_deductible_under_s112\"] = 0\r\n // Output 300\r\n output[\"tax_refunded_paid\"] = 0\r\n // Comes from 'FOREIGN TAX RE: CONSOLIDATION/GROUP RELIEF (+/-)'\r\n // Output 301\r\n output[\"tax_adj_consolidation\"] = 0\r\n // Comes from 'OTHER INCLUSIONS/(DEDUCTIONS)'\r\n // Output 302\r\n output[\"other_additions\"] = 0\r\n // Output 303\r\n output[\"total_change\"] = 0\r\n\r\n // Comes from 'Dividend paid'\r\n // Output 305\r\n output[\"surplus_before_dividend_payout\"] = 0\r\n // Output 306\r\n output[\"dividends_paid\"] = 0\r\n // Output 307\r\n output[\"deemed_dividends_paid_s93_11\"] = 0\r\n // Output 308\r\n output[\"closing_surplus\"] = 0\r\n\r\n // Calculate the values\r\n alterations\r\n .filter(\r\n (alteration: Alteration) =>\r\n alteration.movement.to === \"exempt_surplus\" ||\r\n alteration.movement.from === \"exempt_surplus\"\r\n )\r\n .forEach((alteration: Alteration) => {\r\n let amount = round(alteration.amount)\r\n const type = alteration.type\r\n\r\n switch (type) {\r\n case \"dividend_paid\":\r\n const dividendPaid = alteration.metadata.dividend as Dividend\r\n amount = Math.abs(amount) * -1\r\n if (dividendPaid.schedule_93) {\r\n output[\"deemed_dividends_paid_s93_11\"] += amount\r\n } else {\r\n output[\"dividends_paid\"] += amount\r\n }\r\n break\r\n case \"dividend_recieved\":\r\n const dividendReceived = alteration.metadata.dividend as Dividend\r\n\r\n // Depending on where the amount comes from... (ie. tax)\r\n switch (alteration.movement.from) {\r\n case \"tax_amount\":\r\n output[\"tax_refunded_paid\"] -= amount\r\n break\r\n case \"amount\":\r\n // @TODO: confirm logic\r\n if (dividendReceived.category === \"S112\") {\r\n output[\"dividends_received_deductible_under_s112\"] += amount\r\n } else if (dividendReceived.schedule_93) {\r\n output[\r\n \"deemed_dividends_received_from_surplus_s93_or_11\"\r\n ] += amount\r\n } else {\r\n output[\r\n \"dividends_received_from_surplus_of_another_fa\"\r\n ] += amount\r\n }\r\n break\r\n }\r\n break\r\n case \"adjustment\":\r\n const adjustment = alteration.metadata.adjustment as Adjustment\r\n const metadata = JSON.parse(adjustment.metadata)\r\n const metaId = metadata.meta_id || \"\"\r\n switch (metaId) {\r\n case \"foreign_tax_consolidation\":\r\n output[\"tax_adj_consolidation\"] += amount\r\n break\r\n case \"other_inclusions\":\r\n output[\"other_additions\"] += amount\r\n break\r\n }\r\n\r\n break\r\n }\r\n })\r\n\r\n // Set the values\r\n output[\"total_change\"] =\r\n output[\"dividends_received_from_surplus_of_another_fa\"] +\r\n output[\"deemed_dividends_received_from_surplus_s93_or_11\"] +\r\n output[\"dividends_received_deductible_under_s112\"] +\r\n output[\"tax_refunded_paid\"] +\r\n output[\"tax_adj_consolidation\"] +\r\n output[\"other_additions\"]\r\n\r\n output[\"surplus_before_dividend_payout\"] =\r\n output[\"closing_after_last_sep\"] + output[\"total_change\"]\r\n\r\n output[\"closing_surplus\"] =\r\n output[\"surplus_before_dividend_payout\"] +\r\n output[\"dividends_paid\"] +\r\n output[\"deemed_dividends_paid_s93_11\"]\r\n\r\n return output\r\n }\r\n\r\n private calculatedHybridSurplusOutput(runningOutput: any) {\r\n const output: any = {}\r\n\r\n // Define the fields\r\n // In order of the excel\r\n // Output 317\r\n output[\"rechar_preacq_dividend_paid_by\"] = this.calculator.openings\r\n .recharacterizedAmounts\r\n ? this.calculator.openings.recharacterizedAmounts.hybridBalance\r\n : 0\r\n output[\"rechar_preacq_dividend_paid_by_2\"] = this.calculator.closings\r\n .recharacterizedAmounts\r\n ? this.calculator.closings.recharacterizedAmounts.hybridBalance\r\n : 0\r\n // Output 318\r\n output[\"adjusted_opening\"] = 0\r\n\r\n output[\"adjusted_opening\"] = this.calculator.openings[\"hybridBalance\"]\r\n\r\n runningOutput[\"calculated_hs\"] = output\r\n\r\n // Get the values from the calculator.alterations\r\n output[\"sep_periods\"] = this.accrueAlterations(\r\n this.alterationsHybridSurplusOutput,\r\n runningOutput\r\n )\r\n\r\n runningOutput[\"calculated_hs\"] = output\r\n }\r\n\r\n private alterationsHybridSurplusOutput(\r\n alterations: Alteration[],\r\n runningOutput: any,\r\n sepMultplier: number = 1,\r\n runningSEPPeriods: any = null\r\n ) {\r\n const output: any = {}\r\n // Calculation of Exempt Surplus\r\n output[\"sep_adjustment\"] = sepMultplier\r\n if (runningSEPPeriods) {\r\n let closingAfterLastSep = getDeepProperty(\r\n [\"calculated_hs\", \"adjusted_opening\"],\r\n runningOutput\r\n )\r\n const sepPeriodsDone = Object.keys(runningSEPPeriods)\r\n\r\n // If we have other SEP periods that were already created, used their closing value\r\n if (sepPeriodsDone.length > 0) {\r\n closingAfterLastSep =\r\n runningSEPPeriods[sepPeriodsDone[sepPeriodsDone.length - 1]][\r\n \"closing_surplus\"\r\n ] * sepMultplier\r\n }\r\n output[\"closing_after_last_sep\"] = round(closingAfterLastSep)\r\n }\r\n\r\n // Create all fields necessary\r\n // Output 321\r\n output[\"disposition_adjustment_before_taxes\"] = 0\r\n // Output 322\r\n output[\"disposition_adjustment_taxes\"] = 0\r\n // Output 323\r\n output[\"dividends_received_from_surplus_of_another_fa\"] = 0\r\n // Output 324\r\n output[\"deemed_dividends_received_from_surplus_s93_or_11\"] = 0\r\n // Output 325\r\n output[\"tax_paid_on_dividends_received\"] = 0\r\n // output 326\r\n output[\"tax_adj_consolidation\"] = 0\r\n // output 327\r\n output[\"other_additions\"] = 0\r\n\r\n // Output 330\r\n output[\"surplus_before_dividend_payout\"] = 0\r\n // Output 331\r\n output[\"dividends_paid\"] = 0\r\n // Output 332\r\n output[\"deemed_dividends_paid_s93_11\"] = 0\r\n // Output 385\r\n output[\"closing_surplus\"] = 0\r\n\r\n // Calculate the values\r\n alterations\r\n .filter(\r\n (alteration: Alteration) =>\r\n alteration.movement.to === \"hybrid_surplus\" ||\r\n alteration.movement.from === \"hybrid_surplus\"\r\n )\r\n .forEach((alteration: Alteration) => {\r\n let amount = round(alteration.amount)\r\n const type = alteration.type\r\n\r\n switch (type) {\r\n case \"dividend_paid\":\r\n const dividendPaid = alteration.metadata.dividend as Dividend\r\n amount = Math.abs(amount) * -1\r\n if (dividendPaid.schedule_93) {\r\n output[\"deemed_dividends_received_s93_11\"] += amount\r\n } else {\r\n output[\"dividends_paid\"] += amount\r\n }\r\n break\r\n case \"dividend_recieved\":\r\n const dividendReceived = alteration.metadata.dividend as Dividend\r\n\r\n // Depending on where the amount comes from... (ie. tax)\r\n switch (alteration.movement.from) {\r\n case \"tax_amount\":\r\n output[\"tax_paid_on_dividends_received\"] -= amount\r\n break\r\n case \"amount\":\r\n if (dividendReceived.schedule_93) {\r\n output[\r\n \"deemed_dividends_received_from_surplus_s93_or_11\"\r\n ] += amount\r\n } else {\r\n output[\r\n \"dividends_received_from_surplus_of_another_fa\"\r\n ] += amount\r\n }\r\n break\r\n }\r\n break\r\n case \"adjustment\":\r\n const adjustment = alteration.metadata.adjustment as Adjustment\r\n const metadata = JSON.parse(adjustment.metadata)\r\n const metaId = metadata.meta_id || \"\"\r\n switch (metaId) {\r\n case \"foreign_tax_consolidation\":\r\n output[\"tax_adj_consolidation\"] += amount\r\n break\r\n case \"other_inclusions\":\r\n output[\"other_additions\"] += amount\r\n break\r\n }\r\n break\r\n case \"disposition_adjustment\":\r\n if (alteration.movement.from === \"amount\") {\r\n output[\"disposition_adjustment_before_taxes\"] += amount\r\n } else if (alteration.movement.from === \"tax_amount\") {\r\n output[\"disposition_adjustment_taxes\"] += amount\r\n }\r\n break\r\n }\r\n })\r\n\r\n // Set the values\r\n output[\"total_change\"] =\r\n output[\"dividends_received_from_surplus_of_another_fa\"] +\r\n output[\"disposition_adjustment_before_taxes\"] +\r\n output[\"disposition_adjustment_taxes\"] +\r\n output[\"deemed_dividends_received_from_surplus_s93_or_11\"] +\r\n output[\"tax_adj_consolidation\"] +\r\n output[\"tax_paid_on_dividends_received\"] +\r\n output[\"other_additions\"]\r\n\r\n output[\"surplus_before_dividend_payout\"] =\r\n output[\"closing_after_last_sep\"] + output[\"total_change\"]\r\n\r\n output[\"closing_surplus\"] =\r\n output[\"surplus_before_dividend_payout\"] +\r\n output[\"dividends_paid\"] +\r\n output[\"deemed_dividends_paid_s93_11\"]\r\n\r\n return output\r\n }\r\n\r\n private calculatedTaxableSurplusOutput(runningOutput: any) {\r\n const output: any = {}\r\n\r\n // Define the fields\r\n // In order of the excel\r\n // Output 390\r\n output[\"rechar_preacq_dividend_paid_by\"] = this.calculator.openings\r\n .recharacterizedAmounts\r\n ? this.calculator.openings.recharacterizedAmounts.taxableBalance\r\n : 0\r\n output[\"rechar_preacq_dividend_paid_by_2\"] = this.calculator.closings\r\n .recharacterizedAmounts\r\n ? this.calculator.closings.recharacterizedAmounts.taxableBalance\r\n : 0\r\n // Output 391\r\n output[\"adjusted_opening\"] = 0\r\n // Output 451\r\n output[\"earnings_cy\"] = 0\r\n\r\n output[\"adjusted_opening\"] = this.calculator.openings[\"taxableBalance\"]\r\n\r\n runningOutput[\"calculated_ts\"] = output\r\n\r\n // Get the values from the calculator.alterations\r\n output[\"sep_periods\"] = this.accrueAlterations(\r\n this.alterationsTaxableSurplusOutput,\r\n runningOutput\r\n )\r\n\r\n // Set the values\r\n output[\"earnings_cy\"] = this.calculator.closingTaxableEarnings\r\n\r\n runningOutput[\"calculated_ts\"] = output\r\n }\r\n\r\n private alterationsTaxableSurplusOutput(\r\n alterations: Alteration[],\r\n runningOutput: any,\r\n sepMultplier: number = 1,\r\n runningSEPPeriods: any = null\r\n ) {\r\n const output: any = {}\r\n // Calculation of Taxable Surplus\r\n output[\"sep_adjustment\"] = sepMultplier\r\n if (runningSEPPeriods) {\r\n let closingAfterLastSep = getDeepProperty(\r\n [\"calculated_ts\", \"adjusted_opening\"],\r\n runningOutput\r\n )\r\n const sepPeriodsDone = Object.keys(runningSEPPeriods)\r\n\r\n // If we have other SEP periods that were already created, used their closing value\r\n if (sepPeriodsDone.length > 0) {\r\n closingAfterLastSep =\r\n runningSEPPeriods[sepPeriodsDone[sepPeriodsDone.length - 1]][\r\n \"closing_surplus\"\r\n ] * sepMultplier\r\n }\r\n output[\"closing_after_last_sep\"] = round(closingAfterLastSep)\r\n }\r\n\r\n // Create all fields necessary\r\n // Output 439\r\n output[\"dividends_received_from_surplus_of_another_fa\"] = 0\r\n // Output 440\r\n output[\"deemed_dividends_received_from_surplus_s93_or_11\"] = 0\r\n // Output 441\r\n output[\"tax_refunded_paid\"] = 0\r\n // Comes from 'FOREIGN TAX RE: CONSOLIDATION/GROUP RELIEF (+/-)'\r\n // Output 442\r\n output[\"tax_adj_consolidation\"] = 0\r\n // Comes from 'OTHER INCLUSIONS/(DEDUCTIONS)'\r\n // Output 443\r\n output[\"other_additions\"] = 0\r\n // Output 444\r\n output[\"total_change\"] = 0\r\n\r\n // Comes from 'Dividend paid'\r\n // Output 446\r\n output[\"surplus_before_dividend_payout\"] = 0\r\n // Output 447\r\n output[\"dividends_paid\"] = 0\r\n // Output 448\r\n output[\"deemed_dividends_paid_s93_11\"] = 0\r\n // Output 449\r\n output[\"closing_surplus\"] = 0\r\n\r\n // Calculate the values\r\n alterations\r\n .filter(\r\n (alteration: Alteration) =>\r\n alteration.movement.to === \"taxable_surplus\" ||\r\n alteration.movement.from === \"taxable_surplus\"\r\n )\r\n .forEach((alteration: Alteration) => {\r\n let amount = round(alteration.amount)\r\n const type = alteration.type\r\n\r\n switch (type) {\r\n case \"dividend_paid\":\r\n const dividendPaid = alteration.metadata.dividend as Dividend\r\n amount = Math.abs(amount) * -1\r\n if (dividendPaid.schedule_93) {\r\n output[\"deemed_dividends_paid_s93_11\"] += amount\r\n } else {\r\n output[\"dividends_paid\"] += amount\r\n }\r\n break\r\n case \"dividend_recieved\":\r\n const dividendReceived = alteration.metadata.dividend as Dividend\r\n\r\n // Depending on where the amount comes from... (ie. tax)\r\n switch (alteration.movement.from) {\r\n case \"tax_amount\":\r\n output[\"tax_refunded_paid\"] -= amount\r\n break\r\n case \"amount\":\r\n // @TODO: confirm logic\r\n if (dividendReceived.schedule_93) {\r\n output[\r\n \"deemed_dividends_received_from_surplus_s93_or_11\"\r\n ] += amount\r\n } else {\r\n output[\r\n \"dividends_received_from_surplus_of_another_fa\"\r\n ] += amount\r\n }\r\n break\r\n }\r\n break\r\n case \"adjustment\":\r\n const adjustment = alteration.metadata.adjustment as Adjustment\r\n const metadata = JSON.parse(adjustment.metadata)\r\n const metaId = metadata.meta_id || \"\"\r\n switch (metaId) {\r\n case \"foreign_tax_consolidation\":\r\n output[\"tax_adj_consolidation\"] += amount\r\n break\r\n case \"other_inclusions\":\r\n output[\"other_additions\"] += amount\r\n break\r\n }\r\n\r\n break\r\n }\r\n })\r\n\r\n // Set the values\r\n output[\"total_change\"] =\r\n output[\"dividends_received_from_surplus_of_another_fa\"] +\r\n output[\"deemed_dividends_received_from_surplus_s93_or_11\"] +\r\n output[\"tax_refunded_paid\"] +\r\n output[\"tax_adj_consolidation\"] +\r\n output[\"other_additions\"]\r\n\r\n output[\"surplus_before_dividend_payout\"] =\r\n output[\"closing_after_last_sep\"] + output[\"total_change\"]\r\n\r\n output[\"closing_surplus\"] =\r\n output[\"surplus_before_dividend_payout\"] +\r\n output[\"dividends_paid\"] +\r\n output[\"deemed_dividends_paid_s93_11\"]\r\n\r\n return output\r\n }\r\n\r\n private calculatedHutSurplusOutput(runningOutput: any) {\r\n const output: any = {}\r\n\r\n // Define the fields\r\n // In order of the excel\r\n // Output 458\r\n output[\"rechar_preacq_dividend_paid_by\"] = 0\r\n output[\"rechar_preacq_dividend_paid_by_2\"] = 0\r\n // Output 459\r\n output[\"adjusted_opening\"] = 0\r\n\r\n output[\"rechar_preacq_dividend_paid_by\"] = this.calculator.openings\r\n .recharacterizedAmounts\r\n ? this.calculator.openings.recharacterizedAmounts.hutBalance\r\n : 0\r\n output[\"rechar_preacq_dividend_paid_by_2\"] = this.calculator.closings\r\n .recharacterizedAmounts\r\n ? this.calculator.closings.recharacterizedAmounts.hutBalance\r\n : 0\r\n\r\n output[\"adjusted_opening\"] = this.calculator.openings[\"hutBalance\"]\r\n\r\n runningOutput[\"calculated_hut\"] = output\r\n\r\n // Get the values from the calculator.alterations\r\n output[\"sep_periods\"] = this.accrueAlterations(\r\n this.alterationsHutSurplusOutput,\r\n runningOutput\r\n )\r\n\r\n // Set the values\r\n runningOutput[\"calculated_hut\"] = output\r\n }\r\n\r\n private alterationsHutSurplusOutput(\r\n alterations: Alteration[],\r\n runningOutput: any,\r\n sepMultplier: number = 1,\r\n runningSEPPeriods: any = null\r\n ) {\r\n const output: any = {}\r\n // Calculation of Hut Surplus\r\n output[\"sep_adjustment\"] = sepMultplier\r\n if (runningSEPPeriods) {\r\n let closingAfterLastSep = getDeepProperty(\r\n [\"calculated_hut\", \"adjusted_opening\"],\r\n runningOutput\r\n )\r\n const sepPeriodsDone = Object.keys(runningSEPPeriods)\r\n\r\n // If we have other SEP periods that were already created, used their closing value\r\n if (sepPeriodsDone.length > 0) {\r\n closingAfterLastSep =\r\n runningSEPPeriods[sepPeriodsDone[sepPeriodsDone.length - 1]][\r\n \"closing_surplus\"\r\n ] * sepMultplier\r\n }\r\n output[\"closing_after_last_sep\"] = round(closingAfterLastSep)\r\n }\r\n\r\n // Create all fields necessary\r\n\r\n // Output 462\r\n output[\"tax_applicable_to_capital_gain\"] = 0\r\n // Output 463\r\n output[\"tax_applicable_to_dividends_paid_from_hs\"] = 0\r\n // Output 464\r\n output[\"hut_applicable_to_dividends_recieved\"] = 0\r\n // Output 465\r\n output[\"tax_adj_consolidation\"] = 0\r\n // Output 466\r\n output[\"other_additions\"] = 0\r\n // Output 467\r\n output[\"hut_applicable_to_dividends_paid_from_hybrid\"] = 0\r\n\r\n // Calculate the values\r\n alterations\r\n .filter(\r\n (alteration: Alteration) =>\r\n alteration.movement.to === \"hybrid_underlying_taxes\" ||\r\n alteration.movement.from === \"hybrid_underlying_taxes\"\r\n )\r\n .forEach((alteration: Alteration) => {\r\n let amount = round(alteration.amount)\r\n const type = alteration.type\r\n switch (type) {\r\n case \"dividend_paid\":\r\n amount = Math.abs(amount) * -1\r\n output[\"hut_applicable_to_dividends_paid_from_hybrid\"] += amount\r\n break\r\n case \"dividend_recieved\":\r\n // Depending on where the amount comes from... (ie. tax)\r\n switch (alteration.movement.from) {\r\n case \"tax_amount\":\r\n output[\"tax_applicable_to_dividends_paid_from_hs\"] += round(\r\n amount\r\n )\r\n break\r\n case \"hut_amount\":\r\n output[\"hut_applicable_to_dividends_recieved\"] += round(amount)\r\n break\r\n }\r\n break\r\n case \"adjustment\":\r\n const adjustment = alteration.metadata.adjustment as Adjustment\r\n const metadata = JSON.parse(adjustment.metadata)\r\n const metaId = metadata.meta_id || \"\"\r\n switch (metaId) {\r\n case \"foreign_tax_consolidation\":\r\n output[\"tax_adj_consolidation\"] += amount\r\n break\r\n case \"other_inclusions\":\r\n output[\"other_additions\"] += amount\r\n break\r\n }\r\n break\r\n case \"disposition_adjustment\":\r\n if (alteration.movement.from === \"tax_amount\") {\r\n output[\"tax_applicable_to_capital_gain\"] -= amount\r\n }\r\n break\r\n }\r\n })\r\n\r\n // Set the values\r\n output[\"total_change\"] =\r\n output[\"tax_applicable_to_capital_gain\"] +\r\n output[\"tax_applicable_to_dividends_paid_from_hs\"] +\r\n output[\"hut_applicable_to_dividends_recieved\"] +\r\n output[\"tax_adj_consolidation\"] +\r\n output[\"other_additions\"] +\r\n output[\"hut_applicable_to_dividends_paid_from_hybrid\"]\r\n\r\n const closing = output[\"closing_after_last_sep\"] + output[\"total_change\"]\r\n\r\n output[\"closing_surplus\"] = closing > 0 ? closing : 0\r\n\r\n return output\r\n }\r\n\r\n private calculatedUftSurplusOutput(runningOutput: any) {\r\n const output: any = {}\r\n\r\n // Define the fields\r\n // In order of the excel\r\n // Output 458\r\n output[\"rechar_preacq_dividend_paid_by\"] = 0\r\n output[\"rechar_preacq_dividend_paid_by_2\"] = 0\r\n // Output 459\r\n output[\"adjusted_opening\"] = 0\r\n output[\"tax_applicable\"] =\r\n round(\r\n this.calculator.taxesPaidOnTaxableEarnings +\r\n (!this.calculator.designatedTreatyCountry\r\n ? this.calculator.FITRAllocation(\r\n \"fitr_foreign_active_earnings_before_reg5907\"\r\n )\r\n : 0)\r\n ) * -1\r\n\r\n output[\"rechar_preacq_dividend_paid_by\"] = this.calculator.openings\r\n .recharacterizedAmounts\r\n ? this.calculator.openings.recharacterizedAmounts.uftBalance\r\n : 0\r\n\r\n output[\"rechar_preacq_dividend_paid_by_2\"] = this.calculator.closings\r\n .recharacterizedAmounts\r\n ? this.calculator.closings.recharacterizedAmounts.uftBalance\r\n : 0\r\n\r\n output[\"adjusted_opening\"] = this.calculator.openings[\"uftBalance\"]\r\n\r\n runningOutput[\"calculated_uft\"] = output\r\n\r\n // Get the values from the calculator.alterations\r\n output[\"sep_periods\"] = this.accrueAlterations(\r\n this.alterationsUftSurplusOutput,\r\n runningOutput\r\n )\r\n\r\n // Set the values\r\n runningOutput[\"calculated_uft\"] = output\r\n }\r\n\r\n private alterationsUftSurplusOutput(\r\n alterations: Alteration[],\r\n runningOutput: any,\r\n sepMultplier: number = 1,\r\n runningSEPPeriods: any = null\r\n ) {\r\n const output: any = {}\r\n // Calculation of Hut Surplus\r\n output[\"sep_adjustment\"] = sepMultplier\r\n if (runningSEPPeriods) {\r\n let closingAfterLastSep = getDeepProperty(\r\n [\"calculated_uft\", \"adjusted_opening\"],\r\n runningOutput\r\n )\r\n const sepPeriodsDone = Object.keys(runningSEPPeriods)\r\n\r\n // If we have other SEP periods that were already created, used their closing value\r\n if (sepPeriodsDone.length > 0) {\r\n closingAfterLastSep =\r\n runningSEPPeriods[sepPeriodsDone[sepPeriodsDone.length - 1]][\r\n \"closing_surplus\"\r\n ] * sepMultplier\r\n }\r\n output[\"closing_after_last_sep\"] = round(closingAfterLastSep)\r\n }\r\n\r\n // Create all fields necessary\r\n // Output 554\r\n output[\"tax_applicable_to_dividends_paid_from_ts\"] = 0\r\n // Output 555\r\n output[\"uft_applicable_to_dividends_recieved\"] = 0\r\n // Output 556\r\n output[\"tax_adj_consolidation\"] = 0\r\n // Output 557\r\n output[\"other_additions\"] = 0\r\n // Output 558\r\n output[\"uft_applicable_to_dividends_paid_from_taxable\"] = 0\r\n\r\n // Calculate the values\r\n alterations\r\n .filter(\r\n (alteration: Alteration) =>\r\n alteration.movement.to === \"underlying_foreign_taxes\" ||\r\n alteration.movement.from === \"underlying_foreign_taxes\"\r\n )\r\n .forEach((alteration: Alteration) => {\r\n let amount = round(alteration.amount)\r\n const type = alteration.type\r\n switch (type) {\r\n case \"dividend_paid\":\r\n amount = Math.abs(amount) * -1\r\n output[\"uft_applicable_to_dividends_paid_from_taxable\"] += amount\r\n break\r\n case \"dividend_recieved\":\r\n // Depending on where the amount comes from... (ie. tax)\r\n switch (alteration.movement.from) {\r\n case \"tax_amount\":\r\n output[\"tax_applicable_to_dividends_paid_from_ts\"] += round(\r\n amount\r\n )\r\n break\r\n case \"uft_amount\":\r\n output[\"uft_applicable_to_dividends_recieved\"] += round(amount)\r\n break\r\n }\r\n break\r\n case \"adjustment\":\r\n const adjustment = alteration.metadata.adjustment as Adjustment\r\n const metadata = JSON.parse(adjustment.metadata)\r\n const metaId = metadata.meta_id || \"\"\r\n switch (metaId) {\r\n case \"foreign_tax_consolidation\":\r\n output[\"tax_adj_consolidation\"] += amount\r\n break\r\n case \"other_inclusions\":\r\n output[\"other_additions\"] += amount\r\n break\r\n }\r\n\r\n break\r\n }\r\n })\r\n\r\n // Set the values\r\n output[\"total_change\"] =\r\n output[\"tax_applicable_to_dividends_paid_from_ts\"] +\r\n output[\"uft_applicable_to_dividends_recieved\"] +\r\n output[\"tax_adj_consolidation\"] +\r\n output[\"other_additions\"] +\r\n output[\"uft_applicable_to_dividends_paid_from_taxable\"]\r\n\r\n const closing = output[\"closing_after_last_sep\"] + output[\"total_change\"]\r\n\r\n output[\"closing_surplus\"] = closing > 0 ? closing : 0\r\n\r\n return output\r\n }\r\n\r\n private accrueAlterations(sectionHelper: any, runningOutput: any) {\r\n const output: any = {}\r\n // @TODO: Figure out how to clone this object!\r\n let alterations: Alteration[] = CalculatorHelpers.clone(\r\n this.calculator.alterations\r\n )\r\n\r\n // Need to also consider all different SEP periods\r\n const sepTransactions = this.calculator.transactions.filter(\r\n (t: Transaction) => t.getActionType === \"sepAdjustment\"\r\n )\r\n let runningMultiplier =\r\n (this.calculator.reportingPeriod.sepOpening || 100) / 100\r\n\r\n sepTransactions.forEach((sepTransaction: Transaction, index: number) => {\r\n const sepAdjustment = sepTransaction.getAction as SEPAdjustment\r\n const dateThreshold = getDate(sepAdjustment.date)\r\n\r\n // Filter out the calculator.alterations that happened during this period\r\n const alterationsPriorSep = alterations.filter(\r\n (alteration: Alteration) => {\r\n const date: Date = new Date(alteration.date.toString())\r\n return date <= dateThreshold\r\n }\r\n )\r\n alterations = alterations.filter(\r\n (alteration: Alteration) => !alterationsPriorSep.includes(alteration)\r\n )\r\n // Save the output for this SEP period\r\n output[`sep_${index}`] = sectionHelper(\r\n alterationsPriorSep,\r\n runningOutput,\r\n runningMultiplier,\r\n output\r\n )\r\n runningMultiplier = sepAdjustment.multiplier as number\r\n })\r\n\r\n // Calculate the total after the last SEP adjustment (any remaining adjustments will be covered here)\r\n output[\"last\"] = sectionHelper(\r\n alterations,\r\n runningOutput,\r\n runningMultiplier,\r\n output\r\n )\r\n\r\n return output\r\n }\r\n //#endregion\r\n\r\n //#endregion\r\n}\r\n","import {\r\n ReportingPeriod,\r\n SurplusBalanceTypes,\r\n ForeignAffiliate,\r\n SEPAdjustment,\r\n Dividend,\r\n BalanceTypes,\r\n Adjustment,\r\n SurplusOrderingItem,\r\n DispositionAdjustment,\r\n BalanceSnapshot,\r\n DividendTier,\r\n AdjustmentType,\r\n DividendCategory,\r\n ACBAdjustment,\r\n ACBPeriod,\r\n CalculatorException,\r\n} from \"@/interfaces\"\r\nimport { CalculatorHelpers } from \"./CalculatorHelpers\"\r\nimport Transaction, { ActionType } from \"../transaction/Transaction\"\r\nimport Alteration, { AlterationType, Movement } from \"./Alteration\"\r\nimport dateFns from \"date-fns\"\r\nimport { round } from \"@/util/round\"\r\nimport { getDate } from \"@/util/getDate\"\r\nimport _ from \"lodash\"\r\nimport CalculatorOutput from \"./CalculatorOutput\"\r\nimport acbAdjustments from \"../api/acbAdjustments\"\r\n\r\n/**\r\n * Calculator Class used to calculate the closing surplus of\r\n * a Foreign Affiliate for a specific Reporting Period.\r\n *\r\n * @export\r\n * @class Calculator\r\n */\r\nexport default class Calculator {\r\n //#region Member Variables\r\n public values!: any\r\n\r\n public savedClosingsBeforeEarnings: SurplusBalanceTypes = {\r\n exemptBalance: 0,\r\n hybridBalance: 0,\r\n preAcqBalance: 0,\r\n preAcqRecharBalance: 0,\r\n taxableBalance: 0,\r\n hutBalance: 0,\r\n uftBalance: 0,\r\n acbBalance: 0,\r\n }\r\n\r\n public exceptions!: CalculatorException[]\r\n public transactions!: Transaction[]\r\n public alterations: Alteration[] = []\r\n public foreignAffiliate: ForeignAffiliate\r\n public reportingPeriod: ReportingPeriod\r\n public output: any\r\n public openings: SurplusBalanceTypes\r\n public closings: SurplusBalanceTypes = {\r\n exemptBalance: 0,\r\n hybridBalance: 0,\r\n preAcqBalance: 0,\r\n preAcqRecharBalance: 0,\r\n taxableBalance: 0,\r\n hutBalance: 0,\r\n uftBalance: 0,\r\n openingReDeficit: 0,\r\n acbBalance: 0,\r\n }\r\n public calculatorOutput: CalculatorOutput\r\n public balanceSnapshots: any\r\n //#endregion\r\n\r\n //#region Constructors\r\n /**\r\n * Creates an instance of Calculator.\r\n *\r\n * @param {ForeignAffiliate} foreignAffiliate\r\n * @param {ReportingPeriod} reportingPeriod\r\n * @param {SurplusBalanceTypes} openings\r\n * @memberof Calculator\r\n */\r\n constructor(\r\n foreignAffiliate: ForeignAffiliate,\r\n reportingPeriod: ReportingPeriod,\r\n openings: SurplusBalanceTypes\r\n ) {\r\n this.foreignAffiliate = foreignAffiliate\r\n this.reportingPeriod = reportingPeriod\r\n this.openings = {\r\n ...CalculatorHelpers.clone(openings),\r\n preAcqBalance: 0,\r\n preAcqRecharBalance: 0,\r\n }\r\n this.values = CalculatorHelpers.formatValues(this.reportingPeriod.fields)\r\n this.calculatorOutput = new CalculatorOutput(this)\r\n }\r\n //#endregion\r\n\r\n //#region Helpers\r\n public getFieldValue(metaId: string) {\r\n const field = this.values[metaId]\r\n return field ? field.value : 0\r\n }\r\n //#endregion\r\n\r\n //#region Getters\r\n public get sortedAcbPeriod() {\r\n if (!this.foreignAffiliate.acb_periods) {\r\n return []\r\n }\r\n\r\n return this.foreignAffiliate.acb_periods.sort(\r\n (a: ACBPeriod, b: ACBPeriod) =>\r\n getDate(b.date).getTime() - getDate(a.date).getTime()\r\n )\r\n }\r\n\r\n public get getAlterations(): Alteration[] {\r\n return this.alterations\r\n }\r\n\r\n public get getTransactions(): Transaction[] {\r\n return this.transactions\r\n }\r\n\r\n public get generatedOutput() {\r\n return this.output\r\n }\r\n\r\n public get closingBalances() {\r\n return this.closings\r\n }\r\n\r\n public get closingBalancesBeforeRechar() {\r\n return {\r\n ...this.closings,\r\n exemptBalance:\r\n this.closings.exemptBalance -\r\n (this.closings.recharacterizedAmounts\r\n ? this.closings.recharacterizedAmounts.exemptBalance\r\n : 0),\r\n hybridBalance:\r\n this.closings.hybridBalance -\r\n (this.closings.recharacterizedAmounts\r\n ? this.closings.recharacterizedAmounts.hybridBalance\r\n : 0),\r\n taxableBalance:\r\n this.closings.taxableBalance -\r\n (this.closings.recharacterizedAmounts\r\n ? this.closings.recharacterizedAmounts.taxableBalance\r\n : 0),\r\n }\r\n }\r\n\r\n public get closingRe() {\r\n return (\r\n (this.openings.openingReDeficit != undefined &&\r\n this.openings.openingReDeficit +\r\n this.bookIncomeAfterTaxes +\r\n this.areOtherItems) ||\r\n 0\r\n )\r\n }\r\n\r\n public get designatedTreatyCountry(): boolean {\r\n return (\r\n this.reportingPeriod.fa_business_designated_country &&\r\n this.reportingPeriod.fa_resident_designated_country\r\n )\r\n }\r\n\r\n public get fapiIncludingCapitalGainsPortion(): number {\r\n return (\r\n this.capitalGainsPortions.fapi +\r\n this.values[\"fapi_before_deductible_loss\"].value\r\n )\r\n }\r\n\r\n public get bookIncomeAfterTaxes(): number {\r\n return CalculatorHelpers.sumValues([\r\n this.values[\"book_income_before_taxes\"],\r\n this.values[\"deferred_income_taxes\"],\r\n this.values[\"current_income_taxes\"],\r\n ])\r\n }\r\n\r\n public get areOtherItems(): number {\r\n return CalculatorHelpers.sumValues([\r\n this.values[\"dividends_declared\"],\r\n this.values[\"currency_adjustments\"],\r\n this.values[\"prior_year_adjustments\"],\r\n this.values[\"other_items_affecting_re\"],\r\n ])\r\n }\r\n\r\n public get capitalGains(): number {\r\n return CalculatorHelpers.sumValues([\r\n this.values[\"non_excluded_property_facl\"],\r\n this.values[\"active_business_assets_non_dtc\"],\r\n this.values[\"active_business_assets_dtc\"],\r\n this.values[\"other_excluded_property\"],\r\n this.values[\"shares_of_fa_or_partnership_interest_before_hybrid\"],\r\n ])\r\n }\r\n\r\n public get capitalGainsInclusionRate(): number {\r\n return this.getFieldValue(\"capital_gain_inclusion_rate\") / 100\r\n }\r\n\r\n public get openingExemptEarnings(): number {\r\n let total = 0\r\n if (this.designatedTreatyCountry) {\r\n // line 213 [output]\r\n total += this.netEarningsFromActiveBusiness\r\n }\r\n // add exempt capital gain portions and adjustsments under 952a\r\n // line 213 [output]\r\n total += this.capitalGainsPortions.exempt\r\n // line 214 [output]\r\n total += this.getFieldValue(\"952a_amounts_increase_exempt\")\r\n // New Line\r\n total += this.getFieldValue(\"ctr_amounts_increase_exempt\")\r\n // line 219 and 220 [output]\r\n total += this.totalExemptTaxesPaidRefunded\r\n\r\n return total\r\n }\r\n\r\n public get openingTaxableEarnings(): number {\r\n let total = 0\r\n if (!this.designatedTreatyCountry) {\r\n total += this.netEarningsFromActiveBusiness\r\n }\r\n // line 228 [output]\r\n total += this.fapiIncludingCapitalGainsPortion\r\n // line 229 [output]\r\n total += this.getFieldValue(\"952a_amounts_increase_taxable\")\r\n // New Canadian Tax Rules\r\n total += this.getFieldValue(\"ctr_amounts_increase_taxable\")\r\n // line 230 [output]\r\n total += this.capitalGainsPortions.taxable\r\n\r\n // @TODO - confirm logic with ICT\r\n // line 234 [output]\r\n total += this.FITRAllocation(\"fitr_fapi\")\r\n // line 235 [output]\r\n total += this.FITRAllocation(\"fitr_capital_gain_loss_fapi\")\r\n // line 236 [output]\r\n total += this.taxesApplicableTo952a(\"952a_amounts_increase_taxable\")\r\n // line 237 [output]\r\n total += this.FITRAllocation(\"fitr_capital_gain_loss_taxable\")\r\n\r\n return total\r\n }\r\n\r\n public get closingExemptEarnings(): number {\r\n return (\r\n this.openingExemptEarnings + this.earningsInclusions(\"exempt_earnings\")\r\n )\r\n }\r\n\r\n public get closingTaxableEarnings(): number {\r\n return (\r\n this.openingTaxableEarnings + this.earningsInclusions(\"taxable_earnings\")\r\n )\r\n }\r\n\r\n public get taxesPaidOnTaxableEarnings() {\r\n return (\r\n this.FITRAllocation(\"fitr_fapi\") +\r\n this.FITRAllocation(\"fitr_capital_gain_loss_fapi\") +\r\n this.taxesApplicableTo952a(\"952a_amounts_increase_taxable\") +\r\n this.FITRAllocation(\"fitr_capital_gain_loss_taxable\")\r\n )\r\n }\r\n\r\n public get hybridSurplusGainLoss(): number {\r\n const { disposition_adjustments } = this.reportingPeriod\r\n if (disposition_adjustments) {\r\n const total = disposition_adjustments.reduce(\r\n (acc, curr) => (acc = acc + curr.amount),\r\n 0\r\n )\r\n return total\r\n } else {\r\n return 0\r\n }\r\n }\r\n\r\n public get hybridDispositionTaxes(): number {\r\n const { disposition_adjustments } = this.reportingPeriod\r\n if (disposition_adjustments) {\r\n const total = disposition_adjustments.reduce(\r\n (acc, curr) => (acc = acc + curr.tax_on_amount),\r\n 0\r\n )\r\n return total * -1\r\n } else {\r\n return 0\r\n }\r\n }\r\n\r\n //#region Allocation of taxes to sources of income/(loss)\r\n /**\r\n * Values coming from Section E.2 are used to be split into Capital Gains portions, which\r\n * are then used for calculating the allocation factors.\r\n *\r\n * @readonly\r\n * @type {*}\r\n * @memberof Calculator\r\n */\r\n public get capitalGainsPortions(): any {\r\n const portions = {\r\n exempt: 0,\r\n fapi: 0,\r\n taxable: 0,\r\n }\r\n const remainingCapitalGainsInclusionRate =\r\n 1 - this.capitalGainsInclusionRate\r\n // Exempt, Taxable, FAPI (come from inputs)\r\n // Non-excluded property\r\n portions.exempt +=\r\n this.getFieldValue(\"non_excluded_property_facl\") *\r\n remainingCapitalGainsInclusionRate\r\n portions.fapi +=\r\n this.getFieldValue(\"non_excluded_property_facl\") *\r\n this.capitalGainsInclusionRate\r\n // Active Business Assets - non-DTC\r\n portions.exempt +=\r\n this.getFieldValue(\"active_business_assets_non_dtc\") *\r\n remainingCapitalGainsInclusionRate\r\n portions.taxable +=\r\n this.getFieldValue(\"active_business_assets_non_dtc\") *\r\n this.capitalGainsInclusionRate\r\n // Active Business Assets - DTC\r\n portions.exempt += this.getFieldValue(\"active_business_assets_dtc\")\r\n // Other excluded property not described above\r\n portions.exempt += this.getFieldValue(\"other_excluded_property\")\r\n // Shares of FA/Partnership Interest - EP - Before Hybrid Surplus application\r\n portions.exempt +=\r\n this.getFieldValue(\"shares_of_fa_or_partnership_interest_before_hybrid\") *\r\n remainingCapitalGainsInclusionRate\r\n portions.taxable +=\r\n this.getFieldValue(\"shares_of_fa_or_partnership_interest_before_hybrid\") *\r\n this.capitalGainsInclusionRate\r\n\r\n return portions\r\n }\r\n\r\n /**\r\n * The tax allocation factors are calculated using the positive\r\n * (+) portions of Capital Gains, prorating the positive net amount.\r\n *\r\n * Example:\r\n *\r\n * CG - E: 500\r\n * CG - H: -500\r\n * CG - F: 500\r\n * CG - T: -500\r\n *\r\n * Tax Factors\r\n * E: 0.5\r\n * H: 0\r\n * F: 0.5\r\n * T: 0\r\n *\r\n * @readonly\r\n * @type {*}\r\n * @memberof Calculator\r\n */\r\n public get taxAllocationFactors(): any {\r\n const portions = this.capitalGainsPortions\r\n const factors = {\r\n exempt: 0,\r\n fapi: 0,\r\n taxable: 0,\r\n }\r\n\r\n const prorationAmount =\r\n (portions.exempt > 0 ? portions.exempt : 0) +\r\n (portions.fapi > 0 ? portions.fapi : 0) +\r\n (portions.taxable > 0 ? portions.taxable : 0)\r\n\r\n if (prorationAmount != 0) {\r\n factors.exempt =\r\n portions.exempt > 0 ? portions.exempt / prorationAmount : 0\r\n factors.fapi = portions.fapi > 0 ? portions.fapi / prorationAmount : 0\r\n factors.taxable =\r\n portions.taxable > 0 ? portions.taxable / prorationAmount : 0\r\n }\r\n return factors\r\n }\r\n\r\n /**\r\n * The refund allocation factors are calculated using the negative\r\n * (-) portions of Capital Gains, prorating the negative net amount.\r\n *\r\n * Example:\r\n *\r\n * CG - E: 500\r\n * CG - H: -500\r\n * CG - F: 500\r\n * CG - T: -500\r\n *\r\n * Refund Factors\r\n * E: 0\r\n * H: 0.5\r\n * F: 0\r\n * T: 0.5\r\n *\r\n * @readonly\r\n * @type {*}\r\n * @memberof Calculator\r\n */\r\n public get refundAllocationFactors(): any {\r\n const portions = this.capitalGainsPortions\r\n const factors = {\r\n exempt: 0,\r\n fapi: 0,\r\n taxable: 0,\r\n }\r\n\r\n const prorationAmount =\r\n (portions.exempt < 0 ? portions.exempt : 0) +\r\n (portions.fapi < 0 ? portions.fapi : 0) +\r\n (portions.taxable < 0 ? portions.taxable : 0)\r\n\r\n if (prorationAmount != 0) {\r\n factors.exempt =\r\n portions.exempt < 0 ? portions.exempt / prorationAmount : 0\r\n factors.fapi = portions.fapi < 0 ? portions.fapi / prorationAmount : 0\r\n factors.taxable =\r\n portions.taxable < 0 ? portions.taxable / prorationAmount : 0\r\n }\r\n return factors\r\n }\r\n\r\n public get total952aAdjustments(): number {\r\n return CalculatorHelpers.sumValues([\r\n this.values[\"952a_amounts_increase_exempt\"],\r\n this.values[\"952a_amounts_increase_taxable\"],\r\n ])\r\n }\r\n\r\n /**\r\n * Sets the 'balance' and 'sep' at the end of a passed 'date'.\r\n * Used for the consolidator.\r\n *\r\n * @param {Date} date\r\n * @param {SurplusBalanceTypes} balance\r\n * @param {number} sep\r\n * @memberof Calculator\r\n */\r\n public addBalanceSnapshot(\r\n date: Date,\r\n balance: SurplusBalanceTypes,\r\n sep: number\r\n ) {\r\n const {\r\n exemptBalance,\r\n hutBalance,\r\n taxableBalance,\r\n uftBalance,\r\n hybridBalance,\r\n acbBalance,\r\n } = balance\r\n const balanceSnapshot: BalanceSnapshot = {\r\n exemptBalance,\r\n hutBalance,\r\n taxableBalance,\r\n uftBalance,\r\n hybridBalance,\r\n acbBalance,\r\n sep,\r\n }\r\n const dateKey = dateFns.format(date, \"YYYY-MM-DD\")\r\n this.balanceSnapshots[dateKey] = balanceSnapshot\r\n }\r\n\r\n public earningsInclusions(\r\n earningsType: \"taxable_earnings\" | \"exempt_earnings\"\r\n ) {\r\n return this.alterations\r\n .filter(\r\n (alteration: Alteration) =>\r\n alteration.getType === \"adjustment\" &&\r\n alteration.getMovement.to === earningsType\r\n )\r\n .reduce((acc: number, alteration: Alteration) => {\r\n const adjustment = alteration.getMetadata.adjustment as Adjustment\r\n const metadata = JSON.parse(adjustment.metadata)\r\n const metaId = metadata.meta_id || \"\"\r\n switch (metaId) {\r\n case \"other_inclusions\":\r\n return (acc = acc + alteration.getAmount)\r\n }\r\n return acc\r\n }, 0)\r\n }\r\n\r\n public taxesApplicableTo952a(\r\n type: \"952a_amounts_increase_exempt\" | \"952a_amounts_increase_taxable\"\r\n ) {\r\n let FITRMember = \"\"\r\n if (type === \"952a_amounts_increase_exempt\") {\r\n FITRMember = \"fitr_income_loss_recharacterized_952a\"\r\n } else {\r\n FITRMember = \"fitr_income_loss_recharacterized_952a_taxable\"\r\n }\r\n return this.FITRAllocation(FITRMember)\r\n }\r\n\r\n public get totalExemptTaxesPaidRefunded() {\r\n const taxes952a = this.taxesApplicableTo952a(\"952a_amounts_increase_exempt\")\r\n const taxesCG = this.FITRAllocation(\"fitr_capital_gain_loss\")\r\n return taxes952a + taxesCG\r\n }\r\n //#endregion\r\n\r\n //#region Foreign Income Tax Paid/Refunded (FITR - SECTION E)\r\n public get foreignIncomeDeductedIncluded() {\r\n return (\r\n CalculatorHelpers.sumValues([\r\n this.values[\"income_tax_deducted_from_earnings\"],\r\n this.values[\"income_tax_refunded_and_included_in_earnings\"],\r\n ]) * -1\r\n )\r\n }\r\n public get foreignIncomeTaxRefunded(): number {\r\n const sum =\r\n CalculatorHelpers.sumValues([\r\n this.values[\"fitr_other_foreign_income_tax\"],\r\n ]) +\r\n this.foreignIncomeDeductedIncluded +\r\n this.hybridDispositionTaxes\r\n return sum\r\n }\r\n //#endregion\r\n\r\n //#region Calculation of Earnings From an Active Business\r\n public get netTaxableIncomePerForeignTaxReturn(): number {\r\n // output 130\r\n return (\r\n this.getFieldValue(\"taxable_income_per_foreign_tax_return\") +\r\n this.getFieldValue(\"income_recharacterized_foreign_tax_rules\")\r\n )\r\n }\r\n\r\n public get adjustmentsItemsNotEarningsOrNil(): number {\r\n // output 137\r\n return CalculatorHelpers.sumValues([\r\n this.values[\"dividends_from_other_fas\"],\r\n this.values[\"income_of_other_companies\"],\r\n this.values[\"foreign_imputed_income\"],\r\n this.values[\"other_adjustments_not_earnings_nil\"],\r\n ])\r\n }\r\n\r\n public get adjustedTaxableIncomeLossBeforeReg5907(): number {\r\n // output 139 (130 + 137)\r\n return (\r\n this.netTaxableIncomePerForeignTaxReturn +\r\n this.adjustmentsItemsNotEarningsOrNil\r\n )\r\n }\r\n\r\n public get activeBusinessEarningsAdditions(): number {\r\n return CalculatorHelpers.sumValues([\r\n this.values[\"income_tax_deducted_from_earnings\"],\r\n this.values[\"deductions_claimed_for_tax\"],\r\n this.values[\"losses_from_non_abi_or_property\"],\r\n this.values[\"capital_loss_deducted\"],\r\n // this.values[\"foreign_imputed_income\"], // Confirm with ICT\r\n this.values[\"losses_deducted_from_prior\"],\r\n this.values[\"income_not_included\"],\r\n this.values[\"government_assistance_not_taxed\"],\r\n ])\r\n }\r\n\r\n public get activeBusinessEarningsDeductions(): number {\r\n return CalculatorHelpers.sumValues([\r\n this.values[\"income_tax_refunded_and_included_in_earnings\"],\r\n this.values[\"capital_gain_included\"],\r\n this.values[\"fapi_included_in_earnings\"],\r\n this.values[\"expenses_deducated_for_book\"],\r\n this.values[\"government_assistance_repaid\"],\r\n this.values[\"sale_of_property_from_other_fa\"],\r\n ])\r\n }\r\n\r\n public get adjustedEarningsBeforeDepreciationElection(): number {\r\n // output 159\r\n return (\r\n this.adjustedTaxableIncomeLossBeforeReg5907 +\r\n this.activeBusinessEarningsAdditions +\r\n this.activeBusinessEarningsDeductions\r\n )\r\n }\r\n\r\n public get reg5907andAdjustment(): number {\r\n // output 163\r\n return CalculatorHelpers.sumValues([\r\n this.values[\"depreciation_for_tax_purposes\"],\r\n this.values[\"depreciation_per_financial_statement\"],\r\n ])\r\n }\r\n\r\n public get totalAdjustmentForDepreciationElection(): number {\r\n // output 166\r\n return (\r\n this.reg5907andAdjustment +\r\n CalculatorHelpers.sumValues([\r\n this.values[\"cumulative_reg_5907_prior_year\"],\r\n this.values[\"cumulative_reg_5907_property_disposal\"],\r\n ])\r\n )\r\n }\r\n\r\n public get totalEarningsPerReg5907() {\r\n // Line: 168 [Output]\r\n // if (this.reportingPeriod.depreciation_election) {\r\n // return (\r\n // this.adjustedEarningsBeforeDepreciationElection +\r\n // this.totalAdjustmentForDepreciationElection\r\n // )\r\n // } else {\r\n // return this.adjustedEarningsBeforeDepreciationElection\r\n // }\r\n\r\n return (\r\n this.adjustedEarningsBeforeDepreciationElection +\r\n this.totalAdjustmentForDepreciationElection\r\n )\r\n }\r\n\r\n public get netEarningsFromActiveBusiness(): number {\r\n // 169 + 168\r\n return (\r\n this.totalEarningsPerReg5907 +\r\n this.FITRAllocation(\"fitr_foreign_active_earnings_before_reg5907\")\r\n )\r\n }\r\n\r\n public get netCapitalGainIncludedDeducted(): number {\r\n return CalculatorHelpers.sumValues([\r\n this.values[\"capital_gain_included\"],\r\n this.values[\"capital_loss_deducted\"],\r\n ])\r\n }\r\n\r\n public get netFapiIncludedDeducted(): number {\r\n return CalculatorHelpers.sumValues([\r\n this.values[\"fapi_included_in_earnings\"],\r\n this.values[\"losses_from_non_abi_or_property\"],\r\n ])\r\n }\r\n //#endregion\r\n\r\n //#endregion\r\n\r\n //#region Methods\r\n public init() {\r\n // Clean up all variables\r\n this.transactions = []\r\n this.alterations = []\r\n this.exceptions = []\r\n this.output = {}\r\n this.balanceSnapshots = {}\r\n this.closings = {\r\n exemptBalance: 0,\r\n hybridBalance: 0,\r\n preAcqBalance: 0,\r\n preAcqRecharBalance: 0,\r\n taxableBalance: 0,\r\n hutBalance: 0,\r\n uftBalance: 0,\r\n openingReDeficit: 0,\r\n acbBalance: 0,\r\n }\r\n }\r\n\r\n public FITRAllocation(incomeItem: string) {\r\n if (this.reportingPeriod.fitr_manually_allocate) {\r\n if (incomeItem === \"fitr_capital_gain_loss_hybrid\") {\r\n return this.hybridDispositionTaxes\r\n }\r\n return this.values[incomeItem].value\r\n }\r\n return this.calculateFITRProration()[incomeItem]\r\n }\r\n\r\n public get FITRTaxableIncome(): any {\r\n const netFapiIncludedDeducted =\r\n this.netFapiIncludedDeducted != 0 ? this.netFapiIncludedDeducted * -1 : 0\r\n const adjustmentsItemsNotEarningsOrNil =\r\n this.adjustmentsItemsNotEarningsOrNil != 0\r\n ? this.adjustmentsItemsNotEarningsOrNil * -1\r\n : 0\r\n const netCapitalGainIncludedDeducted =\r\n this.netCapitalGainIncludedDeducted != 0\r\n ? this.netCapitalGainIncludedDeducted * -1\r\n : 0\r\n const incomeRecharForeignTaxRules: number =\r\n this.values[\"income_recharacterized_foreign_tax_rules\"].value != 0\r\n ? this.values[\"income_recharacterized_foreign_tax_rules\"].value * -1\r\n : 0\r\n\r\n const foreignActiveEarningsExcludingOther =\r\n this.values[\"taxable_income_per_foreign_tax_return\"].value -\r\n netFapiIncludedDeducted -\r\n adjustmentsItemsNotEarningsOrNil -\r\n netCapitalGainIncludedDeducted -\r\n incomeRecharForeignTaxRules\r\n\r\n return {\r\n taxable_income_capital_gains: netCapitalGainIncludedDeducted,\r\n taxable_income_fapi: netFapiIncludedDeducted,\r\n taxable_income_income_recharacterized_under_952a: incomeRecharForeignTaxRules,\r\n taxable_income_items_not_nil_for_cdn_income_tax: adjustmentsItemsNotEarningsOrNil,\r\n taxable_income_active_earnings_before_59072_adjustments: foreignActiveEarningsExcludingOther,\r\n }\r\n }\r\n\r\n public addAlteration(\r\n amount: number,\r\n type: AlterationType,\r\n movement: Movement,\r\n date: Date,\r\n metadata: any = {},\r\n relatedTransaction: Transaction\r\n ) {\r\n // Skip alterations with no amount in them\r\n if (amount == 0) {\r\n return null\r\n }\r\n const newAlteration = new Alteration(amount, type, movement, date, metadata)\r\n relatedTransaction.addRelatedAlteration(newAlteration)\r\n this.alterations.push(newAlteration)\r\n return newAlteration\r\n }\r\n\r\n public calculateFITRProration(): any {\r\n const fitrAllocation: any = {\r\n fitr_foreign_active_earnings_before_reg5907: 0,\r\n fitr_capital_gain_loss: 0,\r\n fitr_capital_gain_loss_taxable: 0,\r\n fitr_capital_gain_loss_fapi: 0,\r\n fitr_capital_gain_loss_hybrid: this.hybridDispositionTaxes,\r\n fitr_fapi: 0,\r\n fitr_items_not_earnings_nil: 0,\r\n fitr_income_loss_recharacterized_952a: 0,\r\n fitr_income_loss_recharacterized_952a_taxable: 0,\r\n }\r\n // Get income buckets and allocate foreignIncomeTaxRefunded to the postive ones only\r\n // If not manually allcoated => Proration of all tax to positive income\r\n // manual allcoatoin is default\r\n const incomeRecharForeignTaxRules: number = this.FITRTaxableIncome[\r\n \"taxable_income_income_recharacterized_under_952a\"\r\n ]\r\n const netFapiIncludedDeducted = this.FITRTaxableIncome[\r\n \"taxable_income_fapi\"\r\n ]\r\n const adjustmentsItemsNotEarningsOrNil = this.FITRTaxableIncome[\r\n \"taxable_income_items_not_nil_for_cdn_income_tax\"\r\n ]\r\n const netCapitalGainIncludedDeducted = this.FITRTaxableIncome[\r\n \"taxable_income_capital_gains\"\r\n ]\r\n const foreignActiveEarningsExcludingOther = this.FITRTaxableIncome[\r\n \"taxable_income_active_earnings_before_59072_adjustments\"\r\n ]\r\n\r\n const amountsIncreaseExempt952a: number = this.values[\r\n \"952a_amounts_increase_exempt\"\r\n ].value\r\n\r\n const amountsIncreaseTaxable952a: number = this.values[\r\n \"952a_amounts_increase_taxable\"\r\n ].value\r\n\r\n // Get the split between taxable and exempt for 952a\r\n const factors952a = {\r\n taxable: 0,\r\n exempt: 0,\r\n }\r\n\r\n if (this.total952aAdjustments != 0) {\r\n // In the case both the amounts are the same sign, we prorate amongst them\r\n if (\r\n (amountsIncreaseExempt952a > 0 && amountsIncreaseTaxable952a > 0) ||\r\n (amountsIncreaseExempt952a < 0 && amountsIncreaseTaxable952a < 0)\r\n ) {\r\n factors952a.exempt = Math.abs(\r\n amountsIncreaseExempt952a / this.total952aAdjustments\r\n )\r\n factors952a.taxable = Math.abs(\r\n amountsIncreaseTaxable952a / this.total952aAdjustments\r\n )\r\n } else {\r\n // Else then we only allocate to the positive amount\r\n factors952a.exempt = amountsIncreaseExempt952a > 0 ? 1 : 0\r\n factors952a.taxable = amountsIncreaseTaxable952a > 0 ? 1 : 0\r\n }\r\n }\r\n\r\n const amounts: number[] = [\r\n netFapiIncludedDeducted,\r\n adjustmentsItemsNotEarningsOrNil,\r\n netCapitalGainIncludedDeducted,\r\n incomeRecharForeignTaxRules,\r\n foreignActiveEarningsExcludingOther,\r\n ]\r\n\r\n const allocationFactors =\r\n netCapitalGainIncludedDeducted < 0\r\n ? this.refundAllocationFactors\r\n : this.taxAllocationFactors\r\n\r\n let prorationAmount = 0\r\n const taxesToAllocate =\r\n this.foreignIncomeTaxRefunded - this.hybridDispositionTaxes\r\n const prorateAmount = (\r\n amountToProrate: number,\r\n prorate: boolean = true\r\n ) => {\r\n if (prorate && prorationAmount != 0) {\r\n return (amountToProrate / prorationAmount) * taxesToAllocate\r\n } else {\r\n return 0\r\n }\r\n }\r\n\r\n // If the FITR amount is positive(refunded) the logic is different than if its negative(paid)\r\n // We only want to prorate taxes paid (negative amount), to the positive income buckets\r\n if (taxesToAllocate < 0 && amounts.some(amount => amount > 0)) {\r\n prorationAmount = amounts.reduce(\r\n (acc: number, amount: number) =>\r\n amount > 0 ? (acc = acc + amount) : acc,\r\n 0\r\n )\r\n\r\n fitrAllocation.fitr_foreign_active_earnings_before_reg5907 = prorateAmount(\r\n foreignActiveEarningsExcludingOther,\r\n foreignActiveEarningsExcludingOther > 0\r\n )\r\n\r\n fitrAllocation.fitr_fapi = prorateAmount(\r\n netFapiIncludedDeducted,\r\n netFapiIncludedDeducted > 0\r\n )\r\n\r\n fitrAllocation.fitr_items_not_earnings_nil = prorateAmount(\r\n adjustmentsItemsNotEarningsOrNil,\r\n adjustmentsItemsNotEarningsOrNil > 0\r\n )\r\n\r\n // Since we need to split up the CG/L into the 3 buckets, we use the allocation factors to do this\r\n fitrAllocation.fitr_capital_gain_loss = prorateAmount(\r\n netCapitalGainIncludedDeducted * allocationFactors.exempt,\r\n netCapitalGainIncludedDeducted > 0\r\n )\r\n\r\n fitrAllocation.fitr_capital_gain_loss_taxable = prorateAmount(\r\n netCapitalGainIncludedDeducted * allocationFactors.taxable,\r\n netCapitalGainIncludedDeducted > 0\r\n )\r\n\r\n fitrAllocation.fitr_capital_gain_loss_fapi = prorateAmount(\r\n netCapitalGainIncludedDeducted * allocationFactors.fapi,\r\n netCapitalGainIncludedDeducted > 0\r\n )\r\n\r\n // Need to split out the incomeRecharForeignTaxRules into the two 952a buckets\r\n fitrAllocation.fitr_income_loss_recharacterized_952a = prorateAmount(\r\n incomeRecharForeignTaxRules * factors952a.exempt,\r\n incomeRecharForeignTaxRules > 0\r\n )\r\n\r\n fitrAllocation.fitr_income_loss_recharacterized_952a_taxable = prorateAmount(\r\n incomeRecharForeignTaxRules * factors952a.taxable,\r\n incomeRecharForeignTaxRules > 0\r\n )\r\n } else if (taxesToAllocate > 0 && amounts.some(amount => amount < 0)) {\r\n // We only want to prorate taxes refunded (positive amount), to the negative income buckets\r\n prorationAmount = amounts.reduce(\r\n (acc: number, amount: number) =>\r\n amount < 0 ? (acc = acc + amount) : acc,\r\n 0\r\n )\r\n\r\n fitrAllocation.fitr_foreign_active_earnings_before_reg5907 = prorateAmount(\r\n foreignActiveEarningsExcludingOther,\r\n foreignActiveEarningsExcludingOther < 0\r\n )\r\n\r\n fitrAllocation.fitr_fapi = prorateAmount(\r\n netFapiIncludedDeducted,\r\n netFapiIncludedDeducted < 0\r\n )\r\n\r\n fitrAllocation.fitr_items_not_earnings_nil = prorateAmount(\r\n adjustmentsItemsNotEarningsOrNil,\r\n adjustmentsItemsNotEarningsOrNil < 0\r\n )\r\n\r\n // Since we need to split up the CG/L into the 3 buckets, we use the allocation factors to do this\r\n fitrAllocation.fitr_capital_gain_loss = prorateAmount(\r\n netCapitalGainIncludedDeducted * allocationFactors.exempt,\r\n netCapitalGainIncludedDeducted < 0\r\n )\r\n\r\n fitrAllocation.fitr_capital_gain_loss_taxable = prorateAmount(\r\n netCapitalGainIncludedDeducted * allocationFactors.taxable,\r\n netCapitalGainIncludedDeducted < 0\r\n )\r\n\r\n fitrAllocation.fitr_capital_gain_loss_fapi = prorateAmount(\r\n netCapitalGainIncludedDeducted * allocationFactors.fapi,\r\n netCapitalGainIncludedDeducted < 0\r\n )\r\n\r\n // Need to split out the incomeRecharForeignTaxRules into the two 952a buckets\r\n fitrAllocation.fitr_income_loss_recharacterized_952a = prorateAmount(\r\n incomeRecharForeignTaxRules * factors952a.exempt,\r\n incomeRecharForeignTaxRules < 0\r\n )\r\n\r\n fitrAllocation.fitr_income_loss_recharacterized_952a_taxable = prorateAmount(\r\n incomeRecharForeignTaxRules * factors952a.taxable,\r\n incomeRecharForeignTaxRules < 0\r\n )\r\n } else {\r\n // Else we just prorate the amounts\r\n prorationAmount = amounts.reduce(\r\n (acc: number, amount: number) => (acc = acc + amount),\r\n 0\r\n )\r\n\r\n fitrAllocation.fitr_foreign_active_earnings_before_reg5907 = prorateAmount(\r\n foreignActiveEarningsExcludingOther\r\n )\r\n\r\n fitrAllocation.fitr_fapi = prorateAmount(netFapiIncludedDeducted)\r\n\r\n fitrAllocation.fitr_items_not_earnings_nil = prorateAmount(\r\n adjustmentsItemsNotEarningsOrNil\r\n )\r\n\r\n // Since we need to split up the CG/L into the 3 buckets, we use the allocation factors to do this\r\n fitrAllocation.fitr_capital_gain_loss = prorateAmount(\r\n netCapitalGainIncludedDeducted * allocationFactors.exempt\r\n )\r\n\r\n fitrAllocation.fitr_capital_gain_loss_taxable = prorateAmount(\r\n netCapitalGainIncludedDeducted * allocationFactors.taxable\r\n )\r\n\r\n fitrAllocation.fitr_capital_gain_loss_fapi = prorateAmount(\r\n netCapitalGainIncludedDeducted * allocationFactors.fapi\r\n )\r\n\r\n // Need to split out the incomeRecharForeignTaxRules into the two 952a buckets\r\n fitrAllocation.fitr_income_loss_recharacterized_952a = prorateAmount(\r\n incomeRecharForeignTaxRules * factors952a.exempt\r\n )\r\n\r\n fitrAllocation.fitr_income_loss_recharacterized_952a_taxable = prorateAmount(\r\n incomeRecharForeignTaxRules * factors952a.taxable\r\n )\r\n }\r\n // Since the proration is rounded we need to figure out which ones are incorrect\r\n\r\n Object.keys(fitrAllocation).forEach((key: string) => {\r\n fitrAllocation[key] = round(fitrAllocation[key])\r\n })\r\n\r\n return fitrAllocation\r\n }\r\n\r\n public isAcbAffectedByPreAcq(date: Date | string): boolean {\r\n const closestAcbPeriod = this.sortedAcbPeriod.find(\r\n (acbPeriod: ACBPeriod) =>\r\n getDate(acbPeriod.date).getTime() <= getDate(date).getTime()\r\n )\r\n return closestAcbPeriod ? !closestAcbPeriod.value : true\r\n }\r\n\r\n public applyPreAcqDividendToACB(\r\n amount: number,\r\n dividend: Dividend,\r\n balances: BalanceTypes,\r\n transaction: Transaction\r\n ) {\r\n const runningBalances = CalculatorHelpers.clone(balances) as BalanceTypes\r\n\r\n // If ACB is not affected, just return\r\n if (!this.isAcbAffectedByPreAcq(dividend.date)) {\r\n return runningBalances\r\n }\r\n\r\n const { acbBalance } = runningBalances.surplusBalances\r\n\r\n if (acbBalance >= 0 && amount > acbBalance) {\r\n this.createException(\r\n \"ACB went below 0. Please consider any ACB/surplus implications.\",\r\n dividend.date,\r\n \"acb_adjustments\"\r\n )\r\n }\r\n\r\n runningBalances.surplusBalances.acbBalance -= amount\r\n\r\n this.addAlteration(\r\n amount,\r\n \"acb_adjustment\",\r\n {\r\n from: \"pre_acq_acb_adjustment\",\r\n to: null,\r\n },\r\n getDate(dividend.date),\r\n { dividend, runningBalances },\r\n transaction\r\n )\r\n return runningBalances\r\n }\r\n\r\n public applyDividendPaid(\r\n dividend: Dividend,\r\n balances: BalanceTypes,\r\n transaction: Transaction\r\n ): BalanceTypes {\r\n // take the current running balances at the time and store it\r\n let runningBalances = CalculatorHelpers.clone(balances) as BalanceTypes\r\n\r\n // account for date threshold where the 90 day rule applies\r\n const dateThreshold = dateFns\r\n .addDays(this.reportingPeriod.start_date, 89)\r\n .getTime()\r\n const date = getDate(dividend.date).getTime()\r\n // store amounts for payments\r\n let remainingAmount = dividend.amount\r\n\r\n // Can only pay out if the net surplus is positive\r\n const netSurplus = CalculatorHelpers.getNetSurplus(\r\n runningBalances.surplusBalances\r\n )\r\n\r\n // original ordering should go in this order.\r\n let ordering: SurplusOrderingItem[] = [\r\n {\r\n type: \"exemptBalance\",\r\n movement: { to: null, from: \"exempt_surplus\" },\r\n balance: runningBalances.surplusBalances.exemptBalance,\r\n },\r\n {\r\n type: \"hybridBalance\",\r\n movement: { to: null, from: \"hybrid_surplus\" },\r\n balance: runningBalances.surplusBalances.hybridBalance,\r\n },\r\n {\r\n type: \"taxableBalance\",\r\n movement: { to: null, from: \"taxable_surplus\" },\r\n balance: runningBalances.surplusBalances.taxableBalance,\r\n },\r\n ]\r\n\r\n // if the dividend paid date is after 91 days, we can recharacterize preaq dividends paid out during this time.\r\n // if a dividend is under schedule 93, then it cannot be considered for the 90 day rule\r\n let rechar = false\r\n if (date > dateThreshold && !dividend.schedule_93) {\r\n rechar = true\r\n }\r\n\r\n // the designation is on an individual dividend basis\r\n if (dividend.preacq_designation) {\r\n runningBalances.surplusBalances.preAcqBalance += remainingAmount\r\n this.addAlteration(\r\n remainingAmount,\r\n \"dividend_paid\",\r\n {\r\n from: \"pre_acq_surplus\",\r\n to: null,\r\n },\r\n getDate(dividend.date),\r\n { dividend, runningBalances },\r\n transaction\r\n )\r\n\r\n runningBalances = {\r\n ...runningBalances,\r\n }\r\n return runningBalances\r\n }\r\n\r\n // If we have net surplus > 0, need to balance the amounts to use up all negative amounts towards the positive\r\n if (netSurplus > 0) {\r\n ordering = CalculatorHelpers.balanceNetSurplus(ordering)\r\n } else {\r\n // Since not net surplus to pay out of, then pay out of pre acq\r\n if (rechar) {\r\n runningBalances.surplusBalances.preAcqRecharBalance += remainingAmount\r\n this.addAlteration(\r\n remainingAmount,\r\n \"dividend_paid\",\r\n {\r\n from: \"pre_acq_recharacterized\",\r\n to: null,\r\n },\r\n getDate(dividend.date),\r\n { dividend, runningBalances },\r\n transaction\r\n )\r\n }\r\n\r\n runningBalances.surplusBalances.preAcqBalance += remainingAmount\r\n\r\n this.addAlteration(\r\n remainingAmount,\r\n \"dividend_paid\",\r\n {\r\n from: \"pre_acq_surplus\",\r\n to: null,\r\n },\r\n getDate(dividend.date),\r\n { dividend, runningBalances },\r\n transaction\r\n )\r\n\r\n runningBalances = this.applyPreAcqDividendToACB(\r\n remainingAmount,\r\n dividend,\r\n runningBalances,\r\n transaction\r\n )\r\n\r\n runningBalances = {\r\n ...runningBalances,\r\n }\r\n return runningBalances\r\n }\r\n\r\n // Now we want to pay out of the already balanced surplus pools\r\n while (remainingAmount > 0) {\r\n for (let i = 0; i < ordering.length && remainingAmount > 0; i++) {\r\n // if there are any balances to be paid out of, we should pay out of these, otherwise go to preacq\r\n if (ordering[i].balance > 0) {\r\n // If the balance went down below 0, this means we are gonna fully use our balance to pay out the dividend\r\n let amountMoved = 0\r\n if (ordering[i].balance < remainingAmount) {\r\n // The surplus balance covers part of the div paid\r\n amountMoved = ordering[i].balance\r\n remainingAmount -= amountMoved\r\n ordering[i].balance = 0\r\n } else {\r\n amountMoved = remainingAmount\r\n // The amount to be paid can be fully covered by this balance\r\n ordering[i].balance -= amountMoved\r\n // Since we are out of rechar dividends, we set the remaining amount to 0\r\n remainingAmount = 0\r\n }\r\n\r\n if (amountMoved != 0) {\r\n // add alterations to keep track of what was paid\r\n this.addAlteration(\r\n amountMoved,\r\n \"dividend_paid\",\r\n ordering[i].movement,\r\n getDate(dividend.date),\r\n { dividend, runningBalances },\r\n transaction\r\n )\r\n\r\n // side effect of changing balances\r\n runningBalances.surplusBalances[ordering[i].type] -= amountMoved\r\n\r\n // Want to check if hybrid or taxable pools were used\r\n // Decrease HUT/UFT based on the amount that the pool changed\r\n switch (ordering[i].type) {\r\n case \"hybridBalance\":\r\n const hut =\r\n runningBalances.surplusBalances.hutBalance *\r\n (amountMoved /\r\n (runningBalances.surplusBalances.hybridBalance +\r\n amountMoved))\r\n runningBalances.surplusBalances.hutBalance -= hut\r\n\r\n this.addAlteration(\r\n hut,\r\n \"dividend_paid\",\r\n {\r\n from: \"hybrid_underlying_taxes\",\r\n to: null,\r\n },\r\n getDate(dividend.date),\r\n { dividend, runningBalances },\r\n transaction\r\n )\r\n break\r\n case \"taxableBalance\":\r\n const uft =\r\n runningBalances.surplusBalances.uftBalance *\r\n (amountMoved /\r\n (runningBalances.surplusBalances.taxableBalance +\r\n amountMoved))\r\n runningBalances.surplusBalances.uftBalance -= uft\r\n\r\n this.addAlteration(\r\n uft,\r\n \"dividend_paid\",\r\n {\r\n from: \"underlying_foreign_taxes\",\r\n to: null,\r\n },\r\n getDate(dividend.date),\r\n { dividend, runningBalances },\r\n transaction\r\n )\r\n break\r\n }\r\n }\r\n }\r\n }\r\n\r\n // if balances are all 0 but we still have dividend to pay, we pay out of preacq\r\n if (remainingAmount > 0) {\r\n if (rechar) {\r\n runningBalances.surplusBalances.preAcqRecharBalance += remainingAmount\r\n this.addAlteration(\r\n remainingAmount,\r\n \"dividend_paid\",\r\n {\r\n from: \"pre_acq_recharacterized\",\r\n to: null,\r\n },\r\n getDate(dividend.date),\r\n { dividend, runningBalances },\r\n transaction\r\n )\r\n }\r\n\r\n runningBalances.surplusBalances.preAcqBalance += remainingAmount\r\n\r\n this.addAlteration(\r\n remainingAmount,\r\n \"dividend_paid\",\r\n {\r\n from: \"pre_acq_surplus\",\r\n to: null,\r\n },\r\n getDate(dividend.date),\r\n { dividend, runningBalances },\r\n transaction\r\n )\r\n\r\n runningBalances = this.applyPreAcqDividendToACB(\r\n remainingAmount,\r\n dividend,\r\n runningBalances,\r\n transaction\r\n )\r\n\r\n remainingAmount = 0\r\n }\r\n }\r\n\r\n runningBalances = {\r\n ...runningBalances,\r\n }\r\n return runningBalances\r\n }\r\n\r\n public applyDividendRecieved(\r\n dividend: any,\r\n balances: BalanceTypes,\r\n transaction: Transaction\r\n ): BalanceTypes {\r\n const runningBalances = CalculatorHelpers.clone(balances) as BalanceTypes\r\n // Check if tax paid/refunded on the received dividend and add to the total amount to be adjusted\r\n const tax = dividend.tax_on_amount || 0\r\n const amount = dividend.amount\r\n const { category, hut_amount, uft_amount } = dividend\r\n const date = getDate(dividend.date as string)\r\n\r\n if (category === \"E\") {\r\n runningBalances.surplusBalances.exemptBalance += amount\r\n runningBalances.surplusBalances.exemptBalance -= tax\r\n\r\n if (amount != 0) {\r\n this.addAlteration(\r\n amount,\r\n \"dividend_recieved\",\r\n { to: \"exempt_surplus\", from: \"amount\" },\r\n date,\r\n { dividend, runningBalances },\r\n transaction\r\n )\r\n }\r\n if (tax != 0) {\r\n this.addAlteration(\r\n tax,\r\n \"dividend_recieved\",\r\n { to: \"exempt_surplus\", from: \"tax_amount\" },\r\n date,\r\n { dividend, runningBalances },\r\n transaction\r\n )\r\n }\r\n } else if (category === \"H\") {\r\n runningBalances.surplusBalances.hybridBalance += amount\r\n runningBalances.surplusBalances.hybridBalance -= tax\r\n\r\n runningBalances.surplusBalances.hutBalance += tax\r\n runningBalances.surplusBalances.hutBalance += hut_amount\r\n\r\n if (amount != 0) {\r\n this.addAlteration(\r\n amount,\r\n \"dividend_recieved\",\r\n { to: \"hybrid_surplus\", from: \"amount\" },\r\n date,\r\n { dividend, runningBalances },\r\n transaction\r\n )\r\n }\r\n if (tax != 0) {\r\n this.addAlteration(\r\n tax,\r\n \"dividend_recieved\",\r\n { to: \"hybrid_surplus\", from: \"tax_amount\" },\r\n date,\r\n\r\n { dividend, runningBalances },\r\n transaction\r\n )\r\n this.addAlteration(\r\n tax,\r\n \"dividend_recieved\",\r\n { to: \"hybrid_underlying_taxes\", from: \"tax_amount\" },\r\n date,\r\n { dividend, runningBalances },\r\n transaction\r\n )\r\n }\r\n if (hut_amount != 0) {\r\n this.addAlteration(\r\n hut_amount,\r\n \"dividend_recieved\",\r\n { to: \"hybrid_underlying_taxes\", from: \"hut_amount\" },\r\n date,\r\n { dividend, runningBalances },\r\n transaction\r\n )\r\n }\r\n } else if (category === \"T\") {\r\n runningBalances.surplusBalances.taxableBalance += amount\r\n runningBalances.surplusBalances.taxableBalance -= tax\r\n\r\n runningBalances.surplusBalances.uftBalance += tax\r\n runningBalances.surplusBalances.uftBalance += uft_amount\r\n\r\n if (amount != 0) {\r\n this.addAlteration(\r\n amount,\r\n \"dividend_recieved\",\r\n { to: \"taxable_surplus\", from: \"amount\" },\r\n date,\r\n { dividend, runningBalances },\r\n transaction\r\n )\r\n }\r\n if (tax != 0) {\r\n this.addAlteration(\r\n tax,\r\n \"dividend_recieved\",\r\n { to: \"taxable_surplus\", from: \"tax_amount\" },\r\n date,\r\n { dividend, runningBalances },\r\n transaction\r\n )\r\n this.addAlteration(\r\n tax,\r\n \"dividend_recieved\",\r\n { to: \"underlying_foreign_taxes\", from: \"tax_amount\" },\r\n date,\r\n { dividend, runningBalances },\r\n transaction\r\n )\r\n }\r\n if (uft_amount != 0) {\r\n this.addAlteration(\r\n uft_amount,\r\n \"dividend_recieved\",\r\n { to: \"underlying_foreign_taxes\", from: \"uft_amount\" },\r\n date,\r\n { dividend, runningBalances },\r\n transaction\r\n )\r\n }\r\n } else if (category === \"S112\") {\r\n runningBalances.surplusBalances.exemptBalance += amount\r\n runningBalances.surplusBalances.exemptBalance -= tax\r\n\r\n if (amount != 0) {\r\n this.addAlteration(\r\n amount,\r\n \"dividend_recieved\",\r\n { to: \"exempt_surplus\", from: \"amount\" },\r\n date,\r\n { dividend, runningBalances },\r\n transaction\r\n )\r\n }\r\n if (tax != 0) {\r\n this.addAlteration(\r\n tax,\r\n \"dividend_recieved\",\r\n { to: \"exempt_surplus\", from: \"tax_amount\" },\r\n date,\r\n { dividend, runningBalances },\r\n transaction\r\n )\r\n }\r\n }\r\n return runningBalances\r\n }\r\n\r\n public applyHybridDisposition(\r\n dispositionAdjustment: DispositionAdjustment,\r\n balances: BalanceTypes,\r\n transaction: Transaction\r\n ) {\r\n const runningBalances = CalculatorHelpers.clone(balances) as BalanceTypes\r\n const adjustmentAmount = dispositionAdjustment.amount\r\n const tax = dispositionAdjustment.tax_on_amount || 0\r\n\r\n runningBalances.surplusBalances.hybridBalance += adjustmentAmount + tax\r\n runningBalances.surplusBalances.hutBalance -= tax\r\n\r\n this.addAlteration(\r\n adjustmentAmount,\r\n \"disposition_adjustment\",\r\n { to: \"hybrid_surplus\", from: \"amount\" },\r\n getDate(dispositionAdjustment.date as string),\r\n { dispositionAdjustment, runningBalances },\r\n transaction\r\n )\r\n\r\n if (tax != 0) {\r\n this.addAlteration(\r\n tax,\r\n \"disposition_adjustment\",\r\n { to: \"hybrid_surplus\", from: \"tax_amount\" },\r\n getDate(dispositionAdjustment.date as string),\r\n { dispositionAdjustment, runningBalances },\r\n transaction\r\n )\r\n\r\n this.addAlteration(\r\n tax,\r\n \"disposition_adjustment\",\r\n { to: \"hybrid_underlying_taxes\", from: \"tax_amount\" },\r\n getDate(dispositionAdjustment.date as string),\r\n { dispositionAdjustment, runningBalances },\r\n transaction\r\n )\r\n }\r\n\r\n return runningBalances\r\n }\r\n\r\n public applyACBAdjustment(\r\n acbAdjustment: ACBAdjustment,\r\n balances: BalanceTypes,\r\n transaction: Transaction\r\n ) {\r\n const runningBalances = CalculatorHelpers.clone(balances) as BalanceTypes\r\n const { amount, date } = acbAdjustment\r\n\r\n const { acbBalance } = runningBalances.surplusBalances\r\n\r\n if (acbBalance >= 0 && acbBalance + amount < 0) {\r\n this.createException(\r\n \"ACB went below 0. Please consider any ACB/surplus implications.\",\r\n date,\r\n \"acb_adjustments\"\r\n )\r\n }\r\n\r\n runningBalances.surplusBalances.acbBalance += amount\r\n\r\n this.addAlteration(\r\n amount,\r\n \"acb_adjustment\",\r\n { to: \"acb_adjustment\", from: \"amount\" },\r\n getDate(date as string),\r\n { acbAdjustment, runningBalances },\r\n transaction\r\n )\r\n\r\n return runningBalances\r\n }\r\n\r\n public createTransactions(): Transaction[] {\r\n let transactions: Transaction[] = []\r\n const {\r\n dividends,\r\n adjustments,\r\n sep_adjustments,\r\n disposition_adjustments,\r\n acb_adjustments,\r\n } = this.reportingPeriod\r\n\r\n // Iterate through each of the different entities that are considered to be transactions\r\n sep_adjustments &&\r\n sep_adjustments.forEach(sepAdjustment =>\r\n transactions.push(new Transaction(sepAdjustment, \"sepAdjustment\"))\r\n )\r\n\r\n // [ADHOC] Need to make sure the received dividends get processed first.\r\n dividends &&\r\n [...dividends]\r\n .sort((a: Dividend, b: Dividend) => {\r\n if (a.type == b.type) {\r\n return 0\r\n } else if (a.type == \"R\") {\r\n return -1\r\n } else {\r\n return 1\r\n }\r\n })\r\n .forEach(dividend =>\r\n transactions.push(new Transaction(dividend, \"dividend\"))\r\n )\r\n\r\n adjustments &&\r\n adjustments\r\n .filter(adjustment => adjustment.date)\r\n .forEach(adjustment =>\r\n transactions.push(new Transaction(adjustment, \"adjustment\"))\r\n )\r\n\r\n disposition_adjustments &&\r\n disposition_adjustments.forEach(dispositionAdjustment =>\r\n transactions.push(\r\n new Transaction(dispositionAdjustment, \"dispositionAdjustment\")\r\n )\r\n )\r\n\r\n acb_adjustments &&\r\n acb_adjustments.forEach(acb_adjustment =>\r\n transactions.push(new Transaction(acb_adjustment, \"acbAdjustment\"))\r\n )\r\n\r\n const transactionTypeOrder: any = {\r\n dividend: 1,\r\n adjustment: 2,\r\n dispositionAdjustment: 3,\r\n sepAdjustment: 4,\r\n acbAdjustment: 5,\r\n }\r\n\r\n // Order by date as the order of each transaction needs to be taken into account\r\n transactions = transactions.sort(\r\n (a: Transaction, b: Transaction) =>\r\n new Date(a.getAction.date).getTime() -\r\n new Date(b.getAction.date).getTime() ||\r\n transactionTypeOrder[a.getActionType] -\r\n transactionTypeOrder[b.getActionType]\r\n )\r\n\r\n return transactions\r\n }\r\n\r\n public calculateBalances(): SurplusBalanceTypes {\r\n let closings: BalanceTypes = {\r\n surplusBalances: {\r\n exemptBalance: this.openings.exemptBalance,\r\n hybridBalance: this.openings.hybridBalance,\r\n preAcqBalance: this.openings.preAcqBalance,\r\n taxableBalance: this.openings.taxableBalance,\r\n hutBalance: this.openings.hutBalance,\r\n uftBalance: this.openings.uftBalance,\r\n preAcqRecharBalance: this.openings.preAcqRecharBalance,\r\n openingReDeficit: this.openings.openingReDeficit,\r\n acbBalance: this.openings.acbBalance,\r\n },\r\n earnings: {\r\n exemptEarnings: 0,\r\n taxableEarnings: 0,\r\n },\r\n }\r\n\r\n let previousAdjustment = this.reportingPeriod.sepOpening || 0\r\n this.reportingPeriod.closing_sep = previousAdjustment\r\n\r\n // Capture openings\r\n this.addBalanceSnapshot(\r\n getDate(this.reportingPeriod.start_date),\r\n closings.surplusBalances,\r\n previousAdjustment\r\n )\r\n\r\n // Iterate through all the transactions\r\n this.transactions.forEach((transaction, index) => {\r\n const actionType = transaction.getActionType\r\n const transactionDate: Date = getDate(transaction.getAction.date)\r\n\r\n // Transactions are handled differently\r\n switch (actionType) {\r\n case \"dispositionAdjustment\":\r\n const dispositionAdjustment = transaction.getAction as DispositionAdjustment\r\n closings = this.applyHybridDisposition(\r\n dispositionAdjustment,\r\n closings,\r\n transaction\r\n )\r\n break\r\n case \"dividend\":\r\n const dividend = transaction.getAction as Dividend\r\n if (dividend.type === \"R\") {\r\n closings = this.applyDividendRecieved(\r\n dividend,\r\n closings,\r\n transaction\r\n )\r\n } else {\r\n closings = this.applyDividendPaid(dividend, closings, transaction)\r\n }\r\n break\r\n case \"sepAdjustment\":\r\n const sepAdjustment = transaction.getAction as SEPAdjustment\r\n // update closing SEP\r\n this.reportingPeriod.closing_sep = sepAdjustment.amount\r\n\r\n // Calculate multiplier\r\n // Need to take in consideration that if the sep adjustment is 0, need to reset the multiplier to 1\r\n const multiplier =\r\n sepAdjustment.amount > 0 && previousAdjustment > 0\r\n ? previousAdjustment / sepAdjustment.amount\r\n : 1\r\n\r\n sepAdjustment.multiplier = multiplier\r\n transaction.setMultiplier = multiplier\r\n\r\n previousAdjustment = sepAdjustment.amount\r\n\r\n // Adjust balance\r\n closings.surplusBalances.exemptBalance *= multiplier\r\n closings.surplusBalances.hybridBalance *= multiplier\r\n closings.surplusBalances.taxableBalance *= multiplier\r\n closings.surplusBalances.uftBalance *= multiplier\r\n closings.surplusBalances.hutBalance *= multiplier\r\n\r\n // Retroactively add this SEP Adjustment to all transactions that don't have and SEP Adjustment already\r\n this.transactions.slice(0, index).forEach(priorTransaction => {\r\n if (!priorTransaction.getSepAdjustment) {\r\n priorTransaction.setSepAdjustment = sepAdjustment as SEPAdjustment\r\n priorTransaction.setMultiplier = multiplier\r\n }\r\n })\r\n\r\n break\r\n case \"adjustment\":\r\n const adjustment = transaction.getAction as Adjustment\r\n const { type, amount, date } = adjustment\r\n\r\n switch (type) {\r\n case \"exempt_surplus\":\r\n closings.surplusBalances.exemptBalance += amount\r\n break\r\n case \"taxable_surplus\":\r\n closings.surplusBalances.taxableBalance += amount\r\n break\r\n case \"hybrid_surplus\":\r\n closings.surplusBalances.hybridBalance += amount\r\n break\r\n case \"hybrid_underlying_taxes\":\r\n closings.surplusBalances.hutBalance += amount\r\n break\r\n case \"underlying_foreign_taxes\":\r\n closings.surplusBalances.uftBalance += amount\r\n break\r\n }\r\n\r\n // Create alteration\r\n const runningBalances = CalculatorHelpers.clone(\r\n closings\r\n ) as BalanceTypes\r\n\r\n this.addAlteration(\r\n amount,\r\n \"adjustment\",\r\n { to: type, from: \"amount\" },\r\n getDate(adjustment.date as string),\r\n { adjustment, runningBalances },\r\n transaction\r\n )\r\n break\r\n case \"acbAdjustment\":\r\n const acbAdjustment = transaction.getAction as ACBAdjustment\r\n closings = this.applyACBAdjustment(\r\n acbAdjustment,\r\n closings,\r\n transaction\r\n )\r\n break\r\n }\r\n\r\n // Set the closing balance at this point in time\r\n transaction.setBalance = closings\r\n // After every transaction, want to capture balance\r\n if (transactionDate) {\r\n this.addBalanceSnapshot(\r\n transactionDate,\r\n closings.surplusBalances,\r\n previousAdjustment\r\n )\r\n }\r\n })\r\n\r\n // Capture the closings before the earings are added\r\n this.savedClosingsBeforeEarnings = CalculatorHelpers.clone(\r\n closings.surplusBalances\r\n )\r\n\r\n // Earning to be included with your remaining ES\r\n closings.surplusBalances.exemptBalance += this.closingExemptEarnings\r\n closings.surplusBalances.taxableBalance += this.closingTaxableEarnings\r\n // Taxes paid to by included in the correct buckets\r\n closings.surplusBalances.uftBalance -= this.taxesPaidOnTaxableEarnings\r\n if (!this.designatedTreatyCountry) {\r\n closings.surplusBalances.uftBalance -= this.FITRAllocation(\r\n \"fitr_foreign_active_earnings_before_reg5907\"\r\n )\r\n }\r\n\r\n // Set the closing REEEEE\r\n closings.surplusBalances.openingReDeficit = this.closingRe\r\n return closings.surplusBalances\r\n }\r\n\r\n public calculateBalances90DayRule(\r\n closings: SurplusBalanceTypes\r\n ): { [key: string]: SurplusBalanceTypes } {\r\n // To keep track of the amounts moved\r\n const closings90DayConsidered: SurplusBalanceTypes = CalculatorHelpers.clone(\r\n closings\r\n )\r\n const recharMoved: SurplusBalanceTypes = {\r\n exemptBalance: 0,\r\n hybridBalance: 0,\r\n preAcqBalance: 0,\r\n preAcqRecharBalance: 0,\r\n taxableBalance: 0,\r\n hutBalance: 0,\r\n uftBalance: 0,\r\n acbBalance: 0,\r\n }\r\n\r\n const recharAlterations = this.alterationsByType(\"dividend_paid\").filter(\r\n (a: Alteration) => a.getMovement.from == \"pre_acq_recharacterized\"\r\n )\r\n const recharAmount = recharAlterations.reduce(\r\n (acc: number, curr: Alteration) => (acc = acc + curr.amount),\r\n 0\r\n )\r\n\r\n const acbRecharAlterations = this.alterationsByType(\r\n \"acb_adjustment\"\r\n ).filter((a: Alteration) => a.getMovement.from == \"pre_acq_acb_adjustment\")\r\n const acbRecharAmount = acbRecharAlterations.reduce(\r\n (acc: number, curr: Alteration) => (acc = acc + curr.amount),\r\n 0\r\n )\r\n\r\n // Should only do this is we need to recharacterize amounts\r\n if (recharAmount != 0) {\r\n // Iterate through alterations getting the amount that needs to be paid\r\n recharAlterations.forEach((alteration: Alteration) => {\r\n const parentTransaction: Transaction =\r\n this.transactions.find((t: Transaction) => {\r\n return t.getRelatedAlterations.includes(alteration)\r\n }) || ({} as Transaction)\r\n // store the openings as before and after rechar so one can be rebalanced and the actual values can be altered.\r\n const closingsBeforeRechar = CalculatorHelpers.clone(\r\n closings90DayConsidered\r\n )\r\n\r\n const netBalance = CalculatorHelpers.getNetSurplus(\r\n closings90DayConsidered\r\n )\r\n let remainingAmount = Math.min(netBalance, alteration.amount)\r\n\r\n let ordering: SurplusOrderingItem[] = [\r\n {\r\n type: \"exemptBalance\",\r\n movement: { to: null, from: \"exempt_surplus\" },\r\n balance: closingsBeforeRechar.exemptBalance,\r\n },\r\n {\r\n type: \"hybridBalance\",\r\n movement: { to: null, from: \"hybrid_surplus\" },\r\n balance: closingsBeforeRechar.hybridBalance,\r\n },\r\n {\r\n type: \"taxableBalance\",\r\n movement: { to: null, from: \"taxable_surplus\" },\r\n balance: closingsBeforeRechar.taxableBalance,\r\n },\r\n ]\r\n\r\n if (netBalance > 0) {\r\n // rebalance according to same rules as dividends\r\n ordering = CalculatorHelpers.balanceNetSurplus(ordering)\r\n\r\n while (remainingAmount > 0) {\r\n for (let i = 0; i < ordering.length && remainingAmount > 0; i++) {\r\n if (ordering[i].balance > 0) {\r\n // If the balance went down below 0, this means we are gonna fully use our balance to pay out the rechar dividend\r\n let amountMoved = 0\r\n if (ordering[i].balance < remainingAmount) {\r\n amountMoved = ordering[i].balance\r\n remainingAmount -= amountMoved\r\n ordering[i].balance = 0\r\n } else {\r\n amountMoved = remainingAmount\r\n // The amount to be paid can be fully covered by this balance\r\n ordering[i].balance -= amountMoved\r\n // Since we are out of rechar dividends, we set the remaining amount to 0\r\n remainingAmount = 0\r\n }\r\n\r\n // side effect of changing balances\r\n closings90DayConsidered[ordering[i].type] -= amountMoved\r\n closings90DayConsidered[\"preAcqBalance\"] -= amountMoved\r\n closings90DayConsidered[\"preAcqRecharBalance\"] -= amountMoved\r\n\r\n recharMoved[ordering[i].type] -= amountMoved\r\n recharMoved[\"preAcqBalance\"] -= amountMoved\r\n recharMoved[\"preAcqRecharBalance\"] -= amountMoved\r\n\r\n // add alterations to keep track of what was paid\r\n this.addAlteration(\r\n amountMoved,\r\n \"dividend_paid_rechar\",\r\n ordering[i].movement,\r\n new Date(this.reportingPeriod.end_date),\r\n {},\r\n parentTransaction\r\n )\r\n\r\n // Check if any Pre acq was able to be paid off to return money to the ACB balance\r\n if (recharMoved[\"acbBalance\"] < acbRecharAmount) {\r\n const maxToRechar =\r\n acbRecharAmount - recharMoved[\"acbBalance\"]\r\n const preAcqRecharAmount = Math.min(maxToRechar, amountMoved)\r\n\r\n closings90DayConsidered[\"acbBalance\"] += preAcqRecharAmount\r\n recharMoved[\"acbBalance\"] += preAcqRecharAmount\r\n\r\n this.addAlteration(\r\n preAcqRecharAmount,\r\n \"acb_adjustment\",\r\n {\r\n from: \"dividend_paid_rechar\",\r\n to: \"acb_adjustment\",\r\n },\r\n new Date(this.reportingPeriod.end_date),\r\n {\r\n runningBalances: {\r\n surplusBalances: closings90DayConsidered,\r\n },\r\n },\r\n parentTransaction\r\n )\r\n }\r\n\r\n switch (ordering[i].type) {\r\n case \"hybridBalance\":\r\n const hut =\r\n closings90DayConsidered[\"hutBalance\"] *\r\n (amountMoved /\r\n (closings90DayConsidered[\"hybridBalance\"] +\r\n amountMoved))\r\n closings90DayConsidered[\"hutBalance\"] -= hut\r\n recharMoved[\"hutBalance\"] -= hut\r\n // LOG ALTERATION FOR OUTPUT PURPOSE, SHOULD BE CHANGED TO BE A DIVIDEND\r\n this.addAlteration(\r\n hut,\r\n \"dividend_paid_rechar\",\r\n { to: null, from: \"hybrid_underlying_taxes\" },\r\n new Date(this.reportingPeriod.end_date),\r\n {},\r\n parentTransaction\r\n )\r\n break\r\n case \"taxableBalance\":\r\n const uft =\r\n closings90DayConsidered[\"uftBalance\"] *\r\n (amountMoved /\r\n (closings90DayConsidered[\"taxableBalance\"] +\r\n amountMoved))\r\n closings90DayConsidered[\"uftBalance\"] -= uft\r\n recharMoved[\"uftBalance\"] -= uft\r\n // LOG ALTERATION FOR OUTPUT PURPOSE, SHOULD BE CHANGED TO BE A DIVIDEND\r\n this.addAlteration(\r\n uft,\r\n \"dividend_paid_rechar\",\r\n { to: null, from: \"underlying_foreign_taxes\" },\r\n new Date(this.reportingPeriod.end_date),\r\n {},\r\n parentTransaction\r\n )\r\n break\r\n }\r\n }\r\n }\r\n }\r\n }\r\n })\r\n }\r\n\r\n return { closings: closings90DayConsidered, amountsMoved: recharMoved }\r\n }\r\n\r\n public alterationsByType(type: AlterationType) {\r\n return this.alterations.filter(\r\n (alteration: Alteration) => alteration.getType === type\r\n )\r\n }\r\n\r\n public transactionsByType(type: ActionType) {\r\n return this.transactions.filter(\r\n (transaction: Transaction) => transaction.getActionType === type\r\n )\r\n }\r\n\r\n public dividendsPaidFrom(\r\n surplusType:\r\n | \"exempt_surplus\"\r\n | \"hybrid_surplus\"\r\n | \"taxable_surplus\"\r\n | \"pre_acq_recharacterized\"\r\n | \"pre_acq_surplus\"\r\n ) {\r\n return this.alterations\r\n .filter(\r\n (alteration: Alteration) =>\r\n alteration.getType === \"dividend_paid\" &&\r\n alteration.movement.from === surplusType\r\n )\r\n .reduce((acc: number, alteration: Alteration) => {\r\n const amount = round(alteration.amount)\r\n return (acc = acc + amount)\r\n }, 0)\r\n }\r\n\r\n public dividendsReceivedFrom(\r\n surplusType:\r\n | \"exempt_surplus\"\r\n | \"hybrid_surplus\"\r\n | \"taxable_surplus\"\r\n | \"pre_acq_recharacterized\",\r\n amountType: \"amount\" | \"tax_amount\" | \"uft_amount\" | \"hut_amount\" = \"amount\"\r\n ) {\r\n return this.alterations\r\n .filter(\r\n (alteration: Alteration) =>\r\n alteration.getType === \"dividend_recieved\" &&\r\n alteration.movement.to === surplusType &&\r\n alteration.movement.from === amountType\r\n )\r\n .reduce((acc: number, alteration: Alteration) => {\r\n const amount = round(alteration.amount)\r\n return (acc = acc + amount)\r\n }, 0)\r\n }\r\n\r\n public createException(message: string, date: Date | string, metaId: string) {\r\n this.exceptions.push({\r\n metaId,\r\n message,\r\n date: date ? getDate(date) : undefined,\r\n })\r\n }\r\n\r\n public calculate() {\r\n this.init()\r\n this.transactions = this.createTransactions()\r\n\r\n // This gives us our Closings WITHOUT 90-day rule\r\n const closings = this.calculateBalances()\r\n\r\n // Since we may have Pre acq dividends to rechar, need to calculate the closings with these considered\r\n const closings90DayRules = this.calculateBalances90DayRule(closings)\r\n\r\n this.closings = {\r\n ...closings90DayRules.closings,\r\n recharacterizedAmounts: closings90DayRules.amountsMoved,\r\n }\r\n\r\n // Capture the closings snapshot\r\n this.addBalanceSnapshot(\r\n getDate(this.reportingPeriod.end_date),\r\n this.closings,\r\n this.reportingPeriod.closing_sep || 0\r\n )\r\n\r\n // generates the output obj. the calcualtions are run CalculatorOutput.ts... L38\r\n this.output = this.calculatorOutput.generateOutput()\r\n }\r\n\r\n public calculateUpTo(date: Date) {\r\n this.init()\r\n this.transactions = this.createTransactions()\r\n\r\n // This gives us our Closings WITHOUT 90-day rule\r\n const closings = this.calculateBalances()\r\n\r\n // Since we may have Pre acq dividends to rechar, need to calculate the closings with these considered\r\n const closings90DayRules = this.calculateBalances90DayRule(closings)\r\n\r\n this.closings = {\r\n ...closings90DayRules.closings,\r\n recharacterizedAmounts: closings90DayRules.amountsMoved,\r\n }\r\n }\r\n\r\n public createDividendsReceived(): any {\r\n const newDividends: { [dividend_tier: string]: Dividend[] } = {}\r\n\r\n const dividendsPaid = this.transactionsByType(\"dividend\").filter(\r\n (transaction: Transaction) => {\r\n const dividend: Dividend = transaction.getAction as Dividend\r\n return dividend.type == \"P\"\r\n }\r\n )\r\n\r\n // Ignore certain type of alterations\r\n const alterationsToAvoid: AdjustmentType[] = [\r\n \"pre_acq_recharacterized\",\r\n \"pre_acq_surplus\",\r\n ]\r\n\r\n dividendsPaid.forEach((transaction: Transaction) => {\r\n const dividend: Dividend = transaction.getAction as Dividend\r\n // Get the dividend tiers (only want the ones that are being paid to another foreign affiliate)\r\n const tiers: DividendTier[] =\r\n dividend.dividend_tiers != undefined\r\n ? dividend.dividend_tiers.filter(\r\n (dividendTier: DividendTier) => dividendTier.foreign_affiliate\r\n )\r\n : []\r\n if (tiers.length == 0) {\r\n return\r\n }\r\n\r\n tiers.forEach((tier: DividendTier) => {\r\n if (tier.id) {\r\n if (!newDividends[tier.id]) {\r\n newDividends[tier.id] = []\r\n }\r\n }\r\n })\r\n\r\n const filteredAlterations: Alteration[] = transaction.getRelatedAlterations.filter(\r\n (a: Alteration) =>\r\n !alterationsToAvoid.includes(a.getMovement.from as AdjustmentType)\r\n )\r\n\r\n // Group alterations so we can create the correct set of dividends\r\n const groupedAlterations: { [key: string]: Alteration[] } = {\r\n exempt: [],\r\n taxable: [],\r\n hybrid: [],\r\n }\r\n const groupToDividendCategory: { [key: string]: DividendCategory } = {\r\n exempt: \"E\",\r\n taxable: \"T\",\r\n hybrid: \"H\",\r\n }\r\n\r\n filteredAlterations.forEach((alteration: Alteration) => {\r\n switch (alteration.getMovement.from) {\r\n case \"taxable_surplus\":\r\n case \"underlying_foreign_taxes\":\r\n groupedAlterations.taxable.push(alteration)\r\n break\r\n case \"hybrid_surplus\":\r\n case \"hybrid_underlying_taxes\":\r\n groupedAlterations.hybrid.push(alteration)\r\n break\r\n case \"exempt_surplus\":\r\n groupedAlterations.exempt.push(alteration)\r\n break\r\n }\r\n })\r\n\r\n Object.keys(groupedAlterations).forEach((group: string) => {\r\n const alterations: Alteration[] = groupedAlterations[group]\r\n\r\n // No need to create a dividend if no alterations\r\n if (alterations.length === 0) {\r\n return\r\n }\r\n\r\n // Calculate what amounts should be paid to each recipient\r\n tiers.forEach((tier: DividendTier) => {\r\n const newDividendReceived: Dividend = CalculatorHelpers.createBlankDividend(\r\n {\r\n date: dividend.date,\r\n category: groupToDividendCategory[group],\r\n type: \"R\",\r\n }\r\n )\r\n let amount: number = 0\r\n let uft: number = 0\r\n let hut: number = 0\r\n\r\n alterations.forEach((alteration: Alteration) => {\r\n const percentage = tier.percentage / 100\r\n const fxRate = tier.fx_rate\r\n const alterationAmount: number = round(\r\n alteration.amount *\r\n percentage *\r\n (fxRate != undefined ? fxRate : 1)\r\n )\r\n switch (alteration.getMovement.from) {\r\n case \"taxable_surplus\":\r\n case \"hybrid_surplus\":\r\n case \"exempt_surplus\":\r\n amount += alterationAmount\r\n break\r\n case \"underlying_foreign_taxes\":\r\n uft += alterationAmount\r\n break\r\n case \"hybrid_underlying_taxes\":\r\n hut += alterationAmount\r\n break\r\n }\r\n })\r\n\r\n // Save the accrued amounts\r\n newDividendReceived.amount = amount\r\n newDividendReceived.uft_amount = uft\r\n newDividendReceived.hut_amount = hut\r\n\r\n if (tier.id) {\r\n if (!newDividends[tier.id]) {\r\n newDividends[tier.id] = []\r\n }\r\n newDividends[tier.id].push(newDividendReceived)\r\n }\r\n })\r\n })\r\n })\r\n\r\n return newDividends\r\n }\r\n}\r\n","import _ from \"lodash\"\r\nimport dateFns from \"date-fns\"\r\nimport Vue from \"vue\"\r\n// Project Imports\r\nimport { getInputFieldNames } from \"../../store/calculator/getters\"\r\nimport {\r\n SurplusBalanceTypes,\r\n SepPeriods,\r\n SurplusOrderingItem,\r\n ReportingPeriod,\r\n ForeignAffiliate,\r\n Dividend,\r\n ReportingPeriodCalculation,\r\n} from \"@/interfaces\"\r\nimport { round } from \"@/util/round\"\r\nimport Calculator from \"./Calculator\"\r\n\r\nexport class CalculatorHelpers {\r\n public static scheduleFields: string[] = getInputFieldNames(\"schedule\")\r\n\r\n public static setUpOpenings(\r\n foreignAffiliate: ForeignAffiliate,\r\n reportingPeriod: ReportingPeriod,\r\n previousCalculation?: Calculator\r\n ) {\r\n const fxRate = reportingPeriod.fx_rate ? reportingPeriod.fx_rate : 1\r\n let openings: SurplusBalanceTypes = {\r\n exemptBalance: foreignAffiliate.exempt_surplus_opening_balance,\r\n hybridBalance: foreignAffiliate.hybrid_surplus_opening_balance,\r\n taxableBalance: foreignAffiliate.taxable_surplus_opening_balance,\r\n preAcqBalance: foreignAffiliate.pre_acquisition_surplus_opening_balance,\r\n preAcqRecharBalance: 0,\r\n uftBalance: foreignAffiliate.underlying_foreign_tax_opening_balance,\r\n hutBalance: foreignAffiliate.hybrid_underlying_tax_opening_balance,\r\n openingReDeficit: foreignAffiliate.opening_re_deficit || 0,\r\n acbBalance: foreignAffiliate.acb_opening_balance,\r\n }\r\n reportingPeriod.sepOpening = foreignAffiliate.opening_sep\r\n\r\n // Find the previous closings and SEP, if any\r\n if (previousCalculation) {\r\n openings = CalculatorHelpers.clone(previousCalculation.closings)\r\n reportingPeriod.sepOpening =\r\n previousCalculation.reportingPeriod.closing_sep\r\n }\r\n\r\n // Apply rate here after the opening has been decided\r\n openings.exemptBalance *= fxRate\r\n openings.hybridBalance *= fxRate\r\n openings.taxableBalance *= fxRate\r\n openings.preAcqBalance *= fxRate\r\n openings.uftBalance *= fxRate\r\n openings.hutBalance *= fxRate\r\n openings.acbBalance *= fxRate\r\n if (openings.openingReDeficit) {\r\n openings.openingReDeficit *= fxRate\r\n }\r\n Vue.set(reportingPeriod, \"openings\", openings)\r\n }\r\n\r\n public static calculateFASurplus(foreignAffiliate: ForeignAffiliate) {\r\n // Order periods by date\r\n const periodsInOrder = foreignAffiliate.reporting_periods.sort(\r\n (a: ReportingPeriod, b: ReportingPeriod) =>\r\n new Date(a.start_date).getTime() - new Date(b.start_date).getTime()\r\n )\r\n\r\n // Keep track of the closing of each of the periods\r\n const periodCalculations: ReportingPeriodCalculation = {}\r\n\r\n periodsInOrder.forEach((rp: ReportingPeriod, index: number) => {\r\n if (index > 0) {\r\n const previousRp: ReportingPeriod = periodsInOrder[index - 1]\r\n const previousCalculation = periodCalculations[previousRp.id as string]\r\n this.setUpOpenings(foreignAffiliate, rp, previousCalculation)\r\n } else {\r\n this.setUpOpenings(foreignAffiliate, rp)\r\n }\r\n\r\n // Run the calculation\r\n const calc = new Calculator(\r\n foreignAffiliate,\r\n rp,\r\n rp.openings as SurplusBalanceTypes\r\n )\r\n calc.calculate()\r\n Vue.set(rp, \"calculator\", calc)\r\n\r\n // Save the closing balances\r\n Vue.set(rp, \"closings\", calc.closingBalances)\r\n periodCalculations[rp.id as string] = calc\r\n })\r\n }\r\n\r\n public static createCalculatedValuesPayload(\r\n foreignAffiliate: ForeignAffiliate\r\n ): Promise {\r\n const calculatedValues: any = []\r\n foreignAffiliate.reporting_periods.forEach((rp: ReportingPeriod) => {\r\n const cv = this.createCalculatedValues(rp)\r\n if (cv) {\r\n calculatedValues.push(cv)\r\n }\r\n })\r\n return calculatedValues\r\n }\r\n\r\n public static createCalculatedValues(reportingPeriod: ReportingPeriod) {\r\n if (reportingPeriod.closings && reportingPeriod.calculator) {\r\n return {\r\n balance_snapshots: JSON.stringify(\r\n reportingPeriod.calculator.balanceSnapshots\r\n ),\r\n sep_percentage: reportingPeriod.closing_sep,\r\n reporting_period: reportingPeriod.id,\r\n dividend_tiers: reportingPeriod.calculator.createDividendsReceived(),\r\n }\r\n }\r\n return null\r\n }\r\n\r\n public static roundedProration(\r\n proratedValues: number[],\r\n prorationAmount: number\r\n ) {\r\n const roundedAmounts = proratedValues.map(num => Math.round(num))\r\n\r\n if (roundedAmounts.reduce((a, b) => a + b, 0) != prorationAmount) {\r\n proratedValues.forEach((num, index) => {\r\n const sum = roundedAmounts.reduce((a, b) => a + b, 0)\r\n if (sum > prorationAmount) {\r\n const floorVal = Math.floor(num)\r\n roundedAmounts[index] = floorVal\r\n if (roundedAmounts.reduce((a, b) => a + b, 0) == prorationAmount) {\r\n return\r\n }\r\n } else {\r\n const ceilVal = Math.ceil(num)\r\n roundedAmounts[index] = ceilVal\r\n if (roundedAmounts.reduce((a, b) => a + b, 0) == prorationAmount) {\r\n return\r\n }\r\n }\r\n })\r\n }\r\n\r\n return roundedAmounts\r\n }\r\n\r\n public static add = (accumulator: number, curr: number) => accumulator + curr\r\n\r\n public static sum = (...args: any) =>\r\n [...args].reduce(CalculatorHelpers.add, 0)\r\n\r\n public static sumValues = (values: any[]) => {\r\n return values.reduce((acc, { value }) => (value ? acc + value : acc), 0)\r\n }\r\n\r\n public static formatValues = (fields: any[] | undefined) =>\r\n fields &&\r\n fields.reduce((acc, curr) => {\r\n if (\r\n curr.field_name &&\r\n curr.field_name.meta_id &&\r\n !curr.hasOwnProperty(curr.field_name.meta_id)\r\n ) {\r\n acc[curr.field_name.meta_id] = {\r\n ...curr.field_name,\r\n field_id: curr.id,\r\n date_created: curr.date_created,\r\n reporting_period: curr.reporting_period,\r\n last_updated: curr.last_updated,\r\n value: round(curr.value),\r\n }\r\n }\r\n return acc\r\n }, {})\r\n\r\n public static dateSort = (a: any, b: any) =>\r\n new Date(a.date).getTime() - new Date(b.date).getTime()\r\n\r\n public static clone = (a: any) => JSON.parse(JSON.stringify(a))\r\n\r\n public static rebalance = (a: number, b: number): number[] => {\r\n if (a >= 0 && b >= 0) {\r\n if (a >= b) {\r\n a -= b\r\n b = 0\r\n } else {\r\n b -= a\r\n a = 0\r\n }\r\n } else {\r\n if (a >= b) {\r\n a += b\r\n b = 0\r\n } else {\r\n b += a\r\n a = 0\r\n }\r\n }\r\n\r\n return [a, b]\r\n }\r\n\r\n // remove negative values from ordering\r\n public static balanceNetSurplus = (buckets: SurplusOrderingItem[]) => {\r\n // tslint:disable-next-line\r\n for (let i = 0; i < buckets.length; i++) {\r\n // if the value of this bucket is positive\r\n if (buckets[i].balance > 0) {\r\n // look through every bucket again\r\n // tslint:disable-next-line\r\n for (let j = 0; j < buckets.length; j++) {\r\n // and if we find one that is negative\r\n if (buckets[j].balance < 0) {\r\n // store the original value and take the sum\r\n const temp = buckets[i].balance\r\n buckets[i].balance += buckets[j].balance\r\n // if it's still negative we are gonna start again but now the original number\r\n // is negative and needs to be 0 out\r\n // the negative number now needs to have the positive one added to it\r\n if (buckets[i].balance < 0) {\r\n buckets[j].balance += temp\r\n buckets[i].balance = 0\r\n i--\r\n break\r\n } else {\r\n // item was reduced to 0, so set it back to zero\r\n buckets[j].balance = 0\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return buckets\r\n }\r\n\r\n // type is an object of objects\r\n public static sumSepValues(sepPeriods: SepPeriods, keys: string[]) {\r\n let sum: number = 0\r\n // tslint:disable-next-line\r\n for (const period in sepPeriods) {\r\n keys.forEach((key: string) => {\r\n if (sepPeriods[period].hasOwnProperty(key)) {\r\n sum += sepPeriods[period][key]\r\n }\r\n })\r\n }\r\n return round(sum)\r\n }\r\n\r\n public static getNetSurplus(surplusBalance: SurplusBalanceTypes): number {\r\n return sum(\r\n surplusBalance.exemptBalance,\r\n surplusBalance.hybridBalance,\r\n surplusBalance.taxableBalance\r\n )\r\n }\r\n\r\n public static createBlankDividend(data: any): Dividend {\r\n return {\r\n date: \"\",\r\n category: \"E\",\r\n type: \"R\",\r\n ref: \"\",\r\n client_ref: \"\",\r\n dividend_tiers: [],\r\n preacq_designation: false,\r\n schedule_93: false,\r\n amount: 0,\r\n hut_amount: 0,\r\n tax_on_amount: 0,\r\n uft_amount: 0,\r\n ...data,\r\n }\r\n }\r\n\r\n public static accrueFields(foreignAffiliate: ForeignAffiliate) {\r\n const { reporting_periods } = foreignAffiliate\r\n\r\n // All values for all periods must be accrued before the calcuation is done\r\n reporting_periods.forEach((rp: ReportingPeriod) => {\r\n const {\r\n fields,\r\n dividends,\r\n adjustments,\r\n disposition_adjustments,\r\n acb_adjustments,\r\n } = rp\r\n // Initialize localFields if not yet\r\n if (!rp.localFields) {\r\n rp.localFields = {}\r\n }\r\n const { localFields } = rp\r\n\r\n // Accumulate all the user created fields up to their parent fields\r\n if (fields) {\r\n const fieldsGroupedByParent: any = _.groupBy(\r\n fields,\r\n field => field.field_name.parent\r\n )\r\n // No need to iterate through fields with no parent\r\n delete fieldsGroupedByParent[\"null\"]\r\n this.scheduleFields.forEach(field => {\r\n const parentField = fields.find(f => f.field_name.meta_id == field)\r\n if (parentField) {\r\n const userFields = fieldsGroupedByParent[parentField.field_name.id]\r\n if (userFields && userFields.length > 0) {\r\n parentField.value = CalculatorHelpers.sumValues(userFields)\r\n } else {\r\n parentField.value = 0\r\n }\r\n }\r\n })\r\n\r\n // FITR Consol\r\n const FITRIncomeTaxDeducted = fields.find(\r\n f => f.field_name.meta_id === \"income_tax_deducted_from_earnings\"\r\n )\r\n const FITRIncomeTaxIncluded = fields.find(\r\n f =>\r\n f.field_name.meta_id ===\r\n \"income_tax_refunded_and_included_in_earnings\"\r\n )\r\n const FITROtherForeignIncomeField = fields.find(\r\n f => f.field_name.meta_id === \"fitr_other_foreign_income_tax\"\r\n )\r\n if (\r\n FITRIncomeTaxDeducted &&\r\n FITRIncomeTaxIncluded &&\r\n FITROtherForeignIncomeField\r\n ) {\r\n localFields[\"fitr\"] =\r\n CalculatorHelpers.sumValues([FITROtherForeignIncomeField]) +\r\n CalculatorHelpers.sumValues([\r\n FITRIncomeTaxDeducted,\r\n FITRIncomeTaxIncluded,\r\n ]) *\r\n -1\r\n }\r\n }\r\n\r\n // Set all the local fields\r\n if (dividends) {\r\n let dividendsPaid = 0\r\n let dividendsReceived = 0\r\n dividends.forEach(d => {\r\n if (d.type === \"R\") {\r\n dividendsReceived += d.amount\r\n } else {\r\n dividendsPaid += d.amount\r\n }\r\n })\r\n\r\n localFields[\"dividends_paid\"] = dividendsPaid\r\n localFields[\"dividends_received\"] = dividendsReceived\r\n }\r\n\r\n if (disposition_adjustments) {\r\n let dispostions = 0\r\n let dispostionTax = 0\r\n\r\n disposition_adjustments.forEach(d => {\r\n dispostions += d.amount\r\n dispostionTax += d.tax_on_amount\r\n })\r\n\r\n localFields[\"hybrid_disposition\"] = dispostions\r\n localFields[\"fitr\"] += dispostionTax * -1\r\n }\r\n\r\n if (adjustments) {\r\n let otherAdjustments = 0\r\n let foreignTaxConsolidationAdjustments = 0\r\n\r\n adjustments.forEach((a: any) => {\r\n if (a.metadata) {\r\n const metaId = JSON.parse(a.metadata).meta_id\r\n if (metaId === \"foreign_tax_consolidation\") {\r\n foreignTaxConsolidationAdjustments += a.amount\r\n } else if (metaId === \"other_inclusions\") {\r\n otherAdjustments += a.amount\r\n }\r\n }\r\n })\r\n\r\n localFields[\"other_inclusions\"] = otherAdjustments\r\n localFields[\r\n \"foreign_tax_consolidation\"\r\n ] = foreignTaxConsolidationAdjustments\r\n }\r\n\r\n if (acb_adjustments) {\r\n let acbAdjustments = 0\r\n\r\n acb_adjustments.forEach((a: any) => {\r\n acbAdjustments += a.amount\r\n })\r\n localFields[\"acb_adjustments\"] = acbAdjustments\r\n }\r\n })\r\n }\r\n}\r\n\r\nconst add = (accumulator: number, curr: number) => accumulator + curr\r\n\r\nexport const sum = (...args: any) => [...args].reduce(add, 0)\r\n\r\nexport const sumValues = (values: any[]) => {\r\n return values.reduce((acc, curr) => (curr.value ? acc + curr.value : acc), 0)\r\n}\r\n\r\nexport const formatValues = (fields: any[] | undefined) =>\r\n fields &&\r\n fields.reduce((acc, curr) => {\r\n if (\r\n curr.field_name &&\r\n curr.field_name.meta_id &&\r\n !curr.hasOwnProperty(curr.field_name.meta_id)\r\n ) {\r\n acc[curr.field_name.meta_id] = {\r\n ...curr.field_name,\r\n field_id: curr.id,\r\n date_created: curr.date_created,\r\n reporting_period: curr.reporting_period,\r\n last_updated: curr.last_updated,\r\n value: curr.value,\r\n }\r\n }\r\n return acc\r\n }, {})\r\n","import api, { resolve } from \"./api\"\r\n\r\nconst get = (taxpayer: number | string): any =>\r\n api.get(`acb-adjustment-types/?taxpayer=${taxpayer}`).then(resolve)\r\n\r\nexport default {\r\n get,\r\n}\r\n","import api, { resolve } from \"./api\"\r\n\r\nconst create = (id: string | number, values: any): any =>\r\n api.post(`reporting-periods/${id}/acb-adjustments/`, values).then(resolve)\r\n\r\nconst remove = (id: string | number, adjustmentID: string | number): any =>\r\n api\r\n .delete(`reporting-periods/${id}/acb-adjustments/${adjustmentID}/`)\r\n .then(resolve)\r\n\r\nconst edit = (id: string | number, adj: any): any =>\r\n api\r\n .put(`reporting-periods/${id}/acb-adjustments/${adj.id}/`, adj)\r\n .then(resolve)\r\n\r\nexport default {\r\n create,\r\n remove,\r\n edit,\r\n}\r\n","import { ACBPeriod } from \"@/interfaces\"\r\nimport api, { resolve } from \"./api\"\r\n\r\nconst create = (id: string | number, values: ACBPeriod): any =>\r\n api.post(`foreign-affiliates/${id}/acb-periods/`, values).then(resolve)\r\n\r\nconst remove = (id: string | number, acbPeriodId: string | number): any =>\r\n api\r\n .delete(`foreign-affiliates/${id}/acb-periods/${acbPeriodId}/`)\r\n .then(resolve)\r\n\r\nconst edit = (id: string | number, values: ACBPeriod): any =>\r\n api\r\n .put(`foreign-affiliates/${id}/acb-periods/${values.id}/`, values)\r\n .then(resolve)\r\n\r\nexport default {\r\n create,\r\n remove,\r\n edit,\r\n}\r\n","import { ActionTree } from \"vuex\"\r\nimport {\r\n CalculatorState,\r\n SET_CALCULATOR_FA,\r\n ERROR_CALCULATOR_FA,\r\n SET_SELECTED_RP,\r\n CHANGE_LOOKBACK_SHUFFLE,\r\n CALCULATOR_VALUE_CHANGE,\r\n REVERT_CALCULATOR_VALUES,\r\n CALCULATE_SURPLUS,\r\n RESET_STORE,\r\n ADD_SEP,\r\n DELETE_SEP,\r\n DELETE_DIVIDEND,\r\n ADD_DIVIDEND,\r\n ADD_ADJUSTMENT,\r\n DELETE_ADJUSTMENT,\r\n ADD_FIELD,\r\n DELETE_FIELD,\r\n ACCUMULATE_FIELDS,\r\n ADD_DISPOSITION_ADJUSTMENT,\r\n DELETE_DISPOSITION_ADJUSTMENT,\r\n EDIT_DIVIDEND,\r\n EDIT_SEP,\r\n EDIT_ADJUSTMENT,\r\n EDIT_DISPOSITION_ADJUSTMENT,\r\n EDIT_FIELD,\r\n SET_CALCULATOR_TAXPAYER,\r\n ADD_OUTPUT_PROFILE,\r\n EDIT_OUTPUT_PROFILE,\r\n DELETE_OUTPUT_PROFILE,\r\n UPDATE_METADATA,\r\n EDIT_RP,\r\n ADD_COMMENT,\r\n DELETE_COMMENT,\r\n UPDATE_COMMENT_RESOLVE,\r\n ADD_REVIEW,\r\n DELETE_REVIEW,\r\n EDIT_PRIOR_YEAR_DISPLAY,\r\n SET_ACB_ADJUSTMENT_TYPES,\r\n DELETE_ACB_ADJUSTMENT,\r\n EDIT_ACB_ADJUSTMENT,\r\n ADD_ACB_ADJUSTMENT,\r\n TOGGLE_ACB,\r\n ADD_ACB_PERIOD,\r\n DELETE_ACB_PERIOD,\r\n EDIT_ACB_PERIOD,\r\n} from \"./types\"\r\nimport { RootState } from \"../types\"\r\nimport {\r\n ForeignAffiliate,\r\n ReportingPeriod,\r\n SEPAdjustment,\r\n Dividend,\r\n Adjustment,\r\n DispositionAdjustment,\r\n Taxpayer,\r\n Comment,\r\n Review,\r\n ACBAdjustment,\r\n ACBPeriod,\r\n} from \"@/interfaces\"\r\nimport {\r\n fa,\r\n calculator,\r\n sep,\r\n dividends,\r\n adjustments,\r\n fields,\r\n dispositionAdjustments,\r\n taxpayer,\r\n outputProfile,\r\n period,\r\n comment,\r\n review,\r\n} from \"@/services/api\"\r\nimport _ from \"lodash\"\r\nimport { CalculatorHelpers } from \"@/services/calculator/CalculatorHelpers\"\r\nimport acbAdjustmentTypes from \"@/services/api/acbAdjustmentTypes\"\r\nimport acbAdjustments from \"@/services/api/acbAdjustments\"\r\nimport acbPeriods from \"@/services/api/acbPeriods\"\r\n\r\nexport const actions: ActionTree = {\r\n resetStore({ commit }) {\r\n commit(RESET_STORE)\r\n },\r\n fetchTaxpayer({ commit }, payload: any) {\r\n const { taxpayerId, params } = payload\r\n return taxpayer\r\n .get(taxpayerId, params || { includes: \"\" })\r\n .then((res: any) => {\r\n const payload: Taxpayer = res\r\n commit(SET_CALCULATOR_TAXPAYER, payload)\r\n })\r\n },\r\n fetchData({ commit, dispatch }, foreignAffiliateId: string | number): any {\r\n commit(RESET_STORE)\r\n\r\n const faPromise = fa.get(foreignAffiliateId)\r\n return faPromise\r\n .then((response: any) => {\r\n const payload: ForeignAffiliate = response\r\n // Fetch the taxpayer with some extra info\r\n commit(SET_CALCULATOR_FA, payload)\r\n commit(ACCUMULATE_FIELDS)\r\n const taxpayerPromise = dispatch(\"fetchTaxpayer\", {\r\n taxpayerId: payload.taxpayer,\r\n params: taxpayer.reportingPeriodCalculatorParams,\r\n })\r\n const acbAdjustmentTypesPromise = dispatch(\"fetchAcbAdjustmentType\")\r\n return Promise.all([taxpayerPromise, acbAdjustmentTypesPromise])\r\n })\r\n .catch((err: any) => {\r\n commit(ERROR_CALCULATOR_FA)\r\n })\r\n },\r\n setSelectedReportingPeriod(\r\n { commit },\r\n reportingPeriod: ReportingPeriod\r\n ): any {\r\n commit(SET_SELECTED_RP, reportingPeriod)\r\n },\r\n changeLookbackShuffle({ commit }, payload: any) {\r\n commit(CHANGE_LOOKBACK_SHUFFLE, payload)\r\n },\r\n calculatorValueChange({ commit }, payload: any) {\r\n commit(CALCULATOR_VALUE_CHANGE, payload)\r\n },\r\n calculateSurplus({ commit, dispatch }) {\r\n commit(ACCUMULATE_FIELDS)\r\n commit(CALCULATE_SURPLUS)\r\n dispatch(\"saveCalculatedValues\")\r\n },\r\n saveFieldValues({ state }, payload: any = null) {\r\n const { selectedReportingPeriod, foreignAffiliate } = state\r\n if (\r\n selectedReportingPeriod &&\r\n foreignAffiliate &&\r\n selectedReportingPeriod.id\r\n ) {\r\n const { fields, id } = selectedReportingPeriod\r\n let fieldsArray: any[] = _.map(fields, value => {\r\n return value\r\n })\r\n // Passed set of fields to update\r\n if (payload) {\r\n const { fields } = payload\r\n\r\n if (fields) {\r\n fieldsArray = fields\r\n }\r\n }\r\n return calculator.update(id, fieldsArray)\r\n }\r\n return null\r\n },\r\n updateData({ dispatch, state }) {\r\n const { selectedReportingPeriod, foreignAffiliate } = state\r\n if (selectedReportingPeriod && foreignAffiliate) {\r\n const selectedRPId = selectedReportingPeriod.id\r\n const faId = foreignAffiliate.id\r\n return dispatch(\"fetchData\", faId).then(() => {\r\n const handler = () => {\r\n const newFa = state.foreignAffiliate\r\n if (newFa) {\r\n const selectedRP = newFa.reporting_periods.find(\r\n (rp: ReportingPeriod) => rp.id === selectedRPId\r\n )\r\n if (selectedRP) {\r\n dispatch(\"setSelectedReportingPeriod\", selectedRP)\r\n }\r\n }\r\n }\r\n\r\n // Wait for state to change (UGLY)\r\n if (!state.foreignAffiliate) {\r\n setTimeout(handler, 100)\r\n } else {\r\n handler()\r\n }\r\n })\r\n }\r\n },\r\n revertFieldValues({ commit, state }) {\r\n commit(REVERT_CALCULATOR_VALUES)\r\n commit(CALCULATE_SURPLUS)\r\n },\r\n addSEPAdjustment(\r\n { commit, state, dispatch },\r\n newSEPAdjustment: SEPAdjustment\r\n ) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { id } = state.selectedReportingPeriod\r\n\r\n newSEPAdjustment.reporting_period = id\r\n\r\n return sep.create(id, newSEPAdjustment).then((res: SEPAdjustment) => {\r\n commit(ADD_SEP, res)\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n editSEPAdjustment({ commit, state, dispatch }, editedSEP: SEPAdjustment) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { id } = state.selectedReportingPeriod\r\n\r\n return sep.edit(id, editedSEP).then((res: SEPAdjustment) => {\r\n commit(EDIT_SEP, res)\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n deleteSEPAdjustment(\r\n { commit, dispatch, state },\r\n SEPAdjustmentId: string | number\r\n ) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { id } = state.selectedReportingPeriod\r\n\r\n return sep.remove(id, SEPAdjustmentId).then((res: any) => {\r\n commit(DELETE_SEP, res.sep_adjustment)\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n addDividend({ commit, state, dispatch }, newDividend: Dividend) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { id } = state.selectedReportingPeriod\r\n\r\n newDividend.reporting_period = id\r\n\r\n if (newDividend.category !== \"T\") {\r\n newDividend.uft_amount = 0\r\n }\r\n\r\n if (newDividend.category !== \"H\") {\r\n newDividend.hut_amount = 0\r\n }\r\n\r\n return dividends.create(id, newDividend).then((res: Dividend) => {\r\n commit(ADD_DIVIDEND, res)\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n editDividend({ commit, state, dispatch }, editedDividend: Dividend) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { id } = state.selectedReportingPeriod\r\n\r\n if (editedDividend.category !== \"T\") {\r\n editedDividend.uft_amount = 0\r\n }\r\n\r\n if (editedDividend.category !== \"H\") {\r\n editedDividend.hut_amount = 0\r\n }\r\n\r\n return dividends.edit(id, editedDividend).then((res: Dividend) => {\r\n commit(EDIT_DIVIDEND, res)\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n deleteDividend({ commit, state, dispatch }, dividendId: string | number) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { id } = state.selectedReportingPeriod\r\n\r\n return dividends.remove(id, dividendId).then((res: any) => {\r\n commit(DELETE_DIVIDEND, res.dividend)\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n addAdjustment({ commit, state, dispatch }, newAdjustment: Adjustment) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { id } = state.selectedReportingPeriod\r\n\r\n newAdjustment.reporting_period = id\r\n\r\n return adjustments.create(id, newAdjustment).then((res: Adjustment) => {\r\n commit(ADD_ADJUSTMENT, res)\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n editAdjustment({ commit, state, dispatch }, editedAdjustment: Adjustment) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { id } = state.selectedReportingPeriod\r\n\r\n return adjustments.edit(id, editedAdjustment).then((res: Adjustment) => {\r\n commit(EDIT_ADJUSTMENT, res)\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n deleteAdjustment({ commit, state, dispatch }, adjustmentId: string | number) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { id } = state.selectedReportingPeriod\r\n\r\n return adjustments.remove(id, adjustmentId).then((res: any) => {\r\n commit(DELETE_ADJUSTMENT, res.adjustment)\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n addDispositionAdjustment({ commit, state, dispatch }, newAdjustment: any) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { id } = state.selectedReportingPeriod\r\n newAdjustment.reporting_period = id\r\n\r\n return dispositionAdjustments\r\n .create(id, newAdjustment)\r\n .then((res: Adjustment) => {\r\n commit(ADD_DISPOSITION_ADJUSTMENT, res)\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n editDispositionAdjustment(\r\n { commit, state, dispatch },\r\n editedAdjustment: DispositionAdjustment\r\n ) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { id } = state.selectedReportingPeriod\r\n\r\n return dispositionAdjustments\r\n .edit(id, editedAdjustment)\r\n .then((res: DispositionAdjustment) => {\r\n commit(EDIT_DISPOSITION_ADJUSTMENT, res)\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n deleteDispositionAdjustment(\r\n { commit, state, dispatch },\r\n adjustmentId: string | number\r\n ) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { id } = state.selectedReportingPeriod\r\n\r\n return dispositionAdjustments\r\n .remove(id, adjustmentId)\r\n .then((res: any) => {\r\n commit(DELETE_DISPOSITION_ADJUSTMENT, res.adjustment)\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n addField({ commit, state, dispatch }, newField: any) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { id } = state.selectedReportingPeriod\r\n\r\n newField.reporting_period = id\r\n\r\n return fields.create(id, newField).then((res: any) => {\r\n commit(ADD_FIELD, res)\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n rollforwardFields({ commit, state, dispatch }, values: any) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { id } = state.selectedReportingPeriod\r\n\r\n return fields.duplicate(id, values).then((res: any) => {\r\n const newFields = res.data\r\n newFields.forEach((newField: any) => {\r\n commit(ADD_FIELD, newField)\r\n })\r\n dispatch(\"calculateSurplus\")\r\n return res\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n editField({ commit, state, dispatch }, editedField: any) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { id } = state.selectedReportingPeriod\r\n\r\n return fields.edit(id, editedField).then((res: any) => {\r\n commit(EDIT_FIELD, res)\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n addFields({ commit, state, dispatch }, newFields: any[]) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { id } = state.selectedReportingPeriod\r\n\r\n newFields.forEach(newField => (newField.reporting_period = id))\r\n\r\n return fields.createBulk(id, newFields).then((res: any) => {\r\n res.fields.forEach((field: any) => commit(ADD_FIELD, field))\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n deleteField({ commit, state, dispatch }, fieldId: string | number) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { id } = state.selectedReportingPeriod\r\n\r\n return fields.remove(id, fieldId).then((res: any) => {\r\n commit(DELETE_FIELD, res.field)\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n deleteFields({ commit, state, dispatch }, fieldIds: string | number) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { id } = state.selectedReportingPeriod\r\n\r\n return fields.removeBulk(id, fieldIds).then((res: any) => {\r\n res.fields.forEach((field: any) => commit(DELETE_FIELD, field))\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n saveCalculatedValues({ state }) {\r\n const { foreignAffiliate } = state\r\n if (foreignAffiliate) {\r\n const calculatedValues: any = CalculatorHelpers.createCalculatedValuesPayload(\r\n foreignAffiliate\r\n )\r\n calculator.saveBulkValues(calculatedValues[0].reporting_period, {\r\n values: calculatedValues,\r\n })\r\n }\r\n },\r\n addOutputProfile({ commit, state }, payload: any) {\r\n if (state.taxpayer) {\r\n const requestPromise = outputProfile.createTaxpayerProfile(\r\n state.taxpayer.id,\r\n payload\r\n )\r\n requestPromise.then((res: any) => {\r\n commit(ADD_OUTPUT_PROFILE, res)\r\n })\r\n return requestPromise\r\n }\r\n },\r\n editOutputProfile({ commit }, payload: any) {\r\n commit(EDIT_OUTPUT_PROFILE, payload)\r\n },\r\n deleteOutputProfile({ commit }, payload: any) {\r\n commit(DELETE_OUTPUT_PROFILE, payload)\r\n },\r\n updateMetadata({ commit, state }, payload: any) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n commit(UPDATE_METADATA, payload)\r\n period.update(\r\n {\r\n metadata: state.selectedReportingPeriod.metadata,\r\n },\r\n state.selectedReportingPeriod.id\r\n )\r\n }\r\n },\r\n updateReportingPeriod({ commit }, payload: any) {\r\n return period.update(payload, payload.id).then(() => {\r\n commit(EDIT_RP, payload)\r\n })\r\n },\r\n updateReportingPeriods({ commit }, payload: any[]) {\r\n return period.updateBulk(payload).then(() => {\r\n payload.forEach(element => {\r\n commit(EDIT_RP, element)\r\n })\r\n })\r\n },\r\n addComment({ commit, state }, payload: Comment) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { reporting_period } = payload\r\n\r\n return comment.post(reporting_period, payload).then((res: Comment) => {\r\n commit(ADD_COMMENT, res)\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n deleteComment({ commit, state }, commentId: string | number) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { id } = state.selectedReportingPeriod\r\n\r\n return comment.remove(id, commentId).then((res: any) => {\r\n commit(DELETE_COMMENT, res.id)\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n updateCommentResolve({ commit, state }, payload: any) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { reporting_period, id, resolved } = payload\r\n\r\n return comment\r\n .putResolve(reporting_period, id, resolved)\r\n .then((res: any) => {\r\n commit(UPDATE_COMMENT_RESOLVE, res)\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n addReview({ commit, state }, payload: any) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { model_name, entry_id } = payload\r\n\r\n return review.post(model_name, entry_id).then((res: Review) => {\r\n commit(ADD_REVIEW, res)\r\n })\r\n } else {\r\n return Promise.reject(\"Review exists.\")\r\n }\r\n },\r\n deleteReview({ commit, state }, payload: any) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { model_name, entry_id } = payload\r\n\r\n return review.remove(model_name, entry_id).then((res: any) => {\r\n commit(DELETE_REVIEW, res)\r\n })\r\n } else {\r\n return Promise.reject(\"Error with deletion\")\r\n }\r\n },\r\n editPriorYearDisplay({ commit, state }, value: number) {\r\n commit(EDIT_PRIOR_YEAR_DISPLAY, value)\r\n },\r\n async fetchAcbAdjustmentType({ commit, state }) {\r\n if (state.foreignAffiliate) {\r\n const {\r\n foreignAffiliate: { taxpayer },\r\n } = state\r\n const types = await acbAdjustmentTypes.get(taxpayer)\r\n commit(SET_ACB_ADJUSTMENT_TYPES, types)\r\n }\r\n },\r\n addAcbAdjustment({ commit, state, dispatch }, newAdjustment: ACBAdjustment) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { id } = state.selectedReportingPeriod\r\n\r\n newAdjustment.reporting_period = id\r\n\r\n return acbAdjustments\r\n .create(id, newAdjustment)\r\n .then(async (res: ACBAdjustment) => {\r\n await dispatch(\"fetchAcbAdjustmentType\")\r\n commit(ADD_ACB_ADJUSTMENT, res)\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n editAcbAdjustment(\r\n { commit, state, dispatch },\r\n editedAdjustment: ACBAdjustment\r\n ) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { id } = state.selectedReportingPeriod\r\n\r\n return acbAdjustments\r\n .edit(id, editedAdjustment)\r\n .then(async (res: ACBAdjustment) => {\r\n await dispatch(\"fetchAcbAdjustmentType\")\r\n commit(EDIT_ACB_ADJUSTMENT, res)\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n deleteAcbAdjustment(\r\n { commit, state, dispatch },\r\n adjustmentId: string | number\r\n ) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.id) {\r\n const { id } = state.selectedReportingPeriod\r\n\r\n return acbAdjustments.remove(id, adjustmentId).then((res: any) => {\r\n commit(DELETE_ACB_ADJUSTMENT, res.acb_adjustment)\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected taxation year.\")\r\n }\r\n },\r\n async toggleACB({ state, commit }, value: boolean) {\r\n if (state.foreignAffiliate) {\r\n await fa.update({ acb_enabled: value }, state.foreignAffiliate\r\n .id as string)\r\n commit(TOGGLE_ACB, value)\r\n }\r\n },\r\n addAcbPeriod({ commit, state, dispatch }, newAcbPeriod: ACBPeriod) {\r\n if (state.foreignAffiliate && state.foreignAffiliate.id) {\r\n const { id } = state.foreignAffiliate\r\n\r\n newAcbPeriod.foreign_affiliate = id\r\n\r\n return acbPeriods\r\n .create(id, newAcbPeriod)\r\n .then(async (res: ACBPeriod) => {\r\n commit(ADD_ACB_PERIOD, res)\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected FA.\")\r\n }\r\n },\r\n deleteAcbPeriod({ commit, state, dispatch }, acbPeriodId: string | number) {\r\n if (state.foreignAffiliate && state.foreignAffiliate.id) {\r\n const { id } = state.foreignAffiliate\r\n\r\n return acbPeriods.remove(id, acbPeriodId).then((res: any) => {\r\n commit(DELETE_ACB_PERIOD, res.acb_period)\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected FA.\")\r\n }\r\n },\r\n editAcbPeriod({ commit, state, dispatch }, acbPeriod: ACBPeriod) {\r\n if (state.foreignAffiliate && state.foreignAffiliate.id) {\r\n const { id } = state.foreignAffiliate\r\n\r\n return acbPeriods.edit(id, acbPeriod).then(async (res: any) => {\r\n commit(EDIT_ACB_PERIOD, res)\r\n dispatch(\"calculateSurplus\")\r\n })\r\n } else {\r\n return Promise.reject(\"No selected FA.\")\r\n }\r\n },\r\n}\r\n","import { User } from \"@/interfaces\"\r\n\r\n//// Calculator\r\n// Types\r\nexport interface UserState {\r\n isAuthenticated: boolean\r\n data?: User\r\n isKIU: boolean\r\n error: boolean\r\n}\r\n\r\n// Mutations\r\nexport const SET_IS_AUTHENTICATED = \"SET_IS_AUTHENTICATED\"\r\nexport const SET_USER_DATA = \"SET_USER_DATA\"\r\nexport const TOGGLE_CLIENT = \"TOGGLE_CLIENT\"\r\nexport const ADD_OUTPUT_PROFILE = \"ADD_OUTPUT_PROFILE\"\r\nexport const EDIT_OUTPUT_PROFILE = \"EDIT_OUTPUT_PROFILE\"\r\nexport const DELETE_OUTPUT_PROFILE = \"DELETE_OUTPUT_PROFILE\"\r\n","import { MutationTree } from \"vuex\"\r\nimport dateFns from \"date-fns\"\r\nimport _ from \"lodash\"\r\nimport Vue from \"vue\"\r\n// Project Imports\r\nimport {\r\n CalculatorState,\r\n SET_CALCULATOR_FA,\r\n ERROR_CALCULATOR_FA,\r\n SET_SELECTED_RP,\r\n CHANGE_LOOKBACK_SHUFFLE,\r\n CALCULATOR_VALUE_CHANGE,\r\n REVERT_CALCULATOR_VALUES,\r\n CALCULATE_SURPLUS,\r\n RESET_STORE,\r\n ADD_SEP,\r\n DELETE_SEP,\r\n ADD_DIVIDEND,\r\n DELETE_DIVIDEND,\r\n ADD_ADJUSTMENT,\r\n DELETE_ADJUSTMENT,\r\n ADD_FIELD,\r\n DELETE_FIELD,\r\n ACCUMULATE_FIELDS,\r\n ADD_DISPOSITION_ADJUSTMENT,\r\n DELETE_DISPOSITION_ADJUSTMENT,\r\n EDIT_DIVIDEND,\r\n EDIT_SEP,\r\n EDIT_ADJUSTMENT,\r\n EDIT_DISPOSITION_ADJUSTMENT,\r\n EDIT_FIELD,\r\n SET_CALCULATOR_TAXPAYER,\r\n EDIT_OUTPUT_PROFILE,\r\n DELETE_OUTPUT_PROFILE,\r\n UPDATE_METADATA,\r\n EDIT_RP,\r\n ADD_COMMENT,\r\n DELETE_COMMENT,\r\n UPDATE_COMMENT_RESOLVE,\r\n ADD_REVIEW,\r\n DELETE_REVIEW,\r\n EDIT_PRIOR_YEAR_DISPLAY,\r\n SET_ACB_ADJUSTMENT_TYPES,\r\n ADD_ACB_ADJUSTMENT,\r\n EDIT_ACB_ADJUSTMENT,\r\n DELETE_ACB_ADJUSTMENT,\r\n TOGGLE_ACB,\r\n ADD_ACB_PERIOD,\r\n DELETE_ACB_PERIOD,\r\n EDIT_ACB_PERIOD,\r\n} from \"./types\"\r\nimport {\r\n ForeignAffiliate,\r\n ReportingPeriod,\r\n SEPAdjustment,\r\n Dividend,\r\n SurplusBalanceTypes,\r\n Adjustment,\r\n DispositionAdjustment,\r\n Taxpayer,\r\n Comment,\r\n Review,\r\n ACBAdjustmentType,\r\n ACBAdjustment,\r\n ACBPeriod,\r\n} from \"@/interfaces\"\r\nimport Calculator from \"@/services/calculator/Calculator\"\r\nimport { CalculatorHelpers } from \"@/services/calculator/CalculatorHelpers\"\r\nimport { ADD_OUTPUT_PROFILE } from \"../user/types\"\r\n\r\nexport const mutations: MutationTree = {\r\n [SET_CALCULATOR_TAXPAYER](state, payload: Taxpayer) {\r\n state.taxpayer = payload\r\n },\r\n [SET_CALCULATOR_FA](state, payload: ForeignAffiliate) {\r\n state.error = false\r\n state.foreignAffiliate = payload\r\n state.initialForeignAffiliate = CalculatorHelpers.clone(payload)\r\n },\r\n [ERROR_CALCULATOR_FA](state) {\r\n state.error = true\r\n state.foreignAffiliate = undefined\r\n state.taxpayer = undefined\r\n state.initialForeignAffiliate = undefined\r\n },\r\n [SET_SELECTED_RP](state, payload: ReportingPeriod) {\r\n const { foreignAffiliate } = state\r\n if (foreignAffiliate) {\r\n const reportingPeriod:\r\n | ReportingPeriod\r\n | undefined = foreignAffiliate.reporting_periods.find(\r\n (rp: ReportingPeriod) => {\r\n return rp.id === payload.id\r\n }\r\n )\r\n state.selectedReportingPeriod = reportingPeriod\r\n }\r\n state.lookbackShuffle = 0\r\n state.forwardShuffle = 0\r\n },\r\n [CHANGE_LOOKBACK_SHUFFLE](state, payload: any) {\r\n const { shuffle, direction } = payload\r\n if (direction === \"prior\") {\r\n state.lookbackShuffle += shuffle\r\n } else {\r\n state.forwardShuffle += shuffle\r\n }\r\n },\r\n [CALCULATOR_VALUE_CHANGE](state, payload: any) {\r\n const { metaId, reportingPeriodId, value } = payload\r\n const { foreignAffiliate } = state\r\n if (foreignAffiliate) {\r\n const reportingPeriod:\r\n | ReportingPeriod\r\n | undefined = foreignAffiliate.reporting_periods.find(\r\n (rp: ReportingPeriod) => {\r\n return rp.id === reportingPeriodId\r\n }\r\n )\r\n if (reportingPeriod && reportingPeriod.fields) {\r\n const field: any = reportingPeriod.fields.find((f: any) => {\r\n return f.field_name.meta_id === metaId\r\n })\r\n if (field) {\r\n field.value = value\r\n }\r\n }\r\n }\r\n },\r\n [REVERT_CALCULATOR_VALUES](state) {\r\n const { selectedReportingPeriod, initialForeignAffiliate } = state\r\n\r\n if (selectedReportingPeriod && initialForeignAffiliate) {\r\n // Iterate through all the original fields\r\n const originalReportingPeriod = initialForeignAffiliate.reporting_periods.find(\r\n rp => rp.id === selectedReportingPeriod.id\r\n )\r\n if (originalReportingPeriod && originalReportingPeriod.fields) {\r\n originalReportingPeriod.fields.forEach(originalField => {\r\n if (selectedReportingPeriod.fields) {\r\n const fieldMatch = selectedReportingPeriod.fields.find(\r\n fm => fm.field_name.meta_id === originalField.field_name.meta_id\r\n )\r\n // Match it with the current selected RP fields and revert the value\r\n if (fieldMatch && originalField.value !== fieldMatch.value) {\r\n fieldMatch.value = originalField.value\r\n }\r\n }\r\n })\r\n }\r\n }\r\n },\r\n [ACCUMULATE_FIELDS](state) {\r\n const { foreignAffiliate } = state\r\n if (foreignAffiliate && foreignAffiliate.reporting_periods) {\r\n CalculatorHelpers.accrueFields(foreignAffiliate)\r\n }\r\n },\r\n [CALCULATE_SURPLUS](state) {\r\n if (state.foreignAffiliate) {\r\n CalculatorHelpers.calculateFASurplus(state.foreignAffiliate)\r\n }\r\n },\r\n [RESET_STORE](state) {\r\n state.foreignAffiliate = undefined\r\n state.taxpayer = undefined\r\n state.error = false\r\n state.selectedReportingPeriod = undefined\r\n state.lookbackShuffle = 0\r\n state.forwardShuffle = 0\r\n state.acbAdjustmentTypes = []\r\n },\r\n [ADD_SEP](state, newSEPAdjusment: SEPAdjustment) {\r\n if (\r\n state.selectedReportingPeriod &&\r\n state.selectedReportingPeriod.sep_adjustments\r\n ) {\r\n const existingSEP = state.selectedReportingPeriod.sep_adjustments.find(\r\n (SEP: SEPAdjustment) => {\r\n return SEP.id === newSEPAdjusment.id\r\n }\r\n )\r\n if (!existingSEP) {\r\n state.selectedReportingPeriod.sep_adjustments.push(newSEPAdjusment)\r\n }\r\n }\r\n },\r\n [EDIT_SEP](state, editedSep: SEPAdjustment) {\r\n if (\r\n state.selectedReportingPeriod &&\r\n state.selectedReportingPeriod.sep_adjustments\r\n ) {\r\n let existingSep = state.selectedReportingPeriod.sep_adjustments.find(\r\n (sep: SEPAdjustment) => {\r\n return sep.id === editedSep.id\r\n }\r\n )\r\n if (existingSep) {\r\n existingSep = Object.assign(existingSep, editedSep)\r\n }\r\n }\r\n },\r\n [DELETE_SEP](state, SEPAdjusmentID: number | string) {\r\n if (\r\n state.selectedReportingPeriod &&\r\n state.selectedReportingPeriod.sep_adjustments\r\n ) {\r\n const existingSEP = state.selectedReportingPeriod.sep_adjustments.findIndex(\r\n (SEP: SEPAdjustment) => {\r\n return SEP.id === SEPAdjusmentID\r\n }\r\n )\r\n if (existingSEP >= 0) {\r\n state.selectedReportingPeriod.sep_adjustments.splice(existingSEP, 1)\r\n }\r\n }\r\n },\r\n [ADD_DIVIDEND](state, newDividend: Dividend) {\r\n if (\r\n state.selectedReportingPeriod &&\r\n state.selectedReportingPeriod.dividends\r\n ) {\r\n const existingDividend = state.selectedReportingPeriod.dividends.find(\r\n (div: Dividend) => {\r\n return div.id === newDividend.id\r\n }\r\n )\r\n if (!existingDividend) {\r\n state.selectedReportingPeriod.dividends.push(newDividend)\r\n }\r\n }\r\n },\r\n [EDIT_DIVIDEND](state, editedDividend: Dividend) {\r\n if (\r\n state.selectedReportingPeriod &&\r\n state.selectedReportingPeriod.dividends\r\n ) {\r\n let existingDividend = state.selectedReportingPeriod.dividends.find(\r\n (div: Dividend) => {\r\n return div.id === editedDividend.id\r\n }\r\n )\r\n if (existingDividend) {\r\n existingDividend = Object.assign(existingDividend, editedDividend)\r\n }\r\n }\r\n },\r\n [DELETE_DIVIDEND](state, dividendId: number | string) {\r\n if (\r\n state.selectedReportingPeriod &&\r\n state.selectedReportingPeriod.dividends\r\n ) {\r\n const existingDividend = state.selectedReportingPeriod.dividends.findIndex(\r\n (div: Dividend) => {\r\n return div.id === dividendId\r\n }\r\n )\r\n if (existingDividend >= 0) {\r\n state.selectedReportingPeriod.dividends.splice(existingDividend, 1)\r\n }\r\n }\r\n },\r\n [ADD_ADJUSTMENT](state, newAdjustment: Adjustment) {\r\n if (\r\n state.selectedReportingPeriod &&\r\n state.selectedReportingPeriod.adjustments\r\n ) {\r\n const existingAdjustment = state.selectedReportingPeriod.adjustments.find(\r\n (adj: Adjustment) => {\r\n return adj.id === newAdjustment.id\r\n }\r\n )\r\n if (!existingAdjustment) {\r\n state.selectedReportingPeriod.adjustments.push(newAdjustment)\r\n }\r\n }\r\n },\r\n [EDIT_ADJUSTMENT](state, editedAdjustment: Adjustment) {\r\n if (\r\n state.selectedReportingPeriod &&\r\n state.selectedReportingPeriod.adjustments\r\n ) {\r\n let existingAdjustment = state.selectedReportingPeriod.adjustments.find(\r\n (adj: Adjustment) => {\r\n return adj.id === editedAdjustment.id\r\n }\r\n )\r\n if (existingAdjustment) {\r\n existingAdjustment = Object.assign(existingAdjustment, editedAdjustment)\r\n }\r\n }\r\n },\r\n [DELETE_ADJUSTMENT](state, adjustmentId: number | string) {\r\n if (\r\n state.selectedReportingPeriod &&\r\n state.selectedReportingPeriod.adjustments\r\n ) {\r\n const existingAdjustment = state.selectedReportingPeriod.adjustments.findIndex(\r\n (adj: Adjustment) => {\r\n return adj.id === adjustmentId\r\n }\r\n )\r\n if (existingAdjustment >= 0) {\r\n state.selectedReportingPeriod.adjustments.splice(existingAdjustment, 1)\r\n }\r\n }\r\n },\r\n [ADD_DISPOSITION_ADJUSTMENT](state, newAdjustment: any) {\r\n if (\r\n state.selectedReportingPeriod &&\r\n state.selectedReportingPeriod.disposition_adjustments\r\n ) {\r\n const existingAdjustment = state.selectedReportingPeriod.disposition_adjustments.find(\r\n (adj: any) => {\r\n return adj.id === newAdjustment.id\r\n }\r\n )\r\n if (!existingAdjustment) {\r\n state.selectedReportingPeriod.disposition_adjustments.push(\r\n newAdjustment\r\n )\r\n }\r\n }\r\n },\r\n [EDIT_DISPOSITION_ADJUSTMENT](\r\n state,\r\n editedAdjustment: DispositionAdjustment\r\n ) {\r\n if (\r\n state.selectedReportingPeriod &&\r\n state.selectedReportingPeriod.disposition_adjustments\r\n ) {\r\n let existingAdjustment = state.selectedReportingPeriod.disposition_adjustments.find(\r\n (adj: DispositionAdjustment) => {\r\n return adj.id === editedAdjustment.id\r\n }\r\n )\r\n if (existingAdjustment) {\r\n existingAdjustment = Object.assign(existingAdjustment, editedAdjustment)\r\n }\r\n }\r\n },\r\n [DELETE_DISPOSITION_ADJUSTMENT](state, adjustmentId: number | string) {\r\n if (\r\n state.selectedReportingPeriod &&\r\n state.selectedReportingPeriod.disposition_adjustments\r\n ) {\r\n const existingAdjustment = state.selectedReportingPeriod.disposition_adjustments.findIndex(\r\n (adj: any) => {\r\n return adj.id === adjustmentId\r\n }\r\n )\r\n if (existingAdjustment >= 0) {\r\n state.selectedReportingPeriod.disposition_adjustments.splice(\r\n existingAdjustment,\r\n 1\r\n )\r\n }\r\n }\r\n },\r\n [ADD_FIELD](state, newField: any) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.fields) {\r\n const existingAdjustment = state.selectedReportingPeriod.fields.find(\r\n (field: any) => {\r\n return field.id === newField.id\r\n }\r\n )\r\n if (!existingAdjustment) {\r\n state.selectedReportingPeriod.fields.push(newField)\r\n }\r\n }\r\n },\r\n [EDIT_FIELD](state, editedField: any) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.fields) {\r\n let existingField = state.selectedReportingPeriod.fields.find(\r\n (f: any) => {\r\n return f.id === editedField.id\r\n }\r\n )\r\n if (existingField) {\r\n existingField = Object.assign(existingField, editedField)\r\n }\r\n }\r\n },\r\n [DELETE_FIELD](state, fieldId: number | string) {\r\n if (state.selectedReportingPeriod && state.selectedReportingPeriod.fields) {\r\n const existingField = state.selectedReportingPeriod.fields.findIndex(\r\n (field: any) => {\r\n return field.id === fieldId\r\n }\r\n )\r\n if (existingField >= 0) {\r\n const deletedItem = state.selectedReportingPeriod.fields.splice(\r\n existingField,\r\n 1\r\n )[0]\r\n // To avoid leaving a residual value, need to reset the parent field\r\n if (deletedItem) {\r\n const parentFieldId = deletedItem.field_name.parent\r\n const parentField: any = state.selectedReportingPeriod.fields.find(\r\n (f: any) => {\r\n return f.field_name.id === parentFieldId\r\n }\r\n )\r\n if (parentField) {\r\n parentField.value = \"\"\r\n }\r\n }\r\n }\r\n }\r\n },\r\n [ADD_OUTPUT_PROFILE](state, newOuputProfile: any) {\r\n if (state.taxpayer && state.taxpayer.output_profiles) {\r\n const existingOutputProfile = state.taxpayer.output_profiles.find(\r\n (op: any) => {\r\n return op.id === newOuputProfile.id\r\n }\r\n )\r\n if (!existingOutputProfile) {\r\n state.taxpayer.output_profiles.push(newOuputProfile)\r\n }\r\n }\r\n },\r\n [EDIT_OUTPUT_PROFILE](state, editedProfile: any) {\r\n if (state.taxpayer && state.taxpayer.output_profiles) {\r\n let existingProfile = state.taxpayer.output_profiles.find((op: any) => {\r\n return op.id === editedProfile.id\r\n })\r\n if (existingProfile) {\r\n existingProfile = Object.assign(existingProfile, editedProfile)\r\n }\r\n }\r\n },\r\n [DELETE_OUTPUT_PROFILE](state, profileId: number | string) {\r\n if (state.taxpayer && state.taxpayer.output_profiles) {\r\n const existingProfile = state.taxpayer.output_profiles.findIndex(\r\n (op: any) => {\r\n return op.id === profileId\r\n }\r\n )\r\n if (existingProfile >= 0) {\r\n state.taxpayer.output_profiles.splice(existingProfile, 1)\r\n }\r\n }\r\n },\r\n [UPDATE_METADATA](state, payload: any) {\r\n const { meta, value } = payload\r\n if (state.selectedReportingPeriod) {\r\n let { metadata } = state.selectedReportingPeriod\r\n // Instantiate the metadata object if undefined\r\n if (!metadata) {\r\n metadata = {}\r\n } else {\r\n metadata = JSON.parse(metadata)\r\n }\r\n if (meta && typeof meta == \"string\") {\r\n // if the value is an object, we can proceed to updating the metadata\r\n if (value && typeof value == \"object\") {\r\n if (!metadata.hasOwnProperty(meta)) {\r\n metadata[meta] = {}\r\n }\r\n metadata[meta] = {\r\n ...metadata[meta],\r\n ...value,\r\n }\r\n } else {\r\n // the value must be null or undefined, meaning we want to delete this key from the metadata\r\n delete metadata[meta]\r\n }\r\n }\r\n state.selectedReportingPeriod.metadata = JSON.stringify(metadata)\r\n }\r\n },\r\n [EDIT_RP](state, payload: any) {\r\n if (state.foreignAffiliate) {\r\n const { id } = payload\r\n let targetRp:\r\n | ReportingPeriod\r\n | undefined = state.foreignAffiliate.reporting_periods.find(\r\n (rp: ReportingPeriod) => rp.id == id\r\n )\r\n if (targetRp) {\r\n targetRp = Object.assign(targetRp, payload)\r\n }\r\n }\r\n },\r\n [ADD_COMMENT](state, newComment: Comment) {\r\n if (\r\n state.selectedReportingPeriod &&\r\n state.selectedReportingPeriod.comments\r\n ) {\r\n const existingComment = state.selectedReportingPeriod.comments.find(\r\n (com: Comment) => {\r\n return com.id === newComment.id && com.meta_id === newComment.meta_id\r\n }\r\n )\r\n if (!existingComment) {\r\n // Note: posts are ordered by newest first\r\n state.selectedReportingPeriod.comments.unshift(newComment)\r\n }\r\n }\r\n },\r\n [DELETE_COMMENT](state, commentId: number | string) {\r\n if (\r\n state.selectedReportingPeriod &&\r\n state.selectedReportingPeriod.comments\r\n ) {\r\n const existingComment = state.selectedReportingPeriod.comments.findIndex(\r\n (com: Comment) => {\r\n return com.id === commentId\r\n }\r\n )\r\n if (existingComment >= 0) {\r\n state.selectedReportingPeriod.comments.splice(existingComment, 1)\r\n }\r\n }\r\n },\r\n [UPDATE_COMMENT_RESOLVE](state, newComment: Comment) {\r\n if (\r\n state.selectedReportingPeriod &&\r\n state.selectedReportingPeriod.comments\r\n ) {\r\n const targetComment = state.selectedReportingPeriod.comments.find(\r\n (com: Comment) => {\r\n return com.id == newComment.id\r\n }\r\n )\r\n\r\n if (targetComment) {\r\n Object.assign(targetComment, newComment)\r\n }\r\n }\r\n },\r\n [ADD_REVIEW](state, newReview: Review) {\r\n if (state.selectedReportingPeriod) {\r\n const { model_name } = newReview\r\n let selectedReportingPeriodSection: any\r\n\r\n switch (model_name) {\r\n case \"FieldValue\":\r\n selectedReportingPeriodSection = state.selectedReportingPeriod.fields\r\n break\r\n case \"Dividend\":\r\n selectedReportingPeriodSection =\r\n state.selectedReportingPeriod.dividends\r\n break\r\n case \"DispositionAdjustment\":\r\n selectedReportingPeriodSection =\r\n state.selectedReportingPeriod.disposition_adjustments\r\n break\r\n case \"SEPAdjustmentPeriod\":\r\n selectedReportingPeriodSection =\r\n state.selectedReportingPeriod.sep_adjustments\r\n break\r\n case \"ACBAdjustment\":\r\n selectedReportingPeriodSection =\r\n state.selectedReportingPeriod.acb_adjustments\r\n break\r\n case \"Adjustment\":\r\n selectedReportingPeriodSection =\r\n state.selectedReportingPeriod.adjustments\r\n break\r\n }\r\n\r\n if (selectedReportingPeriodSection) {\r\n const targetElement = selectedReportingPeriodSection.find((el: any) => {\r\n return el.id === newReview.object_id\r\n })\r\n\r\n const existingReview = targetElement.reviews.find(\r\n (reviewEntry: Review) => {\r\n return reviewEntry.reviewer === newReview.reviewer\r\n }\r\n )\r\n\r\n if (!existingReview) {\r\n targetElement.reviews.push(newReview)\r\n }\r\n }\r\n }\r\n },\r\n [DELETE_REVIEW](state, payload: any) {\r\n if (state.selectedReportingPeriod) {\r\n const { model_name, id, object_id } = payload\r\n let selectedReportingPeriodSection: any\r\n\r\n switch (model_name) {\r\n case \"FieldValue\":\r\n selectedReportingPeriodSection = state.selectedReportingPeriod.fields\r\n break\r\n case \"Dividend\":\r\n selectedReportingPeriodSection =\r\n state.selectedReportingPeriod.dividends\r\n break\r\n case \"DispositionAdjustment\":\r\n selectedReportingPeriodSection =\r\n state.selectedReportingPeriod.disposition_adjustments\r\n break\r\n case \"ACBAdjustment\":\r\n selectedReportingPeriodSection =\r\n state.selectedReportingPeriod.acb_adjustments\r\n break\r\n case \"SEPAdjustmentPeriod\":\r\n selectedReportingPeriodSection =\r\n state.selectedReportingPeriod.sep_adjustments\r\n break\r\n case \"Adjustment\":\r\n selectedReportingPeriodSection =\r\n state.selectedReportingPeriod.adjustments\r\n break\r\n }\r\n\r\n if (selectedReportingPeriodSection) {\r\n const targetElement = selectedReportingPeriodSection.find((el: any) => {\r\n return el.id === object_id\r\n })\r\n\r\n const existingReview = targetElement.reviews.findIndex(\r\n (review: Review) => {\r\n return review.id === id\r\n }\r\n )\r\n\r\n if (existingReview >= 0) {\r\n targetElement.reviews.splice(existingReview, 1)\r\n }\r\n }\r\n }\r\n },\r\n [EDIT_PRIOR_YEAR_DISPLAY](state, value: number) {\r\n state.priorYearDisplay = value\r\n },\r\n [SET_ACB_ADJUSTMENT_TYPES](state, types: ACBAdjustmentType[]) {\r\n state.acbAdjustmentTypes = types\r\n },\r\n [ADD_ACB_ADJUSTMENT](state, newAdjustment: ACBAdjustment) {\r\n if (\r\n state.selectedReportingPeriod &&\r\n state.selectedReportingPeriod.acb_adjustments\r\n ) {\r\n const existingAdjustment = state.selectedReportingPeriod.acb_adjustments.find(\r\n (adj: ACBAdjustment) => {\r\n return adj.id === newAdjustment.id\r\n }\r\n )\r\n if (!existingAdjustment) {\r\n state.selectedReportingPeriod.acb_adjustments.push(newAdjustment)\r\n }\r\n }\r\n },\r\n [EDIT_ACB_ADJUSTMENT](state, editedAdjustment: ACBAdjustment) {\r\n if (\r\n state.selectedReportingPeriod &&\r\n state.selectedReportingPeriod.acb_adjustments\r\n ) {\r\n let existingAdjustment = state.selectedReportingPeriod.acb_adjustments.find(\r\n (adj: ACBAdjustment) => {\r\n return adj.id === editedAdjustment.id\r\n }\r\n )\r\n if (existingAdjustment) {\r\n existingAdjustment = Object.assign(existingAdjustment, editedAdjustment)\r\n }\r\n }\r\n },\r\n [DELETE_ACB_ADJUSTMENT](state, adjustmentId: number | string) {\r\n if (\r\n state.selectedReportingPeriod &&\r\n state.selectedReportingPeriod.acb_adjustments\r\n ) {\r\n const existingAdjustment = state.selectedReportingPeriod.acb_adjustments.findIndex(\r\n (adj: ACBAdjustment) => {\r\n return adj.id === adjustmentId\r\n }\r\n )\r\n if (existingAdjustment >= 0) {\r\n state.selectedReportingPeriod.acb_adjustments.splice(\r\n existingAdjustment,\r\n 1\r\n )\r\n }\r\n }\r\n },\r\n [TOGGLE_ACB](state, value: boolean) {\r\n if (state.foreignAffiliate) {\r\n state.foreignAffiliate.acb_enabled = value\r\n }\r\n },\r\n [ADD_ACB_PERIOD](state, newAcbPeriod: ACBPeriod) {\r\n if (state.foreignAffiliate && state.foreignAffiliate.acb_periods) {\r\n const existingAcbPeriod = state.foreignAffiliate.acb_periods.find(\r\n (a: ACBPeriod) => {\r\n return a.id === newAcbPeriod.id\r\n }\r\n )\r\n if (!existingAcbPeriod) {\r\n state.foreignAffiliate.acb_periods.push(newAcbPeriod)\r\n }\r\n }\r\n },\r\n [DELETE_ACB_PERIOD](state, acbPeriodId: number | string) {\r\n if (state.foreignAffiliate && state.foreignAffiliate.acb_periods) {\r\n const existingAcbPeriod = state.foreignAffiliate.acb_periods.findIndex(\r\n (a: ACBPeriod) => {\r\n return a.id === acbPeriodId\r\n }\r\n )\r\n if (existingAcbPeriod >= 0) {\r\n state.foreignAffiliate.acb_periods.splice(existingAcbPeriod, 1)\r\n }\r\n }\r\n },\r\n [EDIT_ACB_PERIOD](state, editedACBPeriod: ACBPeriod) {\r\n if (state.foreignAffiliate && state.foreignAffiliate.acb_periods) {\r\n const { id, date, value } = editedACBPeriod\r\n\r\n const existingAcbPeriod = state.foreignAffiliate.acb_periods.find(\r\n (a: ACBPeriod) => {\r\n return a.id === id\r\n }\r\n )\r\n if (existingAcbPeriod) {\r\n Object.assign(existingAcbPeriod, editedACBPeriod)\r\n }\r\n }\r\n },\r\n}\r\n","import { Module } from \"vuex\"\r\nimport { getters } from \"./getters\"\r\nimport { actions } from \"./actions\"\r\nimport { mutations } from \"./mutations\"\r\nimport { CalculatorState } from \"./types\"\r\nimport { RootState } from \"../types\"\r\n\r\nexport const state: CalculatorState = {\r\n taxpayer: undefined,\r\n foreignAffiliate: undefined,\r\n error: false,\r\n selectedReportingPeriod: undefined,\r\n lookbackShuffle: 0,\r\n forwardShuffle: 0,\r\n priorYearDisplay: 3,\r\n acbAdjustmentTypes: [],\r\n}\r\n\r\nconst namespaced: boolean = true\r\n\r\nexport const calculator: Module = {\r\n namespaced,\r\n state,\r\n getters,\r\n actions,\r\n mutations,\r\n}\r\n","import { GetterTree } from \"vuex\"\r\nimport { UserState } from \"./types\"\r\nimport { RootState } from \"../types\"\r\n\r\nexport const getters: GetterTree = {\r\n name(state: any): string {\r\n const { data } = state\r\n const firstName = data && data.first_name ? data.first_name : \"\"\r\n const lastName = data && data.last_name ? data.last_name : \"\"\r\n return firstName && lastName ? `${firstName} ${lastName}` : \"\"\r\n },\r\n isAuthenticated(state: any): boolean {\r\n return state.isAuthenticated\r\n },\r\n isClient(state: any): boolean {\r\n return (state.data && state.data.client) || false\r\n },\r\n isKIU(state: any): boolean {\r\n return state.isKIU\r\n },\r\n user(state: any): any {\r\n return state.data\r\n },\r\n}\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-container',[_c('b-modal',{attrs:{\"id\":\"taxpayer_form\",\"size\":\"m\",\"title\":\"Add Taxpayer\",\"hide-footer\":\"\",\"no-close-on-backdrop\":\"\"},model:{value:(_vm.showModal.taxPayerForm),callback:function ($$v) {_vm.$set(_vm.showModal, \"taxPayerForm\", $$v)},expression:\"showModal.taxPayerForm\"}},[_c('TaxpayerForm',{attrs:{\"fetchData\":_vm.fetchData,\"taxpayers\":_vm.taxpayers,\"closeModal\":_vm.closeModal}})],1),_c('b-modal',{attrs:{\"id\":\"taxpayer_copy\",\"size\":\"m\",\"title\":\"Copy Taxpayer\",\"hide-footer\":\"\",\"no-close-on-backdrop\":\"\"},model:{value:(_vm.showModal.taxPayerCopy),callback:function ($$v) {_vm.$set(_vm.showModal, \"taxPayerCopy\", $$v)},expression:\"showModal.taxPayerCopy\"}},[_c('TaxpayerCopy',{attrs:{\"fetchData\":_vm.fetchData,\"taxpayers\":_vm.taxpayers,\"closeModal\":_vm.closeModal},on:{\"taxpayer-copied\":_vm.taxpayerCopied}})],1),_c('h1',{staticClass:\"kpmg bg-primary text-white p-4 text-center rounded mb-3\"},[_vm._v(\"\\n Surplus Calculator\\n \")]),_c('b-row',{staticClass:\"mb-2\"},[_c('b-col',{attrs:{\"cols\":\"8\"}},[_c('h2',{staticClass:\"kpmg\"},[_vm._v(\"Canadian Taxpayers\")])]),(!_vm.isClient)?_c('b-col',{style:({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-end',\n })},[_c('b-button',{attrs:{\"size\":\"sm\",\"variant\":\"primary\",\"disabled\":_vm.loading,\"data-cy\":\"new-tp-button\"},on:{\"click\":function($event){_vm.showModal.taxPayerForm = true}}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"size\":\"sm\",\"icon\":\"plus\"}}),_vm._v(\"Add Taxpayer\\n \")],1),_c('b-button',{staticClass:\"ml-2\",attrs:{\"size\":\"sm\",\"variant\":\"primary\",\"data-cy\":\"new-tp-button\",\"disabled\":_vm.loading},on:{\"click\":function($event){_vm.showModal.taxPayerCopy = true}}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"size\":\"sm\",\"icon\":\"copy\"}}),_vm._v(\"Copy Taxpayer\\n \")],1)],1):_vm._e()],1),_c('b-row',[_c('b-col',[_c('transition',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[(_vm.loading)?_c('div',{key:\"loader\"},[_c('hr'),_c('loader')],1):(_vm.taxpayers.length > 0)?_c('TaxpayerList',{key:\"list\",attrs:{\"taxpayers\":_vm.taxpayers}}):_c('h2',{staticClass:\"text-center\"},[_vm._v(\"\\n No taxpayers found.\\n \"),(!_vm.isClient)?_c('a',{attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();_vm.showModal.taxPayerForm = true}}},[_vm._v(\"Create a taxpayer\")]):_vm._e()])],1)],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[(_vm.taxpayers.length === 0)?_c('span',{key:\"message\"},[_c('h3',{staticClass:\"font-weight-light text-center\"},[_vm._v(\"No Taxpayers found.\")])]):_c('b-table',{key:\"table\",attrs:{\"striped\":\"\",\"fields\":_vm.fields,\"items\":_vm.taxpayers,\"data-cy\":\"taxpayer-table\"},scopedSlots:_vm._u([{key:\"cell(name)\",fn:function(data){return [_c('router-link',{attrs:{\"data-cy\":\"taxpayer-link\",\"to\":(\"/taxpayers/\" + (data.item.id))}},[_vm._v(_vm._s(data.item.name))])]}}])})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Vue } from \"vue-property-decorator\"\r\nimport { Taxpayer } from \"@/interfaces\"\r\nimport router from \"@/router\"\r\nimport { taxpayer } from \"@/services/api\"\r\n\r\n@Component\r\nclass TaypayerList extends Vue {\r\n @Prop()\r\n public taxpayers!: Taxpayer[]\r\n\r\n public fields: any[] = [\r\n { key: \"name\", label: \"Name\", sortable: true },\r\n {\r\n key: \"fa_count\",\r\n label: \"FA’s of Taxpayer\",\r\n sortable: true,\r\n thClass: \"text-center\",\r\n tdClass: \"text-center\",\r\n },\r\n ]\r\n}\r\n\r\nexport default TaypayerList\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TaxpayerList.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TaxpayerList.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./TaxpayerList.vue?vue&type=template&id=c1031828&scoped=true&\"\nimport script from \"./TaxpayerList.vue?vue&type=script&lang=ts&\"\nexport * from \"./TaxpayerList.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./TaxpayerList.vue?vue&type=style&index=0&id=c1031828&scoped=true&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"c1031828\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('ErrorAlert',{attrs:{\"error\":_vm.error}}),_c('b-form',{on:{\"submit\":_vm.handleOnSubmit}},[_c('b-form-group',{attrs:{\"invalid-feedback\":_vm.nameInvalid,\"state\":_vm.nameState,\"label\":\"Name\"}},[_c('b-form-input',{attrs:{\"type\":\"text\",\"name\":\"name\",\"required\":\"\",\"description\":\"Name of the company\",\"data-cy\":\"tp-name-input\"},model:{value:(_vm.name),callback:function ($$v) {_vm.name=$$v},expression:\"name\"}})],1),_c('b-form-group',{attrs:{\"label\":\"Presentation Currency\"}},[_c('CurrencyDropdown',{attrs:{\"name\":\"reportingCurrency\",\"data-cy\":\"tp-currency-select\",\"defaultValue\":_vm.reportingCurrency},on:{\"dropdown-change\":_vm.handleOnChange}})],1),_c('b-form-group',{attrs:{\"label\":\"First Taxation Year Begins\",\"description\":\"Note: Date format must include '/', or a space.\"}},[_c('datepicker',{attrs:{\"input-class\":\"form-control\",\"name\":\"taxationYearBegins\",\"typeable\":true,\"format\":\"yyyy MM dd\",\"data-cy\":\"tp-year-start-input\",\"placeholder\":\"yyyy mm dd\",\"required\":\"\"},model:{value:(_vm.taxationYearBegins),callback:function ($$v) {_vm.taxationYearBegins=$$v},expression:\"taxationYearBegins\"}})],1),_c('b-form-group',{attrs:{\"label\":\"First Taxation Year Ends\",\"description\":\"Note: Date format must include '/', or a space.\"}},[_c('datepicker',{attrs:{\"input-class\":\"form-control\",\"name\":\"taxationYearEnds\",\"data-cy\":\"tp-year-end-input\",\"typeable\":true,\"format\":\"yyyy MM dd\",\"placeholder\":\"yyyy mm dd\",\"required\":\"\"},model:{value:(_vm.taxationYearEnds),callback:function ($$v) {_vm.taxationYearEnds=$$v},expression:\"taxationYearEnds\"}})],1),_c('LoadingButton',{attrs:{\"data-cy\":\"tp-submit-button\",\"loading\":_vm.loading,\"disabled\":!_vm.nameState,\"text\":\"Save Taxpayer\"}})],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { Vue } from \"vue-property-decorator\"\r\nimport Component from \"vue-class-component\"\r\n\r\n@Component\r\nexport default class LoadingMixin extends Vue {\r\n protected error: any | null = \"\"\r\n protected loading: boolean = false\r\n protected success: boolean = false\r\n}\r\n\r\n// Decorators\r\n/**\r\n * This decorator expects the return of the function to be a promise.\r\n *\r\n * @export\r\n * @param {Object} target\r\n * @param {string} propertyKey\r\n * @param {TypedPropertyDescriptor} descriptor\r\n * @returns\r\n */\r\nexport function Load(\r\n target: object,\r\n propertyKey: string,\r\n descriptor: TypedPropertyDescriptor\r\n) {\r\n // Save a reference to the original method\r\n const originalMethod = descriptor.value\r\n // NOTE: Do not use arrow syntax here. Use a function expression in\r\n // order to use the correct value of `this` in this method (see notes below)\r\n descriptor.value = function(...args: any[]) {\r\n const result = originalMethod.apply(this, args)\r\n if (this.hasOwnProperty(\"loading\")) {\r\n // @ts-ignore\r\n this.loading = true\r\n }\r\n if (this.hasOwnProperty(\"error\")) {\r\n // @ts-ignore\r\n this.error = \"\"\r\n }\r\n\r\n Promise.resolve(result)\r\n .catch((err: any) => {\r\n if (this.hasOwnProperty(\"error\")) {\r\n // @ts-ignore\r\n this.error = err\r\n }\r\n })\r\n .finally(() => {\r\n if (this.hasOwnProperty(\"loading\")) {\r\n // @ts-ignore\r\n this.loading = false\r\n }\r\n })\r\n return result\r\n }\r\n\r\n return descriptor\r\n}\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-button',{staticClass:\"submit-button\",attrs:{\"block\":\"\",\"variant\":\"primary\",\"type\":\"submit\",\"name\":\"submit\",\"disabled\":_vm.loading || _vm.disabled}},[(_vm.loading)?_c('span',[_c('b-spinner',{attrs:{\"label\":\"Spinning\"}}),(_vm.spinningText)?_c('b-container',[_vm._v(_vm._s(_vm.spinningText))]):_vm._e()],1):_c('span',[_vm._v(_vm._s(_vm.getText()))])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Vue } from \"vue-property-decorator\"\r\n\r\n@Component\r\nexport default class LoadingButton extends Vue {\r\n @Prop()\r\n public loading: boolean = false\r\n\r\n @Prop()\r\n public text!: string\r\n\r\n @Prop({\r\n default: false,\r\n })\r\n public disabled!: boolean\r\n\r\n @Prop({\r\n default: undefined,\r\n })\r\n private spinningText: string | undefined\r\n\r\n public getText(): string {\r\n return this.text\r\n }\r\n}\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./LoadingButton.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./LoadingButton.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./LoadingButton.vue?vue&type=template&id=958011b8&\"\nimport script from \"./LoadingButton.vue?vue&type=script&lang=ts&\"\nexport * from \"./LoadingButton.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-form-select',{attrs:{\"required\":_vm.required,\"options\":_vm.options,\"name\":_vm.name},model:{value:(_vm.selected),callback:function ($$v) {_vm.selected=$$v},expression:\"selected\"}},[_c('template',{slot:\"first\"},[(!_vm.required)?_c('option',{domProps:{\"value\":null}},[_vm._v(\"None\")]):_vm._e(),_c('option',{attrs:{\"value\":\"CAD\"}},[_vm._v(\"CAD - Canadian Dollar\")]),_c('option',{attrs:{\"value\":\"USD\",\"default\":\"\"}},[_vm._v(\"USD - United States Dollar\")]),_c('option',{attrs:{\"value\":\"EUR\"}},[_vm._v(\"EUR - Euro\")]),_c('option',{attrs:{\"disabled\":\"\"},domProps:{\"value\":null}},[_vm._v(\"---------------------------\")])])],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Vue, Watch } from \"vue-property-decorator\"\r\n\r\n@Component\r\nexport default class CurrencyDropdown extends Vue {\r\n public selected: string = \"\"\r\n\r\n public options = [\r\n { value: \"AED\", text: \"AED - United Arab Emirates Dirham\" },\r\n { value: \"AFN\", text: \"AFN - Afghan Afghani\" },\r\n { value: \"ALL\", text: \"ALL - Albanian Lek\" },\r\n { value: \"AMD\", text: \"AMD - Armenian Dram\" },\r\n { value: \"ANG\", text: \"ANG - Netherlands Antillean Guilder\" },\r\n { value: \"AOA\", text: \"AOA - Angolan Kwanza\" },\r\n { value: \"ARS\", text: \"ARS - Argentine Peso\" },\r\n { value: \"AUD\", text: \"AUD - Australian Dollar\" },\r\n { value: \"AWG\", text: \"AWG - Aruban Florin\" },\r\n { value: \"AZN\", text: \"AZN - Azerbaijani Manat\" },\r\n { value: \"BAM\", text: \"BAM - Bosnia-Herzegovina Convertible Mark\" },\r\n { value: \"BBD\", text: \"BBD - Barbadian Dollar\" },\r\n { value: \"BDT\", text: \"BDT - Bangladeshi Taka\" },\r\n { value: \"BGN\", text: \"BGN - Bulgarian Lev\" },\r\n { value: \"BHD\", text: \"BHD - Bahraini Dinar\" },\r\n { value: \"BIF\", text: \"BIF - Burundian Franc\" },\r\n { value: \"BMD\", text: \"BMD - Bermudian Dollar\" },\r\n { value: \"BND\", text: \"BND - Brunei Dollar\" },\r\n { value: \"BOB\", text: \"BOB - Bolivian Boliviano\" },\r\n { value: \"BRL\", text: \"BRL - Brazilian Real\" },\r\n { value: \"BSD\", text: \"BSD - Bahamian Dollar\" },\r\n { value: \"BTN\", text: \"BTN - Bhutanese Ngultrum\" },\r\n { value: \"BWP\", text: \"BWP - Botswana Pula\" },\r\n { value: \"BYN\", text: \"BYN - Belarusian Ruble\" },\r\n { value: \"BZD\", text: \"BZD - Belize Dollar\" },\r\n { value: \"CDF\", text: \"CDF - Congolese Franc\" },\r\n { value: \"CHF\", text: \"CHF - Swiss Franc\" },\r\n { value: \"CLP\", text: \"CLP - Chilean Peso\" },\r\n { value: \"CNY\", text: \"CNY - Chinese Yuan\" },\r\n { value: \"COP\", text: \"COP - Colombian Peso\" },\r\n { value: \"CRC\", text: \"CRC - Costa Rican Colón\" },\r\n { value: \"CUC\", text: \"CUC - Cuban Convertible Peso\" },\r\n { value: \"CUP\", text: \"CUP - Cuban Peso\" },\r\n { value: \"CVE\", text: \"CVE - Cape Verdean Escudo\" },\r\n { value: \"CZK\", text: \"CZK - Czech Koruna\" },\r\n { value: \"DJF\", text: \"DJF - Djiboutian Franc\" },\r\n { value: \"DKK\", text: \"DKK - Danish Krone\" },\r\n { value: \"DOP\", text: \"DOP - Dominican Peso\" },\r\n { value: \"DZD\", text: \"DZD - Algerian Dinar\" },\r\n { value: \"EGP\", text: \"EGP - Egyptian Pound\" },\r\n { value: \"ERN\", text: \"ERN - Eritrean Nakfa\" },\r\n { value: \"ETB\", text: \"ETB - Ethiopian Birr\" },\r\n { value: \"FJD\", text: \"FJD - Fijian Dollar\" },\r\n { value: \"FKP\", text: \"FKP - Falkland Islands Pound\" },\r\n { value: \"GBP\", text: \"GBP - British Pound Sterling\" },\r\n { value: \"GEL\", text: \"GEL - Georgian Lari\" },\r\n { value: \"GGP\", text: \"GGP - Guernsey Pound\" },\r\n { value: \"GHS\", text: \"GHS - Ghanaian Cedi\" },\r\n { value: \"GIP\", text: \"GIP - Gibraltar Pound\" },\r\n { value: \"GMD\", text: \"GMD - Gambian Dalasi\" },\r\n { value: \"GNF\", text: \"GNF - Guinean Franc\" },\r\n { value: \"GTQ\", text: \"GTQ - Guatemalan Quetzal\" },\r\n { value: \"GYD\", text: \"GYD - Guyanese Dollar\" },\r\n { value: \"HKD\", text: \"HKD - Hong Kong Dollar\" },\r\n { value: \"HNL\", text: \"HNL - Honduran Lempira\" },\r\n { value: \"HRK\", text: \"HRK - Croatian Kuna\" },\r\n { value: \"HTG\", text: \"HTG - Haitian Gourde\" },\r\n { value: \"HUF\", text: \"HUF - Hungarian Forint\" },\r\n { value: \"IDR\", text: \"IDR - Indonesian Rupiah\" },\r\n { value: \"ILS\", text: \"ILS - Israeli New Shekel\" },\r\n { value: \"IMP\", text: \"IMP - Manx pound\" },\r\n { value: \"INR\", text: \"INR - Indian Rupee\" },\r\n { value: \"IQD\", text: \"IQD - Iraqi Dinar\" },\r\n { value: \"IRR\", text: \"IRR - Iranian Rial\" },\r\n { value: \"ISK\", text: \"ISK - Icelandic Króna\" },\r\n { value: \"JEP\", text: \"JEP - Jersey Pound\" },\r\n { value: \"JMD\", text: \"JMD - Jamaican Dollar\" },\r\n { value: \"JOD\", text: \"JOD - Jordanian Dinar\" },\r\n { value: \"JPY\", text: \"JPY - Japanese Yen\" },\r\n { value: \"KES\", text: \"KES - Kenyan Shilling\" },\r\n { value: \"KGS\", text: \"KGS - Kyrgyzstani Som\" },\r\n { value: \"KHR\", text: \"KHR - Cambodian Riel\" },\r\n { value: \"KMF\", text: \"KMF - Comorian Franc\" },\r\n { value: \"KPW\", text: \"KPW - North Korean Won\" },\r\n { value: \"KRW\", text: \"KRW - South Korean Won\" },\r\n { value: \"KWD\", text: \"KWD - Kuwaiti Dinar\" },\r\n { value: \"KYD\", text: \"KYD - Cayman Islands Dollar\" },\r\n { value: \"KZT\", text: \"KZT - Kazakhstani Tenge\" },\r\n { value: \"LAK\", text: \"LAK - Lao Kip\" },\r\n { value: \"LBP\", text: \"LBP - Lebanese Pound\" },\r\n { value: \"LKR\", text: \"LKR - Sri Lankan Rupee\" },\r\n { value: \"LRD\", text: \"LRD - Liberian Dollar\" },\r\n { value: \"LSL\", text: \"LSL - Lesotho Loti\" },\r\n { value: \"LYD\", text: \"LYD - Libyan Dinar\" },\r\n { value: \"MAD\", text: \"MAD - Moroccan Dirham\" },\r\n { value: \"MDL\", text: \"MDL - Moldovan Leu\" },\r\n { value: \"MGA\", text: \"MGA - Malagasy Ariary\" },\r\n { value: \"MKD\", text: \"MKD - Macedonian Denar\" },\r\n { value: \"MMK\", text: \"MMK - Myanmar Kyat\" },\r\n { value: \"MNT\", text: \"MNT - Mongolian Tugrik\" },\r\n { value: \"MOP\", text: \"MOP - Macanese Pataca\" },\r\n { value: \"MRO\", text: \"MRO - Mauritanian Ouguiya (pre-2018)\" },\r\n { value: \"MRU\", text: \"MRU - Mauritanian Ouguiya\" },\r\n { value: \"MUR\", text: \"MUR - Mauritian Rupee\" },\r\n { value: \"MVR\", text: \"MVR - Maldivian Rufiyaa\" },\r\n { value: \"MWK\", text: \"MWK - Malawian Kwacha\" },\r\n { value: \"MXN\", text: \"MXN - Mexican Peso\" },\r\n { value: \"MYR\", text: \"MYR - Malaysian Ringgit\" },\r\n { value: \"MZN\", text: \"MZN - Mozambican Metical\" },\r\n { value: \"NAD\", text: \"NAD - Namibian Dollar\" },\r\n { value: \"NGN\", text: \"NGN - Nigerian Naira\" },\r\n { value: \"NIO\", text: \"NIO - Nicaraguan Cordoba\" },\r\n { value: \"NOK\", text: \"NOK - Norwegian Krone\" },\r\n { value: \"NPR\", text: \"NPR - Nepalese Rupee\" },\r\n { value: \"NZD\", text: \"NZD - New Zealand Dollar\" },\r\n { value: \"OMR\", text: \"OMR - Omani Rial\" },\r\n { value: \"PAB\", text: \"PAB - Panamanian Balboa\" },\r\n { value: \"PEN\", text: \"PEN - Peruvian Sol\" },\r\n { value: \"PGK\", text: \"PGK - Papua New Guinean Kina\" },\r\n { value: \"PHP\", text: \"PHP - Philippine Peso\" },\r\n { value: \"PKR\", text: \"PKR - Pakistani Rupee\" },\r\n { value: \"PLN\", text: \"PLN - Polish Zloty\" },\r\n { value: \"PYG\", text: \"PYG - Paraguayan Guarani\" },\r\n { value: \"QAR\", text: \"QAR - Qatari Riyal\" },\r\n { value: \"RON\", text: \"RON - Romanian Leu\" },\r\n { value: \"RSD\", text: \"RSD - Serbian Dinar\" },\r\n { value: \"RUB\", text: \"RUB - Russian Ruble\" },\r\n { value: \"RWF\", text: \"RWF - Rwandan Franc\" },\r\n { value: \"SAR\", text: \"SAR - Saudi Riyal\" },\r\n { value: \"SBD\", text: \"SBD - Solomon Islands Dollar\" },\r\n { value: \"SCR\", text: \"SCR - Seychellois Rupee\" },\r\n { value: \"SDG\", text: \"SDG - Sudanese Pound\" },\r\n { value: \"SEK\", text: \"SEK - Swedish Krona\" },\r\n { value: \"SGD\", text: \"SGD - Singapore Dollar\" },\r\n { value: \"SHP\", text: \"SHP - Saint Helena Pound\" },\r\n { value: \"SLL\", text: \"SLL - Sierra Leonean Leone\" },\r\n { value: \"SOS\", text: \"SOS - Somali Shilling\" },\r\n { value: \"SRD\", text: \"SRD - Surinamese Dollar\" },\r\n { value: \"SSP\", text: \"SSP - South Sudanese Pound\" },\r\n { value: \"STD\", text: \"STD - Sao Tomean Dobra (pre-2018)\" },\r\n { value: \"STN\", text: \"STN - Sao Tomean Dobra\" },\r\n { value: \"SVC\", text: \"SVC - Salvadoran Colón\" },\r\n { value: \"SYP\", text: \"SYP - Syrian Pound\" },\r\n { value: \"SZL\", text: \"SZL - Swazi Lilangeni\" },\r\n { value: \"THB\", text: \"THB - Thai Baht\" },\r\n { value: \"TJS\", text: \"TJS - Tajikistani Somoni\" },\r\n { value: \"TMT\", text: \"TMT - Turkmenistan Manat\" },\r\n { value: \"TND\", text: \"TND - Tunisian Dinar\" },\r\n { value: \"TOP\", text: \"TOP - Tongan Pa'anga\" },\r\n { value: \"TRY\", text: \"TRY - Turkish Lira\" },\r\n { value: \"TTD\", text: \"TTD - Trinidad and Tobago Dollar\" },\r\n { value: \"TWD\", text: \"TWD - New Taiwan Dollar\" },\r\n { value: \"TZS\", text: \"TZS - Tanzanian Shilling\" },\r\n { value: \"UAH\", text: \"UAH - Ukrainian Hryvnia\" },\r\n { value: \"UGX\", text: \"UGX - Ugandan Shilling\" },\r\n { value: \"UYU\", text: \"UYU - Uruguayan Peso\" },\r\n { value: \"UZS\", text: \"UZS - Uzbekistan Som\" },\r\n { value: \"VEF\", text: \"VEF - Venezuelan Bolívar\" },\r\n { value: \"VND\", text: \"VND - Vietnamese Dong\" },\r\n { value: \"VUV\", text: \"VUV - Vanuatu Vatu\" },\r\n { value: \"WST\", text: \"WST - Samoan Tala\" },\r\n { value: \"XCD\", text: \"XCD - East Caribbean Dollar\" },\r\n { value: \"XOF\", text: \"XOF - West African CFA Franc\" },\r\n { value: \"XDR\", text: \"XDR - Special Drawing Rights\" },\r\n { value: \"YER\", text: \"YER - Yemeni Rial\" },\r\n { value: \"ZAR\", text: \"ZAR - South African Rand\" },\r\n { value: \"ZMW\", text: \"ZMW - Zambian Kwacha\" },\r\n { value: \"ZWL\", text: \"ZWL - Zimbabwean Dollar\" },\r\n ]\r\n\r\n @Prop()\r\n public defaultValue!: string\r\n @Prop({ default: false })\r\n public required!: boolean\r\n @Prop()\r\n public name!: string\r\n\r\n @Watch(\"selected\")\r\n public handleOnChange() {\r\n this.$emit(\"dropdown-change\", this.selected)\r\n }\r\n\r\n @Watch(\"defaultValue\", { immediate: true })\r\n public defaultValueChange() {\r\n this.selected = this.defaultValue\r\n }\r\n}\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CurrencyDropdown.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CurrencyDropdown.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./CurrencyDropdown.vue?vue&type=template&id=0cd25ab3&\"\nimport script from \"./CurrencyDropdown.vue?vue&type=script&lang=ts&\"\nexport * from \"./CurrencyDropdown.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-alert',{staticClass:\"text-center\",staticStyle:{\"font-size\":\"0.9rem\"},attrs:{\"fade\":\"\",\"variant\":\"danger\",\"show\":Boolean(_vm.error) || _vm.error !== ''}},[(_vm.error.message)?_c('div',{staticClass:\"font-weight-bold\"},[_vm._v(_vm._s(_vm.error.message))]):_vm._e(),(_vm.error.field)?_c('div',[_c('hr'),_vm._l((_vm.erroneousFields),function(field,index){return _c('div',{key:index,staticClass:\"text-left\"},[_vm._v(\"\\n \"+_vm._s(field.name)+\"\\n \"),_c('ul',_vm._l((field.errors),function(error,index){return _c('li',{key:index,staticClass:\"font-weight-light\"},[_vm._v(\"\\n \"+_vm._s(error)+\"\\n \")])}),0)])})],2):_vm._e(),(_vm.error.nonField)?_c('div',[_c('hr'),_c('ul',_vm._l((_vm.error.nonField),function(error,index){return _c('li',{key:index},[_vm._v(\"\\n \"+_vm._s(error)+\"\\n \")])}),0)]):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Watch, Emit, Vue } from \"vue-property-decorator\"\r\nimport _ from \"lodash\"\r\n\r\n@Component\r\nexport default class ErrorAlert extends Vue {\r\n @Prop()\r\n public error!: any\r\n\r\n public get erroneousFields() {\r\n if (this.error.field) {\r\n return Object.keys(this.error.field).map(field => {\r\n return {\r\n name: _.startCase(field),\r\n errors: this.error.field[field],\r\n }\r\n })\r\n }\r\n return []\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ErrorAlert.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ErrorAlert.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./ErrorAlert.vue?vue&type=template&id=d2bafdf4&\"\nimport script from \"./ErrorAlert.vue?vue&type=script&lang=ts&\"\nexport * from \"./ErrorAlert.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\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\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\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Watch } from \"vue-property-decorator\"\r\nimport Datepicker from \"vuejs-datepicker\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport dateFns from \"date-fns\"\r\n// Project Imports\r\nimport { Taxpayer } from \"@/interfaces\"\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport router from \"@/router\"\r\nimport { taxpayer } from \"@/services/api\"\r\nimport LoadingButton from \"@/components/LoadingButton.vue\"\r\nimport CurrencyDropdown from \"@/components/CurrencyDropdown.vue\"\r\nimport { getDate } from \"@/util/getDate\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\n\r\n@Component({\r\n components: {\r\n LoadingButton,\r\n CurrencyDropdown,\r\n Datepicker,\r\n ErrorAlert,\r\n },\r\n})\r\nclass TaxpayerForm extends mixins(LoadingMixin) {\r\n @Prop()\r\n public fetchData!: any\r\n\r\n @Prop()\r\n public taxpayers!: Taxpayer[]\r\n\r\n @Prop()\r\n public initialData!: Taxpayer\r\n\r\n @Prop({ default: false })\r\n public edit!: boolean\r\n\r\n @Prop()\r\n public closeModal!: any\r\n\r\n private name: string = \"\"\r\n private reportingCurrency: string = \"\"\r\n private taxationYearBegins: string = \"\"\r\n private taxationYearEnds: string = \"\"\r\n\r\n public handleOnChange(val: string, e: any) {\r\n this.reportingCurrency = val\r\n }\r\n\r\n public created() {\r\n if (this.edit && this.initialData.id) {\r\n this.name = this.initialData.name\r\n this.reportingCurrency = this.initialData.reporting_currency\r\n this.taxationYearBegins = getDate(\r\n this.initialData.first_taxation_year_begins\r\n ).toString()\r\n this.taxationYearEnds = getDate(\r\n this.initialData.first_taxation_year_ends\r\n ).toString()\r\n }\r\n }\r\n\r\n public get nameState() {\r\n if (this.taxpayers.find((el: any) => el.name === this.name)) {\r\n return false\r\n } else {\r\n return true\r\n }\r\n }\r\n\r\n public get nameInvalid() {\r\n if (this.taxpayers.find((el: any) => el.name === this.name)) {\r\n return \"Taxpayer name exists\"\r\n }\r\n }\r\n\r\n public handleOnSubmit(e: any) {\r\n e.preventDefault()\r\n this.loading = true\r\n const values = {\r\n name: this.name,\r\n reporting_currency: this.reportingCurrency,\r\n first_taxation_year_begins: dateFns.format(\r\n this.taxationYearBegins,\r\n \"YYYY-MM-DD\"\r\n ),\r\n first_taxation_year_ends: dateFns.format(\r\n this.taxationYearEnds,\r\n \"YYYY-MM-DD\"\r\n ),\r\n }\r\n\r\n taxpayer\r\n .create(values)\r\n .then((response: any) => {\r\n this.fetchData()\r\n this.closeModal()\r\n this.loading = false\r\n this.name = \"\"\r\n this.reportingCurrency = \"\"\r\n this.taxationYearBegins = \"\"\r\n this.taxationYearEnds = \"\"\r\n // tslint:disable-next-line\r\n })\r\n .catch((err: any) => {\r\n this.error = err\r\n this.loading = false\r\n })\r\n }\r\n}\r\n\r\nexport default TaxpayerForm\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TaxpayerForm.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TaxpayerForm.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./TaxpayerForm.vue?vue&type=template&id=32244ece&scoped=true&\"\nimport script from \"./TaxpayerForm.vue?vue&type=script&lang=ts&\"\nexport * from \"./TaxpayerForm.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./TaxpayerForm.vue?vue&type=style&index=0&id=32244ece&scoped=true&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"32244ece\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_vm._m(0),_c('b-form',{on:{\"submit\":_vm.handleOnSubmit}},[_c('model-select',{staticClass:\"mb-2\",attrs:{\"options\":_vm.taxpayerOptions,\"placeholder\":\"Select a Taxpayer\",\"isDisabled\":_vm.loading},model:{value:(_vm.selectedTaxpayer),callback:function ($$v) {_vm.selectedTaxpayer=$$v},expression:\"selectedTaxpayer\"}}),_c('b-form-group',{attrs:{\"label\":\"Name of Copy\",\"description\":\"If name is not changed, 'Copy' will be added to the end of the copy of the taxpayer's name.\"}},[_c('b-form-input',{attrs:{\"type\":\"text\",\"name\":\"name\",\"placeholder\":_vm.selectedTaxpayerName,\"disabled\":!_vm.selectedTaxpayer || _vm.loading},on:{\"focus\":function () {\n if (!_vm.name && _vm.selectedTaxpayerName) {\n _vm.name = _vm.selectedTaxpayerName\n }\n }},model:{value:(_vm.name),callback:function ($$v) {_vm.name=$$v},expression:\"name\"}})],1),_c('b-form-group',{attrs:{\"label\":\"Select Number of Copy\"}},[_c('b-form-select',{attrs:{\"options\":_vm.numberOfCopyList,\"disabled\":!_vm.selectedTaxpayer || _vm.loading},model:{value:(_vm.numberOfCopy),callback:function ($$v) {_vm.numberOfCopy=$$v},expression:\"numberOfCopy\"}})],1),_c('b-form-group',{attrs:{\"label\":\"Configuration\"}},[_c('b-form-checkbox',{attrs:{\"disabled\":_vm.loading},model:{value:(_vm.outputProfiles),callback:function ($$v) {_vm.outputProfiles=$$v},expression:\"outputProfiles\"}},[_vm._v(\"\\n Keep Output Profiles\\n \")]),_c('b-form-checkbox',{attrs:{\"disabled\":_vm.loading},model:{value:(_vm.owners),callback:function ($$v) {_vm.owners=$$v},expression:\"owners\"}},[_vm._v(\"Keep Owners (excluding Client users)\")])],1),_c('LoadingButton',{attrs:{\"data-cy\":\"tp-submit-button\",\"loading\":_vm.loading,\"disabled\":!_vm.selectedTaxpayer,\"spinningText\":\"Please wait as this may take awhile.\",\"text\":\"Copy Taxpayer\"}}),(_vm.loading)?_c('b-progress',{staticClass:\"mt-2\",attrs:{\"max\":_vm.numberOfCopy,\"height\":\"3.0rem\"}},[_c('b-progress-bar',{attrs:{\"value\":_vm.currentCopy - 1,\"variant\":\"success\"}},[_c('span',[_vm._v(\"Completed: \"),_c('strong',[_vm._v(_vm._s(_vm.currentCopy - 1))])])]),_c('b-progress-bar',{attrs:{\"value\":_vm.numberOfCopy - _vm.currentCopy + 1,\"animated\":\"\"}},[_c('span',[_vm._v(\"Remaining:\\n \"),_c('strong',[_vm._v(_vm._s(_vm.numberOfCopy - _vm.currentCopy + 1))])])])],1):_vm._e()],1)],1)}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('p',[_vm._v(\"\\n Select the \"),_c('strong',[_vm._v(\"Taxpayer\")]),_vm._v(\" that you would like to copy and\\n configure what should be copied.\\n \")])}]\n\nexport { render, staticRenderFns }","\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Watch } from \"vue-property-decorator\"\r\nimport Datepicker from \"vuejs-datepicker\"\r\nimport { ModelSelect } from \"vue-search-select\"\r\nimport { mixins } from \"vue-class-component\"\r\n// Project Imports\r\nimport { Taxpayer } from \"@/interfaces\"\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport { taxpayer } from \"@/services/api\"\r\nimport LoadingButton from \"@/components/LoadingButton.vue\"\r\nimport CurrencyDropdown from \"@/components/CurrencyDropdown.vue\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\n\r\n@Component({\r\n components: {\r\n LoadingButton,\r\n CurrencyDropdown,\r\n Datepicker,\r\n ErrorAlert,\r\n ModelSelect,\r\n },\r\n})\r\nclass TaxpayerCopy extends mixins(LoadingMixin) {\r\n @Prop()\r\n public fetchData!: any\r\n\r\n @Prop()\r\n public taxpayers!: Taxpayer[]\r\n\r\n @Prop({ default: false })\r\n public edit!: boolean\r\n\r\n @Prop()\r\n public closeModal!: any\r\n\r\n private selectedTaxpayer: string | null = null\r\n private name: string = this.selectedTaxpayerName\r\n private outputProfiles: boolean = true\r\n private owners: boolean = true\r\n\r\n private numberOfCopy = 1\r\n private numberOfCopyList = this.assembleNumberOfCopyList(2)\r\n private currentCopy = 1\r\n\r\n public assembleNumberOfCopyList(maxVal: number) {\r\n const output: Array<{ [key: string]: number }> = []\r\n for (let i = 1; i < maxVal + 1; i++) {\r\n output.push({\r\n value: i,\r\n text: i,\r\n })\r\n }\r\n return output\r\n }\r\n\r\n public get selectedTaxpayerName() {\r\n if (this.selectedTaxpayer || !this.taxpayers) {\r\n // @ts-ignore\r\n return this.taxpayers.find((el: any) => el.id === this.selectedTaxpayer)\r\n .name\r\n } else {\r\n return \"\"\r\n }\r\n }\r\n\r\n public get taxpayerOptions() {\r\n return this.taxpayers.map(({ id, name }: Taxpayer) => ({\r\n text: name,\r\n value: id,\r\n }))\r\n }\r\n\r\n @Watch(\"selectedTaxpayer\")\r\n public taxpayerChange() {\r\n this.name = \"\"\r\n }\r\n\r\n public async handleOnSubmit(e: any) {\r\n e.preventDefault()\r\n this.loading = true\r\n const values = {\r\n name: this.name || this.selectedTaxpayerName,\r\n output_profiles: this.outputProfiles,\r\n owners: this.owners,\r\n }\r\n\r\n if (this.selectedTaxpayer) {\r\n if (this.numberOfCopy > 1) {\r\n // loops for number of copies minus 1\r\n for (let i = 1; i < this.numberOfCopy; i++) {\r\n this.currentCopy = i\r\n await taxpayer\r\n .copy(this.selectedTaxpayer, values)\r\n .catch((err: any) => {\r\n this.error = err\r\n this.$bvToast.toast(`There was an error. Try again later`, {\r\n title: \"Error\",\r\n variant: \"danger\",\r\n autoHideDelay: 5000,\r\n static: true,\r\n })\r\n })\r\n // if an error occurs, quit the function completely.\r\n if (this.error !== \"\") {\r\n this.currentCopy = 1\r\n this.loading = false\r\n return\r\n }\r\n }\r\n this.currentCopy++\r\n }\r\n await taxpayer\r\n .copy(this.selectedTaxpayer, values)\r\n .then((taxpayerCopy: Taxpayer) => {\r\n this.currentCopy++\r\n this.fetchData()\r\n this.closeModal()\r\n this.$emit(\"taxpayer-copied\", taxpayerCopy)\r\n })\r\n .catch((err: any) => {\r\n this.error = err\r\n this.$bvToast.toast(`There was an error. Try again later`, {\r\n title: \"Error\",\r\n variant: \"danger\",\r\n autoHideDelay: 5000,\r\n static: true,\r\n })\r\n })\r\n .finally(() => (this.loading = false))\r\n }\r\n }\r\n}\r\n\r\nexport default TaxpayerCopy\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TaxpayerCopy.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TaxpayerCopy.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./TaxpayerCopy.vue?vue&type=template&id=7f3187bb&\"\nimport script from \"./TaxpayerCopy.vue?vue&type=script&lang=ts&\"\nexport * from \"./TaxpayerCopy.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-row',[_c('b-col',{staticClass:\"text-center\"},[_c('b-spinner',{attrs:{\"variant\":\"primary\",\"small\":_vm.small}})],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Watch, Emit, Vue } from \"vue-property-decorator\"\r\nimport Stretch from \"vue-loading-spinner/src/components/Stretch.vue\"\r\n@Component({ components: { Stretch } })\r\nexport default class Loader extends Vue {\r\n @Prop({\r\n default: false,\r\n })\r\n public small!: boolean\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Loader.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Loader.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Loader.vue?vue&type=template&id=b68567be&\"\nimport script from \"./Loader.vue?vue&type=script&lang=ts&\"\nexport * from \"./Loader.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\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\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Vue } from \"vue-property-decorator\"\r\nimport TaxpayerList from \"@/components/taxpayer/TaxpayerList.vue\"\r\nimport TaxpayerForm from \"@/components/taxpayer/TaxpayerForm.vue\"\r\nimport TaxpayerCopy from \"@/components/taxpayer/TaxpayerCopy.vue\"\r\nimport _ from \"lodash\"\r\nimport { Taxpayer } from \"@/interfaces\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport LoadingMixin, { Load } from \"@/mixins/LoadingMixin\"\r\nimport { taxpayer } from \"@/services/api\"\r\nimport UserMixin from \"../mixins/UserMixin\"\r\nimport Loader from \"@/components/utils/Loader.vue\"\r\n\r\n@Component({\r\n components: { TaxpayerList, TaxpayerForm, TaxpayerCopy, Loader },\r\n})\r\nexport default class Home extends mixins(LoadingMixin, UserMixin) {\r\n public taxpayers: Taxpayer[] = []\r\n // Object to keep track of opened modals\r\n public showModal: any = {\r\n taxPayerForm: false,\r\n taxPayerCopy: false,\r\n }\r\n\r\n public created() {\r\n this.fetchData()\r\n }\r\n\r\n public closeModal() {\r\n _.forEach(this.showModal, (value: any, key: any) => {\r\n this.$set(this.showModal, key, false)\r\n })\r\n }\r\n\r\n @Load\r\n public fetchData() {\r\n return taxpayer\r\n .get()\r\n .then((data: any) => {\r\n this.taxpayers = data\r\n })\r\n .catch((err: any) => {\r\n this.error = err\r\n })\r\n }\r\n\r\n public taxpayerCopied(taxpayerCopy: Taxpayer) {\r\n this.$bvToast.toast(\r\n `${taxpayerCopy.name} has been created. Click to jump to Taxpayer.`,\r\n {\r\n title: \"Copy created\",\r\n variant: \"success\",\r\n autoHideDelay: 5000,\r\n static: true,\r\n to: `/taxpayers/${taxpayerCopy.id}`,\r\n }\r\n )\r\n }\r\n}\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Home.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Home.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Home.vue?vue&type=template&id=402e4d37&\"\nimport script from \"./Home.vue?vue&type=script&lang=ts&\"\nexport * from \"./Home.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-container',[_c('b-row',[_c('b-col',{attrs:{\"offset-lg\":\"3\",\"lg\":\"6\"}},[_c('LoginForm')],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-card',[_c('b-form',{attrs:{\"action\":\"\"},on:{\"submit\":function($event){$event.preventDefault();return _vm.onSubmit($event)}}},[_c('h1',{staticClass:\"kpmg text-center\"},[_vm._v(\"Surplus Calculator\")]),_c('hr'),_c('ErrorAlert',{attrs:{\"error\":_vm.error}}),_c('transition',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[(!_vm.otpRequired)?_c('div',{key:\"loginForm\"},[_c('b-form-group',{attrs:{\"label\":\"Username\"}},[_c('b-form-input',{attrs:{\"id\":\"username\",\"type\":\"text\",\"required\":\"\",\"placeholder\":\"Username\",\"name\":\"username\",\"data-cy\":\"username-input\",\"autocomplete\":\"off\"},model:{value:(_vm.username),callback:function ($$v) {_vm.username=$$v},expression:\"username\"}})],1),_c('b-form-group',{attrs:{\"label\":\"Password\"}},[_c('b-form-input',{attrs:{\"id\":\"password\",\"type\":\"password\",\"required\":\"\",\"placeholder\":\"Password\",\"name\":\"password\",\"data-cy\":\"password-input\",\"autocomplete\":\"off\"},model:{value:(_vm.password),callback:function ($$v) {_vm.password=$$v},expression:\"password\"}})],1)],1):_c('div',[_c('p',{staticClass:\"font-weight-light\"},[_vm._v(\"\\n An email has been sent to the email registered to your account.\\n Please enter the provided token.\\n \")]),_c('b-form-group',{attrs:{\"label\":\"Token\"}},[_c('b-form-input',{attrs:{\"type\":\"text\",\"required\":\"\",\"placeholder\":\"Token\"},model:{value:(_vm.otp),callback:function ($$v) {_vm.otp=(typeof $$v === 'string'? $$v.trim(): $$v)},expression:\"otp\"}})],1)],1)]),_c('hr'),_c('LoadingButton',{attrs:{\"loading\":_vm.loading,\"text\":\"Login\",\"data-cy\":\"login-button\"}}),_c('p',{staticClass:\"text-center mt-2\"},[_c('router-link',{attrs:{\"to\":{ name: 'forgotPassword' }}},[_vm._v(\"Forgot Password?\")])],1),(_vm.getEnv('VUE_APP_CLIENT_APP') == 'true')?_c('div',{staticClass:\"text-center\"},[_c('small',[_vm._v(\"\\n By using the Surplus Calculator (Client Module), you hereby agree to\\n the Terms of Use as outlined in the\\n \"),_c('router-link',{attrs:{\"to\":{ name: 'termsOfUse' }}},[_vm._v(\"Terms of Use – Surplus Calculator (Client Module)\")]),_vm._v(\".\\n \")],1)]):_vm._e()],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Vue } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\n// Project Imports\r\nimport UserMixin from \"@/mixins/UserMixin\"\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport LoadingButton from \"@/components/LoadingButton.vue\"\r\nimport EnvMixin from \"../mixins/EnvMixin\"\r\n\r\n@Component({\r\n components: {\r\n LoadingButton,\r\n ErrorAlert,\r\n },\r\n})\r\nclass LoginForm extends mixins(LoadingMixin, UserMixin, EnvMixin) {\r\n private username: string = \"\"\r\n private password: string = \"\"\r\n private otp: string = \"\"\r\n private otpRequired: boolean = false\r\n\r\n private onSubmit(): void {\r\n const { username, password, otp, $store } = this\r\n this.error = \"\"\r\n this.loading = true\r\n const credentials: any = {\r\n username,\r\n password,\r\n }\r\n if (this.otpRequired) {\r\n credentials.otp = otp.trim()\r\n }\r\n const promise = this.login(credentials)\r\n .catch((err: any) => {\r\n if (err.status === 422) {\r\n this.otpRequired = true\r\n } else {\r\n this.error = err.errors\r\n }\r\n })\r\n .finally(() => (this.loading = false))\r\n }\r\n}\r\n\r\nexport default LoginForm\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./LoginForm.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./LoginForm.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./LoginForm.vue?vue&type=template&id=676568e1&\"\nimport script from \"./LoginForm.vue?vue&type=script&lang=ts&\"\nexport * from \"./LoginForm.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Vue } from \"vue-property-decorator\"\r\nimport LoginForm from \"@/components/LoginForm.vue\" // @ is an alias to /src\r\n\r\n@Component({\r\n components: {\r\n LoginForm,\r\n },\r\n})\r\nexport default class Login extends Vue {}\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Login.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Login.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Login.vue?vue&type=template&id=6704f2c8&\"\nimport script from \"./Login.vue?vue&type=script&lang=ts&\"\nexport * from \"./Login.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[(_vm.loading)?_c('b-container',{key:\"loader\"},[_c('loader')],1):_c('b-container',{key:\"content\"},[_c('b-modal',{attrs:{\"id\":\"fa_form\",\"size\":\"m\",\"title\":\"Add Foreign Affiliate\",\"hide-footer\":\"\",\"no-close-on-backdrop\":\"\"},on:{\"hidden\":_vm.onModalClose,\"hide\":_vm.onModalHide},model:{value:(_vm.showModal.foreignAffiliateForm.show),callback:function ($$v) {_vm.$set(_vm.showModal.foreignAffiliateForm, \"show\", $$v)},expression:\"showModal.foreignAffiliateForm.show\"}},[(_vm.showModal.foreignAffiliateForm.show)?_c('FAForm',{attrs:{\"fetchData\":_vm.fetchTaxpayer,\"taxpayerId\":this.$route.params.id,\"taxpayerArr\":_vm.taxpayer,\"closeModal\":_vm.closeModal},on:{\"busy\":function (busy) { return (_vm.showModal.foreignAffiliateForm.busy = busy); },\"data-received\":function () { return (_vm.shouldRefresh = true); }}}):_vm._e()],1),_c('b-modal',{attrs:{\"id\":\"fa_copy\",\"size\":\"lg\",\"title\":\"Copy Foreign Affiliate\",\"hide-footer\":\"\",\"no-close-on-backdrop\":\"\"},model:{value:(_vm.showModal.FACopy),callback:function ($$v) {_vm.$set(_vm.showModal, \"FACopy\", $$v)},expression:\"showModal.FACopy\"}},[_c('FACopy',{attrs:{\"fetchTaxpayer\":_vm.fetchTaxpayer,\"taxpayer\":_vm.taxpayer,\"closeModal\":_vm.closeModal},on:{\"foreign-affiliate-copied\":_vm.foreignAffiliateCopied}})],1),_vm._t(\"breadcrumbs\",null,{\"activeTaxpayer\":_vm.taxpayer}),_c('b-row',[_c('b-col',{attrs:{\"lg\":\"12\"}},[_c('b-card',{staticClass:\"border-0\"},[_c('b-row',{staticClass:\"ml-0\"},[_c('h1',{staticClass:\"kpmg\"},[_vm._v(_vm._s(_vm.taxpayer.name))]),_c('OptionsDropdown',{attrs:{\"disabled\":!_vm.editTA}},[(_vm.editTA)?_c('EditTaxpayer',{attrs:{\"initialData\":_vm.taxpayer,\"fetchData\":_vm.fetchTaxpayer,\"taxpayers\":_vm.taxpayers}}):_vm._e()],1)],1),_c('hr'),_c('div',[_c('div',[_c('span',{staticClass:\"font-weight-bold\",attrs:{\"data-cy\":\"first-taxation-year-begins\"}},[_vm._v(\"First Taxation Year Begins\")]),_vm._v(\"\\n \"+_vm._s(_vm.taxpayer.first_taxation_year_begins)+\"\\n \")]),_c('div',[_c('span',{staticClass:\"font-weight-bold\",attrs:{\"data-cy\":\"latest-taxation-year-end\"}},[_vm._v(\"Latest Calculated Taxation Year End\")]),_vm._v(\"\\n \"+_vm._s(_vm.latestReportingDate)+\"\\n \")]),(!_vm.isClient)?_c('div',[_c('span',{staticClass:\"font-weight-bold\"},[_vm._v(\"\\n Presentation Currency\\n \"),_c('h6',{staticStyle:{\"display\":\"inherit\"}},[_c('b-badge',[_vm._v(_vm._s(_vm.taxpayer.reporting_currency))])],1)])]):_vm._e(),_c('div',[_c('span',{staticClass:\"font-weight-bold\"},[_vm._v(\"Number of Foreign Affiliates\")]),_vm._v(\"\\n \"+_vm._s(_vm.taxpayer.foreign_affiliates.length)+\"\\n \")]),(_vm.taxpayer.client_access_expires)?_c('div',[_c('span',{staticClass:\"font-weight-bold\"},[_vm._v(\"Client Access Expiry Date\")]),_vm._v(\"\\n \"+_vm._s(_vm.taxpayer.client_access_expires)+\"\\n \")]):_vm._e(),_c('hr'),_c('div',{staticClass:\"d-flex\"},[_c('b-button',{attrs:{\"size\":\"sm\",\"data-cy\":\"new-fa-button\",\"variant\":\"primary\"},on:{\"click\":function($event){_vm.showModal.foreignAffiliateForm.show = true}}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"size\":\"sm\",\"icon\":\"plus\"}}),_vm._v(\"Add\\n Foreign Affiliate\\n \")],1),(!_vm.isClient)?_c('b-button',{staticClass:\"ml-2\",attrs:{\"variant\":\"primary\",\"size\":\"sm\"},on:{\"click\":function($event){_vm.showModal.FACopy = true}}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"size\":\"sm\",\"icon\":\"copy\"}}),_vm._v(\"Copy\\n Foreign Affiliate\\n \")],1):_vm._e()],1)])],1)],1)],1),_c('br'),_c('FAConsolidator',{attrs:{\"propTaxpayer\":_vm.taxpayer}})],2)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-dropdown-item',{directives:[{name:\"b-modal\",rawName:\"v-b-modal.edit_taxpayer\",modifiers:{\"edit_taxpayer\":true}}],attrs:{\"data-cy\":\"tp-edit-button\",\"disabled\":_vm.loading}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"size\":\"sm\",\"icon\":\"edit\"}}),_vm._v(\"Edit\\n \")],1),_c('b-button',{staticClass:\"d-flex justify-content-center mt-4\",style:({ width: '80%', margin: '0 auto' }),attrs:{\"variant\":\"danger\",\"size\":\"sm\",\"disabled\":_vm.loading},on:{\"click\":_vm.deleteTaxpayer}},[_vm._v(\"Delete\")]),_c('b-modal',{ref:\"edit_modal\",attrs:{\"id\":\"edit_taxpayer\",\"size\":\"m\",\"title\":\"Edit Taxpayer\",\"hide-footer\":\"\",\"no-close-on-backdrop\":\"\"}},[_c('ErrorAlert',{attrs:{\"error\":_vm.error}}),_c('b-form',{on:{\"submit\":_vm.handleOnSubmit}},[_c('b-form-group',{attrs:{\"invalid-feedback\":_vm.nameInvalid,\"state\":_vm.nameState,\"label\":\"Name\"}},[_c('b-form-input',{attrs:{\"type\":\"text\",\"name\":\"name\",\"required\":\"\",\"data-cy\":\"tp-name-input\",\"description\":\"Name of the company\"},model:{value:(_vm.taxpayerName),callback:function ($$v) {_vm.taxpayerName=$$v},expression:\"taxpayerName\"}})],1),_c('b-form-group',{attrs:{\"label\":\"Presentation Currency\"}},[_c('CurrencyDropdown',{attrs:{\"data-cy\":\"tp-currency-select\",\"selected\":_vm.reportingCurrency,\"defaultValue\":_vm.reportingCurrency,\"name\":\"reportingCurrency\"},on:{\"dropdown-change\":_vm.handleOnChange}})],1),_c('b-form-group',{attrs:{\"label\":\"First Taxation Year Begins\",\"description\":\"Note: Date format must include '/', or a space.\"}},[_c('datepicker',{attrs:{\"input-class\":\"form-control\",\"name\":\"taxationYearBegins\",\"typeable\":true,\"data-cy\":\"tp-year-start-input\",\"format\":\"yyyy MM dd\",\"placeholder\":\"yyyy mm dd\",\"required\":\"\"},model:{value:(_vm.taxationYearBegins),callback:function ($$v) {_vm.taxationYearBegins=$$v},expression:\"taxationYearBegins\"}})],1),_c('b-form-group',{attrs:{\"label\":\"First Taxation Year Ends\",\"description\":\"Note: Date format must include '/', or a space.\"}},[_c('datepicker',{attrs:{\"input-class\":\"form-control\",\"name\":\"taxationYearEnds\",\"data-cy\":\"tp-year-end-input\",\"typeable\":true,\"format\":\"yyyy MM dd\",\"placeholder\":\"yyyy mm dd\",\"required\":\"\"},model:{value:(_vm.taxationYearEnds),callback:function ($$v) {_vm.taxationYearEnds=$$v},expression:\"taxationYearEnds\"}})],1),(!_vm.isClient)?_c('b-form-group',{attrs:{\"description\":\"Select who has access to this Taxpayer\"}},[_c('b-modal',{attrs:{\"no-close-on-backdrop\":\"\",\"hide-footer\":\"\",\"size\":\"lg\",\"title\":\"Ownership\"},model:{value:(_vm.showOwnershipModal),callback:function ($$v) {_vm.showOwnershipModal=$$v},expression:\"showOwnershipModal\"}},[(_vm.showOwnershipModal)?_c('TaxpayerOwnership',{attrs:{\"existingTaxpayerOwners\":_vm.owners},on:{\"owners-update\":_vm.updateOwners}}):_vm._e()],1),_c('b-button',{attrs:{\"disabled\":_vm.loading,\"variant\":\"primary\",\"size\":\"sm\"},on:{\"click\":function($event){_vm.showOwnershipModal = true}}},[_vm._v(\"Owners\")])],1):_vm._e(),_c('LoadingButton',{attrs:{\"data-cy\":\"tp-submit-button\",\"loading\":_vm.loading,\"disabled\":!_vm.nameState,\"text\":\"Save Updates\"}})],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[(_vm.loading)?_c('loader',{key:\"loader\"}):_c('div',{key:\"form\"},[(_vm.error)?_c('ErrorAlert',{attrs:{\"error\":_vm.error}}):_vm._e(),_c('b-card',{attrs:{\"no-body\":\"\"}},[_c('b-tabs',{attrs:{\"fill\":\"\",\"pills\":\"\",\"card\":\"\"}},[_c('b-tab',{attrs:{\"title\":\"Staff\"}},[_c('b-row',[_c('b-col',[_c('b-form-group',[_c('b-row',[_c('b-col',[_c('model-select',{attrs:{\"options\":_vm.staffUserOptions,\"placeholder\":\"Select a user\"},model:{value:(_vm.selectedStaffUser),callback:function ($$v) {_vm.selectedStaffUser=$$v},expression:\"selectedStaffUser\"}})],1)],1)],1),_c('hr'),_c('Table',{staticClass:\"table-overflow\",attrs:{\"fields\":_vm.tableFields,\"items\":_vm.staffOwners,\"slots\":_vm.tableSlots},scopedSlots:_vm._u([{key:\"actions\",fn:function(data){return [_c('b-button-group',{staticClass:\"float-right w-100\"},[_c('b-button',{attrs:{\"variant\":\"danger\",\"size\":\"sm\"},on:{\"click\":function($event){return _vm.removeOwner(data)}}},[_c('font-awesome-icon',{attrs:{\"icon\":\"trash\"}})],1)],1)]}}])})],1)],1)],1),_c('b-tab',{attrs:{\"title\":\"Clients\"}},[_c('Table',{staticClass:\"table-overflow\",attrs:{\"fields\":_vm.tableFields,\"items\":_vm.clientOwners,\"slots\":_vm.tableSlots},scopedSlots:_vm._u([{key:\"actions\",fn:function(data){return [_c('b-button-group',{staticClass:\"float-right w-100\"},[_c('b-button',{attrs:{\"variant\":\"danger\",\"size\":\"sm\"},on:{\"click\":function($event){return _vm.removeOwner(data)}}},[_c('font-awesome-icon',{attrs:{\"icon\":\"trash\"}})],1)],1)]}}])})],1)],1)],1),_c('hr'),_c('b-button',{attrs:{\"disabled\":!_vm.staffOwnerExists,\"block\":\"\",\"variant\":\"success\"},on:{\"click\":_vm.saveOwners}},[_vm._v(\"Save\")])],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { Vue } from \"vue-property-decorator\"\r\nimport Component from \"vue-class-component\"\r\n\r\n@Component\r\nexport default class ConfirmBoxMixin extends Vue {\r\n public defaultOptions: any = {\r\n size: \"md\",\r\n }\r\n public deleteOptions: any = {\r\n okVariant: \"danger\",\r\n cancelVariant: \"success\",\r\n }\r\n\r\n public confirmBox(message: string, options: any = {}) {\r\n return this.$bvModal.msgBoxConfirm(message, {\r\n ...this.defaultOptions,\r\n ...options,\r\n })\r\n }\r\n}\r\n","var render = function () {\nvar this$1 = this;\nvar _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-row',{staticClass:\"mb-3\"},[(_vm.$slots['action-bar'])?_c('b-col',{attrs:{\"cols\":\"4\",\"md\":\"3\"}},[_vm._t(\"action-bar\")],2):_vm._e(),(_vm.localOptions.showSearch)?_c('b-col',[_c('b-input-group',[_c('b-form-input',{attrs:{\"placeholder\":\"Type to Search\"},model:{value:(_vm.filter),callback:function ($$v) {_vm.filter=$$v},expression:\"filter\"}}),_c('b-input-group-append',[_c('b-btn',{attrs:{\"disabled\":!_vm.filter},on:{\"click\":function($event){_vm.filter = ''}}},[_vm._v(\"Clear\")])],1)],1)],1):_vm._e(),(_vm.localOptions.showPerPage)?_c('b-col',{attrs:{\"cols\":\"4\",\"md\":\"3\"}},[_c('b-form-group',{attrs:{\"horizontal\":\"\",\"label\":\"Show\"}},[_c('b-form-select',{attrs:{\"options\":_vm.perPageOptions},model:{value:(_vm.perPage),callback:function ($$v) {_vm.perPage=$$v},expression:\"perPage\"}})],1)],1):_vm._e()],1),_c('b-row',[_c('b-col',[_c('b-table',{attrs:{\"responsive\":\"\",\"hover\":\"\",\"striped\":\"\",\"small\":\"\",\"fixed\":\"\",\"fields\":_vm.fields,\"items\":_vm.items,\"filter\":_vm.filter,\"per-page\":_vm.perPage,\"current-page\":_vm.currentPage},on:{\"row-clicked\":function (row) {\n this$1.$emit('row-clicked', row)\n },\"filtered\":_vm.onFiltered},scopedSlots:_vm._u([{key:\"row-details\",fn:function(row){return [_vm._t(\"row-details\",null,{\"row\":row})]}},_vm._l((_vm.slots),function(slot){return {key:_vm.getCellAttr(slot.field),fn:function(row){return [_vm._t(slot.name,null,{\"item\":row.item,\"row\":row})]}}})],null,true)}),_c('b-alert',{staticClass:\"text-center\",attrs:{\"show\":_vm.items.length === 0}},[_vm._v(\"\\n \"+_vm._s(_vm.noResultMessage)+\"\\n \")])],1)],1),(_vm.perPage && _vm.items.length > _vm.perPage)?_c('div',[_c('hr'),_c('b-row',[_c('b-col',[_c('b-pagination',{attrs:{\"align\":\"center\",\"size\":\"md\",\"total-rows\":_vm.items.length,\"per-page\":_vm.perPage},model:{value:(_vm.currentPage),callback:function ($$v) {_vm.currentPage=$$v},expression:\"currentPage\"}})],1)],1)],1):_vm._e()],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Vue, Watch } from \"vue-property-decorator\"\r\n\r\n@Component({})\r\nexport default class Table extends Vue {\r\n @Prop({ required: true })\r\n public fields!: any[]\r\n\r\n @Prop({ required: true })\r\n public items!: any[]\r\n\r\n @Prop({\r\n default: () => {\r\n return []\r\n },\r\n })\r\n public slots!: any[]\r\n\r\n @Prop({\r\n default: () => {\r\n return {}\r\n },\r\n })\r\n public options!: any\r\n\r\n @Prop({\r\n default: \"No results to show\",\r\n })\r\n public noResultMessage!: string\r\n\r\n public filter: string = \"\"\r\n\r\n public perPage: number = 10\r\n\r\n public currentPage = 1\r\n\r\n public perPageOptions: any[] = [\r\n { value: 5, text: \"5\" },\r\n { value: 10, text: \"10\" },\r\n { value: 25, text: \"25\" },\r\n { value: 50, text: \"50\" },\r\n { value: 100, text: \"100\" },\r\n { value: null, text: \"All\" },\r\n ]\r\n\r\n public localOptions: any = {\r\n showSearch: false,\r\n showPerPage: false,\r\n showDownload: false,\r\n perPage: null,\r\n }\r\n\r\n public created() {\r\n this.localOptions = { ...this.localOptions, ...this.options }\r\n this.perPage = this.localOptions.perPage\r\n }\r\n\r\n public resetCurrentPage() {\r\n const totalPages = Math.ceil(this.items.length / this.perPage)\r\n if (totalPages < this.currentPage) {\r\n this.currentPage = totalPages\r\n }\r\n }\r\n\r\n public onFiltered() {\r\n // Trigger pagination to update the number of buttons/pages due to filtering\r\n // this.totalRows = filteredItems.length\r\n this.currentPage = 1\r\n }\r\n\r\n private getCellAttr(key: string) {\r\n return `cell(${key})` // simple string interpolation\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Table.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Table.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Table.vue?vue&type=template&id=1f4bbda4&\"\nimport script from \"./Table.vue?vue&type=script&lang=ts&\"\nexport * from \"./Table.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { mixins } from \"vue-class-component\"\r\nimport { Component, Prop, Watch } from \"vue-property-decorator\"\r\nimport { ModelSelect } from \"vue-search-select\"\r\n// Project Imports\r\nimport LoadingMixin from \"../../mixins/LoadingMixin\"\r\nimport UserMixin from \"../../mixins/UserMixin\"\r\nimport ConfirmBoxMixin from \"../../mixins/ConfirmBoxMixin\"\r\nimport { Taxpayer, User } from \"../../interfaces\"\r\nimport Table from \"@/components/utils/Table.vue\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\n\r\n@Component({ components: { Table, ErrorAlert, ModelSelect } })\r\nexport default class TaxpayerOwnership extends mixins(\r\n LoadingMixin,\r\n UserMixin,\r\n ConfirmBoxMixin\r\n) {\r\n @Prop({ required: false, default: () => [] })\r\n public existingTaxpayerOwners!: any[]\r\n\r\n public owners: User[] = []\r\n public users: User[] = []\r\n public selectedStaffUser: any = {\r\n value: null,\r\n text: null,\r\n }\r\n\r\n public ownersTableHeaders = []\r\n\r\n public get staffOwners() {\r\n return this.owners.filter((user: User) => !user.client)\r\n }\r\n\r\n public get clientOwners() {\r\n return this.owners.filter((user: User) => user.client)\r\n }\r\n\r\n public get userOptions() {\r\n return this.users\r\n .filter((user: User) => !this.owners.includes(user))\r\n .map((user: User) => {\r\n const { first_name, last_name, username, id } = user\r\n let name = \"\"\r\n let text = \"\"\r\n if (first_name && last_name) {\r\n name = `${last_name}, ${first_name}`\r\n } else if (first_name) {\r\n name = `${first_name}`\r\n } else if (last_name) {\r\n name = `${last_name}`\r\n }\r\n\r\n if (name) {\r\n text = `${name} (${username})`\r\n } else {\r\n text = username\r\n }\r\n\r\n return {\r\n text,\r\n value: user,\r\n }\r\n })\r\n .sort((a: any, b: any) => (a.text > b.text ? 1 : -1))\r\n }\r\n\r\n public get staffUserOptions() {\r\n return this.userOptions.filter((option: any) => !option.value.client)\r\n }\r\n\r\n public get tableFields() {\r\n const fields: any[] = [\r\n {\r\n key: \"first_name\",\r\n label: \"First Name\",\r\n },\r\n {\r\n key: \"last_name\",\r\n label: \"Last Name\",\r\n },\r\n {\r\n key: \"username\",\r\n label: \"Username\",\r\n },\r\n { key: \"actions\", label: \"\" },\r\n ]\r\n\r\n return fields\r\n }\r\n\r\n public get staffOwnerExists() {\r\n return this.owners.some((owner: User) => !owner.client)\r\n }\r\n\r\n public tableSlots: any[] = [\r\n {\r\n name: \"actions\",\r\n field: \"actions\",\r\n },\r\n ]\r\n\r\n @Watch(\"owners\", { deep: true })\r\n public ownersChange() {\r\n if (!this.staffOwnerExists) {\r\n this.error = {\r\n message: \"No staff owners added. Please add at least one staff owner.\",\r\n }\r\n } else {\r\n this.error = null\r\n }\r\n }\r\n\r\n @Watch(\"selectedStaffUser.value\")\r\n public selectedStaffUserChange() {\r\n this.addStaffOwner()\r\n }\r\n\r\n public addStaffOwner() {\r\n if (this.selectedStaffUser.value) {\r\n this.owners.push(this.selectedStaffUser.value)\r\n this.selectedStaffUser = {}\r\n }\r\n }\r\n\r\n public created() {\r\n this.loading = true\r\n this.getAllUsers()\r\n .then((res: any) => {\r\n this.users = res\r\n if (this.existingTaxpayerOwners.length > 0) {\r\n this.owners = this.users.filter((user: User) =>\r\n this.existingTaxpayerOwners.includes(user.id)\r\n )\r\n }\r\n })\r\n .finally(() => (this.loading = false))\r\n }\r\n\r\n public async removeOwner(row: any) {\r\n const user: User = row.item\r\n const deleteOwner = await this.confirmBox(\r\n `Remove User '${user.username}?'`,\r\n this.deleteOptions\r\n )\r\n if (deleteOwner) {\r\n const userIndex = this.owners.findIndex(\r\n (owner: User) => owner.id === user.id\r\n )\r\n if (userIndex >= 0) {\r\n this.owners.splice(userIndex, 1)\r\n }\r\n }\r\n }\r\n\r\n public saveOwners() {\r\n const ownerIds = this.owners.map((owner: User) => owner.id)\r\n this.$emit(\"owners-update\", ownerIds)\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TaxpayerOwnership.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TaxpayerOwnership.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./TaxpayerOwnership.vue?vue&type=template&id=5925a944&\"\nimport script from \"./TaxpayerOwnership.vue?vue&type=script&lang=ts&\"\nexport * from \"./TaxpayerOwnership.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./TaxpayerOwnership.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\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\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\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\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\n\n\n\n\n\n\n\n\n\r\nimport Datepicker from \"vuejs-datepicker\"\r\nimport { Component, Prop } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport dateFns from \"date-fns\"\r\n// Project Imports\r\nimport { Taxpayer } from \"@/interfaces\"\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport router from \"@/router\"\r\nimport { taxpayer } from \"@/services/api\"\r\nimport LoadingButton from \"@/components/LoadingButton.vue\"\r\nimport CurrencyDropdown from \"@/components/CurrencyDropdown.vue\"\r\nimport { getDate } from \"@/util/getDate\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport TaxpayerOwnership from \"@/components/taxpayer/TaxpayerOwnership.vue\"\r\nimport UserMixin from \"../mixins/UserMixin\"\r\nimport ConfirmBoxMixin from \"../mixins/ConfirmBoxMixin\"\r\n\r\n@Component({\r\n components: {\r\n LoadingButton,\r\n CurrencyDropdown,\r\n Datepicker,\r\n ErrorAlert,\r\n TaxpayerOwnership,\r\n },\r\n})\r\nclass EditTaxpayer extends mixins(LoadingMixin, UserMixin, ConfirmBoxMixin) {\r\n @Prop()\r\n public fetchData!: any\r\n\r\n @Prop()\r\n public initialData!: Taxpayer\r\n\r\n @Prop()\r\n public taxpayers!: Taxpayer[]\r\n\r\n private taxpayerName: string = \"\"\r\n private reportingCurrency: string = \"\"\r\n private taxationYearBegins: string = \"\"\r\n private taxationYearEnds: string = \"\"\r\n private owners: any[] = []\r\n private showOwnershipModal: boolean = false\r\n\r\n public mounted() {\r\n this.taxpayerName = this.initialData.name\r\n this.owners = this.initialData.owners ? this.initialData.owners : []\r\n this.reportingCurrency = this.initialData.reporting_currency\r\n this.taxationYearBegins = getDate(\r\n this.initialData.first_taxation_year_begins\r\n ).toString()\r\n this.taxationYearEnds = getDate(\r\n this.initialData.first_taxation_year_ends\r\n ).toString()\r\n }\r\n\r\n public get nameState() {\r\n if (\r\n this.taxpayers.find(\r\n (el: any) =>\r\n el.name === this.taxpayerName && el.name !== this.initialData.name\r\n )\r\n ) {\r\n return false\r\n } else {\r\n return true\r\n }\r\n }\r\n\r\n public get nameInvalid() {\r\n if (this.taxpayers.find((el: any) => el.name === this.taxpayerName)) {\r\n return \"Taxpayer name exists\"\r\n }\r\n }\r\n\r\n public async updateOwners(newOwners: any[]) {\r\n const id = parseInt(this.$route.params.id, 10)\r\n this.showOwnershipModal = false\r\n this.loading = true\r\n try {\r\n const updateOwnersPromise = await taxpayer.owners(id, {\r\n owners: newOwners,\r\n })\r\n this.owners = newOwners\r\n } catch (err) {\r\n this.error = err\r\n }\r\n this.loading = false\r\n }\r\n\r\n public handleOnChange(val: string, e: any) {\r\n this.reportingCurrency = val\r\n }\r\n\r\n public async handleOnSubmit(e: any) {\r\n e.preventDefault()\r\n this.loading = true\r\n const values = {\r\n name: this.taxpayerName,\r\n reporting_currency: this.reportingCurrency,\r\n first_taxation_year_begins: dateFns.format(\r\n this.taxationYearBegins,\r\n \"YYYY-MM-DD\"\r\n ),\r\n first_taxation_year_ends: dateFns.format(\r\n this.taxationYearEnds,\r\n \"YYYY-MM-DD\"\r\n ),\r\n }\r\n const id = parseInt(this.$route.params.id, 10)\r\n try {\r\n const updateTaxpayerPromise = await taxpayer.update(id, values)\r\n } catch (err) {\r\n this.error = err\r\n }\r\n this.fetchData()\r\n this.loading = false\r\n this.taxpayerName = \"\"\r\n this.reportingCurrency = \"\"\r\n this.taxationYearBegins = \"\"\r\n this.taxationYearEnds = \"\"\r\n // tslint:disable-next-line\r\n ;(this.$refs[\"edit_modal\"] as any).hide()\r\n }\r\n\r\n public async deleteTaxpayer() {\r\n const deleteTaxpayer = await this.confirmBox(\r\n \"Are you sure you want to delete this taxpayer? THIS ACTION CANNOT BE UNDONE. Deleting a taxpayer will remove all foreign affiliates associated to it.\",\r\n { ...this.deleteOptions, size: \"md\" }\r\n )\r\n if (deleteTaxpayer) {\r\n this.loading = true\r\n taxpayer\r\n .destroy(this.$route.params.id)\r\n .then(() => this.$router.push({ name: \"home\" }))\r\n .catch((err: any) => (this.error = err))\r\n .finally(() => (this.loading = false))\r\n }\r\n }\r\n}\r\n\r\nexport default EditTaxpayer\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./EditTaxpayer.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./EditTaxpayer.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./EditTaxpayer.vue?vue&type=template&id=43947c58&scoped=true&\"\nimport script from \"./EditTaxpayer.vue?vue&type=script&lang=ts&\"\nexport * from \"./EditTaxpayer.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./EditTaxpayer.vue?vue&type=style&index=0&id=43947c58&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"43947c58\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('ErrorAlert',{attrs:{\"error\":_vm.error}}),_c('b-card',{attrs:{\"no-body\":\"\"}},[_c('b-tabs',{attrs:{\"content-class\":\"mt-3\",\"pills\":\"\",\"card\":\"\",\"fill\":\"\"}},[_c('b-tab',{attrs:{\"title\":_vm.edit ? 'Edit' : 'Create',\"active\":\"\"}},[_c('b-form',{on:{\"submit\":function($event){$event.preventDefault();return _vm.handleOnSubmit($event)}}},[_c('b-form-group',{attrs:{\"invalid-feedback\":_vm.nameInvalid,\"state\":_vm.nameState,\"label\":\"Name\"}},[_c('b-form-input',{attrs:{\"type\":\"text\",\"name\":\"fa_name\",\"data-cy\":\"fa-name-input\",\"required\":\"\",\"description\":\"Name of the foreign affiliate\"},model:{value:(_vm.faName),callback:function ($$v) {_vm.faName=$$v},expression:\"faName\"}})],1),_c('b-form-group',{attrs:{\"label\":\"First Year Begins\",\"description\":\"Note: Date format must include '/', or a space.\"}},[_c('datepicker',{attrs:{\"input-class\":\"form-control\",\"name\":\"firstYearBegins\",\"data-cy\":\"fa-first-year-input\",\"typeable\":true,\"format\":\"yyyy MM dd\",\"placeholder\":\"yyyy mm dd\",\"required\":\"\"},model:{value:(_vm.firstYearBegins),callback:function ($$v) {_vm.firstYearBegins=$$v},expression:\"firstYearBegins\"}})],1),_c('b-form-group',{attrs:{\"label\":\"Calculating Currency\"}},[_c('CurrencyDropdown',{attrs:{\"data-cy\":\"fa-currency-select\",\"required\":true,\"defaultValue\":_vm.reportingCurrency},on:{\"dropdown-change\":_vm.handleOnChange}})],1),_c('b-form-group',{attrs:{\"label\":\"Country of Residence\"}},[_c('b-form-input',{attrs:{\"type\":\"text\",\"data-cy\":\"fa-country-input\",\"name\":\"country\",\"required\":\"\",\"description\":\"Country\"},model:{value:(_vm.country),callback:function ($$v) {_vm.country=$$v},expression:\"country\"}})],1),_c('hr'),_c('h4',{staticClass:\"font-weight-bold\"},[_vm._v(\"Opening Balances at Time Became FA\")]),_c('b-form-group',{attrs:{\"label-cols\":\"8\",\"label\":\"Surplus Entitlement Percentage (SEP)\"}},[_c('b-form-input',{attrs:{\"type\":\"text\",\"data-cy\":\"fa-sep-input\",\"name\":\"sepOpening\",\"required\":\"\",\"description\":\"SEP Opening Balance\",\"formatter\":_vm.formatterDecimal,\"lazy-formatter\":\"\"},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0 ? $event.target.select() : null; })($event)}},model:{value:(_vm.sepOpening),callback:function ($$v) {_vm.sepOpening=$$v},expression:\"sepOpening\"}})],1),_c('b-form-group',{attrs:{\"label-cols\":\"8\",\"label\":\"Exempt Surplus/(Deficit)\"}},[_c('b-form-input',{attrs:{\"type\":\"text\",\"data-cy\":\"fa-exempt-input\",\"name\":\"exemptOpening\",\"required\":\"\",\"description\":\"Exempt Opening Balance\",\"lazy-formatter\":\"\",\"formatter\":_vm.formatter},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0 ? $event.target.select() : null; })($event)}},model:{value:(_vm.exemptOpening),callback:function ($$v) {_vm.exemptOpening=$$v},expression:\"exemptOpening\"}})],1),_c('b-form-group',{attrs:{\"label-cols\":\"8\",\"label\":\"Hybrid Surplus/(Deficit)\"}},[_c('b-form-input',{attrs:{\"type\":\"text\",\"data-cy\":\"fa-hybrid-input\",\"name\":\"hybridOpening\",\"required\":\"\",\"description\":\"Hybrid Opening Balance\",\"lazy-formatter\":\"\",\"formatter\":_vm.formatter},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0 ? $event.target.select() : null; })($event)}},model:{value:(_vm.hybridOpening),callback:function ($$v) {_vm.hybridOpening=$$v},expression:\"hybridOpening\"}})],1),_c('b-form-group',{attrs:{\"label-cols\":\"8\",\"label\":\"Taxable Surplus/(Deficit)\"}},[_c('b-form-input',{attrs:{\"type\":\"text\",\"data-cy\":\"fa-taxable-input\",\"name\":\"taxableOpening\",\"required\":\"\",\"description\":\"Taxable Opening Balance\",\"lazy-formatter\":\"\",\"formatter\":_vm.formatter},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0 ? $event.target.select() : null; })($event)}},model:{value:(_vm.taxableOpening),callback:function ($$v) {_vm.taxableOpening=$$v},expression:\"taxableOpening\"}})],1),_c('b-form-group',{attrs:{\"label-cols\":\"8\",\"label\":\"Hybrid Underlying Tax (HUT)\"}},[_c('b-form-input',{attrs:{\"type\":\"text\",\"data-cy\":\"fa-hut-input\",\"name\":\"hutOpening\",\"required\":\"\",\"lazy-formatter\":\"\",\"formatter\":_vm.formatter,\"description\":\"HUT Opening Balance\"},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0 ? $event.target.select() : null; })($event)}},model:{value:(_vm.hutOpening),callback:function ($$v) {_vm.hutOpening=$$v},expression:\"hutOpening\"}})],1),_c('b-form-group',{attrs:{\"label-cols\":\"8\",\"label\":\"Underlying Foreign Tax (UFT)\"}},[_c('b-form-input',{attrs:{\"type\":\"text\",\"data-cy\":\"fa-uft-input\",\"name\":\"uftOpening\",\"required\":\"\",\"description\":\"UFT Opening Balance\",\"lazy-formatter\":\"\",\"formatter\":_vm.formatter},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0 ? $event.target.select() : null; })($event)}},model:{value:(_vm.uftOpening),callback:function ($$v) {_vm.uftOpening=$$v},expression:\"uftOpening\"}})],1),(_vm.showAcbBalance)?_c('b-form-group',{attrs:{\"label-cols\":\"8\",\"label\":\"Adjusted Cost Base (ACB)\"}},[_c('b-form-input',{attrs:{\"type\":\"text\",\"data-cy\":\"fa-acb-input\",\"name\":\"acbOpening\",\"required\":\"\",\"description\":\"ACB Opening Balance\",\"lazy-formatter\":\"\",\"formatter\":_vm.formatter},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0 ? $event.target.select() : null; })($event)}},model:{value:(_vm.acbOpening),callback:function ($$v) {_vm.acbOpening=$$v},expression:\"acbOpening\"}})],1):_vm._e(),_c('b-form-group',{attrs:{\"label-cols\":\"8\",\"label\":\"RE/(Deficit)\"}},[_c('b-form-input',{attrs:{\"type\":\"text\",\"data-cy\":\"fa-re-deficit-input\",\"name\":\"openingReDeficit\",\"required\":\"\",\"description\":\"Opening RE/(Deficit)\",\"lazy-formatter\":\"\",\"formatter\":_vm.formatter},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0 ? $event.target.select() : null; })($event)}},model:{value:(_vm.openingReDeficit),callback:function ($$v) {_vm.openingReDeficit=$$v},expression:\"openingReDeficit\"}})],1),_c('hr'),_c('LoadingButton',{attrs:{\"data-cy\":\"fa-submit-button\",\"loading\":_vm.loading,\"disabled\":!_vm.nameState,\"text\":\"Save Foreign Affiliate\"}})],1)],1),(!_vm.isClient && !_vm.edit)?_c('b-tab',{attrs:{\"title\":\"Upload\"}},[_c('transition',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[(!_vm.importDone)?_c('b-form',{key:\"form\",on:{\"submit\":function($event){$event.preventDefault();return _vm.handleOnUpload($event)}}},[_c('p',{staticClass:\"font-weight-light\"},[_vm._v(\"\\n Please note that once the import is complete, it is the\\n responsibility of the user to review the accuracy of information\\n which has been imported to ensure the correct information is\\n reflected in the surplus balances and to make any required\\n changes if not accurate.\\n \")]),_c('b-form-group',{attrs:{\"label\":\"Template\",\"description\":\"Note: Files with long names (260 characters or more) should be shortened.\"}},[_c('b-form-file',{staticClass:\"text-nowrap text-truncate\",attrs:{\"size\":\"sm\",\"accept\":\".xlsm\",\"state\":Boolean(_vm.faTemplates),\"name\":\"faTemplates\",\"data-cy\":\"fa-template-input\",\"multiple\":\"\",\"no-drop\":\"\",\"file-name-formatter\":_vm.formatNames,\"placeholder\":\"Choose templates from files\"},model:{value:(_vm.faTemplates),callback:function ($$v) {_vm.faTemplates=$$v},expression:\"faTemplates\"}}),_c('p')],1),_c('LoadingButton',{attrs:{\"data-cy\":\"fa-upload-button\",\"loading\":_vm.loading,\"text\":\"Upload\"}})],1):_c('div',{key:\"upload-result\"},[_c('p',{staticClass:\"font-weight-light\"},[_vm._v(\"\\n Please note that once the import is complete, it is the\\n responsibility of the user to review the accuracy of information\\n which has been imported to ensure the correct information is\\n reflected in the surplus balances and to make any required\\n changes if not accurate.\\n \")]),_c('h4',[_vm._v(\"Upload Summary\")]),_c('hr',{staticClass:\"p-0\"}),(_vm.uploadMessages.length > 0)?_c('b-list-group',_vm._l((_vm.uploadMessages),function(response,index){return _c('b-list-group-item',{key:index,staticClass:\"flex-column align-items-start\"},[_c('div',{staticClass:\"d-flex w-100 justify-content-between\"},[_c('h5',{staticClass:\"mb-1\"},[(response.fa_id != 0)?_c('router-link',{attrs:{\"to\":(\"/foreign-affiliates/\" + (response.fa_id)),\"data-cy\":\"fa-link\"}},[_vm._v(_vm._s(response.name))]):_c('span',[_vm._v(_vm._s(response.name))])],1)]),_c('small',[_vm._v(\"\\n From:\\n \"),_c('span',{staticClass:\"font-weight-bold\"},[_vm._v(_vm._s(response.file))])]),_c('hr',{staticClass:\"p-0\"}),_c('ul',_vm._l((response.messages),function(message,index){return _c('li',{key:index},[_vm._v(\"\\n \"+_vm._s(message)+\"\\n \")])}),0)])}),1):_c('h5',[_vm._v(\"No entities created.\")])],1)],1)],1):_vm._e()],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import accounting from \"accounting\"\r\n\r\nexport const formatMoney = (amt: number | string, precision: number = 0) =>\r\n accounting.formatMoney(amt, \"\", precision)\r\n\r\nexport const formatOutputMoney = (\r\n amt: number | string,\r\n precision: number = 0\r\n) =>\r\n accounting.formatMoney(amt, {\r\n symbol: \"\",\r\n precision,\r\n format: {\r\n pos: \"%s %v\",\r\n neg: \"%s (%v)\",\r\n zero: \"%s --\",\r\n },\r\n })\r\n\r\nexport const sumTotal = (array: any[], key: string, precision: number = 0) => {\r\n return formatMoney(\r\n array.reduce(\r\n (acc: number, item: any) => (acc = acc + accounting.unformat(item[key])),\r\n 0\r\n ),\r\n precision\r\n )\r\n}\r\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\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\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\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\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\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\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\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\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\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\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport Datepicker from \"vuejs-datepicker\"\r\nimport dateFns from \"date-fns\"\r\nimport { unformat } from \"accounting\"\r\n// Project Imports\r\nimport { Taxpayer, ForeignAffiliate, ReportingPeriod } from \"@/interfaces\"\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport UserMixin from \"@/mixins/UserMixin\"\r\nimport router from \"@/router\"\r\nimport { fa } from \"@/services/api\"\r\nimport LoadingButton from \"@/components/LoadingButton.vue\"\r\nimport CurrencyDropdown from \"@/components/CurrencyDropdown.vue\"\r\nimport { getDate } from \"@/util/getDate\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\n\r\n@Component({\r\n components: {\r\n LoadingButton,\r\n CurrencyDropdown,\r\n Datepicker,\r\n ErrorAlert,\r\n },\r\n})\r\nclass FAForm extends mixins(LoadingMixin, UserMixin) {\r\n @Prop()\r\n public fetchData!: any\r\n\r\n @Prop()\r\n public taxpayerId!: any\r\n\r\n @Prop()\r\n public taxpayerArr!: Taxpayer\r\n\r\n @Prop()\r\n public faArr!: ForeignAffiliate\r\n\r\n @Prop()\r\n public faData!: ForeignAffiliate\r\n\r\n @Prop({ default: false })\r\n public edit!: boolean\r\n\r\n @Prop({})\r\n public closeModal!: any\r\n\r\n private faName: string = \"\"\r\n private country: string = \"\"\r\n private firstYearBegins: string = \"\"\r\n private reportingCurrency: string = \"\"\r\n private taxpayer: string = this.taxpayerId\r\n private exemptOpening: string = \"0\"\r\n private taxableOpening: string = \"0\"\r\n private hybridOpening: string = \"0\"\r\n private preAcqOpening: string = \"0\"\r\n private hutOpening: string = \"0\"\r\n private uftOpening: string = \"0\"\r\n private acbOpening: string = \"0\"\r\n private sepOpening: string = \"\"\r\n private openingReDeficit: string = \"0\"\r\n private reportingPeriods: ReportingPeriod[] = []\r\n // Import Variables\r\n private faTemplates: File[] = []\r\n private uploadMessages: any[] = []\r\n private importDone: boolean = false\r\n\r\n public get nameState() {\r\n if (\r\n this.taxpayerArr.foreign_affiliates.find((el: any) => {\r\n if (this.faArr) {\r\n // If faArr is defined, this means that FAForm is being called from ForeignAffiliate.vue\r\n // Exclude the active FA name from validity check\r\n return el.name === this.faName && el.name !== this.faArr.name\r\n } else {\r\n return el.name === this.faName\r\n }\r\n })\r\n ) {\r\n return false\r\n } else {\r\n return true\r\n }\r\n }\r\n\r\n /**\r\n * If we are editing, check whether ACB should be shown or not.\r\n */\r\n public get showAcbBalance() {\r\n if (this.edit && this.faData) {\r\n return this.faData.acb_enabled\r\n }\r\n return true\r\n }\r\n\r\n public get nameInvalid() {\r\n if (\r\n this.taxpayerArr.foreign_affiliates.find(\r\n (el: any) => el.name === this.faName\r\n )\r\n ) {\r\n return \"Foreign Affiliate name exists\"\r\n }\r\n }\r\n\r\n public handleOnChange(val: string, e: any) {\r\n this.reportingCurrency = val\r\n }\r\n\r\n public formatter(value: string, evt: any) {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n }\r\n\r\n public formatterDecimal(value: string, evt: any) {\r\n const formatted = formatMoney(value, 10)\r\n return formatted\r\n }\r\n\r\n public created() {\r\n this.taxpayer = this.taxpayerId\r\n if (this.edit && this.faData.id) {\r\n this.faName = this.faData.name\r\n this.firstYearBegins = getDate(this.faData.first_year_begins).toString()\r\n this.country = this.faData.country\r\n this.reportingCurrency = this.faData.reporting_surplus_currency\r\n this.exemptOpening = this.faData.exempt_surplus_opening_balance.toString()\r\n this.hybridOpening = this.faData.hybrid_surplus_opening_balance.toString()\r\n this.taxableOpening = this.faData.taxable_surplus_opening_balance.toString()\r\n this.preAcqOpening = this.faData.pre_acquisition_surplus_opening_balance.toString()\r\n this.hutOpening = this.faData.hybrid_underlying_tax_opening_balance.toString()\r\n this.uftOpening = this.faData.underlying_foreign_tax_opening_balance.toString()\r\n this.acbOpening = this.faData.acb_opening_balance.toString()\r\n this.sepOpening = (this.faData.opening_sep || 0).toString()\r\n this.openingReDeficit = (this.faData.opening_re_deficit || 0).toString()\r\n }\r\n }\r\n\r\n public reset() {\r\n this.fetchData()\r\n this.loading = false\r\n this.faName = \"\"\r\n this.firstYearBegins = \"\"\r\n this.reportingCurrency = \"\"\r\n this.exemptOpening = \"\"\r\n this.country = \"\"\r\n this.closeModal()\r\n }\r\n\r\n public handleOnSubmit() {\r\n this.error = \"\"\r\n if (unformat(this.sepOpening) <= 0 || unformat(this.sepOpening) > 100) {\r\n this.error = {\r\n message: \"SEP Value must be greater than 0 and up to 100.\",\r\n }\r\n this.sepOpening = \"\"\r\n return\r\n }\r\n\r\n this.loading = true\r\n const values: any = {\r\n taxpayer: this.taxpayer,\r\n reporting_periods: this.reportingPeriods,\r\n name: this.faName,\r\n country: this.country,\r\n first_year_begins: dateFns.format(this.firstYearBegins, \"YYYY-MM-DD\"),\r\n reporting_surplus_currency: this.reportingCurrency,\r\n exempt_surplus_opening_balance: unformat(this.exemptOpening),\r\n taxable_surplus_opening_balance: unformat(this.taxableOpening),\r\n hybrid_surplus_opening_balance: unformat(this.hybridOpening),\r\n pre_acquisition_surplus_opening_balance: unformat(this.preAcqOpening),\r\n opening_sep: unformat(this.sepOpening),\r\n opening_re_deficit: unformat(this.openingReDeficit),\r\n hybrid_underlying_tax_opening_balance: unformat(this.hutOpening),\r\n underlying_foreign_tax_opening_balance: unformat(this.uftOpening),\r\n acb_opening_balance: unformat(this.acbOpening),\r\n }\r\n\r\n if (this.edit && this.faData.id) {\r\n fa.update(values, this.faData.id).then((response: any) => {\r\n this.reset()\r\n })\r\n } else {\r\n fa.create(values)\r\n .then((response: any) => {\r\n this.reset()\r\n })\r\n .catch((err: any) => {\r\n this.error = err\r\n })\r\n .finally(() => (this.loading = false))\r\n }\r\n }\r\n\r\n public async handleOnUpload() {\r\n this.error = \"\"\r\n if (this.faTemplates.length === 0) {\r\n this.error = {\r\n message: \"No files added.\",\r\n }\r\n return\r\n }\r\n const chunkSize = 5\r\n const chunkedTemplates = []\r\n const copied = [...this.faTemplates]\r\n const numOfChild = Math.ceil(copied.length / chunkSize)\r\n for (let i = 0; i < numOfChild; i++) {\r\n chunkedTemplates.push(copied.splice(0, chunkSize))\r\n }\r\n\r\n const forms: FormData[] = []\r\n for (const faTemplates of chunkedTemplates) {\r\n const formData = new FormData()\r\n // Add the uploaded files to the formdata to send.\r\n for (const file of faTemplates) {\r\n if (file.name.length < 260) {\r\n formData.append(file.name, file)\r\n } else {\r\n this.error = {\r\n message:\r\n \"Files with long names (260 characters or more) should be shortened.\",\r\n }\r\n return\r\n }\r\n }\r\n forms.push(formData)\r\n }\r\n this.importDone = false\r\n this.loading = true\r\n this.$emit(\"busy\", true)\r\n for (const formData of forms) {\r\n try {\r\n const res = await fa.upload(this.taxpayer, formData)\r\n this.uploadMessages = this.uploadMessages.concat(res.upload_messages)\r\n this.$emit(\"data-received\")\r\n } catch (err) {\r\n this.error = err\r\n }\r\n }\r\n this.$emit(\"busy\", false)\r\n this.loading = false\r\n this.importDone = true\r\n }\r\n\r\n public formatNames(files: any) {\r\n if (files.length === 1) {\r\n return files[0].name\r\n } else {\r\n return `${files.length} files selected`\r\n }\r\n }\r\n}\r\n\r\nexport default FAForm\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FAForm.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FAForm.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./FAForm.vue?vue&type=template&id=1bb84ff6&\"\nimport script from \"./FAForm.vue?vue&type=script&lang=ts&\"\nexport * from \"./FAForm.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[(_vm.loading)?_c('div',{key:\"loader\",staticClass:\"text-center\"},[_c('b-spinner',{staticClass:\"mb-3\"}),(_vm.taxpayerCalculatorProgress.inProgress)?_c('div',[_c('p',{staticClass:\"text-center\"},[_vm._v(_vm._s(_vm.taxpayerCalculatorProgress.status))]),_c('b-progress',{attrs:{\"value\":_vm.taxpayerCalculatorProgress.progress}})],1):_vm._e()],1):_c('b-card',[_c('b-modal',{attrs:{\"size\":\"sm\",\"title\":\"Presentation Currency\",\"hide-footer\":\"\",\"no-close-on-backdrop\":\"\"},model:{value:(_vm.showPresentationCurrencyModal),callback:function ($$v) {_vm.showPresentationCurrencyModal=$$v},expression:\"showPresentationCurrencyModal\"}},[(_vm.rowItem.reporting_currency)?_c('b-form',{on:{\"submit\":function($event){$event.preventDefault();}}},[_c('b-row',{staticClass:\"text-center\"},[_c('b-col',[_c('h4',[_c('b-badge',[_vm._v(_vm._s(_vm.rowItem.fx_currency))])],1)]),_c('b-col',[_c('font-awesome-icon',{attrs:{\"icon\":\"exchange-alt\"}})],1),_c('b-col',[_c('h4',[_c('b-badge',[_vm._v(_vm._s(_vm.rowItem.reporting_currency.currency))])],1)])],1),_c('hr'),_c('b-form-group',{attrs:{\"label-cols\":\"5\",\"label\":\"Rate Override\"}},[_c('b-input-group',[_c('b-form-input',{attrs:{\"lazy-formatter\":\"\",\"formatter\":_vm.formatterDecimal4,\"number\":\"\"},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0 ? $event.target.select() : null; })($event)}},model:{value:(_vm.rowItem.fa.reporting_rate),callback:function ($$v) {_vm.$set(_vm.rowItem.fa, \"reporting_rate\", $$v)},expression:\"rowItem.fa.reporting_rate\"}}),_c('b-input-group-append',[_c('b-button',{attrs:{\"disabled\":_vm.rowItem.fa.reporting_rate == null},on:{\"click\":function () { return (_vm.rowItem.fa.reporting_rate = null); }}},[_vm._v(\"Clear\")])],1)],1)],1)],1):_vm._e()],1),_c('b-modal',{attrs:{\"id\":\"taxpayer-lockdown-modal\",\"size\":\"md\",\"title\":\"Lock All Foreign Affiliates\",\"hide-footer\":\"\",\"no-close-on-backdrop\":\"\"}},[_c('FALockdown',{attrs:{\"taxpayer\":_vm.taxpayer},on:{\"closeModal\":function($event){return _vm.$bvModal.hide('taxpayer-lockdown-modal')}}})],1),(!_vm.isClient)?_c('b-row',[_c('b-col',{attrs:{\"cols\":\"6\"}},[_c('b-form-group',{attrs:{\"label\":\"Consolidator Date\",\"description\":\"Note: Date format must include '/', or a space.\",\"label-cols\":\"3\"}},[_c('datepicker',{attrs:{\"input-class\":\"form-control\",\"typeable\":true,\"data-cy\":\"consolidator-date\",\"format\":\"yyyy MM dd\",\"placeholder\":\"yyyy mm dd\",\"disabledDates\":_vm.disabledDates},model:{value:(_vm.date),callback:function ($$v) {_vm.date=$$v},expression:\"date\"}}),(!_vm.datePickerConstraint)?_c('b-form-text',{staticClass:\"text-left\",staticStyle:{\"color\":\"red !important\"}},[_vm._v(\"\\n The date chosen is not within the Period. Please modify.\\n \")]):_vm._e()],1)],1),_c('b-col',[_c('small',{staticClass:\"text-muted\"},[_vm._v(\"\\n \"+_vm._s(_vm.strings[\"CONSOLIDATOR_DATE_MESSAGE\"])+\"\\n \")])])],1):_vm._e(),(!_vm.isClient)?_c('b-row',[_c('b-col',{staticClass:\"font-weight-light mb-3\"},[_c('hr'),_vm._v(\"\\n To change the presentation currency rate for a foreign affiliate,\\n click on the \"),_c('b-badge',{attrs:{\"variant\":\"warning\"}},[_vm._v(\"Rate\")]),_vm._v(\" button. If\\n the calculating currency of a foreign affiliate is different from the\\n presentation currency of the taxpayer and there is a rate from\\n \"),_c('a',{attrs:{\"target\":\"_blank\",\"href\":\"https://www.bankofcanada.ca/rates/exchange/\"}},[_vm._v(\"Bank of Canada\")]),_vm._v(\"\\n for the specified\\n \"),_c('strong',[_vm._v(\"consolidator date\")]),_vm._v(\", this rate will be applied to the\\n foreign affiliate. Note: This rate can be overriden by adding a\\n \"),_c('b-badge',{attrs:{\"variant\":\"warning\"}},[_vm._v(\"Rate\")]),_vm._v(\".\\n \")],1)],1):_vm._e(),_c('b-row',[_c('b-col',[(!_vm.isClient)?_c('b-row',[_c('b-col',{attrs:{\"cols\":\"4\"}},[_c('div',{staticClass:\"d-flex mb-3\"},[_c('b-button',{staticClass:\"mr-2\",attrs:{\"size\":\"sm\",\"variant\":\"success\"},on:{\"click\":_vm.refreshBalances}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"size\":\"sm\",\"icon\":\"sync-alt\"}}),_vm._v(\"Refresh Balances\\n \")],1),_c('b-button',{directives:[{name:\"b-modal\",rawName:\"v-b-modal\",value:('taxpayer-lockdown-modal'),expression:\"'taxpayer-lockdown-modal'\"}],attrs:{\"size\":\"sm\",\"variant\":\"secondary\"}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"size\":\"sm\",\"icon\":\"lock\"}}),_vm._v(\"Lock/Unlock All\\n \")],1)],1)]),_c('b-col',[_c('b-row',[_c('b-col',{staticClass:\"d-flex align-items-center justify-content-end\",attrs:{\"cols\":\"12\"}},[(_vm.taxpayer.user_profile)?_c('b-form-checkbox',{staticClass:\"text-secondary\",model:{value:(_vm.applyFilters),callback:function ($$v) {_vm.applyFilters=$$v},expression:\"applyFilters\"}},[_vm._v(\"Apply filters\")]):_vm._e(),_c('FAConsolidatorSettings',{staticStyle:{\"width\":\"200px\"},attrs:{\"tableFields\":_vm.fields,\"faList\":_vm.faList,\"outputProfile\":_vm.outputProfile,\"buttonLabel\":\"Consolidator Settings\"},on:{\"update:faList\":function($event){_vm.faList=$event},\"update:fa-list\":function($event){_vm.faList=$event},\"update:outputProfile\":function($event){_vm.outputProfile=$event},\"update:output-profile\":function($event){_vm.outputProfile=$event},\"show-modal-change\":_vm.settingsChange}}),_c('FAConsolidatorOutput',{staticStyle:{\"width\":\"100px\"},attrs:{\"tableFields\":_vm.fields,\"tableItems\":_vm.allForeignAffiliates,\"taxpayer\":_vm.taxpayer,\"consolidatorDate\":_vm.date,\"totalConsolidator\":_vm.consolidateItemAmounts,\"FAConsolidatorProfile\":_vm.outputProfile,\"headerSort\":_vm.headerSort,\"disabled\":!_vm.datePickerConstraint}})],1)],1)],1)],1):_vm._e(),_c('b-table',{ref:\"consolTable\",attrs:{\"responsive\":\"\",\"no-border-collapse\":\"\",\"items\":_vm.displayedForeignAffiliates,\"fields\":_vm.displayedHeaders,\"data-cy\":\"fa-consolidator\",\"sort-by\":_vm.sortBy,\"sort-desc\":_vm.sortDesc},on:{\"head-clicked\":_vm.headerClicked,\"sort-changed\":_vm.sortChanged},scopedSlots:_vm._u([(!_vm.isClient)?{key:\"thead-top\",fn:function(){return [_c('tr',_vm._l((_vm.displayedHeaders),function(field,index){return _c('th',{key:index},[(index == 0)?_c('span',[_vm._v(\"Total:\")]):(_vm.consolidatedTotal[field.key] != undefined)?_c('div',{staticClass:\"text-center\"},[_vm._v(\"\\n \"+_vm._s(_vm.formatter(_vm.consolidatedTotal[field.key]))+\"\\n \")]):_vm._e()])}),0)]},proxy:true}:null,{key:\"cell(name)\",fn:function(data){return [_c('div',{staticStyle:{\"width\":\"200px !important\"}},[(!_vm.isClient && !data.item.calculated)?_c('b-popover',{attrs:{\"target\":(\"not-calculated-badge-\" + (data.item.fa.id)),\"triggers\":\"hover\"}},[_vm._v(\"\\n Opening balance is currently being displayed.\\n \"),(data.item.fa.reporting_periods.length > 0)?_c('span',[_vm._v(\"\\n For consolidator to reflect actual balances, press the\\n “Refresh Balances” button above.\\n \")]):_c('span',[_vm._v(\"No taxation years added yet.\")])]):_vm._e(),(_vm.isClient && data.item.fa.client_hidden)?_c('b-popover',{attrs:{\"target\":(\"client-hidden-\" + (data.item.fa.id)),\"triggers\":\"hover\"}},[_vm._v(_vm._s(_vm.strings[\"CLIENT_LOCK_MESSAGE\"]))]):_vm._e(),(!_vm.isClient)?_c('b-popover',{attrs:{\"target\":(\"lock-badge-\" + (data.item.fa.id)),\"triggers\":\"hover\"}},[_vm._v(_vm._s(_vm.strings[\"CLIENT_LOCK_DESCRIPTION\"]))]):_vm._e(),(!_vm.isClient)?_c('b-modal',{attrs:{\"size\":\"m\",\"id\":(\"fa-lockdown-form-\" + (data.item.fa.id)),\"title\":\"Lockdown\",\"hide-footer\":\"\",\"no-close-on-backdrop\":\"\"}},[_c('FALockdown',{attrs:{\"foreignAffiliate\":data.item.fa},on:{\"closeModal\":function($event){return _vm.$bvModal.hide((\"fa-lockdown-form-\" + (data.item.fa.id)))}}})],1):_vm._e(),_c('span',[(_vm.isClient && data.item.fa.client_hidden)?_c('span',{attrs:{\"id\":(\"client-hidden-\" + (data.item.fa.id))}},[_vm._v(_vm._s(data.item.name))]):_c('router-link',{attrs:{\"to\":(\"/foreign-affiliates/\" + (data.item.id)),\"data-cy\":\"fa-link\"}},[_vm._v(_vm._s(data.item.name))]),_c('font-awesome-icon',{directives:[{name:\"b-modal\",rawName:\"v-b-modal\",value:((\"fa-lockdown-form-\" + (data.item.fa.id))),expression:\"`fa-lockdown-form-${data.item.fa.id}`\"}],staticClass:\"text-secondary ml-1 floar-right\",style:({\n fontSize: '0.85em',\n cursor: _vm.isClient ? '' : 'pointer',\n }),attrs:{\"id\":(\"lock-badge-\" + (data.item.fa.id)),\"icon\":data.item.fa.client_locked ? 'lock' : 'lock-open'}}),(!_vm.isClient && !data.item.calculated)?_c('font-awesome-icon',{staticClass:\"text-warning ml-1 floar-right\",style:({\n fontSize: '0.85em',\n }),attrs:{\"id\":(\"not-calculated-badge-\" + (data.item.fa.id)),\"icon\":\"exclamation-triangle\"}}):_vm._e()],1),_c('br'),(!_vm.isClient && data.item.fa.last_updated)?_c('small',{staticClass:\"text-muted\"},[_c('em',[_vm._v(\"\\n Calculated\\n \"+_vm._s(_vm.formatDateDistance(data.item.fa.last_updated))+\"\\n \")])]):_vm._e()],1)]}},{key:\"cell(reporting_currency)\",fn:function(data){return [_c('h6',[_c('b-popover',{attrs:{\"target\":(\"override-rate-badge-\" + (data.item.fa.id)),\"title\":\"Rate Override\",\"triggers\":\"hover\"}},[_vm._v(\"\\n Set the rate to be applied to the balance of this foreign\\n affiliate. Note: This rate will override any Bank of Canada\\n rate.\\n \")]),_c('b-badge',{attrs:{\"id\":(\"override-rate-badge-\" + (data.item.fa.id)),\"href\":\"#\",\"append\":\"\",\"variant\":\"warning\"},on:{\"click\":function($event){$event.preventDefault();return (function () {\n _vm.showPresentationCurrencyModal = true\n _vm.rowItem = data.item\n })($event)}}},[_vm._v(\"\\n \"+_vm._s((\"\" + (data.item.reporting_currency.rateOverride\n ? _vm.formatterDecimal4(\n data.item.reporting_currency.rateOverride\n )\n : \"Rate\")))+\"\\n \")]),_c('br'),(\n !data.item.reporting_currency.rateOverride &&\n data.item.reporting_currency.bocRate\n )?_c('div',[_c('b-popover',{attrs:{\"target\":(\"boc-rate-badge-\" + (data.item.fa.id)),\"title\":\"Bank of Canada Rate\",\"triggers\":\"hover\"}},[_vm._v(\"This rate comes from the Bank of Canada website.\")]),_c('b-badge',{staticStyle:{\"cursor\":\"pointer\"},attrs:{\"id\":(\"boc-rate-badge-\" + (data.item.fa.id)),\"variant\":\"primary\"}},[_vm._v(\"\\n \"+_vm._s((\"\" + (_vm.formatterDecimal4(\n data.item.reporting_currency.bocRate\n ))))+\"\\n \")])],1):_vm._e()],1)]}},{key:\"cell(fx_currency)\",fn:function(data){return [_c('h6',{staticClass:\"text-uppercase\"},[_c('b-badge',[_vm._v(_vm._s(data.item.fx_currency))])],1)]}}],null,true)}),(!this.taxpayer.foreign_affiliates.length > 0)?_c('div',[_c('h4',{staticClass:\"text-center font-weight-light\"},[_vm._v(\"\\n No foreign affiliates found.\\n \")])]):_vm._e()],1)],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { ReportingPeriod } from \"@/interfaces\"\r\nimport { getDate } from \"./getDate\"\r\n\r\nexport const sortPeriods = (a: ReportingPeriod, b: ReportingPeriod) =>\r\n getDate(a.start_date).getTime() - getDate(b.start_date).getTime()\r\n","import { Vue } from \"vue-property-decorator\"\r\nimport Component from \"vue-class-component\"\r\nimport {\r\n ReportingPeriod,\r\n ForeignAffiliate,\r\n ReconciliationBuckets,\r\n Taxpayer,\r\n Dividend,\r\n ACBPeriod,\r\n} from \"@/interfaces\"\r\nimport { Action, Getter, State } from \"vuex-class\"\r\nimport _ from \"lodash\"\r\nimport { CalculatorState } from \"@/store/calculator/types\"\r\nimport accounting from \"accounting\"\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport { sortPeriods } from \"@/util/sortPeriods\"\r\n// Project imports\r\nconst namespace: string = \"calculator\"\r\n\r\n@Component\r\nexport default class CalculatorMixin extends Vue {\r\n public calculatedValuesMap: any = {\r\n remaining_unreconciled_total: this.remainingUnreconciledTotal,\r\n closing_re: this.closingRe,\r\n }\r\n\r\n // State\r\n @State(\"calculator\") protected calculator!: CalculatorState\r\n // Actions\r\n @Action(\"fetchData\", { namespace })\r\n protected fetchData: any\r\n @Action(\"updateData\", { namespace })\r\n protected updateData: any\r\n @Action(\"changeLookbackShuffle\", { namespace })\r\n protected changeLookbackShuffle: any\r\n @Action(\"setSelectedReportingPeriod\", { namespace })\r\n protected setSelectedReportingPeriod: any\r\n @Action(\"calculatorValueChange\", { namespace })\r\n protected calculatorValueChange: any\r\n @Action(\"saveFieldValues\", { namespace })\r\n protected saveFieldValues: any\r\n @Action(\"revertFieldValues\", { namespace })\r\n protected revertFieldValues: any\r\n @Action(\"calculateSurplus\", { namespace })\r\n protected calculateSurplus: any\r\n @Action(\"addSEPAdjustment\", { namespace })\r\n protected addSEPAdjustment: any\r\n @Action(\"editSEPAdjustment\", { namespace })\r\n protected editSEPAdjustment: any\r\n @Action(\"deleteSEPAdjustment\", { namespace })\r\n protected deleteSEPAdjustment: any\r\n @Action(\"addDividend\", { namespace })\r\n protected addDividend: any\r\n @Action(\"editDividend\", { namespace })\r\n protected editDividend: any\r\n @Action(\"deleteDividend\", { namespace })\r\n protected deleteDividend: any\r\n @Action(\"addAdjustment\", { namespace })\r\n protected addAdjustment: any\r\n @Action(\"editAdjustment\", { namespace })\r\n protected editAdjustment: any\r\n @Action(\"deleteAdjustment\", { namespace })\r\n protected deleteAdjustment: any\r\n @Action(\"addDispositionAdjustment\", { namespace })\r\n protected addDispositionAdjustment: any\r\n @Action(\"editDispositionAdjustment\", { namespace })\r\n protected editDispositionAdjustment: any\r\n @Action(\"deleteDispositionAdjustment\", { namespace })\r\n protected deleteDispositionAdjustment: any\r\n @Action(\"addField\", { namespace })\r\n protected addField: any\r\n @Action(\"rollforwardFields\", { namespace })\r\n protected rollforwardFields: any\r\n @Action(\"editField\", { namespace })\r\n protected editField: any\r\n @Action(\"addFields\", { namespace })\r\n protected addFields: any\r\n @Action(\"deleteField\", { namespace })\r\n protected deleteField: any\r\n @Action(\"deleteFields\", { namespace })\r\n protected deleteFields: any\r\n @Action(\"updateMetadata\", { namespace })\r\n protected updateMetadata: any\r\n @Action(\"updateReportingPeriod\", { namespace })\r\n protected updateReportingPeriod: any\r\n @Action(\"updateReportingPeriods\", { namespace })\r\n protected updateReportingPeriods: any\r\n @Action(\"addComment\", { namespace })\r\n protected addComment: any\r\n @Action(\"deleteComment\", { namespace })\r\n protected deleteComment: any\r\n @Action(\"updateCommentResolve\", { namespace })\r\n protected updateCommentResolve: any\r\n @Action(\"addReview\", { namespace })\r\n protected addReview: any\r\n @Action(\"deleteReview\", { namespace })\r\n protected deleteReview: any\r\n @Action(\"editPriorYearDisplay\", { namespace })\r\n protected editPriorYearDisplay: any\r\n @Action(\"addAcbAdjustment\", { namespace })\r\n protected addAcbAdjustment: any\r\n @Action(\"editAcbAdjustment\", { namespace })\r\n protected editAcbAdjustment: any\r\n @Action(\"deleteAcbAdjustment\", { namespace })\r\n protected deleteAcbAdjustment: any\r\n @Action(\"toggleACB\", { namespace })\r\n protected toggleACB: any\r\n @Action(\"addAcbPeriod\", { namespace })\r\n protected addAcbPeriod!: (acbPeriod: ACBPeriod) => Promise\r\n @Action(\"deleteAcbPeriod\", { namespace })\r\n protected deleteAcbPeriod!: (acbPeriodId: string | number) => Promise\r\n @Action(\"editAcbPeriod\", { namespace })\r\n protected editAcbPeriod!: (acbPeriod: ACBPeriod) => Promise\r\n // Getters\r\n @Getter(\"activeForeignAffiliate\", { namespace })\r\n protected activeForeignAffiliate: ForeignAffiliate | undefined\r\n @Getter(\"activeTaxpayer\", { namespace })\r\n protected activeTaxpayer: Taxpayer | undefined\r\n @Getter(\"activeTaxpayerForeignAffiliates\", { namespace })\r\n protected activeTaxpayerForeignAffiliates!: ForeignAffiliate[]\r\n @Getter(\"selectedReportingPeriod\", { namespace })\r\n protected selectedReportingPeriod: ReportingPeriod | undefined\r\n @Getter(\"priorReportingPeriods\", { namespace })\r\n protected priorReportingPeriods: ReportingPeriod[] | undefined\r\n @Getter(\"nextReportingPeriods\", { namespace })\r\n protected nextReportingPeriods: ReportingPeriod[] | undefined\r\n @Getter(\"displayedPriorPeriods\", { namespace })\r\n protected displayedPriorPeriods!: ReportingPeriod[]\r\n @Getter(\"reportingPeriods\", { namespace })\r\n protected reportingPeriods!: ReportingPeriod[]\r\n @Getter(\"nextReportingPeriod\", { namespace })\r\n protected nextReportingPeriod: ReportingPeriod | undefined\r\n @Getter(\"fieldChangesMade\", { namespace })\r\n protected fieldChangesMade: ReportingPeriod | undefined\r\n @Getter(\"periodFieldValue\", { namespace })\r\n protected periodFieldValue!: (\r\n metaId: string,\r\n reportingPeriodId: any,\r\n original?: boolean\r\n ) => any\r\n @Getter(\"periodFieldName\", { namespace })\r\n protected periodFieldName!: (metaId: string) => any\r\n @Getter(\"periodFieldReviews\", { namespace })\r\n protected periodFieldReviews!: (\r\n metaId: string,\r\n reportingPeriodId: any,\r\n original?: boolean\r\n ) => any[]\r\n @Getter(\"periodField\", { namespace })\r\n protected periodField!: (\r\n metaId: string,\r\n reportingPeriodId: any,\r\n original?: boolean\r\n ) => any\r\n @Getter(\"selectedReportingPeriodMetadata\", { namespace })\r\n protected selectedReportingPeriodMetadata: any\r\n @Getter(\"importDiagnostics\", { namespace })\r\n protected importDiagnostics: any\r\n @Getter(\"isAcbEnabled\", { namespace })\r\n protected isAcbEnabled!: boolean\r\n\r\n public get periodOptions() {\r\n let options: any[] = []\r\n if (\r\n this.activeForeignAffiliate &&\r\n this.activeForeignAffiliate.reporting_periods &&\r\n this.activeForeignAffiliate.reporting_periods.length > 0\r\n ) {\r\n options = this.activeForeignAffiliate.reporting_periods\r\n .slice()\r\n .sort(sortPeriods)\r\n .reverse()\r\n .map((item: any) => ({\r\n value: item,\r\n text: `${item.start_date} to ${item.end_date}`,\r\n }))\r\n }\r\n return options\r\n }\r\n\r\n public reconciliationBuckets(\r\n reportingPeriod: ReportingPeriod\r\n ): ReconciliationBuckets {\r\n const reconciliationValues: ReconciliationBuckets = {\r\n book_income_before_taxes: 0,\r\n taxable_income_per_foreign_tax_return: 0,\r\n income_of_other_companies: 0,\r\n foreign_imputed_income: 0,\r\n deductions_claimed_for_tax: 0,\r\n losses_deducted_from_prior: 0,\r\n income_not_included: 0,\r\n expenses_deducated_for_book: 0,\r\n }\r\n\r\n // Set up default values\r\n Object.keys(reconciliationValues).forEach(key => {\r\n reconciliationValues[key] = this.periodFieldValue(key, reportingPeriod.id)\r\n\r\n if (key != \"book_income_before_taxes\") {\r\n reconciliationValues[key] *= -1\r\n }\r\n })\r\n return reconciliationValues\r\n }\r\n\r\n public closingRe(reportingPeriod: ReportingPeriod): number {\r\n return (\r\n (reportingPeriod.calculator && reportingPeriod.calculator.closingRe) || 0\r\n )\r\n }\r\n\r\n public getPaidDividendTiers(\r\n reportingPeriod: ReportingPeriod,\r\n dividendTierId: string | number\r\n ): Dividend[] {\r\n if (reportingPeriod.calculator) {\r\n return reportingPeriod.calculator.createDividendsReceived()[\r\n dividendTierId\r\n ]\r\n }\r\n return []\r\n }\r\n\r\n public reconciliationTotal(reportingPeriod: ReportingPeriod): number {\r\n const reconciliationValues = this.reconciliationBuckets(reportingPeriod)\r\n\r\n const sum = Object.keys(reconciliationValues).reduce(\r\n (acc, curr) => (acc = acc + reconciliationValues[curr]),\r\n 0\r\n )\r\n return sum\r\n }\r\n\r\n public remainingUnreconciledTotal(reportingPeriod: ReportingPeriod): number {\r\n const cyDifferenceReconciliation = this.periodFieldValue(\r\n \"cy_difference_reconciliation\",\r\n reportingPeriod.id\r\n )\r\n const reconciliationValues = this.reconciliationBuckets(reportingPeriod)\r\n\r\n const reconciliationValuesSum = Object.keys(reconciliationValues).reduce(\r\n (acc, curr) => (acc = acc + reconciliationValues[curr]),\r\n 0\r\n )\r\n return reconciliationValuesSum + cyDifferenceReconciliation\r\n }\r\n\r\n public exemptBalance() {\r\n return (\r\n this.selectedReportingPeriod &&\r\n this.selectedReportingPeriod.closings &&\r\n formatMoney(\r\n Math.round(this.selectedReportingPeriod.closings.exemptBalance)\r\n )\r\n )\r\n }\r\n\r\n public preAcqBalance() {\r\n return (\r\n this.selectedReportingPeriod &&\r\n this.selectedReportingPeriod.closings &&\r\n formatMoney(\r\n Math.round(this.selectedReportingPeriod.closings.preAcqBalance)\r\n )\r\n )\r\n }\r\n\r\n public taxableBalance() {\r\n return (\r\n this.selectedReportingPeriod &&\r\n this.selectedReportingPeriod.closings &&\r\n formatMoney(\r\n Math.round(this.selectedReportingPeriod.closings.taxableBalance)\r\n )\r\n )\r\n }\r\n\r\n public hybridBalance() {\r\n return (\r\n this.selectedReportingPeriod &&\r\n this.selectedReportingPeriod.closings &&\r\n formatMoney(\r\n Math.round(this.selectedReportingPeriod.closings.hybridBalance)\r\n )\r\n )\r\n }\r\n\r\n public hutBalance() {\r\n return (\r\n this.selectedReportingPeriod &&\r\n this.selectedReportingPeriod.closings &&\r\n formatMoney(Math.round(this.selectedReportingPeriod.closings.hutBalance))\r\n )\r\n }\r\n\r\n public uftBalance() {\r\n return (\r\n this.selectedReportingPeriod &&\r\n this.selectedReportingPeriod.closings &&\r\n formatMoney(Math.round(this.selectedReportingPeriod.closings.uftBalance))\r\n )\r\n }\r\n\r\n public acbBalance() {\r\n return (\r\n this.selectedReportingPeriod &&\r\n this.selectedReportingPeriod.closings &&\r\n formatMoney(Math.round(this.selectedReportingPeriod.closings.acbBalance))\r\n )\r\n }\r\n\r\n public usedCurrency(\r\n foreignAffiliate: ForeignAffiliate | undefined,\r\n reportingPeriod: ReportingPeriod | undefined,\r\n faCurrency: boolean = false\r\n ) {\r\n if (\r\n foreignAffiliate &&\r\n foreignAffiliate.reporting_periods &&\r\n foreignAffiliate.reporting_periods.length > 0\r\n ) {\r\n let periodsInOrder: ReportingPeriod[] = foreignAffiliate.reporting_periods\r\n .filter(\r\n (rp: ReportingPeriod) =>\r\n rp.fx_currency !== \"\" && rp.fx_currency !== null\r\n )\r\n .sort(\r\n (a: ReportingPeriod, b: ReportingPeriod) =>\r\n new Date(a.start_date).getTime() - new Date(b.start_date).getTime()\r\n )\r\n\r\n // Get the latest rp with a currency before the selected reporting period\r\n if (reportingPeriod) {\r\n const selectedStartDate = reportingPeriod.start_date\r\n periodsInOrder = periodsInOrder.filter(\r\n (rp: ReportingPeriod) =>\r\n new Date(rp.start_date).getTime() <=\r\n new Date(selectedStartDate).getTime()\r\n )\r\n }\r\n\r\n if (periodsInOrder.length > 0) {\r\n const { fx_currency, fx_rate } = periodsInOrder[\r\n periodsInOrder.length - 1\r\n ]\r\n\r\n return {\r\n fx_currency,\r\n fx_rate,\r\n }\r\n }\r\n\r\n if (faCurrency) {\r\n return {\r\n fx_currency: foreignAffiliate.reporting_surplus_currency,\r\n }\r\n }\r\n return null\r\n }\r\n return null\r\n }\r\n\r\n public isReportingPeriodLocked(reportingPeriod: ReportingPeriod) {\r\n const isClient = this.$store.getters[\"user/isClient\"]\r\n if (isClient) {\r\n switch (reportingPeriod.lock_status) {\r\n case \"CL\":\r\n case \"L\":\r\n return true\r\n case \"U\":\r\n default:\r\n return false\r\n }\r\n } else {\r\n switch (reportingPeriod.lock_status) {\r\n case \"L\":\r\n return true\r\n case \"CL\":\r\n case \"U\":\r\n default:\r\n return false\r\n }\r\n }\r\n }\r\n\r\n public isReportingPeriodEditable(reportingPeriod: ReportingPeriod) {\r\n const isClient = this.$store.getters[\"user/isClient\"]\r\n const isReportingPeriodLocked = this.isReportingPeriodLocked(\r\n reportingPeriod\r\n )\r\n const isSelectedPeriod = this.isSelectedReportingPeriod(reportingPeriod)\r\n if (isClient && this.activeForeignAffiliate) {\r\n return (\r\n !this.activeForeignAffiliate.client_locked &&\r\n isSelectedPeriod &&\r\n !isReportingPeriodLocked\r\n )\r\n }\r\n return isSelectedPeriod && !isReportingPeriodLocked\r\n }\r\n\r\n public isSelectedReportingPeriod(reportingPeriod: ReportingPeriod) {\r\n return this.selectedReportingPeriod === reportingPeriod\r\n }\r\n}\r\n","// tslint:disable\r\nconst strings: any = {\r\n CLIENT_LOCK_MESSAGE:\r\n \"This foreign affiliate is currently under review and no changes can be made at this time. Please contact your KPMG engagement manager if you have any questions.\",\r\n CLIENT_LOCK_DESCRIPTION:\r\n \"Lock the data inputted. Client will not be able to make any changes.\",\r\n CLIENT_DISCLAIMER: [\r\n \"Use of the Surplus Calculator is subject to the terms and conditions as agreed upon in your signed Engagement Letter. Please see the signed Engagement Letter for details of the terms and conditions.\",\r\n \"Please contact a member of your KPMG Engagement Team if you encounter issues or have any questions about using the Surplus Calculator. \",\r\n ],\r\n INTERNAL_DISCLAIMER: [\r\n \"As surplus calculations are complex, please ensure that all surplus calculations are reviewed by a member of the KPMG International Corporate Tax team before providing to your clients.\",\r\n \"If you encounter any issues while using the Surplus Calculator or have any questions, after going through the training resources found on the KPMG ICT Surplus Template site, please contact either your Surplus Calculator regional champion or our technology team. The contact information can be found on the KPMG ICT Surplus Template site. \",\r\n ],\r\n CONSOLIDATOR_DATE_MESSAGE:\r\n \"Surplus balances shown below are calculated as of the end of the Consolidator Date. These balances reflect the 90-day rule for the current taxation year.\",\r\n OUTPUT_DISCLAIMER:\r\n \"Disclaimer: Any advice herein is based on the facts provided to us and on current tax law including judicial and administrative interpretation. Tax law is subject to continual change, at times on a retroactive basis, and may result in incremental taxes, interest or penalties. Should the facts provided to us be incorrect or incomplete, or should the law or its interpretation change, our advice may be inappropriate. We are not responsible for updating our advice for changes in law or interpretation after the date hereof. KPMG's advice is for the sole use of KPMG's client. The advice is based on the specific facts and circumstances and the scope of KPMG’s engagement and is not intended to be relied upon by any other person. KPMG disclaims any responsibility or liability for any reliance that any person other than the client may place on this advice.\",\r\n OUTPUT_DRAFT: \"Draft for Discussion Purposes Only – Not Reviewed by KPMG\",\r\n OUTPUT_DRAFT_NORMAL: \"Draft for Discussion Purposes Only\",\r\n}\r\n\r\nexport default strings\r\n","import { Vue } from \"vue-property-decorator\"\r\nimport Component from \"vue-class-component\"\r\nimport strings from \"@/fixtures/strings\"\r\n\r\n@Component\r\nexport default class StringsMixin extends Vue {\r\n protected strings: any = strings\r\n}\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"form-container\"},[(_vm.error)?_c('ErrorAlert',{attrs:{\"error\":_vm.error}}):_vm._e(),_c('b-form',{on:{\"submit\":function($event){$event.preventDefault();return _vm.lockdownSubmit($event)}}},[_c('b-form-group',{attrs:{\"description\":_vm.checkboxDescriptions.clientLocked}},[_c('b-form-checkbox',{attrs:{\"value\":true,\"unchecked-value\":false},model:{value:(_vm.clientLocked),callback:function ($$v) {_vm.clientLocked=$$v},expression:\"clientLocked\"}},[_vm._v(\"Lock Foreign Affiliate\"+_vm._s(_vm.taxpayer ? \"s\" : \"\"))])],1),(_vm.clientLocked)?_c('b-form-group',{attrs:{\"description\":_vm.checkboxDescriptions.clientHidden}},[_c('b-form-checkbox',{attrs:{\"value\":true,\"unchecked-value\":false},model:{value:(_vm.clientHidden),callback:function ($$v) {_vm.clientHidden=$$v},expression:\"clientHidden\"}},[_vm._v(\"Hide Foreign Affiliate\"+_vm._s(_vm.taxpayer ? \"s\" : \"\"))])],1):_vm._e(),_c('hr'),_c('LoadingButton',{attrs:{\"text\":\"Save\",\"loading\":_vm.loading}})],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\n\n\r\nimport { Component, Prop, Watch } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\n// Project Imports\r\nimport { Taxpayer, ForeignAffiliate, ReportingPeriod } from \"@/interfaces\"\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport LoadingButton from \"@/components/LoadingButton.vue\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport { fa, taxpayer } from \"@/services/api\"\r\nimport { config } from \"@fortawesome/fontawesome-svg-core\"\r\nimport ConfirmBoxMixin from \"../../mixins/ConfirmBoxMixin\"\r\n\r\n@Component({ components: { LoadingButton, ErrorAlert } })\r\nexport default class FALockdown extends mixins(LoadingMixin, ConfirmBoxMixin) {\r\n @Prop({ default: null })\r\n public foreignAffiliate!: ForeignAffiliate\r\n @Prop({ default: null })\r\n public taxpayer!: Taxpayer\r\n\r\n public clientLocked: boolean = false\r\n public clientHidden: boolean = false\r\n public checkboxDescriptions = {\r\n clientLocked: `By locking foreign affiliate${\r\n this.taxpayer ? \"s\" : \"\"\r\n }, the client will not be able to make any changes.`,\r\n clientHidden: `Client will not be able to view foreign affiliate${\r\n this.taxpayer ? \"s\" : \"\"\r\n } while hidden.`,\r\n }\r\n public confirmLockMessage = `${\r\n this.checkboxDescriptions.clientLocked\r\n } Are you sure you want to lock foreign affliliate${\r\n this.taxpayer ? \"s\" : \"\"\r\n }?`\r\n\r\n @Watch(\"foreignAffiliate\", { deep: true })\r\n public foreignAffiliateChange() {\r\n if (this.foreignAffiliate) {\r\n this.clientLocked = this.foreignAffiliate.client_locked || false\r\n this.clientHidden = this.foreignAffiliate.client_hidden || false\r\n }\r\n }\r\n\r\n @Watch(\"taxpayer\", { deep: true })\r\n public taxpayerChange() {\r\n if (this.taxpayer) {\r\n this.clientLocked = this.taxpayer.foreign_affiliates.every(\r\n (fa: ForeignAffiliate) => fa.client_locked || false\r\n )\r\n this.clientHidden = this.taxpayer.foreign_affiliates.every(\r\n (fa: ForeignAffiliate) => fa.client_hidden || false\r\n )\r\n }\r\n }\r\n\r\n public mounted() {\r\n // Set the intial values\r\n if (this.foreignAffiliate) {\r\n this.clientLocked = this.foreignAffiliate.client_locked || false\r\n this.clientHidden = this.foreignAffiliate.client_hidden || false\r\n } else if (this.taxpayer) {\r\n this.clientLocked = this.taxpayer.foreign_affiliates.every(\r\n (fa: ForeignAffiliate) => fa.client_locked || false\r\n )\r\n this.clientHidden = this.taxpayer.foreign_affiliates.every(\r\n (fa: ForeignAffiliate) => fa.client_hidden || false\r\n )\r\n }\r\n }\r\n\r\n public async lockdownSubmit() {\r\n // Hidden to client can only be true if client locked is true\r\n this.clientHidden = this.clientLocked && this.clientHidden\r\n const values: any = {\r\n client_locked: this.clientLocked,\r\n client_hidden: this.clientHidden,\r\n }\r\n\r\n // If user wants to lock, prompt with consequences of locking\r\n if (values.client_locked) {\r\n if (await this.confirmBox(this.confirmLockMessage)) {\r\n if (this.taxpayer) {\r\n this.updateTaxpayerLock(values)\r\n } else {\r\n this.updateFaLock(values)\r\n }\r\n }\r\n } else {\r\n if (this.taxpayer) {\r\n this.updateTaxpayerLock(values)\r\n } else {\r\n this.updateFaLock(values)\r\n }\r\n }\r\n }\r\n\r\n private updateFaLock(values: any) {\r\n if (this.foreignAffiliate && this.foreignAffiliate.id) {\r\n this.loading = true\r\n this.error = \"\"\r\n fa.update(values, this.foreignAffiliate.id)\r\n .then((response: ForeignAffiliate) => {\r\n this.foreignAffiliate.client_locked = response.client_locked\r\n this.foreignAffiliate.client_hidden = response.client_hidden\r\n this.$emit(\"closeModal\")\r\n })\r\n .catch((err: any) => (this.error = err))\r\n .finally(() => (this.loading = false))\r\n }\r\n }\r\n\r\n private updateTaxpayerLock(values: any) {\r\n if (this.taxpayer && this.taxpayer.id) {\r\n this.loading = true\r\n this.error = \"\"\r\n taxpayer\r\n .lockdown(this.taxpayer.id, values)\r\n .then((response: any) => {\r\n this.taxpayer.foreign_affiliates.forEach((fa: ForeignAffiliate) => {\r\n fa.client_locked = response.client_locked\r\n fa.client_hidden = response.client_hidden\r\n })\r\n this.$emit(\"closeModal\")\r\n })\r\n .catch((err: any) => (this.error = err))\r\n .finally(() => (this.loading = false))\r\n }\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FALockdown.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FALockdown.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./FALockdown.vue?vue&type=template&id=5ea30138&scoped=true&\"\nimport script from \"./FALockdown.vue?vue&type=script&lang=ts&\"\nexport * from \"./FALockdown.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./FALockdown.vue?vue&type=style&index=0&id=5ea30138&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"5ea30138\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('modal-button',{attrs:{\"buttonLabel\":\"Export\",\"buttonProps\":_vm.buttonProps,\"modalProps\":_vm.modalProps,\"disabled\":_vm.disabled},on:{\"show-modal-change\":_vm.modalChange},scopedSlots:_vm._u([{key:\"buttonIcon\",fn:function(){return [_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"icon\":\"save\"}})]},proxy:true}])},[[_c('h4',[_vm._v(\"\\n Preview\\n \"),(_vm.outputProfile.draft === 'draft')?_c('span',[_vm._v(\"(\"+_vm._s(this.strings[\"OUTPUT_DRAFT\"])+\")\")]):_vm._e(),(_vm.outputProfile.draft === 'draft-normal')?_c('span',[_vm._v(\"(\"+_vm._s(this.strings[\"OUTPUT_DRAFT_NORMAL\"])+\")\")]):_vm._e()]),_c('hr'),_c('b-row',[_c('b-col',{staticStyle:{\"height\":\"650px\",\"overflow\":\"auto\"}},[(_vm.totalTableFields.length > 0)?_c('b-table',_vm._b({attrs:{\"id\":\"consolidator-total\",\"items\":[_vm.consolidatedTotal],\"fields\":_vm.totalTableFields},scopedSlots:_vm._u([{key:\"thead-top\",fn:function(){return [_c('tr',[_c('th',{staticClass:\"text-center\",attrs:{\"colspan\":_vm.totalTableFields.length}},[_vm._v(\"\\n Total Surplus\\n \")])])]},proxy:true}],null,false,1873986581)},'b-table',_vm.tableProps,false)):_vm._e(),_c('b-table',_vm._b({attrs:{\"id\":\"consolidator-output\",\"items\":_vm._tableItems,\"fields\":_vm._tableFields,\"sort-by\":_vm.sortBy,\"sort-desc\":_vm.sortDesc},scopedSlots:_vm._u([{key:\"cell(index)\",fn:function(data){return [_vm._v(_vm._s(data.index + 1))]}}])},'b-table',_vm.tableProps,false))],1)],1),_c('div',{staticClass:\"footer\"},[_c('hr'),_c('b-row',[_c('b-col',[_c('b-row',[_c('b-col',{staticClass:\"border-right\",attrs:{\"lg\":\"4\"}},[_c('ProfileSelector',{attrs:{\"outputProfile\":_vm.outputProfile,\"defaultOutputProfile\":_vm.defaultOutputProfile,\"profileType\":'CO'},on:{\"update:outputProfile\":function($event){_vm.outputProfile=$event},\"update:output-profile\":function($event){_vm.outputProfile=$event},\"defaultSet\":_vm.setupProfile}})],1),_c('b-col',[_c('b-form-group',{staticClass:\"mb-0\",attrs:{\"label\":\"Show/Hide\"}},[_c('b-form-checkbox',{attrs:{\"value\":true,\"unchecked-value\":false},model:{value:(_vm.outputProfile.showRowNumber),callback:function ($$v) {_vm.$set(_vm.outputProfile, \"showRowNumber\", $$v)},expression:\"outputProfile.showRowNumber\"}},[_vm._v(\"Show row number\")])],1)],1),_c('b-col',[_c('b-form-group',{staticClass:\"mb-0\",attrs:{\"label\":\"Draft Label\"}},[_c('b-form-radio',{attrs:{\"value\":\"no-draft\",\"data-cy\":\"no-draft\"},model:{value:(_vm.outputProfile.draft),callback:function ($$v) {_vm.$set(_vm.outputProfile, \"draft\", $$v)},expression:\"outputProfile.draft\"}},[_vm._v(\"None\")]),_c('b-form-radio',{attrs:{\"value\":\"draft-normal\",\"data-cy\":\"draft-normal\"},model:{value:(_vm.outputProfile.draft),callback:function ($$v) {_vm.$set(_vm.outputProfile, \"draft\", $$v)},expression:\"outputProfile.draft\"}},[_vm._v(\"Draft\")]),_c('b-form-radio',{attrs:{\"value\":\"draft\",\"data-cy\":\"draft\"},model:{value:(_vm.outputProfile.draft),callback:function ($$v) {_vm.$set(_vm.outputProfile, \"draft\", $$v)},expression:\"outputProfile.draft\"}},[_vm._v(\"Draft - Not Reviewed by KPMG\")])],1)],1),_c('b-col',[_c('FAConsolidatorSettings',{staticStyle:{\"width\":\"200px\"},attrs:{\"tableFields\":_vm.tableFields,\"faList\":_vm.faList,\"outputProfile\":_vm.outputProfile,\"buttonLabel\":\"Output Settings\"},on:{\"update:faList\":function($event){_vm.faList=$event},\"update:fa-list\":function($event){_vm.faList=$event},\"update:outputProfile\":function($event){_vm.outputProfile=$event},\"update:output-profile\":function($event){_vm.outputProfile=$event}}})],1)],1)],1),_c('b-col',{attrs:{\"cols\":\"2\"}},[_c('b-button',{attrs:{\"variant\":\"primary\",\"block\":\"\"},on:{\"click\":_vm.printPdf}},[_vm._v(\"Create PDF\")])],1)],1)],1)]],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.showModal)?_c('b-modal',_vm._b({attrs:{\"no-close-on-backdrop\":\"\"},scopedSlots:_vm._u([_vm._l((_vm.$scopedSlots),function(_,name){return {key:name,fn:function(slotData){return [_vm._t(name,null,null,slotData)]}}})],null,true),model:{value:(_vm.showModal),callback:function ($$v) {_vm.showModal=$$v},expression:\"showModal\"}},'b-modal',_vm.modalProps,false),[_vm._t(\"default\")],2):_vm._e(),_c('b-button',_vm._b({attrs:{\"disabled\":_vm.disabled},on:{\"click\":function () { return (_vm.showModal = true); }}},'b-button',_vm.buttonProps,false),[_vm._t(\"buttonIcon\"),_vm._v(\"\\n \"+_vm._s(_vm.buttonLabel)+\"\\n \")],2)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\n\r\nimport { Component, Prop, Watch, Emit, Vue } from \"vue-property-decorator\"\r\n\r\n@Component({ components: {} })\r\nexport default class ModalButton extends Vue {\r\n // Button Props\r\n @Prop({\r\n default: () => {\r\n return {\r\n class: \"\",\r\n style: \"\",\r\n variant: \"primary\",\r\n }\r\n },\r\n })\r\n public buttonProps: any\r\n @Prop({\r\n default: \"button\",\r\n })\r\n public buttonLabel!: string\r\n\r\n // Modal Props\r\n @Prop({\r\n default: () => {\r\n return {\r\n title: \"\",\r\n size: \"lg\",\r\n }\r\n },\r\n })\r\n public modalProps: any\r\n @Prop({\r\n default: false,\r\n })\r\n public disabled!: boolean\r\n\r\n public showModal: boolean = false\r\n\r\n @Watch(\"showModal\")\r\n public showModalChange() {\r\n this.$emit(\"show-modal-change\", this.showModal)\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModalButton.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ModalButton.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./ModalButton.vue?vue&type=template&id=3de332f2&\"\nimport script from \"./ModalButton.vue?vue&type=script&lang=ts&\"\nexport * from \"./ModalButton.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import { Vue, Mixins } from \"vue-property-decorator\"\r\nimport Component from \"vue-class-component\"\r\nimport \"jspdf-autotable\"\r\nimport jsPDF from \"jspdf\"\r\nimport StringsMixin from \"./StringsMixin\"\r\n\r\n// tslint:disable-next-line\r\n;(function() {\r\n if (!Element.prototype.matches) {\r\n Element.prototype.matches =\r\n // @ts-ignore\r\n Element.prototype.msMatchesSelector ||\r\n Element.prototype.webkitMatchesSelector\r\n }\r\n\r\n if (!Element.prototype.closest) {\r\n Element.prototype.closest = function(s: any) {\r\n let el: any = this\r\n do {\r\n if (el.matches(s)) {\r\n return el\r\n }\r\n el = el.parentElement || el.parentNode\r\n } while (el !== null && el.nodeType === 1)\r\n return null\r\n }\r\n }\r\n})()\r\n\r\n@Component\r\nexport default class PDFMixin extends Mixins(StringsMixin) {\r\n public pdf!: jsPDF\r\n\r\n public createjsPdfInstance(config: any) {\r\n return new jsPDF(config)\r\n }\r\n\r\n public addLogo(x: number, y: number) {\r\n const c = document.createElement(\"canvas\")\r\n const logo: any = document.getElementById(\"kpmg_logo\")\r\n const ctx: any = c.getContext(\"2d\")\r\n c.height = 55\r\n c.width = 135\r\n ctx.drawImage(logo, 0, 0, 135, 55)\r\n const logoData = c.toDataURL()\r\n this.pdf.addImage(logoData, \"png\", x, y)\r\n }\r\n\r\n public addDraftBlurb(margin: number, output: string) {\r\n let output_string\r\n\r\n if (output === \"draft\") {\r\n output_string = this.strings[\"OUTPUT_DRAFT\"]\r\n } else if (output === \"draft-normal\") {\r\n output_string = this.strings[\"OUTPUT_DRAFT_NORMAL\"]\r\n }\r\n this.pdf.setFontSize(10)\r\n this.pdf.setTextColor(255, 0, 0)\r\n const fontSize =\r\n this.pdf.internal.getFontSize() / this.pdf.internal.scaleFactor\r\n const x =\r\n this.pdf.internal.pageSize.width -\r\n margin -\r\n fontSize * this.pdf.getStringUnitWidth(output_string)\r\n this.pdf.text(output_string, x, 8)\r\n this.pdf.setTextColor(0, 0, 0)\r\n }\r\n}\r\n","export const FADefaultProfile: any = {\r\n showHeaders: {\r\n fx_currency: true,\r\n reporting_currency: true,\r\n sep_percentage: true,\r\n exempt_surplus: true,\r\n hybrid_surplus: true,\r\n taxable_surplus: true,\r\n net_surplus: true,\r\n hybrid_underlying_tax: true,\r\n underlying_foreign_tax: true,\r\n acb_balance: true,\r\n },\r\n showFA: {\r\n visible: {},\r\n },\r\n sortBy: {\r\n headers: false,\r\n fa: false,\r\n },\r\n FAOrder: {\r\n order: [],\r\n },\r\n headerSort: {\r\n key: \"\",\r\n desc: false,\r\n },\r\n applyFilters: true,\r\n draft: \"no-draft\",\r\n showRowNumber: false,\r\n}\r\n","import { Vue } from \"vue-property-decorator\"\r\nimport Component from \"vue-class-component\"\r\nimport { ForeignAffiliate, OutputProfile } from \"@/interfaces\"\r\nimport { FADefaultProfile } from \"@/components/fa/FAConsolidator.config\"\r\n\r\n@Component\r\nexport default class FAConsolidatorMixin extends Vue {\r\n public filterHeaders(header: any, outputProfile: any) {\r\n const newItem = { ...header }\r\n if (newItem.key == \"name\") {\r\n return true // name always visible\r\n }\r\n if (outputProfile.showHeaders[newItem.key]) {\r\n return true\r\n }\r\n return false\r\n }\r\n\r\n public filterFA(FA: any, outputProfile: any) {\r\n const newItem = { ...FA }\r\n if (outputProfile.showFA.visible[newItem.id]) {\r\n return true\r\n }\r\n return false\r\n }\r\n\r\n public setUpConfig(\r\n foreignAffiliates: ForeignAffiliate[],\r\n outputProfile: any\r\n ) {\r\n this.checkNewKeys(FADefaultProfile, outputProfile)\r\n\r\n Object.keys(outputProfile.showFA.visible).forEach((key: string) => {\r\n const index = foreignAffiliates.findIndex(fa => {\r\n return fa.id == key\r\n })\r\n if (index < 0) {\r\n delete outputProfile.showFA.visible[key]\r\n }\r\n })\r\n\r\n foreignAffiliates.forEach(fa => {\r\n if (outputProfile.showFA.visible[fa.id as string] == undefined) {\r\n this.$set(outputProfile.showFA.visible, fa.id as string, true)\r\n }\r\n if (!outputProfile.FAOrder.order.includes(fa.id)) {\r\n outputProfile.FAOrder.order.push(fa.id)\r\n }\r\n })\r\n\r\n // Insert the taxpayer id into the profile\r\n if (foreignAffiliates.length > 0) {\r\n outputProfile[\"taxpayer\"] = foreignAffiliates[0].taxpayer\r\n }\r\n }\r\n\r\n public reorderFAs(displayedFAs: any, outputProfile: any) {\r\n const orderedList: any = []\r\n const ordering: any[] = outputProfile.FAOrder.order\r\n ordering.forEach(curID => {\r\n displayedFAs.forEach((fa: any) => {\r\n if (fa.id == curID) {\r\n orderedList.push(fa)\r\n }\r\n })\r\n })\r\n return orderedList\r\n }\r\n\r\n /**\r\n * There are times when config in the db does not contain\r\n * all properties in the default config. This might happen\r\n * when we add new property object into the config making\r\n * the db user config 'outdated'. To fix this, we compare\r\n * db config keys with default config keys and add any\r\n * missing properties with the default value\r\n *\r\n * @memberof FAConsolidatorMixin\r\n */\r\n public checkNewKeys(\r\n defaultProfile: OutputProfile,\r\n taxpayerProfile: OutputProfile\r\n ) {\r\n Object.keys(defaultProfile).every((key: any) => {\r\n if (!taxpayerProfile.hasOwnProperty(key)) {\r\n taxpayerProfile[key] = defaultProfile[key]\r\n }\r\n return taxpayerProfile.hasOwnProperty(key)\r\n })\r\n }\r\n}\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('modal-button',_vm._g({attrs:{\"buttonLabel\":_vm.buttonLabel,\"buttonProps\":_vm.buttonProps,\"modalProps\":_vm.modalProps},scopedSlots:_vm._u([{key:\"buttonIcon\",fn:function(){return [_c('font-awesome-icon',{staticClass:\"text-secondary\",attrs:{\"icon\":\"cog\"}})]},proxy:true}])},_vm.$listeners),[_c('b-card',{attrs:{\"no-body\":\"\"}},[_c('b-tabs',{attrs:{\"pills\":\"\",\"card\":\"\",\"vertical\":\"\"}},[_c('b-tab',{attrs:{\"title\":\"Headers\",\"active\":\"\"}},[_c('b-row',[_c('b-col',[_c('p',{staticClass:\"font-weight-light\"},[_vm._v(\"\\n Select the headers to display in the output.\\n \")])])],1),_c('b-row',[_c('b-col',[_c('b-button-group',{attrs:{\"size\":\"sm\"}},[_c('b-button',{attrs:{\"variant\":\"outline-secondary\"},on:{\"click\":function($event){return _vm.toggleAllHeaders(true)}}},[_vm._v(\"Select All\")]),_c('b-button',{attrs:{\"variant\":\"outline-secondary\"},on:{\"click\":function($event){return _vm.toggleAllHeaders(false)}}},[_vm._v(\"Unselect All\")])],1)],1)],1),_c('hr'),_c('b-row',[_c('b-col',_vm._l((_vm.toggleableHeaders),function(header,index){return _c('div',{key:index},[_c('b-row',{staticClass:\"border-bottom mx-2 pt-2 pb-2\"},[_c('b-col',[_c('b-form-checkbox',{on:{\"change\":_vm.emitProfile},model:{value:(_vm.outputProfileEditable.showHeaders[header.key]),callback:function ($$v) {_vm.$set(_vm.outputProfileEditable.showHeaders, header.key, $$v)},expression:\"outputProfileEditable.showHeaders[header.key]\"}},[_vm._v(_vm._s(header.label))])],1)],1)],1)}),0)],1),_c('b-row',{staticClass:\"m-2 pt-3\"},[_c('p',{staticClass:\"text-muted mb-2\"},[_c('strong',[_vm._v(\"Note:\")]),_vm._v(\" Enabling sorting by header will disable\\n your foreign affiliate custom sorting.\\n \")]),_c('b-form-checkbox',{staticClass:\"pb-2\",on:{\"change\":_vm.sortByHeader},model:{value:(_vm.outputProfileEditable.sortBy.headers),callback:function ($$v) {_vm.$set(_vm.outputProfileEditable.sortBy, \"headers\", $$v)},expression:\"outputProfileEditable.sortBy.headers\"}},[_vm._v(\"Enable Header Sorting\")]),_c('div',{staticClass:\"d-flex align-items-center\",staticStyle:{\"width\":\"100%\"}},[_c('b-form-select',{attrs:{\"disabled\":!_vm.outputProfileEditable.sortBy.headers,\"size\":\"sm\",\"options\":_vm.sortableHeaderOptions},on:{\"change\":_vm.emitProfile},model:{value:(_vm.outputProfileEditable.headerSort.key),callback:function ($$v) {_vm.$set(_vm.outputProfileEditable.headerSort, \"key\", $$v)},expression:\"outputProfileEditable.headerSort.key\"}}),_c('b-button',{staticClass:\"ml-2 d-flex align-items-center\",class:_vm.outputProfileEditable.headerSort.desc\n ? 'selected-secondary-button'\n : 'text-secondary',attrs:{\"size\":\"sm\",\"variant\":\"light\",\"disabled\":!_vm.outputProfileEditable.sortBy.headers},on:{\"click\":function($event){return _vm.changeSortDirection(true)}}},[_c('font-awesome-icon',{attrs:{\"icon\":\"sort-amount-down\"}}),_vm._v(\"Desc\\n \")],1),_c('b-button',{staticClass:\"ml-2 d-flex align-items-center\",class:_vm.outputProfileEditable.headerSort.desc\n ? 'text-secondary'\n : 'selected-secondary-button',attrs:{\"size\":\"sm\",\"variant\":\"light\",\"disabled\":!_vm.outputProfileEditable.sortBy.headers},on:{\"click\":function($event){return _vm.changeSortDirection(false)}}},[_c('font-awesome-icon',{attrs:{\"icon\":\"sort-amount-up\"}}),_vm._v(\"Asc\\n \")],1)],1)],1)],1),_c('b-tab',{attrs:{\"title\":\"Foreign Affiliates\"}},[_c('b-row',[_c('b-col',[_c('p',{staticClass:\"font-weight-light\"},[_vm._v(\"\\n Select the Foreign Affiliates to display in the output. Drag and\\n drop to reorder rows.\\n \")])])],1),_c('b-row',[_c('b-col',[_c('b-button-group',{attrs:{\"size\":\"sm\"}},[_c('b-button',{attrs:{\"variant\":\"outline-secondary\"},on:{\"click\":function($event){return _vm.toggleAllFAs(true)}}},[_vm._v(\"Select All\")]),_c('b-button',{attrs:{\"variant\":\"outline-secondary\"},on:{\"click\":function($event){return _vm.toggleAllFAs(false)}}},[_vm._v(\"Unselect All\")])],1)],1)],1),_c('hr'),_c('draggable',_vm._b({staticClass:\"list-group\",attrs:{\"tag\":\"ul\",\"handle\":\".handle\"},on:{\"change\":function($event){return _vm.$emit('update:faList', _vm.faListDraggable)},\"start\":function($event){_vm.drag = true},\"end\":function($event){_vm.drag = false}},model:{value:(_vm.faListDraggable),callback:function ($$v) {_vm.faListDraggable=$$v},expression:\"faListDraggable\"}},'draggable',_vm.dragOptions,false),[_c('transition-group',{attrs:{\"type\":\"transition\",\"name\":!_vm.drag ? 'flip-list' : null}},_vm._l((_vm.faListDraggable),function(fa){return _c('li',{key:fa.id,staticClass:\"list-group-item\"},[_c('b-form-checkbox',{staticClass:\"float-left\",on:{\"change\":_vm.emitProfile},model:{value:(_vm.outputProfileEditable.showFA.visible[fa.id]),callback:function ($$v) {_vm.$set(_vm.outputProfileEditable.showFA.visible, fa.id, $$v)},expression:\"outputProfileEditable.showFA.visible[fa.id]\"}}),_vm._v(\"\\n \"+_vm._s(fa.name)+\"\\n \"),_c('font-awesome-icon',{staticClass:\"float-right handle text-secondary\",attrs:{\"icon\":\"bars\"}})],1)}),0)],1),(!_vm.faListDraggable.length)?_c('h5',{staticClass:\"font-weight-light px-3 pb-3\"},[_vm._v(\"\\n No foreign affiliates found.\\n \")]):_vm._e(),_c('b-row',{staticClass:\"m-2 pt-3\"},[_c('p',{staticClass:\"text-muted mb-2\"},[_c('strong',[_vm._v(\"Note:\")]),_vm._v(\" Enabling sorting by foreign affiliates will\\n disable your header custom sorting.\\n \")]),_c('b-form-checkbox',{staticClass:\"pb-2\",on:{\"change\":_vm.sortByFa},model:{value:(_vm.outputProfileEditable.sortBy.fa),callback:function ($$v) {_vm.$set(_vm.outputProfileEditable.sortBy, \"fa\", $$v)},expression:\"outputProfileEditable.sortBy.fa\"}},[_vm._v(\"Enable Foreign Affiliate Sorting\")])],1)],1)],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\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\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\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\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\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Vue, Prop, Mixins, Watch } from \"vue-property-decorator\"\r\nimport draggable from \"vuedraggable\"\r\nimport ModalButton from \"@/components/utils/ModalButton.vue\"\r\n\r\n@Component({ components: { draggable, ModalButton } })\r\nexport default class FAConsolidatorSettings extends Vue {\r\n @Prop({\r\n required: true,\r\n })\r\n public tableFields!: any[]\r\n @Prop({\r\n required: true,\r\n })\r\n public faList!: any[]\r\n @Prop({\r\n required: true,\r\n })\r\n public outputProfile!: any\r\n @Prop({\r\n default: \"Settings\",\r\n })\r\n public buttonLabel!: string\r\n\r\n public outputProfileEditable: any = {}\r\n public faListDraggable: any = []\r\n public drag: boolean = false\r\n\r\n public buttonProps: any = {\r\n class: \"text-secondary\",\r\n variant: \"link\",\r\n }\r\n\r\n public modalProps: any = {\r\n size: \"lg\",\r\n \"no-close-on-backdrop\": true,\r\n title: this.buttonLabel,\r\n \"hide-footer\": true,\r\n }\r\n\r\n public created() {\r\n this.faListDraggable = [...this.faList]\r\n }\r\n\r\n @Watch(\"outputProfile\", { deep: true, immediate: true })\r\n public outputProfileChange() {\r\n this.outputProfileEditable = { ...this.outputProfile }\r\n }\r\n\r\n @Watch(\"faList\", { deep: true, immediate: true })\r\n public faListChange() {\r\n this.faListDraggable = [...this.faList]\r\n }\r\n\r\n public get dragOptions() {\r\n return {\r\n animation: 200,\r\n group: \"name\",\r\n disabled: false,\r\n ghostClass: \"ghost\",\r\n }\r\n }\r\n\r\n public get sortableHeaderOptions() {\r\n return this.tableFields\r\n .filter((field: any) => field.sortable)\r\n .map((option: any) => ({\r\n value: option.key,\r\n text: `${option.label}`,\r\n }))\r\n }\r\n\r\n public get toggleableHeaders() {\r\n return this.tableFields.filter((field: any) => field.key != \"name\")\r\n }\r\n\r\n public toggleAllHeaders(toggle: boolean) {\r\n Object.keys(this.outputProfileEditable.showHeaders).forEach(\r\n (key: string) => (this.outputProfileEditable.showHeaders[key] = toggle)\r\n )\r\n }\r\n\r\n public toggleAllFAs(toggle: boolean) {\r\n Object.keys(this.outputProfileEditable.showFA.visible).forEach(\r\n (key: string) => (this.outputProfileEditable.showFA.visible[key] = toggle)\r\n )\r\n }\r\n\r\n public sortByHeader(value: boolean) {\r\n if (value) {\r\n this.outputProfileEditable.sortBy.fa = false\r\n }\r\n this.emitProfile()\r\n }\r\n\r\n public sortByFa(value: boolean) {\r\n if (value) {\r\n this.outputProfileEditable.sortBy.headers = false\r\n }\r\n this.emitProfile()\r\n }\r\n\r\n public changeSortDirection(desc: boolean) {\r\n this.outputProfileEditable.headerSort.desc = desc\r\n this.emitProfile()\r\n }\r\n\r\n public emitProfile() {\r\n this.$emit(\"update:outputProfile\", this.outputProfileEditable)\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FAConsolidatorSettings.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FAConsolidatorSettings.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./FAConsolidatorSettings.vue?vue&type=template&id=6297223d&scoped=true&\"\nimport script from \"./FAConsolidatorSettings.vue?vue&type=script&lang=ts&\"\nexport * from \"./FAConsolidatorSettings.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./FAConsolidatorSettings.vue?vue&type=style&index=0&id=6297223d&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"6297223d\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-modal',{attrs:{\"no-close-on-backdrop\":\"\",\"hide-footer\":\"\",\"size\":\"md\",\"title\":((_vm.showProfileModal.update ? 'Edit Profile Name' : 'Save New Profile') + \" \")},model:{value:(_vm.showProfileModal.show),callback:function ($$v) {_vm.$set(_vm.showProfileModal, \"show\", $$v)},expression:\"showProfileModal.show\"}},[(_vm.showProfileModal.show)?_c('ProfileEditor',{attrs:{\"existingTaxpayerProfiles\":_vm.taxpayerOutputProfiles,\"existingUserProfiles\":_vm.userOutputProfiles,\"existingProfile\":_vm.showProfileModal.update ? _vm.selectedOutputProfile : null,\"type\":_vm.profileType,\"profile\":_vm.outputProfile},on:{\"create-done\":_vm.profileCreated,\"update-done\":function($event){_vm.showProfileModal.show = false},\"delete-done\":function () {\n _vm.selectedOutputProfile = null\n _vm.showProfileModal.show = false\n }}}):_vm._e()],1),_c('b-form-group',{staticClass:\"mb-0\",attrs:{\"label\":\"Select Profile\"}},[_c('b-row',[_c('b-col',{staticClass:\"pr-2\",attrs:{\"cols\":\"6\"}},[_c('b-form-select',{attrs:{\"size\":\"sm\"},scopedSlots:_vm._u([{key:\"first\",fn:function(){return [_c('option',{domProps:{\"value\":null}},[_vm._v(\"Default\")])]},proxy:true}]),model:{value:(_vm.selectedOutputProfile),callback:function ($$v) {_vm.selectedOutputProfile=$$v},expression:\"selectedOutputProfile\"}},[_c('optgroup',{attrs:{\"label\":\"User Profiles\"}},_vm._l((_vm.userOutputProfileOptions),function(profile,index){return _c('option',{key:(index + \"-up\"),attrs:{\"disabled\":profile.disabled},domProps:{\"value\":profile.value}},[_vm._v(_vm._s(profile.text))])}),0),_c('optgroup',{attrs:{\"label\":\"Taxpayer Profiles\"}},_vm._l((_vm.taxpayerOutputProfileOptions),function(profile,index){return _c('option',{key:(index + \"-tp\"),attrs:{\"disabled\":profile.disabled},domProps:{\"value\":profile.value}},[_vm._v(_vm._s(profile.text))])}),0)])],1),_c('b-col',{staticClass:\"pr-0 pl-0\",attrs:{\"cols\":\"3\"}},[_c('b-button',{staticClass:\"saveBtn\",attrs:{\"size\":\"sm\",\"block\":\"\",\"variant\":\"outline-primary \",\"content\":\"hi\"},on:{\"click\":function($event){_vm.selectedOutputProfile\n ? _vm.updateProfile()\n : (_vm.showProfileModal = {\n show: true,\n update: false,\n })}}},[(_vm.selectedOutputProfile)?[(_vm.selectedOutputProfile)?_c('transition',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\",\"duration\":\"300\"}},[(_vm.loading)?_c('b-spinner',{attrs:{\"small\":\"\"}}):(!_vm.loading)?_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"size\":\"sm\",\"icon\":\"save\"}}):_vm._e()],1):_vm._e(),_vm._v(\"Save Updates\\n \")]:[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"size\":\"sm\",\"icon\":\"plus\"}}),_vm._v(\"Create\\n Profile\\n \")]],2)],1),(_vm.selectedOutputProfile)?_c('b-col',{staticClass:\"pr-0 pl-0\",attrs:{\"cols\":\"1\"}},[_c('div',[_c('b-dropdown',{staticClass:\"my-dropdown\",attrs:{\"size\":\"sm\",\"variant\":\"link\",\"toggle-class\":\"text-secondary\",\"text\":\"More\"}},[_c('b-dropdown-item',{on:{\"click\":function($event){_vm.showProfileModal = {\n show: true,\n update: true,\n }}}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"size\":\"sm\",\"icon\":\"edit\"}}),_vm._v(\"Edit\\n Name\\n \")],1),_c('b-dropdown-item',{on:{\"click\":function($event){_vm.showProfileModal = {\n show: true,\n update: false,\n }}}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"size\":\"sm\",\"icon\":\"save\"}}),_vm._v(\"Save As\\n New Profile\\n \")],1),_c('b-button',{staticClass:\"d-flex justify-content-center mt-4\",style:({ width: '80%', margin: '0 auto' }),attrs:{\"variant\":\"danger\",\"size\":\"sm\"},on:{\"click\":_vm.deleteProfile}},[_vm._v(\"Delete Profile\")])],1)],1)]):_vm._e()],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[(_vm.loading)?_c('b-row',{key:\"loader\"},[_c('b-col',{staticClass:\"text-center\"},[_c('b-spinner')],1)],1):_c('b-form',{key:\"form\",on:{\"submit\":function($event){$event.preventDefault();return _vm.saveProfile($event)}}},[(_vm.error)?_c('ErrorAlert',{attrs:{\"error\":_vm.error}}):_vm._e(),_c('b-form-group',{attrs:{\"label\":\"Profile Name\"}},[_c('b-form-input',{attrs:{\"required\":\"\"},model:{value:(_vm.profileName),callback:function ($$v) {_vm.profileName=$$v},expression:\"profileName\"}})],1),(!_vm.edit)?_c('b-form-group',{attrs:{\"label\":\"Save to:\"}},[_c('b-form-checkbox',{attrs:{\"value\":true,\"unchecked-value\":false},model:{value:(_vm.saveTaxpayer),callback:function ($$v) {_vm.saveTaxpayer=$$v},expression:\"saveTaxpayer\"}},[_vm._v(\"Taxpayer Profile\")]),_c('b-form-checkbox',{attrs:{\"value\":true,\"unchecked-value\":false},model:{value:(_vm.saveUser),callback:function ($$v) {_vm.saveUser=$$v},expression:\"saveUser\"}},[_vm._v(\"User Profile\")])],1):_vm._e(),_c('hr'),_c('b-row',[_c('b-col',[_c('b-button',{attrs:{\"variant\":\"success\",\"block\":\"\",\"type\":\"submit\"}},[_vm._v(\"Save\")])],1)],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\n\n\n\n\n\n\n\n\r\nimport { Component, Vue, Watch, Prop } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport _ from \"lodash\"\r\n// Project Imports\r\nimport UserMixin from \"../../mixins/UserMixin\"\r\nimport CalculatorMixin from \"../../mixins/CalculatorMixin\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport LoadingMixin from \"../../mixins/LoadingMixin\"\r\nimport { outputProfile, taxpayer } from \"../../services/api\"\r\nimport ConfirmBoxMixin from \"../../mixins/ConfirmBoxMixin\"\r\nimport { ProfileType } from \"../../interfaces\"\r\n\r\n@Component({ components: { ErrorAlert } })\r\nexport default class ProfileEditor extends mixins(\r\n CalculatorMixin,\r\n UserMixin,\r\n LoadingMixin,\r\n ConfirmBoxMixin\r\n) {\r\n @Prop({ default: null })\r\n public existingProfile!: any\r\n @Prop({ default: \"CA\" })\r\n public type!: ProfileType\r\n @Prop({ required: true })\r\n public profile!: any\r\n @Prop({ required: true })\r\n public existingUserProfiles!: any[]\r\n @Prop({ required: true })\r\n public existingTaxpayerProfiles!: any[]\r\n\r\n public profileName = \"\"\r\n public saveUser: boolean = false\r\n public saveTaxpayer: boolean = false\r\n public messages: any = {\r\n duplicate: \"Profile name already used.\",\r\n }\r\n\r\n public get edit() {\r\n return this.existingProfile != null\r\n }\r\n\r\n public get canSaveToUser() {\r\n return !this.findExistingProfileName(\r\n this.existingUserProfiles,\r\n this.profileName\r\n )\r\n }\r\n\r\n public get canSaveToTaxpayer() {\r\n return !this.findExistingProfileName(\r\n this.existingTaxpayerProfiles,\r\n this.profileName\r\n )\r\n }\r\n\r\n public mounted() {\r\n if (this.existingProfile) {\r\n this.profileName = this.existingProfile.name\r\n }\r\n }\r\n\r\n public findExistingProfileName(existingProfiles: any[], profileName: string) {\r\n return existingProfiles.some((p: any) => p.name === profileName)\r\n }\r\n\r\n public get existingProfileType() {\r\n if (this.existingProfile) {\r\n return this.existingUserProfiles.some(\r\n (p: any) => p.id == this.existingProfile.id\r\n )\r\n ? \"user\"\r\n : \"taxpayer\"\r\n }\r\n return null\r\n }\r\n\r\n public saveProfile() {\r\n this.error = null\r\n if (this.edit) {\r\n if (\r\n (this.existingProfileType === \"user\" && !this.canSaveToUser) ||\r\n (this.existingProfileType === \"taxpayer\" && !this.canSaveToTaxpayer)\r\n ) {\r\n this.error = {\r\n message: this.messages.duplicate,\r\n }\r\n return\r\n }\r\n this.loading = true\r\n outputProfile\r\n .update(this.existingProfile.id, {\r\n name: this.profileName,\r\n values: JSON.stringify(this.profile),\r\n })\r\n .then((res: any) => {\r\n // Since we dont know where the profile came from\r\n this.$store.dispatch(\"user/editOutputProfile\", res)\r\n this.$store.dispatch(\"calculator/editOutputProfile\", res)\r\n this.$emit(\"update-done\", res)\r\n })\r\n .catch((error: any) => (this.error = error))\r\n .finally(() => (this.loading = false))\r\n } else {\r\n if (this.saveTaxpayer || this.saveUser) {\r\n if (this.saveUser && !this.canSaveToUser) {\r\n this.error = {\r\n message: this.messages.duplicate,\r\n }\r\n return\r\n }\r\n\r\n if (this.saveTaxpayer && !this.canSaveToTaxpayer) {\r\n this.error = {\r\n message: \"Profile name already used.\",\r\n }\r\n return\r\n }\r\n\r\n const promises: Array> = []\r\n const payload = {\r\n name: this.profileName,\r\n values: JSON.stringify(this.profile),\r\n type: this.type,\r\n }\r\n if (this.saveTaxpayer) {\r\n const taxpayerPromise = this.$store.dispatch(\r\n \"calculator/addOutputProfile\",\r\n payload\r\n )\r\n promises.push(taxpayerPromise)\r\n }\r\n if (this.saveUser) {\r\n const userPromise = this.$store.dispatch(\r\n \"user/addOutputProfile\",\r\n payload\r\n )\r\n\r\n promises.push(userPromise)\r\n }\r\n this.loading = true\r\n Promise.all(promises)\r\n .then((results: any[]) => {\r\n this.$emit(\"create-done\", results)\r\n })\r\n .catch((error: any) => (this.error = error))\r\n .finally(() => (this.loading = false))\r\n } else {\r\n this.error = {\r\n message: \"Please select save location\",\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ProfileEditor.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ProfileEditor.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./ProfileEditor.vue?vue&type=template&id=56a5dead&\"\nimport script from \"./ProfileEditor.vue?vue&type=script&lang=ts&\"\nexport * from \"./ProfileEditor.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\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\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\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\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\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\r\nimport { Component, Vue, Prop, Mixins, Watch } from \"vue-property-decorator\"\r\n// Project Imports\r\nimport { OutputProfile, ProfileType } from \"@/interfaces\"\r\nimport UserMixin from \"../../mixins/UserMixin\"\r\nimport LoadingMixin from \"../../mixins/LoadingMixin\"\r\nimport CalculatorMixin from \"../../mixins/CalculatorMixin\"\r\nimport ConfirmBoxMixin from \"../../mixins/ConfirmBoxMixin\"\r\nimport ProfileEditor from \"@/components/calculator/ProfileEditor.vue\"\r\nimport { outputProfile } from \"../../services/api\"\r\n\r\n@Component({\r\n components: { ProfileEditor },\r\n})\r\nexport default class ProfileSelector extends Mixins(\r\n CalculatorMixin,\r\n UserMixin,\r\n LoadingMixin,\r\n ConfirmBoxMixin\r\n) {\r\n @Prop({ required: true })\r\n public profileType!: ProfileType\r\n @Prop({ required: true })\r\n public defaultOutputProfile!: any\r\n @Prop({ required: true })\r\n public outputProfile!: any\r\n public selectedOutputProfile: OutputProfile | null = null\r\n public showProfileModal: any = {\r\n show: false,\r\n update: false,\r\n }\r\n\r\n public get userOutputProfiles(): OutputProfile[] {\r\n return this.user && this.user.output_profiles\r\n ? this.user.output_profiles.filter((profile: OutputProfile) => {\r\n if (profile.type === this.profileType) {\r\n if (this.profileType == \"CO\" && this.activeTaxpayer) {\r\n const values = JSON.parse(profile.values)\r\n return (\r\n values.taxpayer && values.taxpayer == this.activeTaxpayer.id\r\n )\r\n }\r\n return true\r\n }\r\n return false\r\n })\r\n : []\r\n }\r\n\r\n public get taxpayerOutputProfiles(): OutputProfile[] {\r\n return this.activeTaxpayer && this.activeTaxpayer.output_profiles\r\n ? this.activeTaxpayer.output_profiles.filter(\r\n (profile: OutputProfile) => profile.type === this.profileType\r\n )\r\n : []\r\n }\r\n\r\n public get userOutputProfileOptions() {\r\n return this.userOutputProfiles.length > 0\r\n ? this.userOutputProfiles.map((profile: any) => {\r\n return { text: profile.name, value: profile }\r\n })\r\n : [{ text: \"No User Profiles\", value: null, disabled: true }]\r\n }\r\n\r\n public get taxpayerOutputProfileOptions() {\r\n return this.taxpayerOutputProfiles.length > 0\r\n ? this.taxpayerOutputProfiles.map((profile: any) => {\r\n return { text: profile.name, value: profile }\r\n })\r\n : [{ text: \"No Taxpayer Profiles\", value: null, disabled: true }]\r\n }\r\n\r\n @Watch(\"selectedOutputProfile\")\r\n public selectedOutputProfileChange() {\r\n if (this.selectedOutputProfile) {\r\n const newProfile = Object.assign(\r\n this.outputProfile,\r\n JSON.parse(this.selectedOutputProfile.values)\r\n )\r\n this.$emit(\"update:outputProfile\", newProfile)\r\n this.$emit(\"calc-output-change\", \"profileSet\")\r\n } else {\r\n const newProfile = { ...this.defaultOutputProfile }\r\n this.$emit(\"update:outputProfile\", newProfile)\r\n this.$emit(\"defaultSet\")\r\n this.$emit(\"calc-output-change\", \"defaultSet\")\r\n }\r\n }\r\n\r\n public profileCreated(newProfiles: any[]) {\r\n this.showProfileModal.show = false\r\n if (newProfiles.length > 0) {\r\n const profile: OutputProfile = newProfiles[0]\r\n let index = this.taxpayerOutputProfileOptions.findIndex(\r\n opt => opt.value.id == profile.id\r\n )\r\n if (index >= 0) {\r\n this.selectedOutputProfile = this.taxpayerOutputProfileOptions[\r\n index\r\n ].value\r\n return\r\n }\r\n index = this.userOutputProfileOptions.findIndex(\r\n opt => opt.value.id == profile.id\r\n )\r\n if (index >= 0) {\r\n this.selectedOutputProfile = this.userOutputProfileOptions[index].value\r\n return\r\n }\r\n }\r\n }\r\n\r\n public updateProfile() {\r\n if (this.selectedOutputProfile) {\r\n this.loading = true\r\n outputProfile\r\n .update(this.selectedOutputProfile.id as string, {\r\n name: this.selectedOutputProfile.name,\r\n values: JSON.stringify(this.outputProfile),\r\n })\r\n .then((res: any) => {\r\n // Since we dont know where the profile came from\r\n this.$store.dispatch(\"user/editOutputProfile\", res)\r\n this.$store.dispatch(\"calculator/editOutputProfile\", res)\r\n })\r\n .catch((error: any) => (this.error = error))\r\n .finally(() => (this.loading = false))\r\n }\r\n }\r\n\r\n public async deleteProfile() {\r\n if (this.selectedOutputProfile) {\r\n const deleteFA = await this.confirmBox(\r\n `Delete '${this.selectedOutputProfile.name}' profile?`,\r\n this.deleteOptions\r\n )\r\n if (deleteFA) {\r\n this.loading = true\r\n outputProfile\r\n .destroy(this.selectedOutputProfile.id as string)\r\n .then((res: any) => {\r\n // Since we dont know where the profile came from\r\n this.$store.dispatch(\"user/deleteOutputProfile\", res.id)\r\n this.$store.dispatch(\"calculator/deleteOutputProfile\", res.id)\r\n this.selectedOutputProfile = null\r\n })\r\n .catch((error: any) => (this.error = error))\r\n .finally(() => (this.loading = false))\r\n }\r\n }\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ProfileSelector.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ProfileSelector.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./ProfileSelector.vue?vue&type=template&id=7a88b43a&scoped=true&\"\nimport script from \"./ProfileSelector.vue?vue&type=script&lang=ts&\"\nexport * from \"./ProfileSelector.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./ProfileSelector.vue?vue&type=style&index=0&id=7a88b43a&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"7a88b43a\",\n null\n \n)\n\nexport default component.exports","\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\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\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\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\n\n\n\n\n\n\n\n\n\r\nimport { Component, Vue, Prop, Mixins, Watch } from \"vue-property-decorator\"\r\nimport dateFns from \"date-fns\"\r\nimport { unformat } from \"accounting\"\r\n// Project Imports\r\nimport ModalButton from \"@/components/utils/ModalButton.vue\"\r\nimport PDFMixin from \"../../mixins/PDFMixin\"\r\nimport { Taxpayer } from \"../../interfaces\"\r\nimport StringsMixin from \"../../mixins/StringsMixin\"\r\nimport FAConsolidatorMixin from \"../../mixins/FAConsolidatorMixin\"\r\nimport { FADefaultProfile } from \"./FAConsolidator.config\"\r\nimport FAConsolidatorSettings from \"./FAConsolidatorSettings.vue\"\r\nimport ProfileSelector from \"@/components/calculator/ProfileSelector.vue\"\r\nimport { formatOutputMoney } from \"@/util/formatMoney\"\r\n\r\n@Component({\r\n components: { ModalButton, FAConsolidatorSettings, ProfileSelector },\r\n})\r\nexport default class FAConsolidatorOutput extends Mixins(\r\n PDFMixin,\r\n StringsMixin,\r\n FAConsolidatorMixin\r\n) {\r\n @Prop({\r\n required: true,\r\n })\r\n public tableFields!: any[]\r\n @Prop({\r\n required: true,\r\n })\r\n public tableItems!: any[]\r\n @Prop({\r\n required: true,\r\n })\r\n public taxpayer!: Taxpayer\r\n @Prop({\r\n required: true,\r\n })\r\n public consolidatorDate!: Date\r\n // Receiving the consolidating function as a Prop to avoid repeated code\r\n @Prop({\r\n required: true,\r\n })\r\n public totalConsolidator!: (items: any[]) => any[]\r\n\r\n @Prop({\r\n required: true,\r\n })\r\n public FAConsolidatorProfile!: any\r\n\r\n @Prop({\r\n default: () => {\r\n return {\r\n key: \"\",\r\n desc: false,\r\n }\r\n },\r\n })\r\n public headerSort!: any\r\n @Prop({\r\n required: true,\r\n })\r\n public disabled!: boolean\r\n\r\n public showSettingsModal: boolean = false\r\n\r\n public buttonProps: any = {\r\n size: \"sm\",\r\n class: \"float-right\",\r\n variant: \"primary\",\r\n style: {\r\n width: \"100%\",\r\n },\r\n }\r\n\r\n public modalProps: any = {\r\n size: \"xxxl\",\r\n \"modal-class\": \"modal-fullscreen\",\r\n title: `Export Consolidator - ${this.consolidatorDate}`,\r\n \"hide-footer\": true,\r\n }\r\n\r\n public tableProps: any = {\r\n fixed: true,\r\n small: true,\r\n // bordered: true,\r\n style: \"font-size: 0.9rem\",\r\n striped: true,\r\n }\r\n\r\n public defaultOutputProfile: any = JSON.parse(\r\n JSON.stringify(FADefaultProfile)\r\n )\r\n public outputProfile: any = JSON.parse(\r\n JSON.stringify(this.defaultOutputProfile)\r\n )\r\n\r\n // Necessary to re-order the FAs\r\n public faList: any = []\r\n\r\n public get sortBy() {\r\n if (this.outputProfile.sortBy.headers) {\r\n return this.outputProfile.headerSort.key\r\n }\r\n return \"\"\r\n }\r\n\r\n public get sortDesc() {\r\n if (this.outputProfile.sortBy.headers) {\r\n return this.outputProfile.headerSort.desc\r\n }\r\n return false\r\n }\r\n\r\n public get _tableFields() {\r\n const baseTdClass = \"text-center\"\r\n const newTableItems = this.tableFields\r\n .map(field => {\r\n const newField = { ...field }\r\n const { reporting_currency, type } = newField\r\n // Remove and add all the necessary fields\r\n delete newField.sortable\r\n delete newField.stickyColumn\r\n newField.thClass = \"text-center\"\r\n newField.tdClass = \"text-center\"\r\n\r\n // Highlight negative values as red\r\n if (type == \"surplus\") {\r\n newField.formatter = this.formatter\r\n newField.tdClass = (value: any, key: any, item: any) => {\r\n const numberValue = unformat(value)\r\n if (numberValue < 0) {\r\n return baseTdClass + \" text-danger\"\r\n }\r\n return baseTdClass\r\n }\r\n }\r\n return newField\r\n })\r\n .filter(item => {\r\n return this.filterHeaders(item, this.outputProfile)\r\n })\r\n\r\n if (this.outputProfile.showRowNumber) {\r\n newTableItems.unshift({\r\n key: \"index\",\r\n label: \"\",\r\n tdClass: \"text-center\",\r\n thStyle: \"width: 20px\",\r\n })\r\n }\r\n\r\n return newTableItems\r\n }\r\n\r\n public get _tableItems() {\r\n return (this.outputProfile.sortBy.fa ? this.faList : this.tableItems)\r\n .map((item: any) => {\r\n const newItem = { ...item }\r\n const { reporting_currency } = newItem\r\n // Remove and add all the necessary fields\r\n if (reporting_currency) {\r\n newItem.reporting_currency =\r\n reporting_currency.rateOverride ||\r\n reporting_currency.bocRate ||\r\n \"N/A\"\r\n }\r\n return newItem\r\n })\r\n .filter((item: any) => {\r\n return this.filterFA(item, this.outputProfile)\r\n })\r\n }\r\n\r\n public get totalTableFields() {\r\n return this._tableFields.filter(field => {\r\n return field.type == \"surplus\"\r\n })\r\n }\r\n\r\n public get consolidatedTotal() {\r\n return this.totalConsolidator(this._tableItems)\r\n }\r\n\r\n public modalChange(show: boolean) {\r\n if (show) {\r\n if (this.FAConsolidatorProfile.applyFilters) {\r\n this.outputProfile = JSON.parse(\r\n JSON.stringify(this.FAConsolidatorProfile)\r\n )\r\n } else {\r\n this.outputProfile = JSON.parse(\r\n JSON.stringify(this.defaultOutputProfile)\r\n )\r\n this.outputProfile = {\r\n ...this.outputProfile,\r\n headerSort: this.headerSort,\r\n sortBy: {\r\n headers: true,\r\n fa: false,\r\n },\r\n }\r\n }\r\n this.setupProfile()\r\n }\r\n }\r\n\r\n public setupProfile() {\r\n this.setUpConfig(this.taxpayer.foreign_affiliates, this.outputProfile)\r\n this.faList = [...this.tableItems]\r\n this.faList = this.reorderFAs(this.faList, this.outputProfile)\r\n }\r\n\r\n public formatter(value: string, evt: any) {\r\n const formatted = formatOutputMoney(value)\r\n return formatted\r\n }\r\n\r\n public printPdf() {\r\n this.pdf = this.createjsPdfInstance({\r\n orientation: \"l\",\r\n format: \"a4\",\r\n unit: \"mm\",\r\n })\r\n\r\n const tableConfig = {\r\n theme: \"plain\",\r\n styles: {\r\n font: \"helvetica\",\r\n cellPadding: 1,\r\n },\r\n headStyles: {\r\n fontSize: 7,\r\n cellPadding: 1,\r\n lineWidth: 0.2,\r\n halign: \"center\",\r\n },\r\n bodyStyles: {\r\n fontSize: 5,\r\n lineWidth: 0,\r\n overflow: \"linebreak\",\r\n halign: \"center\",\r\n },\r\n alternateRowStyles: {\r\n fillColor: 240,\r\n },\r\n margin: {\r\n top: 50,\r\n },\r\n columnStyles: {},\r\n }\r\n\r\n // Make the name column fixed width\r\n const nameColIndex = this._tableFields.findIndex(f => f.key == \"name\")\r\n tableConfig.columnStyles = {\r\n ...tableConfig.columnStyles,\r\n [nameColIndex]: {\r\n cellWidth: 30,\r\n },\r\n }\r\n\r\n const willDrawCell = (data: any) => {\r\n const classes = data.cell.raw.getAttribute(\"class\")\r\n\r\n // Style table based on cell classes\r\n if (classes) {\r\n if (classes.includes(\"bold\")) {\r\n this.pdf.setFontStyle(\"bold\")\r\n }\r\n if (classes.includes(\"primary\")) {\r\n this.pdf.setTextColor(0, 51, 141)\r\n }\r\n if (classes.includes(\"danger\")) {\r\n this.pdf.setTextColor(255, 0, 0)\r\n }\r\n }\r\n }\r\n const didParseCell = (data: any) => {\r\n const classes = data.cell.raw.getAttribute(\"class\")\r\n }\r\n\r\n // Total Surplus\r\n const consolidatorTotalSource = document.getElementById(\r\n \"consolidator-total\"\r\n ) as HTMLTableElement\r\n if (consolidatorTotalSource) {\r\n const newSource = consolidatorTotalSource.cloneNode(true)\r\n // @ts-ignore\r\n this.pdf.autoTable({\r\n html: newSource,\r\n ...tableConfig,\r\n columnStyles: null,\r\n didParseCell,\r\n willDrawCell,\r\n })\r\n }\r\n\r\n // Consolidated FAs\r\n // Keep track of page for didDrawPage hook\r\n let curPage = 0\r\n const consolidatorOutputSource = document.getElementById(\r\n \"consolidator-output\"\r\n ) as HTMLTableElement\r\n if (consolidatorOutputSource) {\r\n const newSource = consolidatorOutputSource.cloneNode(true)\r\n // @ts-ignore\r\n this.pdf.autoTable({\r\n html: newSource,\r\n ...tableConfig,\r\n didParseCell,\r\n willDrawCell,\r\n didDrawPage: (data: any) => {\r\n if (this.pdf.internal.getCurrentPageInfo().pageNumber !== curPage) {\r\n const leftMargin = data.settings.margin.left\r\n const rightMargin = data.settings.margin.right\r\n // Header\r\n const taxpayerNameString = `Canadian Taxpayer: ${\r\n this.taxpayer.name\r\n }`\r\n const currencyString = `Presentation Currency: ${\r\n this.taxpayer.reporting_currency\r\n }`\r\n const consolidatorDateString = `Consolidation Date: ${\r\n this.consolidatorDate\r\n }`\r\n\r\n this.pdf.setFontSize(13)\r\n this.pdf.text(taxpayerNameString, leftMargin, 28)\r\n this.pdf.setFontSize(10)\r\n this.pdf.text(currencyString, leftMargin, 32)\r\n this.pdf.text(consolidatorDateString, leftMargin, 36)\r\n this.pdf.setFontSize(6)\r\n this.pdf.text(\r\n this.strings[\"CONSOLIDATOR_DATE_MESSAGE\"],\r\n leftMargin,\r\n 40\r\n )\r\n this.addLogo(leftMargin - 1, 8)\r\n if (this.outputProfile.draft !== \"no-draft\") {\r\n this.addDraftBlurb(rightMargin, this.outputProfile.draft)\r\n }\r\n // Footer\r\n this.pdf.setFontSize(10)\r\n const pageString = `Page ${\r\n this.pdf.internal.getCurrentPageInfo().pageNumber\r\n }`\r\n const fontSize =\r\n this.pdf.internal.getFontSize() / this.pdf.internal.scaleFactor\r\n const footerMargin =\r\n this.pdf.internal.pageSize.width -\r\n data.settings.margin.right -\r\n fontSize * this.pdf.getStringUnitWidth(pageString)\r\n\r\n this.pdf.text(\r\n pageString,\r\n footerMargin,\r\n this.pdf.internal.pageSize.height - 8\r\n )\r\n\r\n // Disclaimer\r\n this.pdf.setFontSize(6)\r\n const wordBreak = 250\r\n const disclaimerText = this.pdf.splitTextToSize(\r\n this.strings[\"OUTPUT_DISCLAIMER\"],\r\n wordBreak\r\n )\r\n this.pdf.text(\r\n disclaimerText,\r\n data.settings.margin.left,\r\n this.pdf.internal.pageSize.height - 12\r\n )\r\n // Increase page to avoid redrawing\r\n curPage++\r\n }\r\n },\r\n })\r\n\r\n // Save PDF\r\n const pdfName = `${this.taxpayer.name} - Consolidator.pdf`\r\n\r\n this.pdf\r\n .save(pdfName, { returnPromise: true })\r\n .then((data: any) => {\r\n this.$bvToast.toast(`${pdfName} download succesful.`, {\r\n title: \"Export\",\r\n variant: \"success\",\r\n autoHideDelay: 5000,\r\n })\r\n })\r\n .catch((err: any) => {\r\n this.$bvToast.toast(`Something went wrong. Please try again.`, {\r\n title: \"Export\",\r\n variant: \"danger\",\r\n autoHideDelay: 5000,\r\n })\r\n })\r\n }\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FAConsolidatorOutput.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FAConsolidatorOutput.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./FAConsolidatorOutput.vue?vue&type=template&id=388a9c5e&scoped=true&\"\nimport script from \"./FAConsolidatorOutput.vue?vue&type=script&lang=ts&\"\nexport * from \"./FAConsolidatorOutput.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./FAConsolidatorOutput.vue?vue&type=style&index=0&id=388a9c5e&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"388a9c5e\",\n null\n \n)\n\nexport default component.exports","export default function(...args: any[]) {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n // tslint:disable-next-line\r\n console.log(...args)\r\n }\r\n}\r\n","import debug from \"./debug\"\r\n\r\ntype CallbackFunctionVariadicAnyReturn = (...args: any[]) => any\r\ninterface Subscribers {\r\n [event: string]: CallbackFunctionVariadicAnyReturn[]\r\n}\r\n\r\n/**\r\n * PubSub implementation\r\n *\r\n * Reference: https://jsmanifest.com/the-publish-subscribe-pattern-in-javascript/\r\n *\r\n * @export\r\n * @class PubSub\r\n */\r\nexport default class PubSub {\r\n private subscribers: Subscribers = {}\r\n\r\n public subscribe(\r\n eventName: string,\r\n callback: CallbackFunctionVariadicAnyReturn\r\n ) {\r\n if (!Array.isArray(this.subscribers[eventName])) {\r\n this.subscribers[eventName] = []\r\n }\r\n this.subscribers[eventName].push(callback)\r\n }\r\n\r\n public unsubscibe(\r\n eventName: string,\r\n callback: CallbackFunctionVariadicAnyReturn\r\n ) {\r\n this.subscribers[eventName] = this.subscribers[eventName].filter(cb => {\r\n // Does not include the callback in the new array\r\n if (cb === callback) {\r\n return false\r\n }\r\n return true\r\n })\r\n }\r\n\r\n protected publish(eventName: string, data: any) {\r\n if (!Array.isArray(this.subscribers[eventName])) {\r\n return\r\n }\r\n this.subscribers[eventName].forEach(callback => {\r\n try {\r\n callback(data)\r\n } catch (e) {\r\n debug(e)\r\n }\r\n })\r\n }\r\n}\r\n","import Vue from \"vue\"\r\n// Project Imports\r\nimport Calculator from \"./Calculator\"\r\nimport { CalculatorHelpers } from \"../../services/calculator/CalculatorHelpers\"\r\nimport {\r\n Taxpayer,\r\n ForeignAffiliate,\r\n ReportingPeriod,\r\n SurplusBalanceTypes,\r\n ReportingPeriodCalculation,\r\n TieringDependency,\r\n Dependency,\r\n} from \"@/interfaces\"\r\nimport { taxpayer, calculator, dividends } from \"../api\"\r\nimport debug from \"@/util/debug\"\r\nimport PubSub from \"@/util/PubSub\"\r\n\r\n/**\r\n * Object that encapsulates all the Taxpayer data, and calculates\r\n * the surplus of all of its foreign affiliates in the correct order.\r\n *\r\n * @export\r\n * @class TaxpayerCalculator\r\n */\r\nexport default class TaxpayerCalculator extends PubSub {\r\n public taxpayerId!: string | number\r\n public taxpayer!: Taxpayer\r\n public tieringDependency!: TieringDependency\r\n public reportingPeriodCalculation!: ReportingPeriodCalculation\r\n\r\n constructor(taxpayerId: string | number) {\r\n super()\r\n this.taxpayerId = taxpayerId\r\n }\r\n\r\n //#region Getters\r\n\r\n public get progress() {\r\n let p = 0\r\n if (this.taxpayer && this.tieringDependency) {\r\n const total = Object.keys(this.tieringDependency).length\r\n const complete = Object.keys(this.reportingPeriodCalculation).length\r\n p = (complete / total) * 100\r\n }\r\n return p\r\n }\r\n\r\n /**\r\n * Check that all rp ids (keys from the tieringDependency Obj) have been calculated.\r\n *\r\n * @readonly\r\n * @type {boolean}\r\n * @memberof TaxpayerCalculator\r\n */\r\n public get allReportingPeriodsCalculated(): boolean {\r\n return Object.keys(this.tieringDependency).every((id: string) =>\r\n this.hasBeenCalculated(id)\r\n )\r\n }\r\n\r\n /**\r\n * Array of the reporting periods that can be calculated based on the status of the Taxpayer calculation.\r\n *\r\n * @readonly\r\n * @type {Array}\r\n * @memberof TaxpayerCalculator\r\n */\r\n public get calculableReportingPeriods(): Array {\r\n const rpIds: Array = []\r\n Object.keys(this.tieringDependency).forEach((rpId: string) => {\r\n // Omit the already calculated ones\r\n if (this.hasBeenCalculated(rpId)) {\r\n return\r\n }\r\n const { depends_on, previous_rp } = this.tieringDependency[rpId]\r\n if (\r\n depends_on.every((id: number) => this.hasBeenCalculated(id)) &&\r\n (previous_rp ? this.hasBeenCalculated(previous_rp) : true)\r\n ) {\r\n rpIds.push(rpId)\r\n }\r\n })\r\n return rpIds\r\n }\r\n\r\n public get incalculableReportingPeriods(): Array {\r\n const rpIds: Array = []\r\n Object.keys(this.tieringDependency).forEach((rpId: string) => {\r\n // Omit the already calculated ones\r\n if (this.hasBeenCalculated(rpId)) {\r\n return\r\n }\r\n if (this.remainingDependencies(rpId).length > 0) {\r\n rpIds.push(rpId)\r\n }\r\n })\r\n return rpIds\r\n }\r\n\r\n //#endregion\r\n\r\n //#region Methods\r\n\r\n /**\r\n * Returns the remaining dependencies for the passed reportingPeriodId.\r\n *\r\n * @param {(string | number)} reportingPeriodId\r\n * @returns {(Array)}\r\n * @memberof TaxpayerCalculator\r\n */\r\n public remainingDependencies(\r\n reportingPeriodId: string | number\r\n ): Array {\r\n const dependencies = this.tieringDependency[reportingPeriodId]\r\n const remaining: Array = []\r\n\r\n if (this.hasBeenCalculated(reportingPeriodId)) {\r\n return []\r\n }\r\n\r\n if (!this.hasBeenCalculated(dependencies.previous_rp)) {\r\n remaining.push(dependencies.previous_rp)\r\n }\r\n\r\n dependencies.depends_on.forEach((rpId: string | number) => {\r\n if (!this.hasBeenCalculated(rpId)) {\r\n remaining.push(rpId)\r\n }\r\n })\r\n\r\n return remaining\r\n }\r\n\r\n /**\r\n * Checks that the Reporting Period has already been calculated.\r\n *\r\n * @param {(string | number)} reportingPeriodId\r\n * @returns {boolean}\r\n * @memberof TaxpayerCalculator\r\n */\r\n public hasBeenCalculated(reportingPeriodId: string | number): boolean {\r\n return this.reportingPeriodCalculation[reportingPeriodId] != undefined\r\n }\r\n\r\n /**\r\n * Get the Foreign Affiliate from the Reporting Period Id.\r\n *\r\n * @param {(string | number)} reportingPeriodId\r\n * @returns {ForeignAffiliate}\r\n * @memberof TaxpayerCalculator\r\n */\r\n public getForeignAffiliate(\r\n reportingPeriodId: string | number\r\n ): ForeignAffiliate {\r\n return this.taxpayer.foreign_affiliates.find((fa: ForeignAffiliate) => {\r\n return fa.reporting_periods.some(\r\n (rp: ReportingPeriod) => rp.id == reportingPeriodId\r\n )\r\n })\r\n }\r\n\r\n /**\r\n * Calculates a reporting period, given that all of its dependencies have been calculated.\r\n * Stores the result of the calculation in a global variable (reportingPeriodCalculation).\r\n *\r\n * @param {(number | string)} reportingPeriodId\r\n * @memberof TaxpayerCalculator\r\n */\r\n public async calculateReportingPeriod(reportingPeriodId: number | string) {\r\n const foreignAffiliate = this.getForeignAffiliate(reportingPeriodId)\r\n // Check that we haven't already calculated this reporting period\r\n if (this.hasBeenCalculated(reportingPeriodId)) {\r\n debug(\"Already calculated: \", foreignAffiliate.name, reportingPeriodId)\r\n return\r\n }\r\n const dependencies: Dependency = this.tieringDependency[reportingPeriodId]\r\n const reportingPeriod: ReportingPeriod = foreignAffiliate.reporting_periods.find(\r\n (rp: ReportingPeriod) => rp.id == reportingPeriodId\r\n ) as ReportingPeriod\r\n\r\n if (reportingPeriod && dependencies) {\r\n debug(\"Calculating...\", foreignAffiliate.name, reportingPeriodId)\r\n const { previous_rp, depends_on } = dependencies\r\n\r\n // Check that all dependent calculation have been handled.\r\n const allDependentRps: Array = [...depends_on]\r\n if (previous_rp) {\r\n allDependentRps.push(previous_rp)\r\n }\r\n\r\n // If not all the depending rps have been calculated then we can't calculate this one\r\n if (\r\n !allDependentRps.every((rpId: string | number) =>\r\n this.hasBeenCalculated(rpId)\r\n )\r\n ) {\r\n return\r\n } else if (depends_on.length > 0) {\r\n // If we had 'depends_on' we need to fetch the data that would've been push by the dependent RP\r\n debug(\"Pull dividend data\")\r\n try {\r\n reportingPeriod.dividends = await dividends.get(reportingPeriodId)\r\n } catch (e) {\r\n // tslint:disable-next-line\r\n console.error(e)\r\n throw new Error(\"Could not fetch Reporting Period dividends.\")\r\n }\r\n }\r\n\r\n // Find the previous closings and SEP, if any\r\n if (previous_rp) {\r\n const previousCalculation = this.reportingPeriodCalculation[previous_rp]\r\n CalculatorHelpers.setUpOpenings(\r\n foreignAffiliate,\r\n reportingPeriod,\r\n previousCalculation\r\n )\r\n } else {\r\n CalculatorHelpers.setUpOpenings(foreignAffiliate, reportingPeriod)\r\n }\r\n\r\n // Run the calculation\r\n const calc = new Calculator(\r\n foreignAffiliate,\r\n reportingPeriod,\r\n reportingPeriod.openings as SurplusBalanceTypes\r\n )\r\n calc.calculate()\r\n Vue.set(reportingPeriod, \"calculator\", calc)\r\n Vue.set(reportingPeriod, \"closings\", calc.closingBalances)\r\n\r\n // Push values to backend\r\n try {\r\n const payload = {\r\n values: [CalculatorHelpers.createCalculatedValues(reportingPeriod)],\r\n }\r\n await calculator.saveBulkValues(reportingPeriodId, payload)\r\n // Save the closing balances\r\n debug(\"Saved...\", foreignAffiliate.name, reportingPeriodId)\r\n this.reportingPeriodCalculation[reportingPeriod.id as string] = calc\r\n this.publish(\"progress-update\", this.progress)\r\n } catch (e) {\r\n // tslint:disable-next-line\r\n console.error(e)\r\n throw new Error(\"Could not save Reporting Period calculated values.\")\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Executes the calculation of the Taxpayer as a whole, taking into consideration the order in which they need to be calculated due to dependecies.\r\n *\r\n * @memberof TaxpayerCalculator\r\n */\r\n public async calculate() {\r\n // Set uo init values\r\n this.reportingPeriodCalculation = {}\r\n // Fetch the data\r\n this.updateStatus(\"Fetching data...\")\r\n try {\r\n this.taxpayer = (await taxpayer.get(this.taxpayerId, {\r\n includes: \"fa,reporting_period\",\r\n })) as Taxpayer\r\n this.tieringDependency = (await taxpayer.tiering(\r\n this.taxpayerId\r\n )) as TieringDependency\r\n } catch (e) {\r\n // tslint:disable-next-line\r\n console.error(e)\r\n throw new Error(\"Could not fetch Taxpayer data.\")\r\n }\r\n\r\n debug(`Data fetched`)\r\n // Accrue all field values\r\n this.taxpayer.foreign_affiliates.forEach((fa: ForeignAffiliate) =>\r\n CalculatorHelpers.accrueFields(fa)\r\n )\r\n\r\n const whileThreshold = 500\r\n let iteration = 0\r\n // We can only calculate the periods that have no dependency or their their depedencies have already been calculated.\r\n // With every iteration, there should be new RPs to calculate.\r\n this.updateStatus(\"Calculating...\")\r\n while (!this.allReportingPeriodsCalculated && iteration < whileThreshold) {\r\n debug(\"Count: \", iteration)\r\n // calculableReportingPeriods updates with the left over calculable RPs. Copy to avoid issues with the getter\r\n const copyCalculableReportingPeriods = Object.assign(\r\n [],\r\n this.calculableReportingPeriods\r\n )\r\n // Calculate all the ones that can be calculated\r\n if (copyCalculableReportingPeriods.length > 0) {\r\n for (const reportingPeriodId of copyCalculableReportingPeriods) {\r\n await this.calculateReportingPeriod(reportingPeriodId)\r\n }\r\n } else {\r\n // tslint:disable-next-line\r\n console.error(\"MUTUAL DEPENDENCY\")\r\n // TODO: Since there are no calculableRps, and not all RPs are calculated, there must be some incalculable RPs due to mutual dependency.\r\n debug(\"MUTUAL DEPENDENCY!\")\r\n this.incalculableReportingPeriods.forEach((rpId: string | number) => {\r\n debug(`RP ${rpId} depends on ${this.remainingDependencies(rpId)}`)\r\n })\r\n break\r\n }\r\n iteration++\r\n }\r\n this.updateStatus(\"Calculation Completed\")\r\n return\r\n }\r\n\r\n //#region Helpers\r\n\r\n public updateStatus(statusMessage: string) {\r\n this.publish(\"status-update\", statusMessage)\r\n }\r\n\r\n //#endregion\r\n\r\n //#endregion\r\n}\r\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\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\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\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\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\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\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\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\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\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\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\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\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\n\n\r\nimport { Component, Vue, Prop, Watch } from \"vue-property-decorator\"\r\nimport Datepicker from \"vuejs-datepicker\"\r\nimport moment from \"moment\"\r\n// Project Imports\r\nimport {\r\n ForeignAffiliate,\r\n ReportingPeriod,\r\n Taxpayer,\r\n SurplusBalanceTypes,\r\n BalanceSnapshot,\r\n} from \"../../interfaces\"\r\nimport dateFns from \"date-fns\"\r\nimport { getDate } from \"../../util/getDate\"\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport UserMixin from \"../../mixins/UserMixin\"\r\nimport CalculatorMixin from \"../../mixins/CalculatorMixin\"\r\nimport { fx } from \"../../services/api\"\r\nimport StringsMixin from \"../../mixins/StringsMixin\"\r\nimport LoadingMixin from \"../../mixins/LoadingMixin\"\r\nimport { taxpayer, calculator } from \"@/services/api\"\r\nimport FALockdown from \"@/components/fa/FALockdown.vue\"\r\nimport FAConsolidatorOutput from \"@/components/fa/FAConsolidatorOutput.vue\"\r\nimport { CalculatorHelpers } from \"../../services/calculator/CalculatorHelpers\"\r\nimport TaxpayerCalculator from \"../../services/calculator/TaxpayerCalculator\"\r\nimport FAConsolidatorSettings from \"./FAConsolidatorSettings.vue\"\r\nimport { FADefaultProfile } from \"./FAConsolidator.config\"\r\nimport FAConsolidatorMixin from \"../../mixins/FAConsolidatorMixin\"\r\n\r\n@Component({\r\n components: {\r\n Datepicker,\r\n FALockdown,\r\n FAConsolidatorOutput,\r\n FAConsolidatorSettings,\r\n },\r\n})\r\nexport default class FAConsolidator extends mixins(\r\n UserMixin,\r\n CalculatorMixin,\r\n LoadingMixin,\r\n StringsMixin,\r\n FAConsolidatorMixin\r\n) {\r\n @Prop({ required: true })\r\n public propTaxpayer!: Taxpayer\r\n public taxpayer: Taxpayer = Object.assign({}, this.propTaxpayer)\r\n public date: string = \"\"\r\n public showPresentationCurrencyModal: boolean = false\r\n public rowItem: any = {}\r\n public disabledDates: any = {}\r\n public conversions: any = {}\r\n public taxpayerCalculatorProgress: any = {\r\n progress: 0,\r\n status: \"\",\r\n inProgress: false,\r\n }\r\n public faList: any = []\r\n public outputProfile: any = JSON.parse(JSON.stringify(FADefaultProfile))\r\n public applyFilters: boolean = true\r\n public headerSort: any = {\r\n key: \"\",\r\n desc: false,\r\n }\r\n\r\n public get datePickerConstraint() {\r\n return (\r\n this.disabledDates.to <= getDate(this.date) &&\r\n this.disabledDates.from >= getDate(this.date)\r\n )\r\n }\r\n\r\n public get fields() {\r\n let fields: any[] = [\r\n {\r\n key: \"name\",\r\n label: \"Name\",\r\n sortable: true,\r\n thClass: \"border-right\",\r\n tdClass: \"border-right\",\r\n stickyColumn: true,\r\n },\r\n {\r\n key: \"fx_currency\",\r\n label: \"Calculating Currency\",\r\n thClass: \"text-center\",\r\n tdClass: \"text-center\",\r\n headerTitle: \"Calculating Currency\",\r\n },\r\n ]\r\n if (!this.isClient) {\r\n const staffFields = [\r\n {\r\n key: \"reporting_currency\",\r\n label: \"Presentation Currency Rate\",\r\n thClass: \"text-center\",\r\n tdClass: \"text-center\",\r\n headerTitle: \"Presentation Currency Rate\",\r\n },\r\n {\r\n key: \"sep_percentage\",\r\n label: \"SEP\",\r\n headerTitle: \"SEP\",\r\n sortable: true,\r\n thClass: \"text-center\",\r\n tdClass: \"text-center\",\r\n formatter: this.formatterDecimal2,\r\n },\r\n {\r\n key: \"exempt_surplus\",\r\n label: \"Exempt Surplus/(Deficit)\",\r\n headerTitle: \"Exempt Surplus/(Deficit)\",\r\n thClass: \"text-center\",\r\n tdClass: \"text-center\",\r\n sortable: true,\r\n formatter: this.formatter,\r\n type: \"surplus\",\r\n },\r\n {\r\n key: \"hybrid_surplus\",\r\n label: \"Hybrid Surplus/(Deficit)\",\r\n thClass: \"text-center\",\r\n tdClass: \"text-center\",\r\n headerTitle: \"Hybrid Surplus/(Deficit)\",\r\n sortable: true,\r\n formatter: this.formatter,\r\n type: \"surplus\",\r\n },\r\n {\r\n key: \"taxable_surplus\",\r\n label: \"Taxable Surplus/(Deficit)\",\r\n thClass: \"text-center\",\r\n tdClass: \"text-center\",\r\n headerTitle: \"Taxable Surplus/(Deficit)\",\r\n formatter: this.formatter,\r\n sortable: true,\r\n type: \"surplus\",\r\n },\r\n {\r\n key: \"net_surplus\",\r\n label: \"Net Surplus/(Deficit)\",\r\n headerTitle: \"Net Surplus/(Deficit)\",\r\n thClass: \"text-center\",\r\n tdClass: \"text-center\",\r\n formatter: this.formatter,\r\n sortable: true,\r\n type: \"surplus\",\r\n },\r\n {\r\n key: \"hybrid_underlying_tax\",\r\n label: \"Hybrid Underlying Tax\",\r\n headerTitle: \"Hybrid Underlying Tax\",\r\n thClass: \"text-center\",\r\n tdClass: \"text-center\",\r\n formatter: this.formatter,\r\n sortable: true,\r\n type: \"surplus\",\r\n },\r\n {\r\n key: \"underlying_foreign_tax\",\r\n label: \"Underlying Foreign Tax\",\r\n thClass: \"text-center\",\r\n tdClass: \"text-center\",\r\n formatter: this.formatter,\r\n sortable: true,\r\n headerTitle: \"Underlying Foreign Tax\",\r\n type: \"surplus\",\r\n },\r\n {\r\n key: \"acb_balance\",\r\n label: \"ACB\",\r\n thClass: \"text-center\",\r\n tdClass: \"text-center\",\r\n formatter: this.formatter,\r\n sortable: true,\r\n headerTitle: \"ACB\",\r\n type: \"surplus\",\r\n },\r\n ]\r\n fields = fields.concat(staffFields)\r\n }\r\n\r\n return fields\r\n }\r\n\r\n public get allForeignAffiliates(): any[] {\r\n const items: any[] = []\r\n // Want to only display the endings that are prior to the selected date\r\n this.taxpayer.foreign_affiliates.forEach((fa: ForeignAffiliate) => {\r\n const { name, reporting_surplus_currency, id } = fa\r\n const currencyForDate = this.conversions[\r\n dateFns.format(this.date, \"YYYY-MM-DD\")\r\n ]\r\n\r\n let bocRate: number | null = null\r\n\r\n let item: any = {\r\n fa,\r\n name,\r\n id,\r\n fx_currency: reporting_surplus_currency,\r\n calculated: false,\r\n }\r\n if (fa.reporting_periods.length > 0) {\r\n // Order periods by date\r\n const periodsInOrder = fa.reporting_periods.sort(\r\n (a: ReportingPeriod, b: ReportingPeriod) =>\r\n getDate(a.start_date).getTime() - getDate(b.start_date).getTime()\r\n )\r\n if (this.date) {\r\n const latestReportingPeriods = periodsInOrder.filter(\r\n (rp: ReportingPeriod) => {\r\n return (\r\n getDate(rp.start_date).getTime() <=\r\n getDate(dateFns.format(this.date, \"YYYY-MM-DD\")).getTime()\r\n )\r\n }\r\n )\r\n const latestRP =\r\n latestReportingPeriods.length > 0\r\n ? latestReportingPeriods[latestReportingPeriods.length - 1]\r\n : periodsInOrder[0]\r\n\r\n const { start_date, end_date } = latestRP\r\n // if we have calculated values for this reporting period then we wanna use those to display\r\n if (latestRP.calculated_value) {\r\n item.calculated = true\r\n const currentDate = getDate(this.date)\r\n const { balance_snapshots } = latestRP.calculated_value\r\n // Fetch the used currency for this period\r\n // As per Nadia email (RE: FX for taxation year - Documentation):\r\n // \"there should be a line (as there is in the excel version) indicating for each year which currency is being used.\"\r\n const currency = this.usedCurrency(fa, latestRP)\r\n const fxCurrency = currency\r\n ? currency.fx_currency\r\n : item.fx_currency\r\n\r\n const fxString = `FX${fxCurrency.toUpperCase()}${this.taxpayer.reporting_currency.toUpperCase()}`\r\n if (currencyForDate && currencyForDate[fxString]) {\r\n bocRate = currencyForDate[fxString].v\r\n }\r\n\r\n // Balance snapshots is an Dict, where the key is a date in \"YYYY-MM-DD\" format.\r\n if (balance_snapshots) {\r\n const balanceSnapshots = JSON.parse(balance_snapshots)\r\n let closestDate = null\r\n // Want to find the closest lower/equal date to the selected one by the user.\r\n Object.keys(balanceSnapshots)\r\n .map(date => getDate(date))\r\n .sort((a: Date, b: Date) => a.getTime() - b.getTime())\r\n .forEach((date: Date) => {\r\n // If date is lesser or equal, use this balance date\r\n if (date.getTime() <= currentDate.getTime()) {\r\n closestDate = date\r\n } else {\r\n return\r\n }\r\n })\r\n\r\n /* If we find one (which should always be the case since we always capture the balance\r\n * at opening/closing), we can use that snapshot as the balance in the consolidator\r\n */\r\n if (closestDate) {\r\n const balance: BalanceSnapshot =\r\n balanceSnapshots[dateFns.format(closestDate, \"YYYY-MM-DD\")]\r\n item = {\r\n ...item,\r\n fx_currency: fxCurrency,\r\n exempt_surplus: balance.exemptBalance,\r\n hybrid_surplus: balance.hybridBalance,\r\n hybrid_underlying_tax: balance.hutBalance,\r\n taxable_surplus: balance.taxableBalance,\r\n underlying_foreign_tax: balance.uftBalance,\r\n sep_percentage: balance.sep,\r\n acb_balance: balance.acbBalance,\r\n start_date,\r\n end_date,\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n /* If there are no reporting periods or there is no calculated values,\r\n * use the opening as the consol amount.\r\n */\r\n if (!item.calculated) {\r\n const exempt_surplus = fa.exempt_surplus_opening_balance\r\n const hybrid_surplus = fa.hybrid_surplus_opening_balance\r\n const hybrid_underlying_tax = fa.hybrid_underlying_tax_opening_balance\r\n const sep_percentage = fa.opening_sep\r\n const taxable_surplus = fa.taxable_surplus_opening_balance\r\n const underlying_foreign_tax = fa.underlying_foreign_tax_opening_balance\r\n const acb_balance = fa.acb_opening_balance\r\n const start_date = fa.first_year_begins\r\n const end_date = fa.first_year_begins\r\n\r\n item = {\r\n ...item,\r\n exempt_surplus,\r\n hybrid_surplus,\r\n taxable_surplus,\r\n hybrid_underlying_tax,\r\n sep_percentage,\r\n underlying_foreign_tax,\r\n acb_balance,\r\n start_date,\r\n end_date,\r\n }\r\n }\r\n\r\n // Set the currency\r\n let rateOverride = null\r\n if (fa.reporting_rate) {\r\n rateOverride = fa.reporting_rate\r\n }\r\n\r\n const reportingCurrency = {\r\n currency: this.taxpayer.reporting_currency,\r\n bocRate,\r\n rateOverride,\r\n }\r\n item.reporting_currency = reportingCurrency\r\n\r\n // Multiply by used rate\r\n const rate = rateOverride || bocRate\r\n item.exempt_surplus *= rate || 1\r\n item.hybrid_surplus *= rate || 1\r\n item.taxable_surplus *= rate || 1\r\n item.hybrid_underlying_tax *= rate || 1\r\n item.underlying_foreign_tax *= rate || 1\r\n item.acb_balance *= rate || 1\r\n\r\n // Need to normalize the balances\r\n const sepMultiplier = item.sep_percentage / 100\r\n item.exempt_surplus *= sepMultiplier\r\n item.hybrid_surplus *= sepMultiplier\r\n item.taxable_surplus *= sepMultiplier\r\n item.hybrid_underlying_tax *= sepMultiplier\r\n item.underlying_foreign_tax *= sepMultiplier\r\n\r\n item.net_surplus =\r\n item.exempt_surplus + item.hybrid_surplus + item.taxable_surplus\r\n\r\n items.push(item)\r\n })\r\n return items\r\n }\r\n\r\n public get displayedForeignAffiliates() {\r\n if (!this.applyFilters) {\r\n return this.allForeignAffiliates\r\n } else {\r\n return (this.outputProfile.sortBy.fa\r\n ? this.faList\r\n : this.allForeignAffiliates\r\n ).filter((item: any) => {\r\n return this.filterFA(item, this.outputProfile)\r\n })\r\n }\r\n }\r\n\r\n public get displayedHeaders() {\r\n if (this.applyFilters) {\r\n return this.fields.filter((item: any) => {\r\n return this.filterHeaders(item, this.outputProfile)\r\n })\r\n }\r\n return this.fields\r\n }\r\n\r\n public get consolidatedTotal() {\r\n return this.consolidateItemAmounts(this.displayedForeignAffiliates)\r\n }\r\n\r\n /**\r\n * Used to consolidate the output amounts for the passed items.\r\n */\r\n public consolidateItemAmounts(items: any[]): any[] {\r\n const consol: any = {\r\n exempt_surplus: 0,\r\n hybrid_surplus: 0,\r\n taxable_surplus: 0,\r\n net_surplus: 0,\r\n hybrid_underlying_tax: 0,\r\n underlying_foreign_tax: 0,\r\n acb_balance: 0,\r\n }\r\n items.forEach((item: any) => {\r\n consol.exempt_surplus += item.exempt_surplus || 0\r\n consol.hybrid_surplus += item.hybrid_surplus || 0\r\n consol.taxable_surplus += item.taxable_surplus || 0\r\n consol.net_surplus += item.net_surplus || 0\r\n consol.hybrid_underlying_tax += item.hybrid_underlying_tax || 0\r\n consol.underlying_foreign_tax += item.underlying_foreign_tax || 0\r\n consol.acb_balance += item.acb_balance || 0\r\n })\r\n return consol\r\n }\r\n\r\n public get latestReportingDate() {\r\n let latestDate: string = \"\"\r\n\r\n const foreignAffiliates = this.taxpayer.foreign_affiliates\r\n // Find the latest date amongst all fa's rps\r\n foreignAffiliates.forEach((fa: ForeignAffiliate) => {\r\n if (fa.reporting_periods.length > 0) {\r\n fa.reporting_periods.forEach((rp: ReportingPeriod) => {\r\n if (!latestDate) {\r\n latestDate = rp.end_date\r\n } else if (getDate(rp.end_date) > getDate(latestDate)) {\r\n latestDate = rp.end_date\r\n }\r\n })\r\n }\r\n })\r\n // If there are no reporting periods then the date should be the first year ends\r\n return dateFns.format(\r\n latestDate\r\n ? getDate(latestDate)\r\n : getDate(this.taxpayer.first_taxation_year_ends),\r\n \"YYYY-MM-DD\"\r\n )\r\n }\r\n\r\n public get firstReportingDate() {\r\n let earliestDate: string = \"\"\r\n\r\n const foreignAffiliates = this.taxpayer.foreign_affiliates\r\n // Find the latest date amongst all fa's rps\r\n foreignAffiliates.forEach((fa: ForeignAffiliate) => {\r\n if (fa.reporting_periods.length > 0) {\r\n fa.reporting_periods.forEach((rp: ReportingPeriod) => {\r\n if (!earliestDate) {\r\n earliestDate = rp.start_date\r\n } else if (getDate(rp.start_date) < getDate(earliestDate)) {\r\n earliestDate = rp.start_date\r\n }\r\n })\r\n }\r\n })\r\n // If there are no reporting periods then the date should be the first year ends\r\n return dateFns.format(\r\n earliestDate\r\n ? getDate(earliestDate)\r\n : getDate(this.taxpayer.first_taxation_year_begins),\r\n \"YYYY-MM-DD\"\r\n )\r\n }\r\n\r\n public get sortBy() {\r\n if (this.applyFilters) {\r\n if (this.outputProfile.sortBy.headers) {\r\n return this.outputProfile.headerSort.key\r\n } else if (this.outputProfile.sortBy.fa) {\r\n return null\r\n }\r\n }\r\n return \"\"\r\n }\r\n\r\n public get sortDesc() {\r\n if (this.applyFilters) {\r\n if (this.outputProfile.sortBy.headers) {\r\n return this.outputProfile.headerSort.desc\r\n } else if (this.outputProfile.sortBy.fa) {\r\n return false\r\n }\r\n }\r\n return false\r\n }\r\n\r\n public sortChanged(sort: any) {\r\n this.headerSort.key = sort.sortBy\r\n this.headerSort.desc = sort.sortDesc\r\n }\r\n\r\n public headerClicked(fieldName: string, field: any) {\r\n if (field.sortable) {\r\n if (this.applyFilters) {\r\n // Waiting for the header sort to change, UGLY!\r\n setTimeout(() => {\r\n this.outputProfile.headerSort.key = this.headerSort.key\r\n this.outputProfile.headerSort.desc = this.headerSort.desc\r\n this.outputProfile.sortBy.headers = true\r\n this.outputProfile.sortBy.fa = false\r\n this.settingsChange(false)\r\n }, 500)\r\n }\r\n }\r\n }\r\n\r\n public created() {\r\n this.date = dateFns.format(this.latestReportingDate, \"YYYY MM DD\")\r\n const lastDate = moment(getDate(this.date))\r\n .add(1, \"days\")\r\n .toDate()\r\n const firstDate = getDate(this.firstReportingDate)\r\n this.disabledDates = {\r\n to: firstDate,\r\n from: lastDate,\r\n }\r\n\r\n this.fetchExchangeRates()\r\n\r\n if (this.taxpayer.user_profile) {\r\n this.outputProfile = this.taxpayer.user_profile\r\n }\r\n this.applyFilters = this.outputProfile.applyFilters\r\n this.setUpConfig(this.taxpayer.foreign_affiliates, this.outputProfile)\r\n this.setUpOrderableForeignAffiliates()\r\n }\r\n\r\n public async refreshBalances() {\r\n this.loading = true\r\n // Run TaxpayerCalulator and updat UI with progress\r\n if (this.taxpayer.id) {\r\n const taxpayerCalculator = new TaxpayerCalculator(this.taxpayer.id)\r\n // Reset progress values\r\n this.taxpayerCalculatorProgress.progress = 0\r\n this.taxpayerCalculatorProgress.status = \"\"\r\n // Subscibe to update/status events\r\n taxpayerCalculator.subscribe(\"progress-update\", progress => {\r\n this.taxpayerCalculatorProgress.progress = progress\r\n })\r\n taxpayerCalculator.subscribe(\"status-update\", status => {\r\n this.taxpayerCalculatorProgress.status = status\r\n })\r\n this.taxpayerCalculatorProgress.inProgress = true\r\n await taxpayerCalculator.calculate()\r\n }\r\n\r\n // Fetch data again to refresh\r\n this.taxpayer = await taxpayer.get(\r\n this.taxpayer.id,\r\n taxpayer.reportingPeriodConsolidatorParams\r\n )\r\n this.taxpayerCalculatorProgress.inProgress = false\r\n this.loading = false\r\n return\r\n }\r\n\r\n public fetchExchangeRates() {\r\n // Get all the currencies necessary\r\n const currencies = this.taxpayer.foreign_affiliates.reduce(\r\n (acc: Set, fa: ForeignAffiliate) => {\r\n acc.add(fa.reporting_surplus_currency.toUpperCase())\r\n fa.reporting_periods.forEach((rp: ReportingPeriod) =>\r\n rp.fx_currency ? acc.add(rp.fx_currency.toUpperCase()) : null\r\n )\r\n return acc\r\n },\r\n new Set()\r\n )\r\n // Create all the conversions needed\r\n const conversions: any[] = []\r\n currencies.forEach((currency: string) => {\r\n if (this.taxpayer.reporting_currency !== currency) {\r\n conversions.push({\r\n from: currency,\r\n to: this.taxpayer.reporting_currency,\r\n })\r\n }\r\n })\r\n\r\n return fx\r\n .get({\r\n conversions,\r\n startDate: this.firstReportingDate,\r\n endDate: this.latestReportingDate,\r\n })\r\n .then((data: any) => {\r\n data.observations.forEach((obs: any) => (this.conversions[obs.d] = obs))\r\n })\r\n }\r\n\r\n public async settingsChange(value: boolean) {\r\n // When the modal is hidden\r\n if (!value) {\r\n this.outputProfile.FAOrder.order = this.faList.map(\r\n (fa: ForeignAffiliate) => {\r\n return fa.id\r\n }\r\n )\r\n this.outputProfile.applyFilters = this.applyFilters\r\n const res = await taxpayer.profile(\r\n this.taxpayer.id as number,\r\n this.outputProfile\r\n )\r\n this.taxpayer.user_profile = this.outputProfile\r\n }\r\n }\r\n\r\n public formatter(value: string, evt: any) {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n }\r\n\r\n public formatterDecimal2(value: string, evt: any) {\r\n const formatted = formatMoney(value, 2)\r\n return formatted\r\n }\r\n\r\n public formatterDecimal4(value: string, evt: any) {\r\n const formatted = formatMoney(value, 4)\r\n return formatted\r\n }\r\n\r\n public formatDateDistance(date: any) {\r\n return dateFns.distanceInWords(new Date(), new Date(date), {\r\n addSuffix: true,\r\n })\r\n }\r\n\r\n public setUpOrderableForeignAffiliates() {\r\n this.faList = [...this.allForeignAffiliates]\r\n this.faList = this.reorderFAs(this.faList, this.outputProfile)\r\n }\r\n\r\n @Watch(\"applyFilters\", { deep: true, immediate: false })\r\n public applyFiltersChange() {\r\n this.settingsChange(false) // false to simulate modal closing\r\n }\r\n\r\n @Watch(\"allForeignAffiliates\")\r\n public allForeignAffiliatesChange() {\r\n this.setUpOrderableForeignAffiliates()\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FAConsolidator.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FAConsolidator.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./FAConsolidator.vue?vue&type=template&id=6a66cc9a&scoped=true&\"\nimport script from \"./FAConsolidator.vue?vue&type=script&lang=ts&\"\nexport * from \"./FAConsolidator.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./FAConsolidator.vue?vue&type=style&index=0&id=6a66cc9a&scoped=true&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"6a66cc9a\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-form',{on:{\"submit\":_vm.handleOnSubmit}},[_c('p',[_vm._v(\"\\n Select the \"),_c('strong',[_vm._v(\"Foreign Affiliate\")]),_vm._v(\" that you would like to\\n copy.\\n \")]),_c('model-select',{staticClass:\"mb-2\",attrs:{\"options\":_vm.foreignAffiliateOptions,\"placeholder\":\"Select a Foreign Affiliate\",\"isDisabled\":_vm.loading},model:{value:(_vm.selectedForeignAffiliate),callback:function ($$v) {_vm.selectedForeignAffiliate=$$v},expression:\"selectedForeignAffiliate\"}}),_c('b-form-group',{attrs:{\"label\":\"Name of Copy\",\"description\":\"If name is not changed, 'Copy' will be added to the end of the copy of the foreign affiliates's name.\"}},[_c('b-form-input',{attrs:{\"type\":\"text\",\"name\":\"name\",\"placeholder\":_vm.selectedForeignAffiliateName,\"disabled\":!_vm.selectedForeignAffiliate || _vm.loading},on:{\"focus\":function () {\n if (!_vm.name && _vm.selectedForeignAffiliate) {\n _vm.name = _vm.selectedForeignAffiliateName\n }\n }},model:{value:(_vm.name),callback:function ($$v) {_vm.name=$$v},expression:\"name\"}})],1),_c('b-form-group',{attrs:{\"label\":\"Select Number of Copy\"}},[_c('b-form-select',{attrs:{\"options\":_vm.numberOfCopyList,\"disabled\":_vm.loading},model:{value:(_vm.numberOfCopy),callback:function ($$v) {_vm.numberOfCopy=$$v},expression:\"numberOfCopy\"}})],1),_c('b-form-checkbox',{staticClass:\"mb-2\",attrs:{\"disabled\":!_vm.selectedForeignAffiliate || _vm.loading},model:{value:(_vm.statusComplexCopy),callback:function ($$v) {_vm.statusComplexCopy=$$v},expression:\"statusComplexCopy\"}},[_vm._v(\"\\n Expand to customize certain aspects of the copy\\n \")]),(_vm.statusComplexCopy && _vm.selectedForeignAffiliate)?_c('FACopyOptions',{key:_vm.selectedForeignAffiliate,attrs:{\"selectedForeignAffiliate\":_vm.selectedForeignAffiliate,\"disabled\":!_vm.selectedForeignAffiliate || _vm.loading,\"copyAcbPeriods\":_vm.copyAcbPeriods},on:{\"selected-payload\":function($event){_vm.selectedPayload = $event},\"update:copyAcbPeriods\":function($event){_vm.copyAcbPeriods=$event},\"update:copy-acb-periods\":function($event){_vm.copyAcbPeriods=$event}}}):_vm._e(),_c('LoadingButton',{attrs:{\"data-cy\":\"tp-submit-button\",\"loading\":_vm.loading,\"disabled\":!_vm.selectedForeignAffiliate,\"spinningText\":\"Please wait as this may take awhile.\",\"text\":\"Copy Foreign Affiliate\"}}),(_vm.loading)?_c('b-progress',{staticClass:\"mt-2\",attrs:{\"max\":_vm.numberOfCopy,\"height\":\"3rem\"}},[_c('b-progress-bar',{attrs:{\"value\":_vm.currentCopy - 1,\"variant\":\"success\"}},[_c('span',[_vm._v(\"Completed: \"),_c('strong',[_vm._v(_vm._s(_vm.currentCopy - 1))])])]),_c('b-progress-bar',{attrs:{\"value\":_vm.numberOfCopy - _vm.currentCopy + 1,\"animated\":\"\"}},[_c('span',[_vm._v(\"Remaining:\\n \"),_c('strong',[_vm._v(_vm._s(_vm.numberOfCopy - _vm.currentCopy + 1))])])])],1):_vm._e()],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-card',{staticClass:\"mb-3\"},[_c('PeriodCallout',{attrs:{\"variant\":\"primary\",\"text\":\"Please note that while creating the copy of the foreign affiliate, you will not be able to see the data of the foreign affiliate that you have chosen to copy. If you would like to see the data while customizing the copy of the foreign affiliate, please open a second tab on your browser with the surplus calculation of the foreign affiliate that you have chosen to copy.\",\"icon\":\"info\",\"mb\":\"2\"}}),_c('PeriodCallout',{attrs:{\"variant\":\"secondary\",\"text\":\"Please note that this feature does not allow you to modify calculating currency. To change calculating currency, please navigate to the corresponding taxation year of the respective foreign affiliate once the copy has been completed.\",\"icon\":\"info\",\"mb\":\"2\"}}),_c('b-form-checkbox',{staticClass:\"mb-2\",attrs:{\"checked\":_vm.copyAcbPeriods},on:{\"change\":function (val) { return _vm.$emit('update:copyAcbPeriods', val); }}},[_vm._v(\"\\n Copy periods of Partnership?\\n \")]),_c('FACopyOptionsRPCard',{attrs:{\"label\":\"Modify all/remaining taxation year(s)\",\"isAll\":true,\"periodProfileEdited\":_vm.statusComplexCopyPeriodProfile,\"disabled\":_vm.reportingPeriodOptions.length === 0 || _vm.disabled},on:{\"open-modal\":function($event){return _vm.openModal($event)}}}),(_vm.statusComplexCopyPeriodProfile)?_c('PeriodCallout',{staticClass:\"mt-2\",attrs:{\"variant\":\"warning\",\"text\":\"Override multiple Period Profile has been enabled.\",\"icon\":\"warning\",\"mb\":\"2\"}}):_vm._e(),_c('hr'),_c('label',{staticClass:\"mb-0\"},[_vm._v(\"Modify a specific taxation year:\")]),_c('model-select',{staticClass:\"mb-2\",attrs:{\"options\":_vm.reportingPeriodOptions,\"placeholder\":\"Select a Taxation Year\",\"isDisabled\":_vm.disabled},model:{value:(_vm.selectedRP),callback:function ($$v) {_vm.selectedRP=$$v},expression:\"selectedRP\"}}),_vm._l((_vm.selectedRPList),function(targetRP,index){return _c('FACopyOptionsRPCard',{key:(\"\" + index),attrs:{\"label\":(\"\" + (targetRP.text)),\"reportingPeriodId\":targetRP.value,\"periodProfileEdited\":_vm.periodProfileRPIndicator(targetRP.value),\"disabled\":_vm.disabled},on:{\"open-modal\":function($event){return _vm.openModal($event)},\"delete-rp\":function($event){return _vm.deleteRPList($event)}}})}),_c('hr'),_c('b-button',{attrs:{\"size\":\"sm\",\"disabled\":_vm.disableSummaryOfChanges},on:{\"click\":function($event){_vm.showModal.FAOptionsCopySummary = true}}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"icon\":\"file-alt\"}}),_vm._v(\"\\n Summary of Changes\\n \")],1),_c('b-modal',{attrs:{\"size\":\"lg\",\"title\":\"Summary of Changes\",\"hide-footer\":\"\",\"no-close-on-backdrop\":\"\"},model:{value:(_vm.showModal.FAOptionsCopySummary),callback:function ($$v) {_vm.$set(_vm.showModal, \"FAOptionsCopySummary\", $$v)},expression:\"showModal.FAOptionsCopySummary\"}},[_c('FACopyOptionsSummary',{attrs:{\"selectedPayload\":_vm.selectedPayload}})],1),_c('b-modal',{attrs:{\"id\":\"fa_complex_copy\",\"size\":\"lg\",\"title\":\"Configure Copy Options\",\"hide-footer\":\"\",\"no-close-on-backdrop\":\"\"},model:{value:(_vm.showModal.FAComplexCopy),callback:function ($$v) {_vm.$set(_vm.showModal, \"FAComplexCopy\", $$v)},expression:\"showModal.FAComplexCopy\"}},[(_vm.selectedRPList.length > 0 && _vm.rpCardChoice === 'all')?_c('PeriodCallout',{attrs:{\"variant\":\"warning\",\"text\":\"Modifications are now being applied to remaining taxation year(s) that have not been selected. To modify all taxation year(s) instead, please delete all the specific taxation year(s) that are selected and then return to this screen.\",\"icon\":\"warning\",\"mb\":\"2\"}}):_vm._e(),_c('div',{staticClass:\"line-item mb-2\"},[_c('b-button-group',{staticClass:\"icon\",attrs:{\"size\":\"sm\"}},[_c('b-button',{attrs:{\"variant\":\"outline-secondary\",\"disabled\":_vm.disabled},on:{\"click\":function($event){return _vm.toggleMultipleSelected(true)}}},[_vm._v(\"Select All\")]),_c('b-button',{attrs:{\"variant\":\"outline-secondary\",\"disabled\":_vm.disabled},on:{\"click\":function($event){return _vm.toggleMultipleSelected(false)}}},[_vm._v(\"Unselect All\")])],1)],1),_vm._l((_vm.dataFATreeBaseTemp),function(node,index){return _c('FACopyConfiguration',{key:(\"\" + index),attrs:{\"label\":node.label,\"nodes\":node.children,\"depth\":0,\"id\":node.id,\"level\":node.level,\"settings\":node.settings,\"optionField\":node.optionField,\"parentId\":node.id,\"parentSelected\":node.selected,\"parentOptionField\":node.optionField,\"index2\":index,\"selected\":node.selected},on:{\"update:selected\":function($event){return _vm.$set(node, \"selected\", $event)}}})}),(_vm.selectedRPList.length > 0 && _vm.rpCardChoice === 'specific')?_c('span',[_c('hr'),_c('b-form-checkbox',{staticClass:\"mb-2\",attrs:{\"checked\":_vm.periodProfileModified.specific},on:{\"input\":function($event){_vm.periodProfileModified.specific = $event}}},[_vm._v(\"\\n Edit period profile?\\n \")]),(_vm.periodProfileModified.specific)?_c('FACopyBridgePeriodOptionPanel',_vm._b({attrs:{\"reportingPeriodOptionsList\":null,\"foreign_Affiliate\":_vm.foreign_affiliate,\"selectedRPIndividual\":_vm.selectedRP,\"disabled\":!_vm.periodProfileModified.specific}},'FACopyBridgePeriodOptionPanel',_vm.periodProfile,false,true)):_vm._e()],1):_c('span',[_c('b-form-checkbox',{staticClass:\"mt-2 mb-2\",attrs:{\"disabled\":_vm.disabled},model:{value:(_vm.statusComplexCopyPeriodProfile),callback:function ($$v) {_vm.statusComplexCopyPeriodProfile=$$v},expression:\"statusComplexCopyPeriodProfile\"}},[_vm._v(\"\\n Override multiple period profiles?\\n \")]),(_vm.statusComplexCopyPeriodProfile)?_c('span',[(_vm.statusComplexCopyPeriodProfile)?_c('FACopyPeriodOptionPanel',{attrs:{\"reportingPeriodOptionsList\":_vm.reportingPeriodOptionsList,\"foreign_affiliate\":_vm.foreign_affiliate,\"dataFATreePeriodProfile\":_vm.dataFATreePeriodProfile,\"disabled\":_vm.disabled,\"periodProfileMultiple\":_vm.periodProfileMultiple},on:{\"period-profile-multiple-update\":function($event){_vm.periodProfileMultiple = $event}}}):_vm._e()],1):_vm._e()],1)],2)],2)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"tree-menu\",class:_vm.depth > 0 ? \"pl-3 pr-3\" : null},[_c('div',{staticClass:\"line-item border-bottom p-1\"},[_c('b-checkbox',{attrs:{\"checked\":_vm.selected,\"disabled\":_vm.disabledCheckbox},on:{\"input\":function($event){_vm.bus({ value: $event, payload: {} }, _vm.level, _vm.id)\n _vm.updateFunction($event)}}}),_c('label',{staticClass:\"title mb-0\"},[_vm._v(\"\\n \"+_vm._s(_vm.level === \"section\" ? (_vm.id + \" - \" + _vm.label) : (\"\" + _vm.label))+\"\\n \")]),_c('div',{staticClass:\"icon\"},[(_vm.optionField)?_c('span',{directives:[{name:\"b-toggle\",rawName:\"v-b-toggle\",value:((\"collapse-option-field-\" + _vm.parentId + \"-\" + _vm.depth + \"-\" + _vm.index2)),expression:\"`collapse-option-field-${parentId}-${depth}-${index2}`\"}],staticClass:\"mr-1 option-icon-on\"},[_c('font-awesome-icon',{staticClass:\"when-opened text-info\",attrs:{\"icon\":\"list-alt\"}}),_c('font-awesome-icon',{staticClass:\"when-closed text-secondary\",attrs:{\"icon\":\"list-alt\"}}),_vm._v(\"\\n Option\\n \")],1):_vm._e(),(_vm.settings.show && _vm.nodes)?_c('label',{directives:[{name:\"b-toggle\",rawName:\"v-b-toggle\",value:((\"collapse-picker-\" + _vm.parentId + \"-\" + _vm.depth + \"-\" + _vm.index2)),expression:\"`collapse-picker-${parentId}-${depth}-${index2}`\"}],staticClass:\"expand-icon mb-0 text-primary\"},[_c('font-awesome-icon',{staticClass:\"when-closed mr-1\",attrs:{\"icon\":\"plus-circle\"}}),_c('font-awesome-icon',{staticClass:\"when-opened mr-1\",attrs:{\"icon\":\"minus-circle\"}})],1):_c('label',{staticClass:\"mb-0 text-secondary\"},[_c('font-awesome-icon',{staticClass:\"mr-1\",style:({ fillOpacity: 0.3 }),attrs:{\"icon\":\"plus-circle\"}})],1)])],1),(_vm.optionField)?_c('b-collapse',{staticClass:\"border rounded-lg m-2 pl-3 pr-3 pt-2 pb-2\",attrs:{\"id\":(\"collapse-option-field-\" + _vm.parentId + \"-\" + _vm.depth + \"-\" + _vm.index2)}},_vm._l((_vm.optionField),function(option,index){return _c('FACopyConfigurationOptionField',{key:index,attrs:{\"selectedOption\":option.selected,\"label\":option.label,\"meta_id\":option.meta_id,\"parentSelected\":_vm.selected,\"parentOptionField\":_vm.parentOptionField,\"children\":_vm.nodes,\"disabledCheckbox\":!_vm.selected,\"disabledIndeterminate\":!_vm.settings.show},on:{\"update:selectedOption\":function($event){return _vm.$set(option, \"selected\", $event)},\"update:selected-option\":function($event){return _vm.$set(option, \"selected\", $event)}}})}),1):_vm._e(),_c('span',[_c('b-collapse',{attrs:{\"id\":(\"collapse-picker-\" + _vm.parentId + \"-\" + _vm.depth + \"-\" + _vm.index2)}},_vm._l((_vm.nodes),function(node,index){return _c('FACopyConfiguration',{key:index,attrs:{\"label\":node.label,\"nodes\":node.children,\"depth\":_vm.depth + 1,\"id\":node.id,\"level\":node.level,\"settings\":node.settings,\"optionField\":node.optionField,\"parentId\":_vm.id,\"parentSelected\":_vm.selected,\"parentOptionField\":_vm.optionField,\"index2\":index,\"selected\":node.selected},on:{\"update:selected\":function($event){return _vm.$set(node, \"selected\", $event)},\"bus\":function($event){return _vm.bus($event, _vm.level, _vm.id)}}})}),1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"line-item text-secondary\"},[_c('b-checkbox',{staticClass:\"text-secondary\",attrs:{\"checked\":_vm.selectedOption,\"disabled\":_vm.disabledCheckbox,\"indeterminate\":_vm.getterCheckIndeterminate},on:{\"input\":function($event){return _vm.updateSelected($event)}}}),_vm._v(\"\\n \"+_vm._s(_vm.label)+\"\\n\")],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Watch } from \"vue-property-decorator\"\r\nimport Datepicker from \"vuejs-datepicker\"\r\nimport { mixins } from \"vue-class-component\"\r\n// Project Imports\r\nimport { TreePayload, FieldOptionField } from \"../../interfaces\"\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport LoadingButton from \"@/components/LoadingButton.vue\"\r\nimport CurrencyDropdown from \"@/components/CurrencyDropdown.vue\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\n\r\n@Component({\r\n components: {\r\n LoadingButton,\r\n CurrencyDropdown,\r\n Datepicker,\r\n ErrorAlert,\r\n },\r\n})\r\nclass FACopyConfigurationOptionField extends mixins(LoadingMixin) {\r\n @Prop()\r\n public selectedOption!: boolean\r\n @Prop()\r\n public label!: string\r\n @Prop()\r\n public meta_id!: string\r\n @Prop()\r\n public parentSelected!: boolean\r\n @Prop()\r\n public parentOptionField!: FieldOptionField[]\r\n @Prop()\r\n public children!: TreePayload[]\r\n @Prop()\r\n public disabledCheckbox!: boolean\r\n @Prop()\r\n public disabledIndeterminate!: boolean\r\n\r\n @Watch(\"parentOptionField\", { deep: true })\r\n public optionFieldToggle() {\r\n const objParentOptionField = this.parentOptionField.find(\r\n (el: FieldOptionField) => {\r\n return el.meta_id === this.meta_id\r\n }\r\n )\r\n\r\n if (\r\n this.parentSelected &&\r\n objParentOptionField &&\r\n this.selectedOption !== objParentOptionField.selected\r\n ) {\r\n this.updateSelected(objParentOptionField.selected)\r\n }\r\n }\r\n\r\n @Watch(\"parentSelected\")\r\n public toggleChildren() {\r\n this.updateSelected(this.parentSelected)\r\n }\r\n\r\n public updateSelected(event: boolean) {\r\n this.$emit(\"update:selectedOption\", event)\r\n }\r\n\r\n public grabOptionFieldsArray(children: TreePayload[]) {\r\n // console.log(this.meta_id)\r\n\r\n let childOptionFields: Array = []\r\n\r\n if (children) {\r\n childOptionFields = children.map((el: TreePayload) => {\r\n // console.log(el.level)\r\n return el.optionField\r\n })\r\n }\r\n\r\n return childOptionFields.map(\r\n (optionFieldsBranch: FieldOptionField[] | undefined) => {\r\n if (optionFieldsBranch) {\r\n return optionFieldsBranch.find((el: FieldOptionField) => {\r\n return el.meta_id === this.meta_id\r\n })\r\n }\r\n }\r\n )\r\n }\r\n\r\n public get getterCheckIndeterminate() {\r\n if (this.disabledIndeterminate) {\r\n // Turns off indeterminate when a children is disabled from view\r\n return false\r\n }\r\n\r\n if (this.selectedOption === false) {\r\n return false\r\n }\r\n\r\n // const output = this.checkIndeterminate(this.children) ||\r\n // this.recursiveCheckIndeterminate(this.children)\r\n // console.log(\"indeterminate: \", output)\r\n // console.log(\"\")\r\n\r\n // return output\r\n return (\r\n this.checkIndeterminate(this.children) ||\r\n this.recursiveCheckIndeterminate(this.children)\r\n )\r\n }\r\n\r\n public recursiveCheckIndeterminate(children: TreePayload[]) {\r\n /*\r\n Checks for indeterminate recursively for the nested children in the payload.\r\n */\r\n if (children === undefined) {\r\n return false\r\n }\r\n if (children) {\r\n const output = children.map((el: TreePayload) => {\r\n if (el.children) {\r\n return (\r\n this.checkIndeterminate(el.children) ||\r\n (this.recursiveCheckIndeterminate(el.children) || false)\r\n )\r\n } else {\r\n return false\r\n }\r\n })\r\n // console.log(output)\r\n\r\n if (output.length > 1) {\r\n // console.log(output)\r\n const isFalse = (currentVal: boolean) => currentVal === false\r\n if (output.every(Boolean) || output.every(isFalse)) {\r\n return false\r\n } else {\r\n return true\r\n }\r\n }\r\n return false\r\n } else {\r\n return false\r\n }\r\n }\r\n\r\n public checkIndeterminate(children: TreePayload[]) {\r\n /*\r\n Checks for indeterminate in the current children level\r\n */\r\n const currentOptionFieldsArray = this.grabOptionFieldsArray(children)\r\n\r\n let currentOptionFieldsBooleanArray: Array = []\r\n\r\n if (currentOptionFieldsArray.length > 0) {\r\n currentOptionFieldsBooleanArray = currentOptionFieldsArray.map(\r\n (el: FieldOptionField | undefined) => {\r\n if (el) {\r\n return el.selected\r\n }\r\n }\r\n )\r\n }\r\n\r\n const isFalse = (currentVal: boolean | undefined) => currentVal === false\r\n // console.log(currentOptionFieldsBooleanArray)\r\n\r\n // When the array has more than 1 entry\r\n if (currentOptionFieldsBooleanArray.length > 1) {\r\n if (\r\n currentOptionFieldsBooleanArray.every(Boolean) ||\r\n currentOptionFieldsBooleanArray.every(isFalse)\r\n ) {\r\n // If all true or all false.\r\n\r\n // console.log(currentOptionFieldsBooleanArray)\r\n // console.log(false)\r\n\r\n return false\r\n } else {\r\n // console.log(true)\r\n return true\r\n }\r\n }\r\n // When the array has only 1 entry\r\n if (currentOptionFieldsBooleanArray.length === 1) {\r\n return !currentOptionFieldsBooleanArray[0]\r\n }\r\n return false\r\n }\r\n}\r\nexport default FACopyConfigurationOptionField\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FACopyConfigurationOptionField.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FACopyConfigurationOptionField.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./FACopyConfigurationOptionField.vue?vue&type=template&id=62b3ba75&\"\nimport script from \"./FACopyConfigurationOptionField.vue?vue&type=script&lang=ts&\"\nexport * from \"./FACopyConfigurationOptionField.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\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\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Watch } from \"vue-property-decorator\"\r\nimport Datepicker from \"vuejs-datepicker\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport { ModelSelect } from \"vue-search-select\"\r\n// Project Imports\r\nimport {\r\n TreePayload,\r\n FieldOptionField,\r\n FieldComplexCopySettings,\r\n} from \"../../interfaces\"\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport LoadingButton from \"@/components/LoadingButton.vue\"\r\nimport CurrencyDropdown from \"@/components/CurrencyDropdown.vue\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport FACopyOptions from \"@/components/fa/FACopyOptions.vue\"\r\nimport FACopyConfigurationOptionField from \"@/components/fa/FACopyConfigurationOptionField.vue\"\r\n\r\n@Component({\r\n name: \"FACopyConfiguration\",\r\n components: {\r\n LoadingButton,\r\n CurrencyDropdown,\r\n Datepicker,\r\n ErrorAlert,\r\n ModelSelect,\r\n FACopyOptions,\r\n FACopyConfiguration,\r\n FACopyConfigurationOptionField,\r\n },\r\n})\r\nclass FACopyConfiguration extends mixins(LoadingMixin) {\r\n @Prop()\r\n public label!: string\r\n @Prop()\r\n public nodes!: TreePayload[]\r\n @Prop()\r\n public depth!: number\r\n @Prop()\r\n public id!: string\r\n @Prop()\r\n public level!: string\r\n @Prop()\r\n public settings!: FieldComplexCopySettings\r\n @Prop()\r\n public optionField!: FieldOptionField[]\r\n @Prop()\r\n public parentId!: string | number\r\n @Prop()\r\n public parentSelected!: boolean\r\n @Prop()\r\n public parentOptionField!: FieldOptionField[]\r\n @Prop({ default: false })\r\n public disabledCheckbox!: boolean\r\n @Prop()\r\n public index2!: number\r\n @Prop()\r\n public selected!: boolean\r\n\r\n public showChildren = false\r\n\r\n public bus(data: any, depth: string, id: string) {\r\n // console.log(depth, ' ', id)\r\n const { value, payload } = data\r\n payload[depth] = id\r\n this.$emit(\"bus\", { value, payload })\r\n }\r\n\r\n // toggle Children checkboxes if parent is checked.\r\n @Watch(\"parentSelected\")\r\n public toggleChildren() {\r\n this.updateFunction(this.parentSelected)\r\n }\r\n\r\n public updateFunction(event: boolean) {\r\n this.$emit(\"update:selected\", event)\r\n }\r\n\r\n public updateOptionField(event: boolean) {\r\n return this.optionField.map((el: FieldOptionField) => {\r\n el.selected = event\r\n return el\r\n })\r\n }\r\n\r\n @Watch(\"optionField\", { deep: true })\r\n public optionFieldChange() {\r\n const booleanArray = this.optionField.map((el: any) => el.selected)\r\n const isFalse = (currentVal: boolean) => currentVal === false\r\n\r\n // if every optionField is false. disable selected.\r\n if (booleanArray.every(isFalse)) {\r\n this.updateFunction(false)\r\n }\r\n }\r\n\r\n /*\r\n Below is some code to try and get the indeterminate to work for the selected checkbox.\r\n */\r\n\r\n // public get getterCheckIndeterminate() {\r\n // if (!this.settings.show) {\r\n // return false\r\n // }\r\n\r\n // if (this.selected === false) {\r\n // return false\r\n // }\r\n\r\n // const output = this.checkIndeterminateSection(this.nodes) ||\r\n // this.recursiveCheckIndeterminate(this.nodes)\r\n\r\n // // console.log(this.nodes)\r\n // // console.log(this.checkIndeterminateSection(this.nodes))\r\n // // console.log(this.recursiveCheckIndeterminate(this.nodes))\r\n // // console.log(output)\r\n // // console.log(\"\")\r\n // return (\r\n // output\r\n // )\r\n // }\r\n\r\n // public recursiveCheckIndeterminate(children: TreePayload[]) {\r\n // if (children === undefined) {\r\n // return false\r\n // }\r\n\r\n // if (children) {\r\n // const output = children.map((el: TreePayload) => {\r\n // if (el.children) {\r\n // return (\r\n // this.checkIndeterminateSection(el.children) ||\r\n // (this.recursiveCheckIndeterminate(el.children) || false)\r\n // )\r\n // } else {\r\n // return false\r\n // }\r\n // })\r\n // // console.log(output)\r\n\r\n // if (output.length > 1) {\r\n // // console.log(output)\r\n // const isFalse = (currentVal: boolean) => currentVal === false\r\n // if (output.every(Boolean) || output.every(isFalse)) {\r\n // return false\r\n // } else {\r\n // return true\r\n // }\r\n // }\r\n // return false\r\n // } else {\r\n // return false\r\n // }\r\n // }\r\n\r\n // public checkIndeterminateSection(children: TreePayload[]) {\r\n // if (!this.nodes) {\r\n // return false\r\n // }\r\n // const currentSelectedBooleanArray = this.nodes.map((el: TreePayload) => el.selected)\r\n\r\n // if (currentSelectedBooleanArray.length > 1) {\r\n // const isFalse = (currentVal: boolean) => currentVal === false\r\n\r\n // if (currentSelectedBooleanArray.every(Boolean) || currentSelectedBooleanArray.every(isFalse)) {\r\n // return false\r\n // } else {\r\n // return true\r\n // }\r\n // }\r\n\r\n // if (currentSelectedBooleanArray.length === 1) {\r\n // return !currentSelectedBooleanArray[0]\r\n // }\r\n\r\n // return false\r\n\r\n // // All false.\r\n // // if (currentSelectedBooleanArray.every(isFalse)) {\r\n // // this.updateFunction(false)\r\n // // }\r\n // // else if (currentSelectedBooleanArray.every(Boolean)){ // All true or mixed\r\n // // this.updateFunction(true)\r\n // // } else {\r\n // // this.updateFunction(true)\r\n // // }\r\n\r\n // // if (currentSelectedBooleanArray.includes(true) ){\r\n // // this.updateFunction(true)\r\n // // }\r\n\r\n // // Check if every entry are equvalent. Doesn't matter if it is true or false.\r\n // return false\r\n // return !currentSelectedBooleanArray.every(\r\n // (val: boolean, i: number, arr: boolean[]) => val === arr[0]\r\n // )\r\n\r\n // // If all equilvalent => False: not indeterminate\r\n // // if there is different => True: indeterminate\r\n\r\n // // return !this.nodes.map( (el: any) => el.selected ).every(Boolean)\r\n // }\r\n}\r\nexport default FACopyConfiguration\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FACopyConfiguration.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FACopyConfiguration.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./FACopyConfiguration.vue?vue&type=template&id=25c95c12&\"\nimport script from \"./FACopyConfiguration.vue?vue&type=script&lang=ts&\"\nexport * from \"./FACopyConfiguration.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./FACopyConfiguration.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-card',{staticClass:\"rp-card\",staticStyle:{\"padding\":\"0.75rem 1.0rem\"},attrs:{\"no-body\":\"\"}},[_c('div',{staticClass:\"line-item\"},[_c('label',{staticClass:\"mb-0\"},[_vm._v(_vm._s(_vm.label))]),_c('div',{staticClass:\"right-button line-item\"},[(!_vm.isAll)?_c('b-button',{staticClass:\"border-0 mr-2\",attrs:{\"size\":\"sm\",\"variant\":\"outline-danger\",\"disabled\":_vm.disabled},on:{\"click\":function($event){return _vm.$emit('delete-rp', _vm.reportingPeriodId)}}},[_c('font-awesome-icon',{attrs:{\"size\":\"sm\",\"icon\":\"trash\"}})],1):_vm._e(),_c('font-awesome-icon',{staticClass:\"mr-2\",class:_vm.periodProfileEdited ? \"text-warning\" : \"text-muted\",attrs:{\"id\":(\"\" + _vm.reportingPeriodId),\"icon\":_vm.periodProfileEdited ? \"dot-circle\" : \"circle\",\"size\":\"xs\"}}),_c('b-tooltip',{attrs:{\"target\":(\"\" + _vm.reportingPeriodId),\"triggers\":\"hover\"}},[_vm._v(\"\\n \"+_vm._s(_vm.isAll ? \"Override\" : \"\")+\" Period Profile has\\n \"+_vm._s(!_vm.periodProfileEdited ? \"not\" : \"\")+\" been edited.\\n \")]),_c('b-button',{staticClass:\" border-0\",attrs:{\"size\":\"sm\",\"variant\":\"outline-secondary\",\"disabled\":_vm.disabled},on:{\"click\":function($event){return _vm.$emit('open-modal', _vm.reportingPeriodId)}}},[_c('font-awesome-icon',{attrs:{\"size\":\"sm\",\"icon\":\"pen\"}})],1)],1)])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Watch } from \"vue-property-decorator\"\r\nimport Datepicker from \"vuejs-datepicker\"\r\nimport { mixins } from \"vue-class-component\"\r\n// Project Imports\r\nimport {\r\n Taxpayer,\r\n ForeignAffiliate,\r\n ReportingPeriod,\r\n ReportingPeriodTreePayload,\r\n TreePayload,\r\n BusPayload,\r\n FieldOptionField,\r\n FieldComplexCopySettings,\r\n CalculatorSection,\r\n CalculatorSectionSubgroup,\r\n SEPAdjustment,\r\n Adjustment,\r\n Dividend,\r\n ReportingPeriodList,\r\n} from \"../../interfaces\"\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport LoadingButton from \"@/components/LoadingButton.vue\"\r\nimport CurrencyDropdown from \"@/components/CurrencyDropdown.vue\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport { clone } from \"lodash\"\r\n\r\n@Component({\r\n components: {\r\n LoadingButton,\r\n CurrencyDropdown,\r\n Datepicker,\r\n ErrorAlert,\r\n },\r\n})\r\nclass FACopyOptionsRPCard extends mixins(LoadingMixin) {\r\n @Prop()\r\n public label!: string\r\n @Prop({ default: false })\r\n public disabled!: boolean\r\n @Prop({ default: false })\r\n public isAll!: boolean\r\n @Prop({ default: undefined })\r\n public reportingPeriodId!: number | undefined\r\n @Prop({ default: false })\r\n public periodProfileEdited!: boolean\r\n}\r\nexport default FACopyOptionsRPCard\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FACopyOptionsRPCard.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FACopyOptionsRPCard.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./FACopyOptionsRPCard.vue?vue&type=template&id=6bd7b523&scoped=true&\"\nimport script from \"./FACopyOptionsRPCard.vue?vue&type=script&lang=ts&\"\nexport * from \"./FACopyOptionsRPCard.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./FACopyOptionsRPCard.vue?vue&type=style&index=0&id=6bd7b523&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"6bd7b523\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:\"accordion\",attrs:{\"role\":\"tablist\"}},_vm._l((_vm.selectedPayload),function(item,index){return _c('b-card',{key:index,staticClass:\"mb-1\",attrs:{\"no-body\":\"\"}},[_c('b-card-header',{staticClass:\"p-1\",attrs:{\"header-tag\":\"header\",\"role\":\"tab\"}},[_c('b-button',{directives:[{name:\"b-toggle\",rawName:\"v-b-toggle\",value:((\"accordion-\" + index)),expression:\"`accordion-${index}`\"}],attrs:{\"block\":\"\",\"variant\":\"primary\"}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"icon\":\"calendar\"}}),_vm._v(\"\\n \"+_vm._s(item.label)+\"\\n \")],1)],1),_c('b-collapse',{attrs:{\"id\":(\"accordion-\" + index),\"visible\":\"\",\"accordion\":\"my-accordion\",\"role\":\"tabpanel\"}},[_c('b-card-body',[_c('div',{staticClass:\"line-item\"},[_c('b-button-group',{staticClass:\"icon\",attrs:{\"size\":\"sm\"}},[_c('b-button',{attrs:{\"variant\":\"outline-secondary\"},on:{\"click\":function($event){return _vm.toggleMultipleAttribute(index, true)}}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"icon\":\"expand\"}}),_vm._v(\"Expand\")],1),_c('b-button',{attrs:{\"variant\":\"outline-secondary\"},on:{\"click\":function($event){return _vm.toggleMultipleAttribute(index, false)}}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"icon\":\"compress\"}}),_vm._v(\"Minimize\")],1)],1)],1),_c('label',{staticClass:\"mb-0 mt-2\"},[_vm._v(\"Fields Modified:\")]),(item.selected.length > 0)?_c('span',_vm._l((item.selected),function(selectedItem,selectedIndex){return _c('span',{key:selectedIndex},[_c('div',{staticClass:\"line-item ml-2\"},[_c('b-checkbox',{attrs:{\"checked\":selectedItem.selected,\"disabled\":true}},[_vm._v(\"\\n \"+_vm._s(selectedItem.label)+\"\\n \")]),_c('div',{staticClass:\"icon\"},[(selectedItem.optionField !== undefined)?_c('label',{staticClass:\"expand-icon mb-0 text-primary\",class:_vm.getSingleAttribute(\n (\"collapse-option-field-summary-\" + index + \"-\" + selectedIndex)\n )\n ? null\n : \"collapsed\",attrs:{\"aria-expanded\":_vm.getSingleAttribute(\n (\"collapse-option-field-summary-\" + index + \"-\" + selectedIndex)\n )\n ? \"true\"\n : \"false\",\"aria-controls\":(\"collapse-option-field-summary-\" + index + \"-\" + selectedIndex)},on:{\"click\":function($event){return _vm.toggleSingleAttribute(\n (\"collapse-option-field-summary-\" + index + \"-\" + selectedIndex)\n )}}},[_c('font-awesome-icon',{staticClass:\"when-closed mr-1\",attrs:{\"icon\":\"plus-circle\"}}),_c('font-awesome-icon',{staticClass:\"when-opened mr-1\",attrs:{\"icon\":\"minus-circle\"}})],1):_vm._e()])],1),_c('b-collapse',{attrs:{\"id\":(\"collapse-option-field-summary-\" + index + \"-\" + selectedIndex)},model:{value:(\n _vm.collapseObject[\n (\"collapse-option-field-summary-\" + index + \"-\" + selectedIndex)\n ]\n ),callback:function ($$v) {_vm.$set(_vm.collapseObject, \n (\"collapse-option-field-summary-\" + index + \"-\" + selectedIndex)\n , $$v)},expression:\"\\n collapseObject[\\n `collapse-option-field-summary-${index}-${selectedIndex}`\\n ]\\n \"}},_vm._l((selectedItem.optionField),function(optionFieldItem,optionFieldIndex){return _c('div',{key:optionFieldIndex,staticClass:\"line-item ml-4\"},[_c('b-checkbox',{attrs:{\"checked\":optionFieldItem.selected,\"disabled\":true}},[_vm._v(\"\\n \"+_vm._s(optionFieldItem.label)+\"\\n \")])],1)}),0)],1)}),0):_c('span',[_c('div',{staticClass:\"ml-2\"},[_vm._v(\"\\n No Changes\\n \")])]),_c('div',{staticClass:\"line-item mt-3\"},[_c('label',{staticClass:\"mb-0\"},[_vm._v(\"Period Profile Modified:\")]),_c('div',{staticClass:\"icon\"},[_c('label',{staticClass:\"expand-icon mb-0 text-primary\",class:_vm.getSingleAttribute((\"collapse-period-profile-\" + index))\n ? null\n : \"collapsed\",attrs:{\"aria-expanded\":_vm.getSingleAttribute((\"collapse-period-profile-\" + index))\n ? \"true\"\n : \"false\",\"aria-controls\":(\"collapse-period-profile-\" + index)},on:{\"click\":function($event){return _vm.toggleSingleAttribute((\"collapse-period-profile-\" + index))}}},[_c('font-awesome-icon',{staticClass:\"when-closed mr-1\",attrs:{\"icon\":\"plus-circle\"}}),_c('font-awesome-icon',{staticClass:\"when-opened mr-1\",attrs:{\"icon\":\"minus-circle\"}})],1)])]),_c('b-collapse',{attrs:{\"id\":(\"collapse-period-profile-\" + index)},model:{value:(_vm.collapseObject[(\"collapse-period-profile-\" + index)]),callback:function ($$v) {_vm.$set(_vm.collapseObject, (\"collapse-period-profile-\" + index), $$v)},expression:\"collapseObject[`collapse-period-profile-${index}`]\"}},[(Object.keys(item.period_profile).length > 0)?_c('span',_vm._l((_vm.periodProfileText),function(ppItem,ppIndex){return _c('div',{key:(\"period-profile-\" + index + \"-\" + ppIndex),staticClass:\"mb-0 ml-2\"},[_vm._v(\"\\n \"+_vm._s(ppItem.name)+\"\\n\\n \"),_vm._l((ppItem.data),function(ppDataItem,ppDataIndex){return _c('div',{key:(\"period-profile-\" + index + \"-\" + ppIndex + \"-\" + ppDataIndex),staticClass:\"ml-4\"},[_c('b-checkbox',{attrs:{\"checked\":item.period_profile[ppDataItem.id],\"disabled\":true}},[_vm._v(\"\\n \"+_vm._s(ppDataItem.text)+\"\\n \")])],1)})],2)}),0):_c('span',[_c('div',{staticClass:\"ml-2\"},[_vm._v(\"\\n No changes\\n \")])])])],1)],1)],1)}),1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\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\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\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Watch } from \"vue-property-decorator\"\r\nimport Datepicker from \"vuejs-datepicker\"\r\nimport { mixins } from \"vue-class-component\"\r\n// Project Imports\r\nimport { SelectedPayload, TreePayload } from \"../../interfaces\"\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport CalculatorMixin from \"@/mixins/CalculatorMixin\"\r\nimport LoadingButton from \"@/components/LoadingButton.vue\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport _ from \"lodash\"\r\n\r\n@Component({\r\n components: {\r\n LoadingButton,\r\n Datepicker,\r\n ErrorAlert,\r\n },\r\n})\r\nclass FACopyOptionsSummary extends mixins(LoadingMixin, CalculatorMixin) {\r\n @Prop()\r\n public selectedPayload!: SelectedPayload[]\r\n\r\n public toggleObject: any = {}\r\n\r\n public get collapseObject() {\r\n /*\r\n Creates the object that handles collapse visibility\r\n */\r\n const output: { [key: string]: boolean } = {}\r\n\r\n this.selectedPayload.map((el: SelectedPayload, index: number) => {\r\n el.selected.map((selectedEl: TreePayload, selectedIndex: number) => {\r\n const key = `collapse-option-field-summary-${index}-${selectedIndex}`\r\n output[key] = false\r\n })\r\n // For Period Profile\r\n output[`collapse-period-profile-${index}`] = false\r\n })\r\n return output\r\n }\r\n\r\n public toggleMultipleAttribute(targetIndex: number, show: boolean) {\r\n this.selectedPayload[targetIndex].selected.map(\r\n (selectedEl: TreePayload, selectedIndex: number) => {\r\n const key = `collapse-option-field-summary-${targetIndex}-${selectedIndex}`\r\n this.$set(this.toggleObject, key, show)\r\n }\r\n )\r\n this.$set(this.toggleObject, `collapse-period-profile-${targetIndex}`, show)\r\n }\r\n\r\n public toggleSingleAttribute(targetKey: string) {\r\n const targetAttr = this.toggleObject[targetKey]\r\n this.$set(this.toggleObject, targetKey, !targetAttr)\r\n }\r\n\r\n public getSingleAttribute(targetKey: string) {\r\n return this.toggleObject[targetKey]\r\n }\r\n\r\n public get periodProfileText() {\r\n return [\r\n {\r\n name: \"Business Activity\",\r\n data: [\r\n {\r\n id: \"fa_resident_designated_country\",\r\n text:\r\n \"Was the FA resident in a designated treaty country (for common law purposes and pursuant to 5907(11.2))?\",\r\n },\r\n {\r\n id: \"fa_business_activity\",\r\n text: \"Did the FA carry on an active business?\",\r\n },\r\n {\r\n id: \"fa_business_designated_country\",\r\n text:\r\n \"Did the FA carry on such active business in a designated treaty country?\",\r\n },\r\n {\r\n id: \"fa_foreign_tax_law_required\",\r\n text:\r\n \"Was the FA required to compute income or profits from the active business in accordance with the foreign income tax law of a designated treaty country?\",\r\n },\r\n ],\r\n },\r\n {\r\n name: \"Dividends\",\r\n data: [\r\n {\r\n id: \"dividends_paid\",\r\n text: \"Did the FA pay a dividend?\",\r\n },\r\n {\r\n id: \"dividends_from_fa\",\r\n text: \"Did the FA receive a dividend from other FAs?\",\r\n },\r\n {\r\n id: \"dividends_pay_tax\",\r\n text: \"If yes, did the FA pay tax on dividends received?\",\r\n },\r\n ],\r\n },\r\n {\r\n name: \"Other\",\r\n data: [\r\n {\r\n id: \"depreciation_election\",\r\n text: \"Has Reg. 5907(2.1) Depreciation Election been made?\",\r\n },\r\n {\r\n id: \"sep_changes\",\r\n text: \"Did the FA have any SEP changes?\",\r\n },\r\n {\r\n id: \"fapi\",\r\n text: \"Did the FA earn FAPI?\",\r\n },\r\n {\r\n id: \"recharacterized_property_income\",\r\n text:\r\n \"Did the FA earn property income that was recharacterized as active business income?\",\r\n },\r\n {\r\n id: \"dispositions\",\r\n text:\r\n \"Were there any dispositions that gave rise to capital gains/(losses)?\",\r\n },\r\n {\r\n id: \"consolidation_or_group_relief\",\r\n text:\r\n \"Was the FA subject to a consolidation regime or group relief in the foreign jurisdiction?\",\r\n },\r\n ],\r\n },\r\n ]\r\n }\r\n // Unused\r\n // dividends_acb:\r\n // dividends_taxable_surplus_first:\r\n public created() {\r\n if (this.selectedPayload) {\r\n this.toggleObject = this.collapseObject\r\n }\r\n }\r\n}\r\nexport default FACopyOptionsSummary\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FACopyOptionsSummary.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FACopyOptionsSummary.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./FACopyOptionsSummary.vue?vue&type=template&id=b2445b18&\"\nimport script from \"./FACopyOptionsSummary.vue?vue&type=script&lang=ts&\"\nexport * from \"./FACopyOptionsSummary.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('PeriodCallout',{attrs:{\"variant\":\"warning\",\"text\":\"Any Period Profile modifications made below will apply to all taxation years of the copy of the foreign affiliate.\",\"icon\":\"warning\",\"mb\":\"2\"}}),_c('PeriodCallout',{attrs:{\"variant\":\"secondary\",\"text\":\"To configure the Period Profile of a specific taxation year, please use the 'Modify a specific taxation year' section in the previous modal.\",\"icon\":\"info\",\"mb\":\"2\"}}),_vm._v(\"\\n Retrieve a reference taxation year's period profile:\\n \"),_c('model-select',{staticClass:\"mb-2\",attrs:{\"options\":_vm.reportingPeriodOptionsList,\"placeholder\":\"Select a Taxation Year\",\"isDisabled\":_vm.disabled},model:{value:(_vm.selectedRP),callback:function ($$v) {_vm.selectedRP=$$v},expression:\"selectedRP\"}}),_c('FACopyBridgePeriodOptionPanel',_vm._b({key:(\"\" + _vm.selectedRP),attrs:{\"reportingPeriodOptionsList\":null,\"foreign_Affiliate\":_vm.foreign_affiliate,\"selectedRPIndividual\":_vm.selectedRP,\"disabled\":_vm.disabled}},'FACopyBridgePeriodOptionPanel',_vm.periodProfile,false,true))],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-card',[(_vm.periodProfile === null)?_c('span',[_c('h3',[_vm._v(_vm._s(_vm.title))]),_c('b-row',[_c('b-col',[_c('b-form-checkbox',{attrs:{\"data-cy\":\"change-in-calculating-currency\",\"disabled\":_vm.disabled},model:{value:(_vm.currencyChange),callback:function ($$v) {_vm.currencyChange=$$v},expression:\"currencyChange\"}},[_vm._v(\"Was there a change in calculating currency?\")])],1)],1),(_vm.currencyChange)?_c('div',[_c('br'),_c('b-row',[_c('b-col',[_c('b-form-group',{attrs:{\"label\":\"New Calculating Currency\",\"disabled\":_vm.disabled}},[_c('CurrencyDropdown',{attrs:{\"name\":\"faReportingCurrency\",\"data-cy\":\"new-calculating-currency\",\"required\":_vm.fxRate !== '',\"defaultValue\":_vm.fxCurrency},on:{\"dropdown-change\":_vm.handleOnChange}})],1)],1),_c('b-col',[_c('b-form-group',{attrs:{\"label\":\"Calculating FX Rate\",\"disabled\":_vm.disabled}},[_c('b-form-input',{attrs:{\"type\":\"text\",\"name\":\"fxRate\",\"required\":_vm.fxCurrency !== null && _vm.fxCurrency !== '',\"description\":\"Calculating FX Rate\",\"formatter\":_vm.formatter,\"data-cy\":\"calculating-fx-rate\",\"lazy-formatter\":\"\"},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0 ? $event.target.select() : null; })($event)}},model:{value:(_vm.fxRate),callback:function ($$v) {_vm.fxRate=$$v},expression:\"fxRate\"}})],1)],1)],1)],1):_vm._e(),_c('hr')],1):_vm._e(),_c('h4',[_vm._v(\"Period Profile\")]),_c('small',[_vm._v(\"Answer all questions that apply to the taxation year\")]),_c('hr'),_c('b-card',{attrs:{\"no-body\":\"\"}},[_c('b-form-group',{staticClass:\"form-group-mb-zero\",attrs:{\"disabled\":_vm.disabled}},[_c('b-tabs',{attrs:{\"id\":\"profile-tabs\",\"pills\":\"\",\"card\":\"\",\"fill\":\"\"}},[_c('b-tab',{key:\"business\",attrs:{\"active\":\"\"}},[_c('div',{attrs:{\"slot\":\"title\",\"data-cy\":\"business-tab\"},slot:\"title\"},[_vm._v(\"Business Activity\")]),_c('b-form-checkbox',{attrs:{\"name\":\"faResidentDesignatedCountry\",\"data-cy\":\"fa-Resident-Designated-Country\"},model:{value:(_vm.faResidentDesignatedCountry),callback:function ($$v) {_vm.faResidentDesignatedCountry=$$v},expression:\"faResidentDesignatedCountry\"}},[_vm._v(\"\\n Was the FA resident in a designated treaty country (for common\\n law purposes and pursuant to 5907(11.2))?\\n \")]),_c('b-form-checkbox',{attrs:{\"name\":\"faResidentDesignatedCountry\",\"data-cy\":\"fa-carry-on-active-business\"},model:{value:(_vm.faBusinessActivity),callback:function ($$v) {_vm.faBusinessActivity=$$v},expression:\"faBusinessActivity\"}},[_vm._v(\"Did the FA carry on an active business?\")]),(_vm.faBusinessActivity)?_c('b-form-checkbox',{attrs:{\"name\":\"faBusinessDesignatedCountry\",\"data-cy\":\"fa-carry-business-in-designated-treaty-country\"},model:{value:(_vm.faBusinessDesignatedCountry),callback:function ($$v) {_vm.faBusinessDesignatedCountry=$$v},expression:\"faBusinessDesignatedCountry\"}},[_vm._v(\"\\n Did the FA carry on such active business in a designated treaty\\n country?\\n \")]):_vm._e(),(_vm.faBusinessDesignatedCountry && _vm.faBusinessActivity)?_c('b-form-checkbox',{attrs:{\"name\":\"faBusinessDesignatedCountry\",\"data-cy\":\"fa-compute-income-or-profits\"},model:{value:(_vm.faForeignTaxLawRequired),callback:function ($$v) {_vm.faForeignTaxLawRequired=$$v},expression:\"faForeignTaxLawRequired\"}},[_vm._v(\"\\n Was the FA required to compute income or profits from the active\\n business in accordance with the foreign income tax law of a\\n designated treaty country?\\n \")]):_vm._e()],1),_c('b-tab',{key:\"dividends\"},[_c('div',{attrs:{\"slot\":\"title\",\"data-cy\":\"dividends-tab\"},slot:\"title\"},[_vm._v(\"Dividends\")]),_c('b-form-checkbox',{attrs:{\"name\":\"dividendsPaid\",\"data-cy\":\"fa-pay-dividend\"},model:{value:(_vm.dividendsPaid),callback:function ($$v) {_vm.dividendsPaid=$$v},expression:\"dividendsPaid\"}},[_vm._v(\"Did the FA pay a dividend?\")]),_c('b-form-checkbox',{attrs:{\"name\":\"dividendsFromFa\",\"data-cy\":\"fa-received-dividend\"},model:{value:(_vm.dividendsFromFa),callback:function ($$v) {_vm.dividendsFromFa=$$v},expression:\"dividendsFromFa\"}},[_vm._v(\"Did the FA receive a dividend from other FAs?\")]),(_vm.dividendsFromFa)?_c('b-form-checkbox',{attrs:{\"name\":\"dividendsPayTax\",\"data-cy\":\"fa-pay-tax-received-dividend\"},model:{value:(_vm.dividendsPayTax),callback:function ($$v) {_vm.dividendsPayTax=$$v},expression:\"dividendsPayTax\"}},[_vm._v(\"\\n If yes, did the FA pay tax on dividends received?\\n \")]):_vm._e()],1),_c('b-tab',{key:\"other\"},[_c('div',{attrs:{\"slot\":\"title\",\"data-cy\":\"other-tab\"},slot:\"title\"},[_vm._v(\"Other\")]),_c('b-form-checkbox',{attrs:{\"name\":\"depreciationElection\",\"data-cy\":\"depreciation-election\"},model:{value:(_vm.depreciationElection),callback:function ($$v) {_vm.depreciationElection=$$v},expression:\"depreciationElection\"}},[_vm._v(\"\\n Has Reg. 5907(2.1) Depreciation Election been made?\\n \")]),_c('b-form-checkbox',{attrs:{\"name\":\"sepChanges\",\"data-cy\":\"sep-changes\"},model:{value:(_vm.sepChanges),callback:function ($$v) {_vm.sepChanges=$$v},expression:\"sepChanges\"}},[_vm._v(\"Did the FA have any SEP changes?\")]),_c('b-form-checkbox',{attrs:{\"name\":\"fapi\",\"data-cy\":\"fapi\"},model:{value:(_vm.fapi),callback:function ($$v) {_vm.fapi=$$v},expression:\"fapi\"}},[_vm._v(\"Did the FA earn FAPI?\")]),_c('b-form-checkbox',{attrs:{\"name\":\"recharacterizedPropertyIncome\",\"data-cy\":\"recharacterized-property-income\"},model:{value:(_vm.recharacterizedPropertyIncome),callback:function ($$v) {_vm.recharacterizedPropertyIncome=$$v},expression:\"recharacterizedPropertyIncome\"}},[_vm._v(\"\\n Did the FA earn property income that was recharacterized as\\n active business income?\\n \")]),_c('b-form-checkbox',{attrs:{\"name\":\"dispositions\",\"data-cy\":\"dispositions\"},model:{value:(_vm.dispositions),callback:function ($$v) {_vm.dispositions=$$v},expression:\"dispositions\"}},[_vm._v(\"\\n Were there any dispositions that gave rise to capital\\n gains/(losses)?\\n \")]),_c('b-form-checkbox',{attrs:{\"name\":\"consolidationOrGroupRelief\",\"data-cy\":\"consolidation-or-group-relief\"},model:{value:(_vm.consolidationOrGroupRelief),callback:function ($$v) {_vm.consolidationOrGroupRelief=$$v},expression:\"consolidationOrGroupRelief\"}},[_vm._v(\"\\n Was the FA subject to a consolidation regime or group relief in\\n the foreign jurisdiction?\\n \")])],1)],1)],1)],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\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\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\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\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\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\r\nimport { Component, Prop, Watch, Emit } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport * as _ from \"lodash\"\r\nimport dateFns from \"date-fns\"\r\nimport Datepicker from \"vuejs-datepicker\"\r\n// Project Imports\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport LoadingButton from \"@/components/LoadingButton.vue\"\r\nimport { ReportingPeriod, ForeignAffiliate } from \"@/interfaces\"\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport CurrencyDropdown from \"@/components/CurrencyDropdown.vue\"\r\nimport CalculatorMixin from \"../../mixins/CalculatorMixin\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport ConfirmBoxMixin from \"../../mixins/ConfirmBoxMixin\"\r\n\r\n@Component({\r\n components: {\r\n LoadingButton,\r\n Datepicker,\r\n ErrorAlert,\r\n CurrencyDropdown,\r\n },\r\n})\r\nclass PeriodOptionPanel extends mixins(\r\n LoadingMixin,\r\n CalculatorMixin,\r\n ConfirmBoxMixin\r\n) {\r\n @Prop()\r\n public initialData!: ReportingPeriod\r\n @Prop({ required: true })\r\n public foreignAffiliate!: ForeignAffiliate\r\n @Prop()\r\n public taxationYearType!: number\r\n @Prop()\r\n public selectedRP!: number | null\r\n @Prop()\r\n public title!: string\r\n @Prop({ default: false })\r\n public edit!: boolean\r\n @Prop({ default: false })\r\n public disabled!: boolean\r\n @Prop({ default: null }) // used with complex copy\r\n public periodProfile!: { [key: string]: boolean }\r\n\r\n public faResidentDesignatedCountry: boolean = false\r\n public faBusinessActivity: boolean = false\r\n public faBusinessDesignatedCountry: boolean = false\r\n public faForeignTaxLawRequired: boolean = false\r\n public depreciationElection: boolean = false\r\n public dividendsTaxableSurplusFirst: boolean = false\r\n public dividendsAcb: boolean = false\r\n public sepChanges: boolean = false\r\n public recharacterizedPropertyIncome: boolean = false\r\n public fapi: boolean = false\r\n public dividendsFromFa: boolean = false\r\n public dividendsPayTax: boolean = false\r\n public dividendsPaid: boolean = false\r\n public dispositions: boolean = false\r\n public consolidationOrGroupRelief: boolean = false\r\n public currencyChange: boolean = false\r\n public fxRate: string = \"\"\r\n public fxCurrency: string = \"\"\r\n\r\n public handleOnChange(val: string, e: any) {\r\n this.fxCurrency = val\r\n this.componentEmit(this.fxCurrency, \"fxCurrency\")\r\n }\r\n\r\n public componentEmit(event: any, type: string) {\r\n if (type !== \"\") {\r\n this.$emit(`${type}`, event)\r\n }\r\n }\r\n\r\n @Watch(\"currencyChange\")\r\n public currencyToggle() {\r\n if (!this.currencyChange) {\r\n this.fxRate = \"\"\r\n this.fxCurrency = \"\"\r\n }\r\n }\r\n @Watch(\"faBusinessActivity\")\r\n public faBusinessActivityChange() {\r\n this.componentEmit(this.faBusinessActivity, \"faBusinessActivity\")\r\n }\r\n @Watch(\"faForeignTaxLawRequired\")\r\n public faForeignTaxLawRequiredChagne() {\r\n this.componentEmit(this.faForeignTaxLawRequired, \"faForeignTaxLawRequired\")\r\n }\r\n @Watch(\"faResidentDesignatedCountry\")\r\n public faResidentDesignatedCountryChange() {\r\n this.componentEmit(\r\n this.faResidentDesignatedCountry,\r\n \"faResidentDesignatedCountry\"\r\n )\r\n }\r\n @Watch(\"faBusinessDesignatedCountry\")\r\n public faBusinessDesignatedCountryChange() {\r\n this.componentEmit(\r\n this.faBusinessDesignatedCountry,\r\n \"faBusinessDesignatedCountry\"\r\n )\r\n }\r\n @Watch(\"depreciationElection\")\r\n public depreciationElectionChange() {\r\n this.componentEmit(this.depreciationElection, \"depreciationElection\")\r\n }\r\n @Watch(\"dividendsTaxableSurplusFirst\")\r\n public dividendsTaxableSurplusFirstChange() {\r\n this.componentEmit(\r\n this.dividendsTaxableSurplusFirst,\r\n \"dividendsTaxableSurplusFirst\"\r\n )\r\n }\r\n @Watch(\"dividendsAcb\")\r\n public dividendsAcbChange() {\r\n this.componentEmit(this.dividendsAcb, \"dividendsAcb\")\r\n }\r\n @Watch(\"sepChanges\")\r\n public sepChangesChange() {\r\n this.componentEmit(this.sepChanges, \"sepChanges\")\r\n }\r\n @Watch(\"recharacterizedPropertyIncome\")\r\n public recharacterizedPropertyIncomeChange() {\r\n this.componentEmit(\r\n this.recharacterizedPropertyIncome,\r\n \"recharacterizedPropertyIncome\"\r\n )\r\n }\r\n @Watch(\"fapi\")\r\n public fapiChange() {\r\n this.componentEmit(this.fapi, \"fapi\")\r\n }\r\n @Watch(\"dividendsFromFa\")\r\n public dividendsFromFaChange() {\r\n this.componentEmit(this.dividendsFromFa, \"dividendsFromFa\")\r\n }\r\n @Watch(\"dividendsPayTax\")\r\n public dividendsPayTaxChange() {\r\n this.componentEmit(this.dividendsPayTax, \"dividendsPayTax\")\r\n }\r\n @Watch(\"dividendsPaid\")\r\n public dividendsPaidChange() {\r\n this.componentEmit(this.dividendsPaid, \"dividendsPaid\")\r\n }\r\n @Watch(\"dispositions\")\r\n public dispositionsChange() {\r\n this.componentEmit(this.dispositions, \"dispositions\")\r\n }\r\n @Watch(\"consolidationOrGroupRelief\")\r\n public consolidationOrGroupReliefChange() {\r\n this.componentEmit(\r\n this.consolidationOrGroupRelief,\r\n \"consolidationOrGroupRelief\"\r\n )\r\n }\r\n @Watch(\"fxRate\")\r\n public fxRateChange() {\r\n this.componentEmit(this.fxRate, \"fxRate\")\r\n }\r\n @Watch(\"fxCurrency\")\r\n public fxCurrencyChange() {\r\n this.componentEmit(this.fxCurrency, \"fxCurrency\")\r\n }\r\n\r\n public formatter(value: string, evt: any) {\r\n if (value === \"\") {\r\n return value\r\n }\r\n const formatted = formatMoney(value, 4)\r\n return formatted\r\n }\r\n\r\n public created() {\r\n let questionnaireSource: any\r\n\r\n // For the instance when editing a taxation year\r\n if (this.edit && this.initialData) {\r\n this.fxRate = this.initialData.fx_rate\r\n ? this.initialData.fx_rate.toString()\r\n : \"\"\r\n this.fxCurrency = this.initialData.fx_currency\r\n\r\n if (this.fxRate != \"\") {\r\n this.currencyChange = true\r\n }\r\n\r\n // Set the default answers, whether it is passed data or the last periods carryfoward\r\n questionnaireSource = this.initialData\r\n }\r\n\r\n // For period profile in complex copy\r\n if (this.periodProfile !== null) {\r\n questionnaireSource = { ...this.periodProfile }\r\n }\r\n\r\n // Carry forward for every other case\r\n if (!questionnaireSource) {\r\n const periodsInOrder: ReportingPeriod[] = this.foreignAffiliate.reporting_periods.sort(\r\n (a: ReportingPeriod, b: ReportingPeriod) =>\r\n new Date(a.start_date).getTime() - new Date(b.start_date).getTime()\r\n )\r\n\r\n let carryforwardPeriod: any\r\n\r\n switch (this.taxationYearType) {\r\n case 0: // Next Closest taxation year\r\n carryforwardPeriod =\r\n periodsInOrder.length > 0 ? periodsInOrder[0] : null\r\n break\r\n case 1:\r\n carryforwardPeriod =\r\n periodsInOrder.length > 0\r\n ? periodsInOrder[periodsInOrder.length - 1]\r\n : null\r\n break\r\n case 2:\r\n carryforwardPeriod =\r\n periodsInOrder.length > 0\r\n ? periodsInOrder[\r\n periodsInOrder.findIndex(\r\n (el: any) => el.id === this.selectedRP\r\n )\r\n ]\r\n : null\r\n break\r\n }\r\n\r\n questionnaireSource = carryforwardPeriod\r\n }\r\n\r\n if (questionnaireSource) {\r\n this.faBusinessActivity = questionnaireSource.fa_business_activity\r\n this.faForeignTaxLawRequired =\r\n questionnaireSource.fa_foreign_tax_law_required\r\n this.faResidentDesignatedCountry =\r\n questionnaireSource.fa_resident_designated_country\r\n this.faBusinessDesignatedCountry =\r\n questionnaireSource.fa_business_designated_country\r\n this.depreciationElection = questionnaireSource.depreciation_election\r\n this.dividendsTaxableSurplusFirst =\r\n questionnaireSource.dividends_taxable_surplus_first\r\n this.dividendsAcb = questionnaireSource.dividends_acb\r\n this.sepChanges = questionnaireSource.sep_changes\r\n this.recharacterizedPropertyIncome =\r\n questionnaireSource.recharacterized_property_income\r\n this.fapi = questionnaireSource.fapi\r\n this.dividendsFromFa = questionnaireSource.dividends_from_fa\r\n this.dividendsPayTax = questionnaireSource.dividends_pay_tax\r\n this.dividendsPaid = questionnaireSource.dividends_paid\r\n this.dispositions = questionnaireSource.dispositions\r\n this.consolidationOrGroupRelief =\r\n questionnaireSource.consolidation_or_group_relief\r\n }\r\n }\r\n}\r\n\r\nexport default PeriodOptionPanel\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PeriodOptionPanel.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PeriodOptionPanel.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./PeriodOptionPanel.vue?vue&type=template&id=f9a8f724&\"\nimport script from \"./PeriodOptionPanel.vue?vue&type=script&lang=ts&\"\nexport * from \"./PeriodOptionPanel.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('PeriodOptionPanel',{attrs:{\"initialData\":undefined,\"foreignAffiliate\":_vm.selectedRPIndividual,\"taxationYearType\":0,\"selectedRP\":_vm.selectedRP,\"title\":\"Edit Period Profile\",\"periodProfile\":_vm.periodProfile,\"disabled\":_vm.disabled},on:{\"faBusinessActivity\":function($event){return _vm.$emit('update:fa_business_activity', $event)},\"faForeignTaxLawRequired\":function($event){return _vm.$emit('update:fa_foreign_tax_law_required', $event)},\"faResidentDesignatedCountry\":function($event){return _vm.$emit('update:fa_resident_designated_country', $event)},\"faBusinessDesignatedCountry\":function($event){return _vm.$emit('update:fa_business_designated_country', $event)},\"depreciationElection\":function($event){return _vm.$emit('update:depreciation_election', $event)},\"dividendsTaxableSurplusFirst\":function($event){return _vm.$emit('update:dividends_taxable_surplus_first', $event)},\"dividendsAcb\":function($event){return _vm.$emit('update:dividends_acb', $event)},\"sepChanges\":function($event){return _vm.$emit('update:sep_changes', $event)},\"recharacterizedPropertyIncome\":function($event){return _vm.$emit('update:recharacterized_property_income', $event)},\"fapi\":function($event){return _vm.$emit('update:fapi', $event)},\"dividendsFromFa\":function($event){return _vm.$emit('update:dividends_from_fa', $event)},\"dividendsPayTax\":function($event){return _vm.$emit('update:dividends_pay_tax', $event)},\"dividendsPaid\":function($event){return _vm.$emit('update:dividends_paid', $event)},\"dispositions\":function($event){return _vm.$emit('update:dispositions', $event)},\"consolidationOrGroupRelief\":function($event){return _vm.$emit('update:consolidation_or_group_relief', $event)}}})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Watch } from \"vue-property-decorator\"\r\nimport Datepicker from \"vuejs-datepicker\"\r\nimport { ModelSelect } from \"vue-search-select\"\r\nimport { mixins } from \"vue-class-component\"\r\n// Project Imports\r\nimport { ForeignAffiliate, ReportingPeriodOptions } from \"../../interfaces\"\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport CalculatorMixin from \"@/mixins/CalculatorMixin\"\r\nimport LoadingButton from \"@/components/LoadingButton.vue\"\r\nimport CurrencyDropdown from \"@/components/CurrencyDropdown.vue\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport FACopyConfiguration from \"@/components/fa/FACopyConfiguration.vue\"\r\nimport FACopyOptionsRPCard from \"@/components/fa/FACopyOptionsRPCard.vue\"\r\nimport _ from \"lodash\"\r\nimport PeriodOptionPanel from \"@/components/periods/PeriodOptionPanel.vue\"\r\n\r\n@Component({\r\n components: {\r\n LoadingButton,\r\n CurrencyDropdown,\r\n Datepicker,\r\n ErrorAlert,\r\n ModelSelect,\r\n FACopyConfiguration,\r\n FACopyOptionsRPCard,\r\n PeriodOptionPanel,\r\n },\r\n})\r\nclass FACopyBridgePeriodOptionPanel extends mixins(\r\n LoadingMixin,\r\n CalculatorMixin\r\n) {\r\n @Prop()\r\n public reportingPeriodOptionsList!: ReportingPeriodOptions[]\r\n @Prop()\r\n public foreign_affiliate!: ForeignAffiliate\r\n @Prop({ default: null })\r\n public selectedRPIndividual!: string | null\r\n @Prop()\r\n public fa_business_activity!: boolean\r\n @Prop()\r\n public fa_foreign_tax_law_required!: boolean\r\n @Prop()\r\n public fa_resident_designated_country!: boolean\r\n @Prop()\r\n public fa_business_designated_country!: boolean\r\n @Prop()\r\n public depreciation_election!: boolean\r\n @Prop()\r\n public dividends_taxable_surplus_first!: boolean\r\n @Prop()\r\n public dividends_acb!: boolean\r\n @Prop()\r\n public sep_changes!: boolean\r\n @Prop()\r\n public recharacterized_property_income!: boolean\r\n @Prop()\r\n public fapi!: boolean\r\n @Prop()\r\n public dividends_from_fa!: boolean\r\n @Prop()\r\n public dividends_pay_tax!: boolean\r\n @Prop()\r\n public dividends_paid!: boolean\r\n @Prop()\r\n public dispositions!: boolean\r\n @Prop()\r\n public consolidation_or_group_relief!: boolean\r\n @Prop({ default: false })\r\n public disabled!: boolean\r\n\r\n public selectedRP: string | null = null\r\n\r\n public get periodProfile() {\r\n /*\r\n This bridges the props to the periodProfile objects.\r\n Note: .sync cannot sync for objects, but can pass into a component as a prop.\r\n */\r\n return {\r\n fa_business_activity: this.fa_business_activity,\r\n fa_foreign_tax_law_required: this.fa_foreign_tax_law_required,\r\n fa_resident_designated_country: this.fa_resident_designated_country,\r\n fa_business_designated_country: this.fa_business_designated_country,\r\n depreciation_election: this.depreciation_election,\r\n dividends_taxable_surplus_first: this.dividends_taxable_surplus_first,\r\n dividends_acb: this.dividends_acb,\r\n sep_changes: this.sep_changes,\r\n recharacterized_property_income: this.recharacterized_property_income,\r\n fapi: this.fapi,\r\n dividends_from_fa: this.dividends_from_fa,\r\n dividends_pay_tax: this.dividends_pay_tax,\r\n dividends_paid: this.dividends_paid,\r\n dispositions: this.dispositions,\r\n consolidation_or_group_relief: this.consolidation_or_group_relief,\r\n }\r\n }\r\n}\r\nexport default FACopyBridgePeriodOptionPanel\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FACopyBridgePeriodOptionPanel.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FACopyBridgePeriodOptionPanel.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./FACopyBridgePeriodOptionPanel.vue?vue&type=template&id=18ff61ca&\"\nimport script from \"./FACopyBridgePeriodOptionPanel.vue?vue&type=script&lang=ts&\"\nexport * from \"./FACopyBridgePeriodOptionPanel.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:(\"mb-\" + _vm.mb + \" bd-callout bd-callout-\" + _vm.variant + \" \" + _vm.size)},[(_vm.icon === \"warning\")?_c('label',{class:(\"mb-0 text-\" + _vm.variant)},[_vm._v(\"⚠\")]):_vm._e(),(_vm.icon === \"info\")?_c('label',{class:(\"mb-0 text-\" + _vm.variant)},[_vm._v(\"ⓘ\")]):_vm._e(),_vm._v(\"\\n \"+_vm._s(_vm.text)+\"\\n \"),_vm._t(\"text-slot\")],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Vue } from \"vue-property-decorator\"\r\n// Project Imports\r\nimport \"@/style/app.scss\"\r\n\r\n@Component\r\nclass PeriodCallout extends Vue {\r\n @Prop({ default: \"\" })\r\n public text!: string\r\n @Prop({ default: \"primary\" })\r\n public variant!: string\r\n @Prop({ default: \"info\" })\r\n public icon!: string\r\n @Prop({ default: \"\" })\r\n public size!: string\r\n @Prop({ default: 3 })\r\n public mb!: number\r\n}\r\nexport default PeriodCallout\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PeriodCallout.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PeriodCallout.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./PeriodCallout.vue?vue&type=template&id=332ccc93&scoped=true&\"\nimport script from \"./PeriodCallout.vue?vue&type=script&lang=ts&\"\nexport * from \"./PeriodCallout.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./PeriodCallout.vue?vue&type=style&index=0&id=332ccc93&scoped=true&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"332ccc93\",\n null\n \n)\n\nexport default component.exports","\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\n\n\n\r\nimport { Component, Prop, Watch } from \"vue-property-decorator\"\r\nimport Datepicker from \"vuejs-datepicker\"\r\nimport { ModelSelect } from \"vue-search-select\"\r\nimport { mixins } from \"vue-class-component\"\r\n// Project Imports\r\nimport {\r\n ForeignAffiliate,\r\n ReportingPeriodOptions,\r\n PeriodProfilePayload,\r\n} from \"../../interfaces\"\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport CalculatorMixin from \"@/mixins/CalculatorMixin\"\r\nimport LoadingButton from \"@/components/LoadingButton.vue\"\r\nimport CurrencyDropdown from \"@/components/CurrencyDropdown.vue\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport FACopyConfiguration from \"@/components/fa/FACopyConfiguration.vue\"\r\nimport FACopyOptionsRPCard from \"@/components/fa/FACopyOptionsRPCard.vue\"\r\nimport _ from \"lodash\"\r\nimport PeriodOptionPanel from \"@/components/periods/PeriodOptionPanel.vue\"\r\nimport FACopyBridgePeriodOptionPanel from \"@/components/fa/FACopyBridgePeriodOptionPanel.vue\"\r\nimport PeriodCallout from \"@/components/periods/PeriodCallout.vue\"\r\n\r\n@Component({\r\n components: {\r\n LoadingButton,\r\n CurrencyDropdown,\r\n Datepicker,\r\n ErrorAlert,\r\n ModelSelect,\r\n FACopyConfiguration,\r\n FACopyOptionsRPCard,\r\n PeriodOptionPanel,\r\n FACopyBridgePeriodOptionPanel,\r\n PeriodCallout,\r\n },\r\n})\r\nclass FACopyPeriodOptionsPanel extends mixins(LoadingMixin, CalculatorMixin) {\r\n @Prop()\r\n public reportingPeriodOptionsList!: ReportingPeriodOptions[]\r\n @Prop()\r\n public foreign_affiliate!: ForeignAffiliate\r\n @Prop({ default: null })\r\n public selectedRPIndividual!: string | null\r\n @Prop()\r\n public dataFATreePeriodProfile!: PeriodProfilePayload[]\r\n @Prop({ default: false })\r\n public disabled!: boolean\r\n @Prop()\r\n public periodProfileMultiple!: { [key: string]: boolean } | null\r\n\r\n public selectedRP: string | null = null\r\n public periodProfile: { [key: string]: boolean } = {}\r\n\r\n public created() {\r\n if (this.periodProfileMultiple !== null) {\r\n this.periodProfile = this.periodProfileMultiple\r\n } else {\r\n this.periodProfile = this.assembleBlankPeriodProfile()\r\n }\r\n }\r\n\r\n @Watch(\"selectedRP\")\r\n public selectedRPChange() {\r\n if (this.selectedRP) {\r\n const targetPeriodProfileRP = this.dataFATreePeriodProfile.find(\r\n (el: PeriodProfilePayload) => el.id === this.selectedRP\r\n )\r\n\r\n if (targetPeriodProfileRP) {\r\n this.periodProfile = this.assembleBlankPeriodProfile(\r\n _.cloneDeep(targetPeriodProfileRP.periodProfile)\r\n )\r\n } else {\r\n this.periodProfile = this.assembleBlankPeriodProfile()\r\n }\r\n }\r\n }\r\n\r\n @Watch(\"periodProfile\", { deep: true })\r\n public periodProfileChange() {\r\n // emit when periodProfile has changed\r\n this.$emit(\"period-profile-multiple-update\", this.periodProfile)\r\n }\r\n\r\n public assembleBlankPeriodProfile(\r\n periodProfile: { [key: string]: boolean } | null = null\r\n ) {\r\n const defaultPeriodProfile = {\r\n fa_business_activity: false,\r\n fa_foreign_tax_law_required: false,\r\n fa_resident_designated_country: false,\r\n fa_business_designated_country: false,\r\n depreciation_election: false,\r\n dividends_taxable_surplus_first: false,\r\n dividends_acb: false,\r\n sep_changes: false,\r\n recharacterized_property_income: false,\r\n fapi: false,\r\n dividends_from_fa: false,\r\n dividends_pay_tax: false,\r\n dividends_paid: false,\r\n dispositions: false,\r\n consolidation_or_group_relief: false,\r\n }\r\n\r\n return { ...defaultPeriodProfile, ...periodProfile }\r\n }\r\n}\r\nexport default FACopyPeriodOptionsPanel\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FACopyPeriodOptionPanel.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FACopyPeriodOptionPanel.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./FACopyPeriodOptionPanel.vue?vue&type=template&id=4f481e6f&\"\nimport script from \"./FACopyPeriodOptionPanel.vue?vue&type=script&lang=ts&\"\nexport * from \"./FACopyPeriodOptionPanel.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\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\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\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\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\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\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\r\nimport { Component, Prop, Watch } from \"vue-property-decorator\"\r\nimport Datepicker from \"vuejs-datepicker\"\r\nimport { ModelSelect } from \"vue-search-select\"\r\nimport { mixins } from \"vue-class-component\"\r\n// Project Imports\r\nimport {\r\n Taxpayer,\r\n ForeignAffiliate,\r\n ReportingPeriod,\r\n ReportingPeriodTreePayload,\r\n TreePayload,\r\n FieldOptionField,\r\n FieldComplexCopySettings,\r\n CalculatorSection,\r\n CalculatorSectionSubgroup,\r\n ReportingPeriodOptions,\r\n PeriodProfilePayload,\r\n PeriodProfileModified,\r\n SelectedPayload,\r\n} from \"../../interfaces\"\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport CalculatorMixin from \"@/mixins/CalculatorMixin\"\r\nimport LoadingButton from \"@/components/LoadingButton.vue\"\r\nimport CurrencyDropdown from \"@/components/CurrencyDropdown.vue\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport fields from \"@/fixtures/fields\"\r\nimport FACopyConfiguration from \"@/components/fa/FACopyConfiguration.vue\"\r\nimport FACopyOptionsRPCard from \"@/components/fa/FACopyOptionsRPCard.vue\"\r\nimport FACopyOptionsSummary from \"@/components/fa/FACopyOptionsSummary.vue\"\r\nimport FACopyPeriodOptionPanel from \"@/components/fa/FACopyPeriodOptionPanel.vue\"\r\nimport FACopyBridgePeriodOptionPanel from \"@/components/fa/FACopyBridgePeriodOptionPanel.vue\"\r\nimport PeriodOptionPanel from \"@/components/periods/PeriodOptionPanel.vue\"\r\nimport PeriodCallout from \"@/components/periods/PeriodCallout.vue\"\r\nimport _ from \"lodash\"\r\nimport { getDate } from \"@/util/getDate.ts\"\r\n\r\n@Component({\r\n components: {\r\n LoadingButton,\r\n CurrencyDropdown,\r\n Datepicker,\r\n ErrorAlert,\r\n ModelSelect,\r\n FACopyConfiguration,\r\n FACopyOptionsRPCard,\r\n FACopyPeriodOptionPanel,\r\n FACopyBridgePeriodOptionPanel,\r\n PeriodOptionPanel,\r\n PeriodCallout,\r\n FACopyOptionsSummary,\r\n },\r\n})\r\nclass FACopyOptions extends mixins(LoadingMixin, CalculatorMixin) {\r\n @Prop()\r\n public selectedForeignAffiliate!: number | string\r\n @Prop({ default: false })\r\n public disabled!: boolean\r\n @Prop({ required: true })\r\n public copyAcbPeriods!: boolean\r\n\r\n public selectedRP: string | null = null\r\n public selectedRPList: ReportingPeriodOptions[] = []\r\n public selectedRPListPeriodProfileModified: PeriodProfileModified[] = []\r\n\r\n public sections: any = fields\r\n\r\n public dataFATree: ReportingPeriodTreePayload[] = []\r\n public dataFATreeBaseTemp: TreePayload[] = []\r\n public dataFATreeBase: TreePayload[] = []\r\n public reportingPeriodInfoList: ReportingPeriodOptions[] = []\r\n public dataFATreeBaseSectionOnly: TreePayload[] = []\r\n\r\n public dataFATreePeriodProfile: PeriodProfilePayload[] | undefined = []\r\n\r\n public periodProfile: { [key: string]: boolean } = {}\r\n\r\n public foreign_affiliates: ForeignAffiliate[] | undefined = undefined\r\n public foreign_affiliate: ForeignAffiliate | undefined = undefined\r\n\r\n public statusComplexCopyPeriodProfile: boolean = false\r\n public periodProfileModified: { [key: string]: boolean } = {}\r\n public periodProfileModifiedSpecific: boolean = false\r\n\r\n public reportingPeriodOptionsList: ReportingPeriodOptions[] = []\r\n\r\n public periodProfileMultiple: { [key: string]: boolean } | null = null\r\n\r\n public rpCardChoice: string | undefined = \"all\"\r\n\r\n public selectedPayload: SelectedPayload[] = []\r\n\r\n public reportingPeriodId: number | undefined = undefined\r\n\r\n public showModal = {\r\n FAComplexCopy: false,\r\n FAOptionsCopySummary: false,\r\n }\r\n\r\n public created() {\r\n if (this.activeTaxpayer) {\r\n // the current foreign affiliate id\r\n this.foreign_affiliate = this.activeTaxpayer.foreign_affiliates.find(\r\n (el: ForeignAffiliate) => el.id === this.selectedForeignAffiliate\r\n )\r\n\r\n // creates the generic tree base\r\n this.dataFATreeBase = this.getTreeListBase\r\n this.dataFATreeBaseTemp = this.dataFATreeBase\r\n\r\n this.dataFATreeBaseSectionOnly = this.keepSectionRow\r\n this.dataFATreePeriodProfile = this.getPeriodProfile // A backup of the periodProfile tree\r\n\r\n this.reportingPeriodInfoList = this.getRPInfoList\r\n this.reportingPeriodOptionsList = _.cloneDeep(this.reportingPeriodOptions)\r\n }\r\n }\r\n\r\n public get keepSectionRow() {\r\n const dataFATreeBaseSectionOnly = _.cloneDeep(this.dataFATreeBase)\r\n\r\n return dataFATreeBaseSectionOnly.map((el: TreePayload) => {\r\n const { children, optionField, ...remaining } = el\r\n return remaining\r\n })\r\n }\r\n\r\n public periodProfileRPIndicator(value: number) {\r\n /*\r\n Retrieves information on whether a taxation year's period profile has been edited\r\n */\r\n if (this.selectedRPListPeriodProfileModified.length > 0) {\r\n const target = this.selectedRPListPeriodProfileModified.find(\r\n (el: PeriodProfileModified) => el.value === value\r\n )\r\n\r\n if (target) {\r\n return target.periodProfileEdited\r\n }\r\n }\r\n\r\n return false\r\n }\r\n\r\n @Watch(\"selectedRPList\")\r\n public selectedRPListChange(newValue: number[], oldValue: number[]) {\r\n // handles the selectedRPList\r\n if (newValue.length > 0 && this.dataFATree.length === 0) {\r\n // When a RP is selected\r\n this.dataFATree = this.getTreeList\r\n }\r\n\r\n if (newValue.length === 0 && this.dataFATree.length > 0) {\r\n // When all the RP's are removed from selected\r\n this.dataFATree = []\r\n }\r\n }\r\n\r\n @Watch(\"dataFATree\")\r\n @Watch(\"showModal.FAComplexCopy\", { deep: true })\r\n @Watch(\"selectedRPList\")\r\n // @Watch(\"periodProfileMultiple\", { deep: true })\r\n public treeChange() {\r\n /*\r\n Updates the Complex Copy payload for the backend.\r\n */\r\n let targetTreePayload: ReportingPeriodTreePayload[] = []\r\n\r\n if (this.selectedRPList.length === 0) {\r\n targetTreePayload = this.getTreeList\r\n this.selectedRPListPeriodProfileModified = []\r\n } else {\r\n /*\r\n Update data in this.dataFATree for non=selected taxation year.\r\n */\r\n if (this.reportingPeriodOptions.length > 0) {\r\n this.reportingPeriodOptions.map((el: ReportingPeriodOptions) => {\r\n const { value } = el\r\n const index = this.dataFATree.findIndex(\r\n (el: ReportingPeriodTreePayload) => el.id === value\r\n )\r\n this.dataFATree[index].children = _.cloneDeep(this.dataFATreeBase)\r\n })\r\n }\r\n targetTreePayload = this.dataFATree\r\n\r\n // Update the mirroring array of selectedRPList that holds whether a PeriodProfile has been edited\r\n this.selectedRPListPeriodProfileModified = []\r\n this.selectedRPList.map(({ value }: ReportingPeriodOptions) => {\r\n const targetValue = this.dataFATree.find(\r\n (el: ReportingPeriodTreePayload) => value === el.id\r\n )\r\n\r\n this.selectedRPListPeriodProfileModified.push({\r\n value,\r\n periodProfileEdited: targetValue\r\n ? targetValue.periodProfileModified.specific\r\n : false,\r\n })\r\n })\r\n }\r\n\r\n const output = targetTreePayload.map(\r\n ({\r\n children,\r\n periodProfile,\r\n periodProfileModified,\r\n id,\r\n label,\r\n }: ReportingPeriodTreePayload) => {\r\n const { specific } = periodProfileModified\r\n let tempPeriodProfile: { [key: string]: boolean } = {}\r\n\r\n if (specific) {\r\n // keep specific rp profile\r\n tempPeriodProfile = { ...periodProfile }\r\n } else {\r\n if (this.periodProfileMultiple) {\r\n // override profile for multiple RP\r\n tempPeriodProfile = { ...this.periodProfileMultiple }\r\n } else {\r\n // no override profile for multiple RP\r\n tempPeriodProfile = {}\r\n }\r\n }\r\n\r\n return {\r\n id,\r\n label,\r\n selected: this.grabLeafEntry(children),\r\n period_profile: tempPeriodProfile,\r\n }\r\n }\r\n )\r\n\r\n // console.log(targetTreePayload)\r\n // console.log(output)\r\n\r\n this.selectedPayload = output\r\n\r\n this.$emit(\"selected-payload\", output)\r\n }\r\n\r\n @Watch(\"statusComplexCopyPeriodProfile\")\r\n public statusComplexCopyPeriodProfileChange(\r\n newVal: boolean,\r\n oldVal: boolean\r\n ) {\r\n if (newVal === oldVal) {\r\n return\r\n }\r\n\r\n if (newVal === false) {\r\n this.periodProfileMultiple = null\r\n }\r\n }\r\n\r\n @Watch(\"selectedRP\")\r\n public selectedRPChange() {\r\n // Detects when the reporting period that is selected\r\n if (this.selectedRP !== null) {\r\n const targetRP = this.reportingPeriodOptions.find(\r\n (el: ReportingPeriodOptions) => el.value === this.selectedRP\r\n )\r\n\r\n if (targetRP !== undefined) {\r\n this.selectedRPList.push(targetRP)\r\n this.selectedRPList.sort(\r\n (a: ReportingPeriodOptions, b: ReportingPeriodOptions) => {\r\n // @ts-ignore\r\n return getDate(a.startDate) - getDate(b.startDate) // descending\r\n }\r\n )\r\n }\r\n }\r\n this.selectedRP = null\r\n }\r\n\r\n public deleteRPList(reportingPeriodId: number) {\r\n // Deletes selected reporting period\r\n this.selectedRPList = this.selectedRPList.filter(\r\n (el: ReportingPeriodOptions) => el.value !== reportingPeriodId\r\n )\r\n\r\n const index = this.dataFATree.findIndex(\r\n (el: ReportingPeriodTreePayload) => el.id === reportingPeriodId\r\n )\r\n this.dataFATree[index].children = _.cloneDeep(this.dataFATreeBase)\r\n if (this.dataFATreePeriodProfile) {\r\n const findTarget = this.dataFATreePeriodProfile.find(\r\n (el: PeriodProfilePayload) => el.id === reportingPeriodId\r\n )\r\n if (findTarget) {\r\n this.dataFATree[index].periodProfile = _.cloneDeep(\r\n findTarget.periodProfile\r\n )\r\n }\r\n }\r\n this.dataFATree[index].periodProfileModified = { specific: false }\r\n }\r\n\r\n public closeModal() {\r\n this.showModal.FAComplexCopy = false\r\n }\r\n\r\n public openModal(reportingPeriodId: number | undefined) {\r\n // opens a modal, and also switches the dataFATreeBaseTemp accordingly\r\n this.rpCardChoiceType(reportingPeriodId) // toggles components/html for RPCard\r\n if (reportingPeriodId === undefined) {\r\n if (this.selectedRPList.length === 0) {\r\n this.dataFATreeBaseTemp = this.dataFATreeBase\r\n this.periodProfile = {}\r\n } else {\r\n // this.dataFATreeBaseTemp = this.dataFATreeBaseSectionOnly\r\n this.dataFATreeBaseTemp = this.dataFATreeBase\r\n }\r\n this.reportingPeriodId = undefined\r\n } else {\r\n const index = this.dataFATree.findIndex(\r\n (el: ReportingPeriodTreePayload) => el.id === reportingPeriodId\r\n )\r\n // Note: this is retrieving the data by reference.\r\n this.dataFATreeBaseTemp = this.dataFATree[index].children\r\n this.periodProfile = this.dataFATree[index].periodProfile\r\n this.periodProfileModified = this.dataFATree[index].periodProfileModified\r\n\r\n this.periodProfileModifiedSpecific = this.periodProfileModified.specific\r\n this.reportingPeriodId = index\r\n }\r\n this.$set(this.showModal, \"FAComplexCopy\", true)\r\n }\r\n\r\n public rpCardChoiceType(reportingPeriodId: number | undefined) {\r\n if (reportingPeriodId === undefined) {\r\n this.rpCardChoice = \"all\"\r\n } else {\r\n this.rpCardChoice = \"specific\"\r\n }\r\n }\r\n\r\n public grabLeafEntry(children: TreePayload[]): TreePayload[] {\r\n /*\r\n recursively grab values are the end of a branch\r\n */\r\n const output: Array = children.map(\r\n (el: TreePayload) => {\r\n if (!el.children) {\r\n return this.checkLeafEntryChanged(el) ? el : undefined\r\n } else {\r\n return this.grabLeafEntry(el.children)\r\n }\r\n }\r\n )\r\n // exclude undefined objects\r\n return output.flat(1).filter((el: TreePayload | undefined) => el)\r\n }\r\n\r\n public checkLeafEntryChanged(el: TreePayload) {\r\n /*\r\n Checks if if the end leaf of the tree has changed\r\n */\r\n\r\n // either optionField or selected is changed ==> keep\r\n const { optionField, selected } = el\r\n // Check if everything in OptionField is true.\r\n const criteriaOne = optionField\r\n ? !optionField.map((el: FieldOptionField) => el.selected).every(Boolean)\r\n : false\r\n const criteriaTwo = !selected\r\n\r\n return criteriaOne || criteriaTwo\r\n }\r\n\r\n public get getPeriodProfile() {\r\n if (this.foreign_affiliate !== undefined) {\r\n return this.foreign_affiliate.reporting_periods\r\n .reverse()\r\n .map((elRP: ReportingPeriod) => {\r\n return {\r\n id: elRP.id,\r\n periodProfile: {\r\n fa_business_activity: elRP.fa_business_activity,\r\n fa_foreign_tax_law_required: elRP.fa_foreign_tax_law_required,\r\n fa_resident_designated_country:\r\n elRP.fa_resident_designated_country,\r\n fa_business_designated_country:\r\n elRP.fa_business_designated_country,\r\n depreciation_election: elRP.depreciation_election,\r\n dividends_taxable_surplus_first:\r\n elRP.dividends_taxable_surplus_first,\r\n dividends_acb: elRP.dividends_acb,\r\n sep_changes: elRP.sep_changes,\r\n recharacterized_property_income:\r\n elRP.recharacterized_property_income,\r\n fapi: elRP.fapi,\r\n dividends_from_fa: elRP.dividends_from_fa,\r\n dividends_pay_tax: elRP.dividends_pay_tax,\r\n dividends_paid: elRP.dividends_paid,\r\n dispositions: elRP.dispositions,\r\n consolidation_or_group_relief: elRP.consolidation_or_group_relief,\r\n },\r\n }\r\n })\r\n }\r\n }\r\n\r\n // public retrieveBus(data: BusPayload) {\r\n // console.log(\"top level: \", data)\r\n // console.log(this.dataFATreeBase)\r\n // }\r\n\r\n public get reportingPeriodOptions() {\r\n // displays a list of the reporting periods\r\n const existInSelectedRP = (id: string | number | undefined) => {\r\n const filteredRP = this.selectedRPList.filter(\r\n (el: ReportingPeriodOptions) => id === el.value\r\n )\r\n return filteredRP.length > 0\r\n }\r\n\r\n return this.reportingPeriodInfoList\r\n .filter((el: ReportingPeriodOptions) => {\r\n return !existInSelectedRP(el.value)\r\n })\r\n .map(({ text, value, startDate }: ReportingPeriodOptions) => ({\r\n text,\r\n value,\r\n startDate,\r\n }))\r\n }\r\n\r\n public get getTreeListBase() {\r\n const subGroupLevel = (\r\n section: CalculatorSection,\r\n parentOptionField: FieldOptionField[] | undefined\r\n ) => {\r\n return Object.keys(section.subGroups).map((subGroupKey: string) => {\r\n const subGroup = section.subGroups[subGroupKey]\r\n const optionField = subGroup.optionField\r\n ? this.assembleOptionFieldSelected(subGroup.optionField)\r\n : parentOptionField\r\n\r\n const label =\r\n subGroup.name === undefined || subGroup.name === \"\"\r\n ? subGroup.altName\r\n : subGroup.name\r\n\r\n return {\r\n label,\r\n id: subGroupKey,\r\n level: \"subGroup\",\r\n settings: {\r\n show: this.showSetting(subGroup.complexCopySettings),\r\n },\r\n selected: true,\r\n optionField: _.cloneDeep(optionField),\r\n children: fieldsLevel(subGroup, optionField),\r\n }\r\n })\r\n }\r\n\r\n const fieldsLevel = (\r\n subGroup: CalculatorSectionSubgroup,\r\n parentOptionField: FieldOptionField[] | undefined\r\n ) => {\r\n // if altFields exist, loop through altFields instead of fields.\r\n const targetFields = subGroup.altFields\r\n ? subGroup.altFields\r\n : subGroup.fields\r\n\r\n return Object.keys(targetFields).map((fieldKey: string) => {\r\n const field = targetFields[fieldKey]\r\n const optionField = field.optionField\r\n ? this.assembleOptionFieldSelected(field.optionField)\r\n : parentOptionField\r\n return {\r\n label: field.name,\r\n id: fieldKey,\r\n schedule: field.type,\r\n level: \"field\",\r\n selected: true,\r\n settings: {\r\n show: this.showSetting(field.complexCopySettings),\r\n },\r\n optionField: _.cloneDeep(optionField),\r\n }\r\n })\r\n }\r\n\r\n return this.calculatorSections.map((section: CalculatorSection) => {\r\n const optionField = this.assembleOptionFieldSelected(section.optionField)\r\n return {\r\n label: section.name,\r\n id: section.section,\r\n level: \"section\",\r\n settings: {\r\n show: this.showSetting(section.complexCopySettings),\r\n },\r\n selected: true,\r\n optionField: _.cloneDeep(optionField),\r\n children: subGroupLevel(section, optionField),\r\n }\r\n })\r\n }\r\n\r\n public showSetting(\r\n complexCopySettings: FieldComplexCopySettings | undefined\r\n ) {\r\n return complexCopySettings ? !complexCopySettings.entireSection : true\r\n }\r\n\r\n public assembleOptionFieldSelected(data: FieldOptionField[] | undefined) {\r\n /*\r\n Handles the optionField in getTreeListBase\r\n - If the field doesn't exist at the current level, it copies the data from a previous level\r\n - Otherwise it retrieves the data for the field and adds a key of 'selected'\r\n */\r\n if (data === undefined) {\r\n return data\r\n }\r\n return data.map((el: FieldOptionField) => {\r\n el[\"selected\"] = true\r\n return el\r\n })\r\n }\r\n\r\n public get getRPInfoList(): ReportingPeriodOptions[] {\r\n // Gets the list of reporting period information\r\n if (this.foreign_affiliate != undefined) {\r\n return this.foreign_affiliate.reporting_periods\r\n .reverse()\r\n .map((elRP: ReportingPeriod) => {\r\n return {\r\n text: `${elRP.start_date} to ${elRP.end_date}`,\r\n value: elRP.id,\r\n startDate: elRP.start_date,\r\n }\r\n })\r\n } else {\r\n return []\r\n }\r\n }\r\n\r\n public get getTreeList() {\r\n /*\r\n Assembles a JSON for all the RP's with the dataFATreeBase configuration\r\n */\r\n if (this.foreign_affiliate != undefined) {\r\n return this.foreign_affiliate.reporting_periods\r\n .reverse()\r\n .map((elRP: ReportingPeriod) => {\r\n return {\r\n label: `${elRP.start_date} to ${elRP.end_date}`,\r\n id: elRP.id,\r\n level: \"reportingPeriod\",\r\n startDate: elRP.start_date,\r\n children: _.cloneDeep(this.dataFATreeBase),\r\n periodProfile: {\r\n fa_business_activity: elRP.fa_business_activity,\r\n fa_foreign_tax_law_required: elRP.fa_foreign_tax_law_required,\r\n fa_resident_designated_country:\r\n elRP.fa_resident_designated_country,\r\n fa_business_designated_country:\r\n elRP.fa_business_designated_country,\r\n depreciation_election: elRP.depreciation_election,\r\n dividends_taxable_surplus_first:\r\n elRP.dividends_taxable_surplus_first,\r\n dividends_acb: elRP.dividends_acb,\r\n sep_changes: elRP.sep_changes,\r\n recharacterized_property_income:\r\n elRP.recharacterized_property_income,\r\n fapi: elRP.fapi,\r\n dividends_from_fa: elRP.dividends_from_fa,\r\n dividends_pay_tax: elRP.dividends_pay_tax,\r\n dividends_paid: elRP.dividends_paid,\r\n dispositions: elRP.dispositions,\r\n consolidation_or_group_relief: elRP.consolidation_or_group_relief,\r\n },\r\n periodProfileModified: {\r\n specific: false,\r\n },\r\n }\r\n })\r\n } else {\r\n return []\r\n }\r\n }\r\n\r\n public get calculatorSections() {\r\n const sections = Object.keys(this.sections).map((key: string) => {\r\n const section = this.sections[key]\r\n return { ...section, section: key }\r\n })\r\n\r\n return sections.filter(\r\n (el: CalculatorSection) => el.complexCopySettings.show\r\n )\r\n }\r\n\r\n public get disableSummaryOfChanges() {\r\n /*\r\n This function checks if there were any changes for the complex copy\r\n */\r\n if (this.selectedPayload.length === 0) {\r\n return true\r\n }\r\n\r\n const periodProfileExist = this.selectedPayload.map(\r\n (el: SelectedPayload) => Object.keys(el.period_profile).length === 0\r\n )\r\n const selectedExist = this.selectedPayload.map(\r\n (el: SelectedPayload) => el.selected.length === 0\r\n )\r\n\r\n if (periodProfileExist.every(Boolean) && selectedExist.every(Boolean)) {\r\n return true\r\n }\r\n return false\r\n }\r\n\r\n public toggleMultipleSelected(show: boolean) {\r\n /*\r\n This function toggles select/deselect all checkboxes for the FA Copy Options screen.\r\n */\r\n if (show) {\r\n this.dataFATreeBaseTemp.map((el: TreePayload) => {\r\n this.$set(el, \"selected\", show)\r\n })\r\n } else {\r\n const dataFATreeBaseTempAlt = _.cloneDeep(this.dataFATreeBaseTemp)\r\n dataFATreeBaseTempAlt.map((el: TreePayload) => {\r\n el.selected = show\r\n\r\n if (el.children) {\r\n el.children = this.setSelectedChildren(el.children, show)\r\n }\r\n })\r\n\r\n if (this.reportingPeriodId === undefined) {\r\n // for all reporting periods\r\n // due to pass by reference, need to also update the root\r\n this.dataFATreeBase = _.cloneDeep(dataFATreeBaseTempAlt)\r\n this.dataFATreeBaseTemp = this.dataFATreeBase\r\n } else {\r\n // with specific reporting period\r\n // due to pass by reference, need to also update the root\r\n this.dataFATree[this.reportingPeriodId].children = _.cloneDeep(\r\n dataFATreeBaseTempAlt\r\n )\r\n this.dataFATreeBaseTemp = this.dataFATree[\r\n this.reportingPeriodId\r\n ].children\r\n }\r\n }\r\n }\r\n\r\n public setSelectedChildren(childrenArr: TreePayload[], show: boolean) {\r\n /*\r\n Recursive function used with toggleMultipleSelected to toggle 'selected' for the children in a tree list\r\n */\r\n return childrenArr.map((el: TreePayload) => {\r\n el.selected = show\r\n\r\n if (el.children) {\r\n el.children = this.setSelectedChildren(el.children, show)\r\n }\r\n return el\r\n })\r\n }\r\n}\r\nexport default FACopyOptions\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FACopyOptions.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FACopyOptions.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./FACopyOptions.vue?vue&type=template&id=09376dc9&\"\nimport script from \"./FACopyOptions.vue?vue&type=script&lang=ts&\"\nexport * from \"./FACopyOptions.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Watch } from \"vue-property-decorator\"\r\nimport Datepicker from \"vuejs-datepicker\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport { ModelSelect } from \"vue-search-select\"\r\n// Project Imports\r\nimport { Taxpayer } from \"@/interfaces\"\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport { fa } from \"@/services/api\"\r\nimport LoadingButton from \"@/components/LoadingButton.vue\"\r\nimport CurrencyDropdown from \"@/components/CurrencyDropdown.vue\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport { ForeignAffiliate, ReportingPeriodTreePayload } from \"../../interfaces\"\r\nimport FACopyOptions from \"@/components/fa/FACopyOptions.vue\"\r\n\r\n@Component({\r\n components: {\r\n LoadingButton,\r\n CurrencyDropdown,\r\n Datepicker,\r\n ErrorAlert,\r\n ModelSelect,\r\n FACopyOptions,\r\n },\r\n})\r\nclass FACopy extends mixins(LoadingMixin) {\r\n @Prop()\r\n public fetchTaxpayer!: any\r\n @Prop()\r\n public taxpayer!: Taxpayer\r\n @Prop({ default: false })\r\n public edit!: boolean\r\n @Prop()\r\n public closeModal!: any\r\n\r\n public selectedPayload: ReportingPeriodTreePayload[] = []\r\n public statusComplexCopy: boolean = false\r\n public copyAcbPeriods: boolean = true\r\n\r\n private selectedForeignAffiliate: string | null = null\r\n private name: string = this.selectedForeignAffiliateName\r\n\r\n private numberOfCopy = 1\r\n private numberOfCopyList = this.assembleNumberOfCopyList(10)\r\n private currentCopy = 1\r\n\r\n public assembleNumberOfCopyList(maxVal: number) {\r\n const output: Array<{ [key: string]: number }> = []\r\n for (let i = 1; i < maxVal + 1; i++) {\r\n output.push({\r\n value: i,\r\n text: i,\r\n })\r\n }\r\n return output\r\n }\r\n\r\n public get foreignAffiliateOptions() {\r\n return this.taxpayer.foreign_affiliates.map(({ id, name }: Taxpayer) => ({\r\n text: name,\r\n value: id,\r\n }))\r\n }\r\n\r\n public get selectedForeignAffiliateName() {\r\n if (this.selectedForeignAffiliate || !this.taxpayer) {\r\n // @ts-ignore\r\n return this.taxpayer.foreign_affiliates.find(\r\n (el: any) => el.id === this.selectedForeignAffiliate\r\n ).name\r\n } else {\r\n return \"\"\r\n }\r\n }\r\n\r\n @Watch(\"selectedForeignAffiliate\")\r\n public changeName() {\r\n this.name = \"\"\r\n }\r\n\r\n @Watch(\"statusComplexCopy\")\r\n public statusComplexCopyChange(newVal: boolean, oldVal: boolean) {\r\n if (newVal === oldVal) {\r\n return\r\n }\r\n if (newVal === false) {\r\n this.selectedPayload = []\r\n }\r\n }\r\n\r\n public async handleOnSubmit(e: any) {\r\n e.preventDefault()\r\n this.loading = true\r\n const values = {\r\n name: this.name || this.selectedForeignAffiliateName,\r\n taxpayer_id: this.taxpayer.id,\r\n selected: this.selectedPayload,\r\n copy_acb_periods: this.copyAcbPeriods,\r\n }\r\n if (this.selectedForeignAffiliate) {\r\n if (this.numberOfCopy > 1) {\r\n // loops for number of copies minus 1\r\n for (let i = 1; i < this.numberOfCopy; i++) {\r\n this.currentCopy = i\r\n await fa\r\n .copy(this.selectedForeignAffiliate, values)\r\n .catch((err: any) => {\r\n this.error = err\r\n this.$bvToast.toast(`There was an error. Try again later`, {\r\n title: \"Error\",\r\n variant: \"danger\",\r\n autoHideDelay: 5000,\r\n static: true,\r\n })\r\n })\r\n // if an error occurs, quit the function completely.\r\n if (this.error !== \"\") {\r\n this.currentCopy = 1\r\n this.loading = false\r\n return\r\n }\r\n }\r\n this.currentCopy++\r\n }\r\n await fa\r\n .copy(this.selectedForeignAffiliate, values)\r\n .then((faCopy: ForeignAffiliate) => {\r\n this.currentCopy++\r\n this.fetchTaxpayer()\r\n this.closeModal()\r\n this.$emit(\"foreign-affiliate-copied\", faCopy)\r\n })\r\n .catch((err: any) => {\r\n this.error = err\r\n this.$bvToast.toast(`There was an error. Try again later`, {\r\n title: \"Error\",\r\n variant: \"danger\",\r\n autoHideDelay: 5000,\r\n static: true,\r\n })\r\n })\r\n .finally(() => (this.loading = false))\r\n }\r\n }\r\n}\r\n\r\nexport default FACopy\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FACopy.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FACopy.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./FACopy.vue?vue&type=template&id=5c3a3a84&\"\nimport script from \"./FACopy.vue?vue&type=script&lang=ts&\"\nexport * from \"./FACopy.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-dropdown',{class:_vm.dropdownClass,attrs:{\"size\":\"sm\",\"dropright\":\"\",\"variant\":\"link\",\"toggle-class\":\"text-secondary\",\"text\":\"Options\",\"disabled\":_vm.disabled}},[_vm._t(\"default\")],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Vue, Prop } from \"vue-property-decorator\"\r\n\r\n@Component({})\r\nexport default class OptionsDropdown extends Vue {\r\n @Prop({ default: \"my-dropdown align-self-end mb-3 ml-2\" })\r\n public dropdownClass!: string\r\n\r\n @Prop({ default: false })\r\n public disabled!: boolean\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./OptionsDropdown.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./OptionsDropdown.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./OptionsDropdown.vue?vue&type=template&id=39915bba&\"\nimport script from \"./OptionsDropdown.vue?vue&type=script&lang=ts&\"\nexport * from \"./OptionsDropdown.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\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\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\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\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\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Vue } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport dateFns from \"date-fns\"\r\n// Project Imports\r\nimport EditTaxpayer from \"@/components/EditTaxpayer.vue\"\r\nimport FAForm from \"@/components/fa/FAForm.vue\"\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport FAConsolidator from \"@/components/fa/FAConsolidator.vue\"\r\nimport FACopy from \"@/components/fa/FACopy.vue\"\r\nimport OptionsDropdown from \"@/components/utils/OptionsDropdown.vue\"\r\nimport UserMixin from \"@/mixins/UserMixin\"\r\nimport { taxpayer } from \"@/services/api\"\r\nimport {\r\n ForeignAffiliate,\r\n ReportingPeriod,\r\n Taxpayer,\r\n SurplusBalanceTypes,\r\n} from \"@/interfaces\"\r\nimport { getDate } from \"@/util/getDate\"\r\nimport CalculatorMixin from \"../mixins/CalculatorMixin\"\r\n\r\n@Component({\r\n components: { EditTaxpayer, FAConsolidator, FAForm, FACopy, OptionsDropdown },\r\n})\r\nexport default class Home extends mixins(\r\n LoadingMixin,\r\n UserMixin,\r\n CalculatorMixin\r\n) {\r\n public taxpayer!: Taxpayer\r\n // Object to keep track of opened modals\r\n public showModal: any = {\r\n foreignAffiliateForm: {\r\n show: false,\r\n busy: false,\r\n },\r\n FACopy: false,\r\n }\r\n public shouldRefresh: boolean = false\r\n\r\n public taxpayers!: Taxpayer[]\r\n public editTA = false\r\n\r\n public get latestReportingDate() {\r\n let latestDate: string = \"\"\r\n\r\n const foreignAffiliates = this.taxpayer.foreign_affiliates\r\n // Find the latest date amongst all fa's rps\r\n foreignAffiliates.forEach((fa: ForeignAffiliate) => {\r\n if (fa.reporting_periods.length > 0) {\r\n fa.reporting_periods.forEach((rp: ReportingPeriod) => {\r\n if (!latestDate) {\r\n latestDate = rp.end_date\r\n } else if (getDate(rp.end_date) > getDate(latestDate)) {\r\n latestDate = rp.end_date\r\n }\r\n })\r\n }\r\n })\r\n // If there are no reporting periods then the date should be the first year ends\r\n return dateFns.format(\r\n latestDate\r\n ? getDate(latestDate)\r\n : getDate(this.taxpayer.first_taxation_year_ends),\r\n \"YYYY-MM-DD\"\r\n )\r\n }\r\n\r\n public created() {\r\n this.fetchTaxpayer()\r\n this.fetchTaxpayers()\r\n }\r\n\r\n public foreignAffiliateCopied(faCopy: ForeignAffiliate) {\r\n this.$bvToast.toast(\r\n `${faCopy.name} has been created. Click to jump to Foreign Affiliate.`,\r\n {\r\n title: \"Copy created\",\r\n variant: \"success\",\r\n autoHideDelay: 5000,\r\n static: true,\r\n to: `/foreign-affiliates/${faCopy.id}`,\r\n }\r\n )\r\n }\r\n\r\n public closeModal() {\r\n this.showModal.foreignAffiliateForm.show = false\r\n this.showModal.FACopy = false\r\n }\r\n\r\n public fetchTaxpayer() {\r\n this.loading = true\r\n this.error = null\r\n\r\n this.$store\r\n .dispatch(\"calculator/fetchTaxpayer\", {\r\n taxpayerId: parseInt(this.$route.params.id, 10),\r\n params: taxpayer.reportingPeriodConsolidatorParams,\r\n })\r\n .then(() => {\r\n this.taxpayer = this.activeTaxpayer as Taxpayer\r\n })\r\n .catch((err: any) => {\r\n this.error = err\r\n this.$router.push({ name: \"404\" })\r\n })\r\n .finally(() => (this.loading = false))\r\n }\r\n\r\n public fetchTaxpayers() {\r\n this.editTA = false\r\n return taxpayer\r\n .get()\r\n .then((data: any) => {\r\n this.taxpayers = data\r\n })\r\n .catch((err: any) => {\r\n this.error = err\r\n })\r\n .finally(() => (this.editTA = true))\r\n }\r\n\r\n public onModalClose() {\r\n if (this.shouldRefresh) {\r\n this.fetchTaxpayer()\r\n }\r\n }\r\n\r\n public onModalHide(evt: any) {\r\n // Cancel modal close if the modal is busy\r\n if (\r\n this.showModal.foreignAffiliateForm.busy &&\r\n !confirm(\"Upload in progress. Close Modal?\")\r\n ) {\r\n evt.preventDefault()\r\n }\r\n }\r\n}\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Taxpayer.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Taxpayer.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Taxpayer.vue?vue&type=template&id=2e61f982&\"\nimport script from \"./Taxpayer.vue?vue&type=script&lang=ts&\"\nexport * from \"./Taxpayer.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[(_vm.loading || !_vm.activeForeignAffiliate)?_c('b-container',{key:\"loader\"},[_c('loader')],1):_c('b-container',{key:\"content\"},[_c('b-modal',{attrs:{\"size\":\"lg\",\"id\":\"fa_diagnostic_form\",\"title\":\"Import Diagnostics\",\"hide-footer\":\"\",\"no-close-on-backdrop\":\"\"},model:{value:(_vm.showModal.importDiagnostics),callback:function ($$v) {_vm.$set(_vm.showModal, \"importDiagnostics\", $$v)},expression:\"showModal.importDiagnostics\"}},[_c('ImportDiagnostics')],1),_c('b-modal',{attrs:{\"id\":\"fa_form\",\"size\":\"m\",\"title\":'Edit ' + _vm.activeForeignAffiliate.name,\"hide-footer\":\"\",\"no-close-on-backdrop\":\"\"},model:{value:(_vm.showModal.foreignAffiliateForm),callback:function ($$v) {_vm.$set(_vm.showModal, \"foreignAffiliateForm\", $$v)},expression:\"showModal.foreignAffiliateForm\"}},[(_vm.showModal.foreignAffiliateForm)?_c('FAForm',{attrs:{\"fetchData\":_vm.fetchCalcData,\"taxpayerId\":_vm.activeForeignAffiliate.taxpayer.id,\"taxpayerArr\":_vm.taxpayer,\"faArr\":_vm.faArr,\"edit\":true,\"faData\":_vm.activeForeignAffiliate,\"closeModal\":_vm.closeModal}}):_vm._e()],1),_c('b-modal',{attrs:{\"id\":\"period_form\",\"size\":\"m\",\"title\":\"Add taxation year\",\"hide-footer\":\"\",\"no-close-on-backdrop\":\"\"},model:{value:(_vm.showModal.reportingPeriodForm),callback:function ($$v) {_vm.$set(_vm.showModal, \"reportingPeriodForm\", $$v)},expression:\"showModal.reportingPeriodForm\"}},[(_vm.showModal.reportingPeriodForm)?_c('PeriodForm',{attrs:{\"fetchDataProp\":_vm.fetchCalcData,\"foreignAffiliate\":_vm.activeForeignAffiliate},on:{\"closeModal\":_vm.closeModal}}):_vm._e()],1),_c('b-modal',{attrs:{\"id\":\"rp_lock_form\",\"size\":\"xl\",\"title\":\"Lock Taxation Years\",\"hide-footer\":\"\"},model:{value:(_vm.showModal.reportingPeriodLockForm),callback:function ($$v) {_vm.$set(_vm.showModal, \"reportingPeriodLockForm\", $$v)},expression:\"showModal.reportingPeriodLockForm\"}},[(_vm.showModal.reportingPeriodLockForm)?_c('PeriodLockForm',{on:{\"closeModal\":_vm.closeModal}}):_vm._e()],1),_c('b-modal',{attrs:{\"id\":\"acb_settings_form\",\"size\":\"lg\",\"title\":\"ACB Settings\",\"hide-footer\":\"\"},model:{value:(_vm.showModal.acbModuleSettings),callback:function ($$v) {_vm.$set(_vm.showModal, \"acbModuleSettings\", $$v)},expression:\"showModal.acbModuleSettings\"}},[_c('ACBSettings')],1),_vm._t(\"breadcrumbs\",null,{\"activeForeignAffiliate\":_vm.activeForeignAffiliate}),_c('b-row',{attrs:{\"align-v\":\"center\"}},[_c('b-col',{attrs:{\"lg\":\"12\"}},[_c('b-card',{staticClass:\"border-0\"},[_c('b-row',{staticClass:\"ml-0\"},[_c('h1',{staticClass:\"kpmg\"},[_vm._v(_vm._s(_vm.activeForeignAffiliate.name))]),(!_vm.clientLocked)?_c('OptionsDropdown',[_c('b-dropdown-item',{on:{\"click\":function($event){_vm.showModal.foreignAffiliateForm = true}}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"size\":\"sm\",\"icon\":\"edit\"}}),_vm._v(\"Edit\\n \")],1),(!_vm.isClient && _vm.importDiagnostics)?_c('b-dropdown-item',{on:{\"click\":function () { return (_vm.showModal.importDiagnostics = true); }}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"size\":\"sm\",\"icon\":\"file-medical-alt\"}}),_vm._v(\"Diagnostics\\n \")],1):_vm._e(),_c('b-button',{staticClass:\"d-flex justify-content-center mt-4\",style:({ width: '80%', margin: '0 auto' }),attrs:{\"variant\":\"danger\",\"size\":\"sm\"},on:{\"click\":_vm.deleteFA}},[_vm._v(\"Delete\")])],1):_vm._e()],1),(_vm.selectedReportingPeriod)?_c('div',{staticClass:\"mb-3\"},[_c('hr'),_c('span',{staticClass:\"font-weight-bold\"},[_vm._v(\"Taxation Year\")]),_vm._v(\"\\n \"+_vm._s(_vm.selectedReportingPeriod.start_date)+\" to\\n \"+_vm._s(_vm.selectedReportingPeriod.end_date)+\"\\n \"),(!_vm.clientLocked)?_c('EditPeriod',{attrs:{\"foreignAffiliate\":_vm.activeForeignAffiliate}}):_vm._e(),_c('br'),_c('span',[_c('span',{staticClass:\"font-weight-bold\",attrs:{\"data-cy\":\"calculating-currency\"}},[_vm._v(\"\\n Calculating Currency\\n \"),_c('b-badge',{staticClass:\"text-uppercase\",attrs:{\"data-cy\":\"changed-currency\"}},[_vm._v(\"\\n \"+_vm._s(_vm.currency\n ? _vm.currency.fx_currency\n : _vm.activeForeignAffiliate.reporting_surplus_currency)+\"\\n \")])],1)]),_c('br'),(_vm.currency && _vm.currency.fx_rate)?_c('span',[_c('span',{staticClass:\"font-weight-bold\"},[_vm._v(\"\\n Calculating FX Rate\\n \"),_c('h6',{staticStyle:{\"display\":\"inherit\"}},[_c('b-badge',[_vm._v(_vm._s(_vm.currency.fx_rate))])],1)])]):_vm._e()],1):_vm._e(),_c('hr'),_c('div',{staticClass:\"d-flex mt-2\"},[(!_vm.clientLocked)?_c('b-button',{staticClass:\"mr-2\",attrs:{\"variant\":\"primary\",\"size\":\"sm\",\"data-cy\":\"new-rp-button\"},on:{\"click\":function($event){_vm.showModal.reportingPeriodForm = true}}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"size\":\"sm\",\"icon\":\"plus\"}}),_vm._v(\"Add\\n Taxation Year\\n \")],1):_vm._e(),(!_vm.isClient)?_c('b-button',{staticClass:\"mr-2\",attrs:{\"variant\":\"primary\",\"size\":\"sm\",\"data-cy\":\"new-rp-button\"},on:{\"click\":function($event){_vm.showModal.reportingPeriodLockForm = true}}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"size\":\"sm\",\"icon\":\"lock\"}}),_vm._v(\"Lock\\n Taxation Years\\n \")],1):_vm._e(),(!_vm.isClient)?_c('b-button',{staticClass:\"mr-2\",attrs:{\"variant\":\"primary\",\"size\":\"sm\",\"data-cy\":\"acb-settings-button\"},on:{\"click\":function($event){_vm.showModal.acbModuleSettings = true}}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"size\":\"sm\",\"icon\":\"cog\"}}),_vm._v(\"ACB\\n Settings\\n \")],1):_vm._e(),_c('CommentSidebar',{attrs:{\"no-header\":\"\",\"right\":\"\",\"shadow\":\"\",\"backdrop\":\"\",\"buttonVariant\":\"primary\",\"buttonSize\":\"sm\"},scopedSlots:_vm._u([{key:\"button-content\",fn:function(){return [_vm._v(\"\\n Recent Comments\\n \")]},proxy:true}])})],1)],1)],1)],1),_c('br'),_c('transition',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[(_vm.periodOptions.length == 0)?_c('div',[_c('h2',{staticClass:\"text-center\"},[_vm._v(\"\\n No taxation years found.\\n \"),(!_vm.clientLocked)?_c('a',{attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();_vm.showModal.reportingPeriodForm = true}}},[_vm._v(\"Create a taxation year\")]):_vm._e()])]):(!_vm.selectedReportingPeriod)?_c('div',{key:\"periodSelect\"},[_c('b-card',[_c('h2',{staticClass:\"text-center\"},[_vm._v(\"Select a taxation year\")]),_c('hr'),_c('b-form-select',{attrs:{\"data-cy\":\"select-taxation-year\",\"options\":_vm.periodOptions},model:{value:(_vm.selectedReportingPeriodModel),callback:function ($$v) {_vm.selectedReportingPeriodModel=$$v},expression:\"selectedReportingPeriodModel\"}})],1)],1):_c('div',{key:\"calculatorContent\"},[_c('Calculator',{attrs:{\"foreignAffiliate\":_vm.activeForeignAffiliate}})],1)])],2)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {\nvar this$1 = this;\nvar _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[(_vm.loading)?_c('loader',{key:\"loader\"}):_c('div',{key:\"calculator\"},[(_vm.clientLocked)?_c('div',[_c('h4',{staticClass:\"text-center font-weight-light\"},[_vm._v(\"\\n \"+_vm._s(_vm.strings[\"CLIENT_LOCK_MESSAGE\"])+\"\\n \")]),_c('hr')]):_vm._e(),(!_vm.clientHidden)?_c('CalculatorPeriodNavigation',{staticClass:\"mb-3\",attrs:{\"foreignAffiliate\":_vm.foreignAffiliate},on:{\"collapse-all\":function($event){_vm.collapseAll = !_vm.collapseAll},\"expand-all\":function($event){_vm.expandAll = !_vm.expandAll}}}):_vm._e(),(!_vm.clientHidden)?_c('div',{staticClass:\"p-2\"},_vm._l((_vm.calculatorSections),function(value,key){return _c('CalculatorSection',{key:(\"calc-sec-\" + key),attrs:{\"section\":value,\"collapseAll\":_vm.collapseAll,\"expandAll\":_vm.expandAll}})}),1):_vm._e(),(!_vm.clientHidden)?_c('transition',{attrs:{\"name\":\"fade\"}},[_c('div',{key:\"toggle\",staticClass:\"fixed-bottom justify-content-center bg-white rounded pt-3 pb-3 calc-footer\"},[_c('b-container',[_c('span',{staticClass:\"text-muted font-weight-bold\"},[_vm._v(\"\\n \"+_vm._s(this.foreignAffiliate.name)+\"\\n \")])]),(!_vm.isClient)?_c('b-button',{directives:[{name:\"b-hover\",rawName:\"v-b-hover\",value:(function ($event) { return (this$1.isHoveredFooter = $event); }),expression:\"$event => (this.isHoveredFooter = $event)\"}],staticClass:\"m-0 p-0\",class:_vm.visible ? null : 'collapsed',attrs:{\"id\":\"footer-toggle\",\"block\":\"\",\"variant\":\"link\",\"aria-expanded\":_vm.visible ? 'true' : 'false',\"aria-controls\":\"collapse-footer\"},on:{\"click\":function($event){_vm.visible = !_vm.visible}}},[_c('font-awesome-icon',{staticClass:\"when-closed\",attrs:{\"opacity\":_vm.isHoveredFooter ? 1.0 : 0.6,\"icon\":\"chevron-up\"}}),_c('font-awesome-icon',{staticClass:\"when-opened\",attrs:{\"opacity\":_vm.isHoveredFooter ? 1.0 : 0.6,\"icon\":\"chevron-down\"}})],1):_vm._e(),_c('b-collapse',{attrs:{\"id\":\"collapse-footer\"},model:{value:(_vm.visible),callback:function ($$v) {_vm.visible=$$v},expression:\"visible\"}},[_c('b-container',{key:\"bottomActionBar\"},[_c('b-row',{attrs:{\"align-v\":\"center\"}},[(!_vm.isClient)?_c('b-col',{attrs:{\"cols\":\"8\"}},[_c('b-collapse',{staticClass:\"text-center\",attrs:{\"visible\":\"\",\"id\":\"collapse-balances\"}},[_c('b-row',[_c('b-col',[_c('div',{staticClass:\"closing-balance-label\"},[_c('span',[_vm._v(\"Exempt Surplus/(Deficit)\")])]),_c('span',{staticClass:\"font-weight-bold\"},[_vm._v(_vm._s(_vm.exemptBalance()))])]),_c('b-col',[_c('div',{staticClass:\"closing-balance-label\"},[_c('span',[_vm._v(\"Hybrid Surplus/(Deficit)\")])]),_c('span',{staticClass:\"font-weight-bold\"},[_vm._v(_vm._s(_vm.hybridBalance()))])]),_c('b-col',[_c('div',{staticClass:\"closing-balance-label\"},[_c('span',[_vm._v(\"Taxable Surplus/(Deficit)\")])]),_c('span',{staticClass:\"font-weight-bold\"},[_vm._v(_vm._s(_vm.taxableBalance()))])])],1),_c('b-row',[_c('b-col',[(_vm.isAcbEnabled)?_c('div',[_c('div',{staticClass:\"closing-balance-label\"},[_c('span',[_vm._v(\"ACB\")])]),_c('span',{staticClass:\"font-weight-bold\"},[_vm._v(_vm._s(_vm.acbBalance()))])]):_vm._e()]),_c('b-col',[_c('div',{staticClass:\"closing-balance-label\"},[_c('span',[_vm._v(\"Hybrid Underlying Tax\")])]),_c('span',{staticClass:\"font-weight-bold\"},[_vm._v(_vm._s(_vm.hutBalance()))])]),_c('b-col',[_c('div',{staticClass:\"closing-balance-label\"},[_c('span',[_vm._v(\"Underlying Foreign Tax\")])]),_c('span',{staticClass:\"font-weight-bold\"},[_vm._v(_vm._s(_vm.uftBalance()))])])],1),_c('b-row',[_c('b-col',[_c('small',{staticClass:\"text-primary\"},[_vm._v(\"\\n Note: These balances reflect the 90-day rule for the\\n current taxation year.\\n \")])])],1)],1)],1):_vm._e(),_c('b-col',{attrs:{\"offset\":!_vm.isClient ? 0 : 8,\"cols\":\"4\"}},[_c('div',[(!_vm.isClient)?_c('CalculatorBreakdown'):_vm._e(),_c('b-modal',{attrs:{\"no-close-on-backdrop\":\"\",\"hide-footer\":\"\",\"size\":\"xxxl\",\"title\":(\"Export - \" + (_vm.foreignAffiliate.name))},model:{value:(_vm.showModal),callback:function ($$v) {_vm.showModal=$$v},expression:\"showModal\"}},[(!_vm.isClient && _vm.showModal)?_c('CalculatorOutput',{staticClass:\"mt-2\",attrs:{\"foreignAffiliate\":_vm.foreignAffiliate,\"buttonClass\":'function-bar-button ',\"buttonVariant\":'primary'}}):_vm._e()],1),(!_vm.isClient)?_c('div',[_c('b-button',{class:'function-bar-button mt-2',attrs:{\"block\":\"\",\"variant\":'primary'},on:{\"click\":function () { return (_vm.showModal = true); }}},[_vm._v(\"\\n Output\\n \")])],1):_vm._e(),_c('FANavigationSidebar',{attrs:{\"no-header\":\"\",\"right\":\"\",\"shadow\":\"\",\"backdrop\":\"\",\"buttonClass\":\"function-bar-button mt-2\",\"buttonVariant\":\"primary\",\"buttonStyle\":\"width:100%\"},scopedSlots:_vm._u([{key:\"button-content\",fn:function(){return [_vm._v(\"\\n Navigate to another FA\\n \")]},proxy:true}],null,false,2315499871)})],1)])],1)],1)],1)],1)]):_vm._e()],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"mb-4 mt-4\"},[_c('b-row',{staticClass:\"calculator-section bg-light\",attrs:{\"align-v\":\"center\"}},[_c('b-col',{staticClass:\"pointer pt-3 pb-3 d-flex section-drop-arrow justify-content-center\",attrs:{\"cols\":\"1\"},on:{\"click\":function($event){_vm.showing = !_vm.showing}}},[_c('div',[_c('font-awesome-icon',{class:_vm.showing ? 'text-primary' : 'text-secondary',style:({\n fontSize: '1 rem',\n }),attrs:{\"size\":\"sm\",\"icon\":_vm.showing ? 'chevron-circle-down' : 'chevron-circle-right'}})],1)]),_c('b-col',{staticStyle:{\"cursor\":\"pointer\"},attrs:{\"data-cy\":(\"section-\" + (_vm.section.key))},on:{\"click\":function($event){_vm.showing = !_vm.showing}}},[_c('div',{staticClass:\"pt-3 pb-3 font-weight-bold d-flex align-items-baseline\"},[_vm._v(\"\\n \"+_vm._s(((_vm.section.section ? _vm.section.section + \".\" : \"\") + \" \" + (_vm.section.name)))+\"\\n \")])]),(!_vm.isClient)?_c('b-col',{staticClass:\"d-flex\",attrs:{\"cols\":\"3\"}},[_c('label',{staticClass:\"ml-auto mb-0 mr-2 text-muted font-italic\",attrs:{\"for\":\"switch_1\"}},[_vm._v(\"Section Reviewed (For Reviewers Purpose Only)\")]),_c('b-form-checkbox',{staticStyle:{\"font-size\":\"0.88rem\"},attrs:{\"value\":true,\"unchecked-value\":false},on:{\"change\":_vm.reviewCheckboxChange},model:{value:(_vm.reviewed),callback:function ($$v) {_vm.reviewed=$$v},expression:\"reviewed\"}})],1):_vm._e()],1),_c('b-collapse',{attrs:{\"id\":\"collapse-4\"},model:{value:(_vm.showing),callback:function ($$v) {_vm.showing=$$v},expression:\"showing\"}},[_c('transition',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[_c('div',[_c('b-row',{staticClass:\"mb-4\",attrs:{\"align-v\":\"end\"}},[_c('b-col',{attrs:{\"cols\":\"3\"}}),_vm._l((_vm.displayedPriorPeriods),function(reportingPeriod,index){return _c('b-col',{key:(\"prior-period-col-\" + index)})}),_c('b-col',{staticClass:\"active-period\"}),_c('b-col')],2),_vm._l((_vm.subGroups),function(subGroup,key){return _c('div',{key:key},[_c('CalculatorSubSection',{attrs:{\"subGroup\":subGroup}})],1)})],2)])],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"mb-4\"},[(_vm.subGroup.name)?_c('h6',{staticClass:\"text-primary pb-2\"},[_vm._v(\"\\n \"+_vm._s(_vm.subGroup.name)+\"\\n \"),(_vm.subGroup.zeroToggle && !_vm.isClient)?_c('b-form-checkbox',{staticClass:\"float-right\",attrs:{\"value\":true,\"unchecked-value\":false},model:{value:(_vm.showZeroes),callback:function ($$v) {_vm.showZeroes=$$v},expression:\"showZeroes\"}},[_vm._v(\"Show zero rows\")]):_vm._e()],1):_vm._e(),_c('p',[_vm._v(_vm._s(_vm.subGroup.desc))]),_vm._l((_vm.subGroup.fields),function(field,metaId){return _c('div',{key:(\"calc-row-\" + (_vm.subGroup.name) + \"-\" + metaId)},[_c('transition',{attrs:{\"name\":\"fade-fast\",\"mode\":\"out-in\"}},[_c('CalculatorRow',{directives:[{name:\"show\",rawName:\"v-show\",value:(!_vm.showZeroes ? !_vm.isZeroRow(metaId) : true),expression:\"!showZeroes ? !isZeroRow(metaId) : true\"}],attrs:{\"field\":Object.assign({}, field, {meta_id: metaId})}})],1)],1)}),(_vm.subGroup.subtotal && !_vm.isClient)?_c('CalculatorRowSubtotal',{attrs:{\"fields\":_vm.mapFields(_vm.subGroup.fields)}}):_vm._e()],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-row',{staticClass:\"mb-2\",attrs:{\"align-v\":\"center\"}},[(_vm.field.desc)?_c('b-popover',{ref:(\"popover-\" + (_vm.field.meta_id)),attrs:{\"target\":(\"popover-\" + (_vm.field.meta_id)),\"placement\":\"right\",\"title\":\"Description\",\"triggers\":\"click blur\"}},[_c('div',{staticClass:\"popover-container\"},[_vm._v(_vm._s(_vm.field.desc))])]):_vm._e(),_c('b-col',{staticClass:\"pb-3\",attrs:{\"cols\":\"3\"}},[_c('b-row',[_c('b-col',[_c('div',{staticClass:\"pl-3\"},[_c('p',{staticClass:\"font-weight-light mb-1\"},[_vm._v(_vm._s(_vm.field.name))])])]),_c('b-col',{staticClass:\"p-0\",attrs:{\"cols\":\"1\"}},[(_vm.field.desc)?_c('a',{attrs:{\"href\":\"#\",\"id\":(\"popover-\" + (_vm.field.meta_id))},on:{\"click\":function($event){$event.preventDefault();}}},[_c('font-awesome-icon',{attrs:{\"icon\":\"info-circle\"}})],1):_vm._e()])],1)],1),_vm._l((_vm.displayedPriorPeriods),function(reportingPeriod,index){return _c('b-col',{key:(\"prior-period-col-\" + index)},[(reportingPeriod && _vm.field.type)?_c('div',[(_vm.field.type === 'input')?_c('CalculatorInput',{key:(\"calc-input-\" + (_vm.field.meta_id) + \"-prior-\" + index),attrs:{\"reportingPeriod\":reportingPeriod,\"field\":_vm.field}}):(_vm.field.type === 'schedule')?_c('CalculatorSchedule',{key:(\"calc-input-\" + (_vm.field.meta_id) + \"-prior-\" + index),attrs:{\"reportingPeriod\":reportingPeriod,\"field\":_vm.field}}):(_vm.isReadOnlyField(_vm.field.type))?_c('CalculatorReadOnly',{key:(\"calc-input-\" + (_vm.field.meta_id) + \"-prior-\" + index),attrs:{\"field\":_vm.field,\"reportingPeriod\":reportingPeriod}}):_vm._e()],1):_vm._e()])}),_c('b-col',[(_vm.selectedReportingPeriod && _vm.field.type)?_c('div',[(_vm.field.type === 'input')?_c('CalculatorInput',{key:(\"calc-input-\" + (_vm.field.meta_id) + \"-current\"),attrs:{\"reportingPeriod\":_vm.selectedReportingPeriod,\"field\":_vm.field}}):(_vm.field.type === 'schedule')?_c('CalculatorSchedule',{key:(\"calc-input-\" + (_vm.field.meta_id) + \"-current\"),attrs:{\"reportingPeriod\":_vm.selectedReportingPeriod,\"field\":_vm.field}}):(_vm.isReadOnlyField(_vm.field.type))?_c('CalculatorReadOnly',{key:(\"calc-input-\" + (_vm.field.meta_id) + \"-current\"),attrs:{\"field\":_vm.field,\"reportingPeriod\":_vm.selectedReportingPeriod}}):_vm._e()],1):_vm._e()]),_c('b-col',[(_vm.nextReportingPeriod && _vm.field.type)?_c('div',[(_vm.field.type === 'input')?_c('CalculatorInput',{key:(\"calc-input-\" + (_vm.field.meta_id) + \"-next\"),attrs:{\"reportingPeriod\":_vm.nextReportingPeriod,\"field\":_vm.field}}):(_vm.field.type === 'schedule')?_c('CalculatorSchedule',{key:(\"calc-input-\" + (_vm.field.meta_id) + \"-next\"),attrs:{\"reportingPeriod\":_vm.nextReportingPeriod,\"field\":_vm.field}}):(_vm.isReadOnlyField(_vm.field.type))?_c('CalculatorReadOnly',{key:(\"calc-input-\" + (_vm.field.meta_id) + \"-next\"),attrs:{\"field\":_vm.field,\"reportingPeriod\":_vm.nextReportingPeriod}}):_vm._e()],1):_vm._e()])],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('transition',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[_c('div',[(_vm.reportingPeriod && _vm.show)?_c('b-form-group',{key:\"input\"},[_c('b-input-group',[(!_vm.isClient)?_c('ReviewSection',{key:(\"calc-review-section-\" + (_vm.field.meta_id) + \"-\" + (_vm.reportingPeriod.id)),attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":_vm.field}}):_vm._e(),_c('b-form-input',{key:_vm.field.id,class:{ 'field-changed': _vm.changesMade, 'text-right': true },attrs:{\"readonly\":_vm.readonly,\"formatter\":_vm.formatter,\"lazy-formatter\":\"\",\"type\":\"text\"},on:{\"contextmenu\":function($event){$event.preventDefault();return _vm.openMenu($event)},\"blur\":_vm.onBlur},nativeOn:{\"focus\":function($event){return (function () { return ($event.target.value == 0 ? $event.target.select() : null); })($event)}},model:{value:(_vm.localValue),callback:function ($$v) {_vm.localValue=$$v},expression:\"localValue\"}})],1)],1):_c('div',{key:\"spinner\",staticClass:\"text-center\"},[_c('b-spinner',{attrs:{\"small\":\"\"}})],1)],1)]),(!_vm.readonly)?_c('vue-context',{ref:\"menu\",on:{\"open\":_vm.menuOpened}},[_c('li',[_c('b-button',{attrs:{\"size\":\"sm\",\"disabled\":!_vm.changesMade,\"block\":\"\",\"variant\":\"link\"},on:{\"click\":function($event){$event.preventDefault();return _vm.revertChange($event)}}},[_vm._v(\"Revert\")])],1)]):_vm._e()],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import Vue from \"vue\"\r\nexport const EventBus = new Vue()\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (!_vm.componentName || _vm.reviews.length != 0)?_c('b-input-group-prepend',[_c('b-input-group-text',[_c('div',{staticClass:\"review-section\"},[_c('span',{attrs:{\"id\":_vm.object\n ? (\"popover-id-\" + (_vm.field.meta_id) + \"-\" + (_vm.reportingPeriod.id) + \"-\" + (_vm.object.id))\n : (\"popover-id-\" + (_vm.field.meta_id) + \"-\" + (_vm.reportingPeriod.id))}},[(_vm.reviewIconComplete > 0)?_c('span',{staticClass:\"text-muted\"},[_c('font-awesome-icon',{staticStyle:{\"color\":\"green\"},attrs:{\"size\":\"sm\",\"icon\":\"user-check\"}}),_vm._v(\"\\n \"+_vm._s(_vm.reviewIconComplete)+\"\\n \")],1):_vm._e(),(_vm.reviewIconPartial > 0)?_c('span',{staticClass:\"text-muted\"},[_c('font-awesome-icon',{staticStyle:{\"color\":\"goldenrod\"},attrs:{\"size\":\"sm\",\"icon\":\"user-check\"}}),_vm._v(\"\\n \"+_vm._s(_vm.reviewIconPartial)+\"\\n \")],1):_vm._e()]),_c('b-popover',{attrs:{\"target\":_vm.object\n ? (\"popover-id-\" + (_vm.field.meta_id) + \"-\" + (_vm.reportingPeriod.id) + \"-\" + (_vm.object.id))\n : (\"popover-id-\" + (_vm.field.meta_id) + \"-\" + (_vm.reportingPeriod.id)),\"triggers\":\"hover\",\"placement\":_vm.object ? 'left' : 'top'}},[(_vm.reviews.length > 0)?_c('div',_vm._l((_vm.reviews),function(review,index){return _c('div',{key:index,staticClass:\"row-reviewers\"},[_c('b-row',{staticClass:\"row-reviewers\"},[_c('b-col',{staticClass:\"checkCol p-0 text-left\",attrs:{\"cols\":\"2\"}},[_c('font-awesome-icon',{attrs:{\"size\":\"sm\",\"icon\":\"check\"}})],1),_c('b-col',{staticClass:\"usernameCol col-7\"},[_vm._v(_vm._s(review.reviewer_details.username))]),(review.count)?_c('b-col',{staticClass:\"p-0 text-right col-3\"},[_vm._v(\"\\n \"+_vm._s(review.count)+\" / \"+_vm._s(review.max)+\"\\n \")]):_vm._e()],1),_c('b-row',{staticClass:\"row-reviewers\"},[_c('b-col',{staticClass:\"dateCol text-muted font-weight-light\"},[_vm._v(\"\\n \"+_vm._s(review.count != undefined ? \"Last\" : \"\")+\"\\n \"+_vm._s(_vm.formatDate(review.date_reviewed)))])],1)],1)}),0):_c('div',[_vm._v(\"\\n No reviews\\n \")])]),(!_vm.componentName)?_c('b-form-checkbox',{staticClass:\"ml-2\",attrs:{\"checked\":_vm.reviewed,\"disabled\":!_vm.readonly},on:{\"change\":_vm.reviewCheckboxChange}}):_vm._e()],1)])],1):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { ACBAdjustmentType } from \"@/interfaces\"\r\nimport { Component, Vue } from \"vue-property-decorator\"\r\nimport { namespace } from \"vuex-class\"\r\n\r\nconst calculatorModule = namespace(\"calculator\")\r\n@Component\r\nexport default class OptionTypesMixin extends Vue {\r\n @calculatorModule.State(\"acbAdjustmentTypes\")\r\n public acbAdjustmentTypes!: ACBAdjustmentType[]\r\n\r\n public FTCAdjustmentTypeOptions: any[] = [\r\n {\r\n value: \"exempt_surplus\",\r\n text: \"Exempt Surplus/(Deficit)\",\r\n },\r\n {\r\n value: \"hybrid_surplus\",\r\n text: \"Hybrid Surplus/(Deficit)\",\r\n },\r\n {\r\n value: \"taxable_surplus\",\r\n text: \"Taxable Surplus/(Deficit)\",\r\n },\r\n {\r\n value: \"hybrid_underlying_taxes\",\r\n text: \"Hybrid Underlying Taxes\",\r\n },\r\n {\r\n value: \"underlying_foreign_taxes\",\r\n text: \"Underlying Foreign Taxes\",\r\n },\r\n ]\r\n\r\n public adjustmentTypeOptions: any[] = [\r\n {\r\n value: \"exempt_earnings\",\r\n text: \"Exempt Earnings\",\r\n },\r\n {\r\n value: \"taxable_earnings\",\r\n text: \"Taxable Earnings\",\r\n },\r\n {\r\n value: \"exempt_surplus\",\r\n text: \"Exempt Surplus/(Deficit)\",\r\n },\r\n {\r\n value: \"hybrid_surplus\",\r\n text: \"Hybrid Surplus/(Deficit)\",\r\n },\r\n {\r\n value: \"taxable_surplus\",\r\n text: \"Taxable Surplus/(Deficit)\",\r\n },\r\n {\r\n value: \"hybrid_underlying_taxes\",\r\n text: \"Hybrid Underlying Taxes\",\r\n },\r\n {\r\n value: \"underlying_foreign_taxes\",\r\n text: \"Underlying Foreign Taxes\",\r\n },\r\n ]\r\n\r\n public categoryOptions: any[] = [\r\n {\r\n value: \"E\",\r\n text: \"Exempt Surplus/(Deficit) of another FA\",\r\n },\r\n {\r\n value: \"H\",\r\n text: \"Hybrid Surplus/(Deficit) of another FA\",\r\n },\r\n {\r\n value: \"T\",\r\n text: \"Taxable Surplus/(Deficit) of another FA\",\r\n },\r\n {\r\n value: \"S112\",\r\n text: \"Deductible Under S.112\",\r\n },\r\n ]\r\n\r\n public dividendTypeOptions: any[] = [\r\n {\r\n value: \"E\",\r\n text: \"Exempt\",\r\n },\r\n {\r\n value: \"H\",\r\n text: \"Hybrid\",\r\n },\r\n {\r\n value: \"T\",\r\n text: \"Taxable\",\r\n },\r\n {\r\n value: \"S112\",\r\n text: \"Deductible Under S.112\",\r\n },\r\n ]\r\n\r\n public dispositionTypeOptions: any[] = [\r\n {\r\n value: \"excluded_property\",\r\n text: \"Shares of FA/Partnership Interest - Excluded property\",\r\n },\r\n {\r\n value: \"capital_loss\",\r\n text: \"Capital Loss - DLAD - non-EP-shares of FA\",\r\n },\r\n ]\r\n\r\n public get acbAdjustmentTypeOptions(): any[] {\r\n const options = this.acbAdjustmentTypes\r\n .map(acbType => {\r\n return {\r\n value: acbType.id,\r\n text: acbType.name,\r\n }\r\n })\r\n .sort((a, b) => a.text.localeCompare(b.text))\r\n\r\n options.push({\r\n value: 0,\r\n text: \"Other (specify below)\",\r\n })\r\n\r\n return options\r\n }\r\n}\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"text-muted font-weight-light\"},[_c('h6',[_vm._v(\"\\n Foreign Affiliate:\\n \"),_c('span',{staticClass:\"font-weight-bold\"},[_vm._v(_vm._s(this.foreignAffiliate.name))]),_c('br',{staticClass:\"mb-1\"}),_vm._v(\"Taxation Year:\\n \"),_c('span',{staticClass:\"font-weight-bold\"},[_vm._v(_vm._s(this.reportingPeriod.start_date)+\" to\\n \"+_vm._s(this.reportingPeriod.end_date))])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Vue } from \"vue-property-decorator\"\r\nimport { ForeignAffiliate, ReportingPeriod } from \"../../../interfaces\"\r\n\r\n@Component\r\nexport default class ScheduleHeader extends Vue {\r\n @Prop({ required: true })\r\n public foreignAffiliate!: ForeignAffiliate\r\n @Prop({ required: true })\r\n public reportingPeriod!: ReportingPeriod\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ScheduleHeader.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ScheduleHeader.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./ScheduleHeader.vue?vue&type=template&id=c2f538cc&\"\nimport script from \"./ScheduleHeader.vue?vue&type=script&lang=ts&\"\nexport * from \"./ScheduleHeader.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import accounting from \"accounting\"\r\nimport dateFns from \"date-fns\"\r\nimport { Component, Mixins, Prop } from \"vue-property-decorator\"\r\n// Project Imports\r\nimport {\r\n ForeignAffiliate,\r\n Taxpayer,\r\n ReportingPeriod,\r\n Dividend,\r\n DividendTier,\r\n} from \"@/interfaces\"\r\nimport CalculatorMixin from \"@/mixins/CalculatorMixin\"\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport { taxpayer } from \"@/services/api\"\r\nimport OptionTypesMixin from \"./OptionTypesMixin\"\r\nimport UserMixin from \"./UserMixin\"\r\nimport ScheduleHeader from \"@/components/calculator/schedules/ScheduleHeader.vue\"\r\n\r\n@Component({\r\n components: {\r\n ScheduleHeader,\r\n },\r\n})\r\nexport default class ScheduleMixin extends Mixins(\r\n CalculatorMixin,\r\n LoadingMixin,\r\n OptionTypesMixin,\r\n UserMixin\r\n) {\r\n @Prop({ default: true })\r\n public editable!: boolean\r\n public foreignAffiliates: ForeignAffiliate[] = []\r\n public editData: any = null\r\n public taxpayer!: Taxpayer\r\n // Form Validation Variables\r\n public refValidationRules = \"required|max:20\"\r\n\r\n public get priorDividends(): Dividend[] {\r\n if (this.priorReportingPeriods && this.selectedReportingPeriod) {\r\n const periods = [\r\n ...this.priorReportingPeriods,\r\n this.selectedReportingPeriod,\r\n ]\r\n return periods\r\n .flatMap((rp: ReportingPeriod) => {\r\n if (rp.dividends) {\r\n return rp.dividends\r\n }\r\n return []\r\n })\r\n .sort(\r\n (a: Dividend, b: Dividend) =>\r\n new Date(a.date).getTime() - new Date(b.date).getTime()\r\n )\r\n }\r\n return []\r\n }\r\n\r\n public prompt: any = {\r\n title: \"Delete\",\r\n message: \"Delete Dividend?\",\r\n show: false,\r\n defer: null,\r\n }\r\n\r\n public fetchTaxpayer() {\r\n const { foreignAffiliate } = this.calculator\r\n if (foreignAffiliate && foreignAffiliate.taxpayer) {\r\n this.loading = true\r\n taxpayer.get(foreignAffiliate.taxpayer).then((res: Taxpayer) => {\r\n this.loading = false\r\n this.taxpayer = res\r\n this.foreignAffiliates = res.foreign_affiliates.filter(\r\n (fa: ForeignAffiliate) => {\r\n return fa.id !== foreignAffiliate.id\r\n }\r\n )\r\n })\r\n }\r\n }\r\n\r\n public getOptionText(options: any[], value: string, faName: string = \"\") {\r\n const match = options.find(option => {\r\n return option.value == value\r\n })\r\n if (match && match.text && faName) {\r\n return (match.text as string).replace(\"another FA\", faName)\r\n }\r\n return (match && match.text) || \"\"\r\n }\r\n\r\n public getForeignAffiliateName(id: string | number) {\r\n const fa = this.activeTaxpayerForeignAffiliates.find(f => f.id == id)\r\n return fa ? fa.name : \"\"\r\n }\r\n\r\n public onPromptCallback(result: boolean) {\r\n if (result) {\r\n this.prompt.defer.resolve()\r\n } else {\r\n this.prompt.defer.reject()\r\n }\r\n\r\n // Reset the object\r\n this.prompt.show = false\r\n this.prompt.defer = null\r\n }\r\n\r\n public validateData(tableFields: any[], data: any): any {\r\n const validatedData: any = { ...data }\r\n tableFields.forEach((field: any) => {\r\n const { key, type } = field\r\n if (data.hasOwnProperty(key)) {\r\n const value = data[key]\r\n switch (type) {\r\n case \"number\":\r\n validatedData[key] = accounting.unformat(value)\r\n break\r\n case \"date\":\r\n validatedData[key] = dateFns.format(value, \"YYYY-MM-DD\")\r\n break\r\n case \"checkbox\":\r\n validatedData[key] = value === true\r\n break\r\n default:\r\n validatedData[key] = value\r\n break\r\n }\r\n }\r\n })\r\n\r\n return validatedData\r\n }\r\n\r\n public createField(\r\n fieldData: any,\r\n reportingPeriod: ReportingPeriod,\r\n parentField: any\r\n ) {\r\n const newField = {\r\n value: fieldData.value,\r\n reporting_period: reportingPeriod.id,\r\n field_name: {\r\n parent: parentField.field_name.id,\r\n meta_id: null,\r\n metadata: JSON.stringify(fieldData),\r\n user_created: true,\r\n },\r\n }\r\n return newField\r\n }\r\n\r\n public updateField(newFieldData: any, oldFieldData: any) {\r\n const newMetadata = {\r\n ...JSON.parse(oldFieldData.field_name.metadata),\r\n ...newFieldData,\r\n }\r\n const newField = {\r\n id: oldFieldData.id,\r\n value: newFieldData.value,\r\n reporting_period: oldFieldData.reporting_period,\r\n field_name: {\r\n id: oldFieldData.field_name.id,\r\n parent: oldFieldData.field_name.parent,\r\n meta_id: null,\r\n metadata: JSON.stringify(newMetadata),\r\n user_created: true,\r\n },\r\n }\r\n return newField\r\n }\r\n\r\n public getMetadata(metadata: any) {\r\n return metadata ? JSON.parse(metadata) : {}\r\n }\r\n}\r\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\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\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\r\nimport { Component, Prop, Mixins, Watch } from \"vue-property-decorator\"\r\nimport _ from \"lodash\"\r\nimport { VueContext } from \"vue-context\"\r\nimport dateFns from \"date-fns\"\r\nimport {\r\n ReportingPeriod,\r\n Review,\r\n User,\r\n Adjustment,\r\n Dividend,\r\n} from \"../../interfaces\"\r\n\r\n// Project imports\r\nimport ScheduleMixin from \"../../mixins/ScheduleMixin\"\r\n\r\ninterface ReviewAggregate {\r\n reviewer: number\r\n reviewer_details: User\r\n date_reviewed: string\r\n count: number\r\n max: number\r\n}\r\n\r\n@Component({ components: { VueContext } })\r\nexport default class ReviewSection extends Mixins(ScheduleMixin) {\r\n public initialFlag: boolean = false\r\n public show: boolean = true\r\n public localValue: string = \"\"\r\n public countReviewer: any = []\r\n\r\n @Prop({ required: true })\r\n public reportingPeriod!: ReportingPeriod\r\n @Prop({ required: true })\r\n public field!: any\r\n @Prop()\r\n public componentName!: string\r\n @Prop() // only exists when inside a schedule for b-table\r\n public object!: any\r\n\r\n public formatDate(date: any) {\r\n // Timezone shorthand was retrived from here: https://stackoverflow.com/a/66180857\r\n\r\n const dateObj = new Date(date)\r\n const intlObj: any = new Intl.DateTimeFormat(\"en-us\", {\r\n timeZoneName: \"short\",\r\n })\r\n\r\n const timeZone = intlObj\r\n .formatToParts(dateObj)\r\n .find((part: any) => part.type == \"timeZoneName\").value\r\n\r\n return dateFns.format(date, \"MMM DD, YYYY hh:mm:ss A\").concat(\" \", timeZone)\r\n }\r\n\r\n public reviewCheckboxChange(value: boolean) {\r\n const entry_id =\r\n this.modelName === \"FieldValue\" && !this.object\r\n ? this.periodField(this.field.meta_id, this.reportingPeriod.id).id\r\n : this.object.id\r\n\r\n const obj = {\r\n model_name: this.modelName,\r\n entry_id,\r\n }\r\n\r\n if (value) {\r\n this.addReview(obj)\r\n } else {\r\n this.deleteReview(obj)\r\n }\r\n }\r\n\r\n public get modelName() {\r\n // FieldValue, Dividend, DispositionAdjustment, SEPAdjustmentPeriod, Adjustment, ACBAdjustment\r\n const { meta_id } = this.field\r\n\r\n switch (meta_id) {\r\n case \"dividends_paid\":\r\n case \"dividends_received\":\r\n return \"Dividend\"\r\n case \"hybrid_disposition\":\r\n return \"DispositionAdjustment\"\r\n case \"sep_adjustments\":\r\n return \"SEPAdjustmentPeriod\"\r\n case \"acb_adjustments\":\r\n return \"ACBAdjustment\"\r\n case \"other_inclusions\":\r\n case \"foreign_tax_consolidation\":\r\n return \"Adjustment\"\r\n default:\r\n return \"FieldValue\"\r\n }\r\n }\r\n\r\n public get reviews(): Array {\r\n // Case where the values are for one field AKA not a schedule\r\n if (this.componentName) {\r\n let targetElement: any[] = []\r\n switch (this.componentName) {\r\n case \"SepAdjustmentsSchedule\":\r\n targetElement = this.reportingPeriod.sep_adjustments || []\r\n break\r\n case \"HybridDispositionSchedule\":\r\n targetElement = this.reportingPeriod.disposition_adjustments || []\r\n break\r\n case \"AcbAdjustmentsSchedule\":\r\n targetElement = this.reportingPeriod.acb_adjustments || []\r\n break\r\n case \"OtherInclusionsSchedule\":\r\n targetElement =\r\n // @ts-ignore\r\n this.reportingPeriod.adjustments.filter(\r\n (el: Adjustment) =>\r\n JSON.parse(el.metadata).meta_id === \"other_inclusions\"\r\n ) || []\r\n break\r\n case \"ForeignTaxConsolidationSchedule\":\r\n targetElement =\r\n // @ts-ignore\r\n this.reportingPeriod.adjustments.filter(\r\n (el: Adjustment) =>\r\n JSON.parse(el.metadata).meta_id === \"foreign_tax_consolidation\"\r\n ) || []\r\n break\r\n case \"DividendsPaidSchedule\":\r\n targetElement =\r\n // @ts-ignore\r\n this.reportingPeriod.dividends.filter(\r\n (d: Dividend) => d.type === \"P\"\r\n ) || []\r\n break\r\n case \"DividendsReceivedSchedule\":\r\n targetElement =\r\n // @ts-ignore\r\n this.reportingPeriod.dividends.filter(\r\n (d: Dividend) => d.type === \"R\"\r\n ) || []\r\n break\r\n case \"FitrSchedule\":\r\n targetElement = this.periodFieldReviewsFITR || []\r\n break\r\n default:\r\n targetElement = this.userCreatedFields || []\r\n break\r\n }\r\n\r\n const reviews = targetElement\r\n .map(te => te.reviews)\r\n .reduce((acc, val) => acc.concat(val), [])\r\n\r\n const reviewsGroupedByReviewer = _.groupBy(reviews, \"reviewer\")\r\n\r\n return Object.values(reviewsGroupedByReviewer).map(reviews => {\r\n const descReviews = reviews.reverse()\r\n return {\r\n reviewer: descReviews[0].reviewer,\r\n reviewer_details: descReviews[0].reviewer_details,\r\n date_reviewed: descReviews[0].date_reviewed,\r\n count: descReviews.length,\r\n max: targetElement ? targetElement.length : 0,\r\n }\r\n })\r\n } else if (this.object) {\r\n return this.object.reviews\r\n } else {\r\n // FieldValue\r\n return this.periodFieldReviews(\r\n this.field.meta_id,\r\n this.reportingPeriod.id\r\n )\r\n }\r\n }\r\n\r\n public get periodFieldReviewsFITR() {\r\n const FITRmetaID = [\r\n \"fitr_income_tax_refunded\",\r\n \"fitr_capital_gain_loss_hybrid\",\r\n \"fitr_other_foreign_income_tax\",\r\n \"fitr_foreign_active_earnings_before_reg5907\",\r\n \"fitr_capital_gain_loss\",\r\n \"fitr_capital_gain_loss_taxable\",\r\n \"fitr_capital_gain_loss_fapi\",\r\n \"fitr_fapi\",\r\n \"fitr_income_loss_recharacterized_952a\",\r\n \"fitr_income_loss_recharacterized_952a_taxable\",\r\n \"fitr_items_not_earnings_nil\",\r\n ]\r\n\r\n return FITRmetaID.map(metaID =>\r\n this.periodField(metaID, this.reportingPeriod.id)\r\n )\r\n }\r\n\r\n public get reviewed() {\r\n return this.reviews.some((reviewEntry: any) => {\r\n return reviewEntry.reviewer == this.$store.state.user.data.id\r\n })\r\n }\r\n\r\n public get reviewIconComplete() {\r\n if (this.componentName && this.reviews) {\r\n const reviewAggregates = this.reviews as ReviewAggregate[]\r\n return reviewAggregates.filter((r: ReviewAggregate) => r.count == r.max)\r\n .length\r\n } else {\r\n return this.reviews.length || 0\r\n }\r\n }\r\n\r\n public get reviewIconPartial() {\r\n if (this.componentName && this.reviews) {\r\n const reviewAggregates = this.reviews as ReviewAggregate[]\r\n return reviewAggregates.filter((r: ReviewAggregate) => r.count != r.max)\r\n .length\r\n } else {\r\n return 0\r\n }\r\n }\r\n\r\n public get readonly() {\r\n return this.isReportingPeriodEditable(this.reportingPeriod)\r\n }\r\n\r\n public get parentField() {\r\n return this.periodField(this.field.meta_id, this.reportingPeriod.id)\r\n }\r\n\r\n public get userCreatedFields() {\r\n if (this.reportingPeriod.fields && this.parentField) {\r\n return (\r\n this.reportingPeriod.fields\r\n .filter(\r\n f =>\r\n f.field_name.user_created &&\r\n f.field_name.parent == this.parentField.field_name.id\r\n )\r\n // Include the metadata as part of the field\r\n .map((f: any) => {\r\n const metadata = this.getMetadata(f.field_name.metadata)\r\n const obj = { ...f }\r\n for (const key of Object.keys(metadata)) {\r\n if (obj[key] === undefined) {\r\n obj[key] = metadata[key]\r\n }\r\n }\r\n return obj\r\n })\r\n )\r\n } else {\r\n return []\r\n }\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReviewSection.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ReviewSection.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./ReviewSection.vue?vue&type=template&id=41928d4e&scoped=true&\"\nimport script from \"./ReviewSection.vue?vue&type=script&lang=ts&\"\nexport * from \"./ReviewSection.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./ReviewSection.vue?vue&type=style&index=0&id=41928d4e&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"41928d4e\",\n null\n \n)\n\nexport default component.exports","\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Taxpayer, ReportingPeriod } from \"@/interfaces\"\r\nimport { Component, Vue, Prop, Emit, Watch } from \"vue-property-decorator\"\r\nimport { State, Action, Getter } from \"vuex-class\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport _ from \"lodash\"\r\nimport { VueContext } from \"vue-context\"\r\nimport accounting from \"accounting\"\r\nimport dateFns from \"date-fns\"\r\n\r\n// Project imports\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport { EventBus } from \"./calc-event-bus\"\r\nimport CalculatorMixin from \"@/mixins/CalculatorMixin\"\r\nimport UserMixin from \"../../mixins/UserMixin\"\r\nimport ReviewSection from \"@/components/calculator/ReviewSection.vue\"\r\n\r\n// @ts-ignore\r\n@Component({ components: { VueContext, ReviewSection } })\r\nexport default class CalculatorInput extends mixins(\r\n CalculatorMixin,\r\n UserMixin\r\n) {\r\n public initialFlag: boolean = false\r\n public show: boolean = true\r\n public localValue: string = \"\"\r\n public reviews: any = []\r\n\r\n @Prop({ required: true })\r\n public reportingPeriod!: ReportingPeriod\r\n @Prop({ required: true })\r\n public field!: any\r\n\r\n @Watch(\"reportingPeriod\", { immediate: true })\r\n public periodChange() {\r\n this.show = false\r\n setTimeout(() => {\r\n this.show = true\r\n }, 100)\r\n }\r\n\r\n @Watch(\"value\", { immediate: true })\r\n public valueChange() {\r\n const unformatted = accounting.unformat(this.localValue)\r\n if (unformatted === this.value) {\r\n return\r\n }\r\n this.localValue = formatMoney(\r\n this.value,\r\n this.field.precision ? this.field.precision : 0\r\n )\r\n }\r\n\r\n @Watch(\"localValue\", { immediate: true })\r\n public localValueChange() {\r\n const { sign } = this.field\r\n let unformatted = accounting.unformat(this.localValue)\r\n if (unformatted === this.value) {\r\n return\r\n }\r\n if (sign) {\r\n unformatted = Math.abs(unformatted)\r\n if (sign === \"-\") {\r\n unformatted *= -1\r\n }\r\n this.localValue = this.formatter(unformatted.toString(), null)\r\n }\r\n this.value = unformatted\r\n }\r\n\r\n public get changesMade() {\r\n return (\r\n !this.readonly &&\r\n this.periodFieldValue(this.field.meta_id, this.reportingPeriod.id) !==\r\n this.periodFieldValue(this.field.meta_id, this.reportingPeriod.id, true)\r\n )\r\n }\r\n\r\n public get editable() {\r\n return this.isReportingPeriodEditable(this.reportingPeriod)\r\n }\r\n\r\n public get readonly() {\r\n return this.field.readonly || !this.editable\r\n }\r\n\r\n public get value() {\r\n if (this.reportingPeriod) {\r\n return (\r\n this.periodFieldValue(this.field.meta_id, this.reportingPeriod.id) || 0\r\n )\r\n }\r\n }\r\n\r\n public set value(newValue) {\r\n if (newValue === this.value || this.readonly || !this.reportingPeriod) {\r\n return\r\n }\r\n const { meta_id } = this.field\r\n const { id } = this.reportingPeriod\r\n this.calculatorValueChange({\r\n metaId: meta_id,\r\n reportingPeriodId: id,\r\n value: newValue,\r\n })\r\n this.value = newValue\r\n }\r\n\r\n public formatter(value: string, evt: any) {\r\n const formatted = formatMoney(\r\n value,\r\n this.field.precision ? this.field.precision : 0\r\n )\r\n return formatted\r\n }\r\n\r\n public onBlur() {\r\n this.calculateSurplus()\r\n this.saveFieldValues()\r\n }\r\n\r\n public revertChange() {\r\n this.value = this.periodFieldValue(\r\n this.field.meta_id,\r\n this.reportingPeriod.id,\r\n true\r\n )\r\n this.calculateSurplus()\r\n this.saveFieldValues()\r\n }\r\n\r\n public openMenu(event: any) {\r\n if (this.$refs.menu) {\r\n // tslint:disable-next-line\r\n ;(this.$refs.menu as any).open(event)\r\n }\r\n }\r\n\r\n public menuOpened() {\r\n if (this.$refs.menu) {\r\n EventBus.$emit(\"menuOpened\", this.$refs.menu)\r\n }\r\n }\r\n\r\n public mounted() {\r\n // Init local value\r\n this.localValue = formatMoney(\r\n this.value,\r\n this.field.precision ? this.field.precision : 0\r\n )\r\n\r\n // Listen for the menuOpened event, to avoid having multiple menus open.\r\n if (this.$refs.menu) {\r\n EventBus.$on(\"menuOpened\", (menuRef: any) => {\r\n if (this.$refs.menu && this.$refs.menu !== menuRef) {\r\n // tslint:disable-next-line\r\n ;(this.$refs.menu as any).close()\r\n }\r\n })\r\n }\r\n\r\n this.reviews = this.periodFieldReviews(\r\n this.field.meta_id,\r\n this.reportingPeriod.id\r\n )\r\n // console.log(this.reviews)\r\n // console.log(this.reviews.length)\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorInput.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorInput.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./CalculatorInput.vue?vue&type=template&id=27ec1a51&scoped=true&\"\nimport script from \"./CalculatorInput.vue?vue&type=script&lang=ts&\"\nexport * from \"./CalculatorInput.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./CalculatorInput.vue?vue&type=style&index=0&id=27ec1a51&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"27ec1a51\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.showModal)?_c('b-modal',{attrs:{\"size\":\"xxl\",\"no-close-on-backdrop\":\"\",\"hide-footer\":\"\",\"data-cy\":\"calculator-schedule-modal\"},model:{value:(_vm.showModal),callback:function ($$v) {_vm.showModal=$$v},expression:\"showModal\"}},[_c(_vm.scheduleName,{tag:\"component\",attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":_vm.field,\"formatter\":_vm.formatter,\"editable\":_vm.editable},on:{\"schedule-done\":function($event){_vm.showModal = false}}}),_c('hr'),_c('CommentSection',{staticClass:\"comments-section\",attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"metaId\":_vm.field.meta_id}})],1):_vm._e(),_c('b-row',[_c('b-col',[(_vm.locked)?_c('b-tooltip',{key:(\"rp-\" + (_vm.reportingPeriod.id) + \"-edit-schedule-\" + (_vm.field.meta_id) + \"-tooltip\"),attrs:{\"target\":(\"rp-\" + (_vm.reportingPeriod.id) + \"-edit-schedule-\" + (_vm.field.meta_id) + \"-button\"),\"triggers\":\"hover\"}},[_vm._v(\"Taxation year is locked. You won't be able to make any\\n edits.\")]):_vm._e(),(!_vm.noConsolFields.includes(_vm.field.meta_id))?_c('b-input-group',[(!_vm.isClient)?_c('ReviewSection',{key:(\"calc-review-section-\" + (_vm.field.meta_id) + \"-\" + (_vm.reportingPeriod.id) + \"-\" + _vm.componentKey),attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":_vm.field,\"componentName\":_vm.scheduleName}}):_vm._e(),_c('CommentResolutionStatus',{attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"metaId\":_vm.field.meta_id,\"wrapper\":\"b-input-group-prepend\",\"wrapperProps\":{\n 'is-text': true,\n }}}),_c('b-form-input',{staticClass:\"text-right custom-disabled\",attrs:{\"disabled\":\"\"},model:{value:(_vm.total),callback:function ($$v) {_vm.total=$$v},expression:\"total\"}}),_c('b-input-group-append',[_c('b-button',{key:(\"rp-\" + (_vm.reportingPeriod.id) + \"-edit-schedule-\" + (_vm.field.meta_id) + \"-button\"),attrs:{\"id\":(\"rp-\" + (_vm.reportingPeriod.id) + \"-edit-schedule-\" + (_vm.field.meta_id) + \"-button\"),\"variant\":_vm.buttonVariant},on:{\"click\":function () { return (_vm.showModal = true); }}},[(_vm.editable)?_c('span',{attrs:{\"data-cy\":(\"rp-\" + (_vm.reportingPeriod.id) + \"-edit-schedule-\" + (_vm.field.meta_id))}},[_c('font-awesome-icon',{attrs:{\"icon\":\"edit\"}})],1):_c('span',{attrs:{\"data-cy\":(\"rp-\" + (_vm.reportingPeriod.id) + \"-view-schedule-\" + (_vm.field.meta_id))}},[_c('font-awesome-icon',{attrs:{\"icon\":\"search\"}})],1)])],1)],1):_c('div',[_c('b-button',{key:(\"rp-\" + (_vm.reportingPeriod.id) + \"-edit-schedule-\" + (_vm.field.meta_id) + \"-button\"),attrs:{\"id\":(\"rp-\" + (_vm.reportingPeriod.id) + \"-edit-schedule-\" + (_vm.field.meta_id) + \"-button\"),\"block\":\"\",\"variant\":_vm.buttonVariant},on:{\"click\":function () { return (_vm.showModal = true); }}},[(_vm.editable)?_c('span',[_c('font-awesome-icon',{attrs:{\"icon\":\"edit\",\"data-cy\":(\"rp-\" + (_vm.reportingPeriod.id) + \"-edit-schedule-\" + (_vm.field.meta_id))}})],1):_c('span',{attrs:{\"data-cy\":(\"rp-\" + (_vm.reportingPeriod.id) + \"-view-schedule-\" + (_vm.field.meta_id))}},[_c('font-awesome-icon',{attrs:{\"icon\":\"search\"}})],1)])],1)],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-row',{attrs:{\"align-v\":\"center\"}},[_c('b-col',[_c('h2',[_vm._v(\"Dividends Paid\")]),_c('ScheduleHeader',{attrs:{\"foreignAffiliate\":_vm.activeForeignAffiliate,\"reportingPeriod\":_vm.reportingPeriod}})],1)],1),(_vm.prompt.show)?_c('prompt-window',{attrs:{\"title\":_vm.prompt.title,\"message\":_vm.prompt.message,\"showCancel\":true},on:{\"prompt-result\":_vm.onPromptCallback}},[_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"confirmButton\",\"variant\":\"danger\"},slot:\"confirmButton\"},[_vm._v(\"Delete\")]),_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"cancelButton\",\"variant\":\"success\"},slot:\"cancelButton\"},[_vm._v(\"Cancel\")])],1):_vm._e(),_c('AddForm',{attrs:{\"formTitle\":\"Edit Dividend\",\"formFields\":_vm.tableFields,\"formData\":_vm.editData,\"edit\":true,\"modalSize\":\"xl\"},on:{\"form-submit\":_vm.editDividendPaid,\"modal-close\":function () { return (_vm.editData = null); }},scopedSlots:_vm._u([{key:\"dividend_tiers\",fn:function(slotProps){return [_c('dividend-tiers',_vm._b({},'dividend-tiers',slotProps,false))]}}])}),(_vm.loading)?_c('b-row',[_c('b-col',{staticClass:\"text-center\"},[_c('b-spinner',{staticClass:\"large-spinner\"})],1)],1):_c('div',[_c('ErrorAlert',{attrs:{\"error\":_vm.error}}),_c('Table',{attrs:{\"fields\":_vm.tableFields,\"items\":_vm.DividendsPaid,\"slots\":_vm.tableSlots},scopedSlots:_vm._u([{key:\"row-details\",fn:function(props){return [(!_vm.isClient)?_c('DividendPaidBreakdown',{attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"dividend\":props.row.item}}):_vm._e()]}},{key:\"schedule_93\",fn:function(data){return [_c('b-form-group',[_c('b-form-checkbox',{attrs:{\"disabled\":\"\",\"readonly\":\"\"},model:{value:(data.item.schedule_93),callback:function ($$v) {_vm.$set(data.item, \"schedule_93\", $$v)},expression:\"data.item.schedule_93\"}})],1)]}},{key:\"preacq_designation\",fn:function(data){return [_c('b-form-group',[_c('b-form-checkbox',{attrs:{\"disabled\":\"\",\"readonly\":\"\"},model:{value:(data.item.preacq_designation),callback:function ($$v) {_vm.$set(data.item, \"preacq_designation\", $$v)},expression:\"data.item.preacq_designation\"}})],1)]}},{key:\"category\",fn:function(data){return [_vm._v(\"\\n \"+_vm._s(_vm.getOptionText(_vm.categoryOptions, data.item.category))+\"\\n \")]}},{key:\"actions\",fn:function(data){return [_c('b-button-group',{staticClass:\"float-right w-100\"},[(!_vm.isClient)?_c('ReviewSection',{key:(\"calc-review-section-\" + (_vm.field.meta_id) + \"-\" + (_vm.reportingPeriod.id) + \"-\" + (data.item.id)),attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":_vm.field,\"object\":data.item}}):_vm._e(),_c('b-button',{attrs:{\"variant\":\"secondary\",\"size\":\"sm\"},on:{\"click\":function () { return (_vm.editData = data.item); }}},[_c('font-awesome-icon',{attrs:{\"icon\":\"cog\"}})],1),_c('b-button',{attrs:{\"variant\":\"danger\",\"size\":\"sm\"},on:{\"click\":function($event){return _vm.removeDividendPaid(data)}}},[_c('font-awesome-icon',{attrs:{\"icon\":\"trash\"}})],1)],1)]}},{key:\"dividend_tiers\",fn:function(data){return [_c('div',{staticClass:\"d-flex align-items-center justify-content-between\"},[_vm._v(\"\\n \"+_vm._s(_vm.formatDividendTiers(data.item))+\"\\n \"),(\n !_vm.isClient &&\n data.item.dividend_tiers.filter(function (dt) { return dt.foreign_affiliate; })\n .length\n )?_c('b-button',{staticClass:\"float-right\",attrs:{\"size\":\"sm\",\"variant\":\"light\"},on:{\"click\":data.row.toggleDetails}},[_vm._v(_vm._s(data.row.detailsShowing ? \"Hide\" : \"Show\")+\" Details\")]):_vm._e()],1)]}}])},[(_vm.editable)?_c('template',{slot:\"action-bar\"},[_c('AddForm',{key:\"div-paid-form\",attrs:{\"formTitle\":\"New Dividend\",\"formFields\":_vm.tableFields,\"modalSize\":\"xl\"},on:{\"form-submit\":_vm.addNewDividendPaid},scopedSlots:_vm._u([{key:\"dividend_tiers\",fn:function(slotProps){return [_c('dividend-tiers',_vm._b({},'dividend-tiers',slotProps,false))]}}],null,false,1025315964)},[(_vm.loading)?_c('b-spinner',{attrs:{\"slot\":\"buttonContent\"},slot:\"buttonContent\"}):_vm._e()],1)],1):_vm._e()],2)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import Calculator from \"./services/calculator/Calculator\"\r\nimport { Movement } from \"./services/calculator/Alteration\"\r\n\r\nexport interface LoginDetails {\r\n username: string\r\n password: string\r\n otp?: string\r\n}\r\n\r\nexport interface LoginResponseOk {\r\n access: string\r\n refresh: string\r\n}\r\n\r\nexport type ProfileType = \"CA\" | \"CO\"\r\n\r\nexport interface OutputProfile {\r\n id?: string | number\r\n values: any\r\n name: string\r\n type: ProfileType\r\n [key: string]: any\r\n}\r\n\r\nexport interface Taxpayer {\r\n id?: number\r\n name: string\r\n first_taxation_year_begins: string\r\n first_taxation_year_ends: string\r\n client_access_expires: string\r\n reporting_currency: string\r\n foreign_affiliates: any[]\r\n output_profiles?: OutputProfile[]\r\n owners?: any[]\r\n user_profile?: any\r\n}\r\n\r\nexport interface User {\r\n id: number\r\n username: string\r\n first_name: string\r\n last_name: string\r\n email: string\r\n client: boolean\r\n groups: any[]\r\n output_profiles?: OutputProfile[]\r\n user_permissions: any[]\r\n client_persist?: boolean\r\n}\r\n\r\nexport interface ForeignAffiliate {\r\n name: string\r\n first_year_begins: string\r\n country: string\r\n reporting_surplus_currency: string\r\n exempt_surplus_opening_balance: number\r\n hybrid_surplus_opening_balance: number\r\n taxable_surplus_opening_balance: number\r\n pre_acquisition_surplus_opening_balance: number\r\n hybrid_underlying_tax_opening_balance: number\r\n underlying_foreign_tax_opening_balance: number\r\n acb_opening_balance: number\r\n taxpayer: string\r\n id?: string\r\n reporting_periods: ReportingPeriod[]\r\n exemptSurplus?: number\r\n hybridSurplus?: number\r\n opening_sep?: number\r\n opening_re_deficit?: number\r\n reporting_rate?: number\r\n last_updated?: Date\r\n client_locked?: boolean\r\n client_hidden?: boolean\r\n acb_enabled: boolean\r\n acb_periods: ACBPeriod[]\r\n}\r\n\r\nexport interface ReportingPeriod {\r\n id?: string | number\r\n dividend_tiers: DividendTier[]\r\n dividends?: Dividend[]\r\n fields?: any[]\r\n localFields?: any\r\n sep_adjustments?: SEPAdjustment[]\r\n adjustments?: Adjustment[]\r\n acb_adjustments?: ACBAdjustment[]\r\n disposition_adjustments?: any[]\r\n fa_resident_designated_country: boolean\r\n fitr_manually_allocate?: boolean\r\n fa_business_activity: boolean\r\n fa_foreign_tax_law_required: boolean\r\n fa_business_designated_country: boolean\r\n depreciation_election: boolean\r\n dividends_taxable_surplus_first: boolean\r\n dividends_acb: boolean\r\n sep_changes: boolean\r\n recharacterized_property_income: boolean\r\n fapi: boolean\r\n dividends_from_fa: boolean\r\n dividends_pay_tax: boolean\r\n dividends_paid: boolean\r\n dispositions: boolean\r\n consolidation_or_group_relief: boolean\r\n start_date: string\r\n end_date: string\r\n foreign_affiliate: string\r\n closing_sep?: number\r\n fx_rate: number\r\n fx_currency: string\r\n openings?: SurplusBalanceTypes\r\n closings?: SurplusBalanceTypes\r\n calculator?: Calculator\r\n calculated_value?: any\r\n metadata?: any\r\n sepOpening?: number\r\n lock_status: ReportingPeriodLockStatus\r\n comments: Comment[]\r\n}\r\n\r\n/**\r\n * KPMG = K\r\n * Client = C\r\n */\r\nexport type CommentType = \"K\" | \"C\"\r\n\r\nexport interface Comment {\r\n id?: number\r\n comment: string\r\n date_created: string\r\n last_updated: string\r\n meta_id: string\r\n reporting_period: number\r\n user: number\r\n user_details: User\r\n type: CommentType\r\n}\r\n\r\nexport interface Review {\r\n id?: number\r\n date_reviewed: string\r\n object_id: number\r\n reviewer: number\r\n content_type: number\r\n reviewer_details: User\r\n model_name: string\r\n}\r\n\r\n/**\r\n * U = Unlocked\r\n * CL = Client Locked\r\n * L = Locked (Every User)\r\n */\r\nexport type ReportingPeriodLockStatus = \"U\" | \"CL\" | \"L\"\r\n\r\nexport interface Params {\r\n [key: string]: any\r\n includes: any\r\n}\r\n\r\nexport interface SEPAdjustment {\r\n id?: string | number\r\n reporting_period: number | string\r\n date: string\r\n amount: number\r\n result_of_share_issuance: boolean\r\n total?: number\r\n multiplier?: number\r\n ref: string\r\n client_ref: string\r\n reviews: Review[]\r\n}\r\n\r\nexport type DividendType = \"P\" | \"R\"\r\n\r\nexport type DividendCategory = \"E\" | \"T\" | \"H\" | \"S112\" | \"HUT\" | \"UFT\"\r\n\r\nexport interface Dividend {\r\n id?: string | number\r\n reporting_period?: number | string\r\n date: string\r\n ref: string\r\n client_ref: string\r\n amount: number\r\n category: DividendCategory\r\n schedule_93: boolean\r\n type: DividendType\r\n recipient?: string | number | undefined\r\n payer?: string | number | undefined\r\n tax_on_amount: number\r\n hut_amount: number\r\n uft_amount: number\r\n preacq_designation: boolean\r\n dividend_tiers: DividendTier[]\r\n parent_tier: string | number | undefined\r\n tier_owner: string | number | undefined\r\n tier: DividendTier | undefined\r\n reviews: Review[]\r\n}\r\n\r\nexport interface DividendTier {\r\n id?: string | number\r\n dividend?: number | string\r\n dividend_received?: number | string\r\n foreign_affiliate?: number | string\r\n direct_to_taxpayer?: boolean\r\n amount: number\r\n percentage: number\r\n fx_rate?: number | null\r\n fx_amount?: number | null\r\n fx_tax_on_amount?: number | null\r\n date?: string | undefined\r\n payer_id?: number | undefined\r\n payer_name?: string | undefined\r\n tax_on_amount: number\r\n schedule_93?: boolean\r\n}\r\n\r\nexport type AdjustmentType =\r\n | \"exempt_earnings\"\r\n | \"taxable_earnings\"\r\n | \"exempt_surplus\"\r\n | \"hybrid_surplus\"\r\n | \"pre_acq_surplus\"\r\n | \"pre_acq_recharacterized\"\r\n | \"taxable_surplus\"\r\n | \"hybrid_underlying_taxes\"\r\n | \"underlying_foreign_taxes\"\r\n | \"excluded_property\"\r\n | \"capital_loss\"\r\n\r\nexport interface Adjustment {\r\n id: string | number\r\n type: AdjustmentType\r\n date: string | Date\r\n reporting_period: string | number\r\n client_ref: string\r\n ref: string\r\n amount: number\r\n metadata: string\r\n reviews: Review[]\r\n}\r\n\r\nexport interface ACBAdjustment {\r\n id: string | number\r\n type: number\r\n new_type?: string\r\n date: string | Date\r\n reporting_period: string | number\r\n client_ref: string\r\n ref: string\r\n amount: number\r\n metadata: string\r\n reviews: Review[]\r\n}\r\n\r\nexport interface SurplusBalanceTypes {\r\n [key: string]: any\r\n exemptBalance: number\r\n hybridBalance: number\r\n taxableBalance: number\r\n preAcqBalance: number\r\n preAcqRecharBalance: number\r\n hutBalance: number\r\n uftBalance: number\r\n acbBalance: number\r\n recharacterizedAmounts?: SurplusBalanceTypes\r\n openingReDeficit?: number\r\n}\r\n\r\nexport interface BalanceSnapshot {\r\n [key: string]: any\r\n exemptBalance: number\r\n hybridBalance: number\r\n taxableBalance: number\r\n hutBalance: number\r\n uftBalance: number\r\n sep: number\r\n}\r\n\r\nexport interface EarningsTypes {\r\n exemptEarnings: number\r\n taxableEarnings: number\r\n}\r\n\r\nexport interface BalanceTypes {\r\n surplusBalances: SurplusBalanceTypes\r\n earnings: EarningsTypes\r\n}\r\n\r\nexport class Deferred {\r\n public promise: Promise | undefined\r\n public resolve: any\r\n public reject: any\r\n\r\n constructor() {\r\n this.promise = new Promise((resolve, reject) => {\r\n this.resolve = resolve\r\n this.reject = reject\r\n })\r\n }\r\n}\r\n\r\nexport type DispositionType = \"excluded_property\" | \"capital_loss\"\r\n\r\nexport interface DispositionAdjustment {\r\n id?: string | number\r\n reporting_period: number | string\r\n date: string\r\n amount: number\r\n tax_on_amount: number\r\n type: DispositionType\r\n client_ref: string\r\n ref: string\r\n}\r\n\r\nexport interface ExemptSurplusPeriod {\r\n closing_after_last_sep: number\r\n closing_surplus: number\r\n deemed_dividends_paid_s93_11: number\r\n deemed_dividends_received_from_surplus_s93_or_11: number\r\n dividends_paid: number\r\n dividends_received_deductible_under_s112: number\r\n dividends_received_from_surplus_of_another_fa: number\r\n other_additions: number\r\n sep_adjustment: number\r\n surplus_before_dividend_payout: number\r\n tax_adj_consolidation: number\r\n tax_refunded_paid: number\r\n total_change: number\r\n}\r\n\r\nexport interface SepPeriods {\r\n [key: string]: ExemptSurplusPeriod | any\r\n}\r\n\r\nexport interface SurplusOrderingItem {\r\n [key: string]: any\r\n type: string\r\n movement: Movement\r\n balance: number\r\n}\r\n\r\nexport interface ReconciliationBuckets {\r\n [key: string]: number\r\n book_income_before_taxes: number\r\n taxable_income_per_foreign_tax_return: number\r\n income_of_other_companies: number\r\n foreign_imputed_income: number\r\n deductions_claimed_for_tax: number\r\n losses_deducted_from_prior: number\r\n income_not_included: number\r\n expenses_deducated_for_book: number\r\n}\r\n\r\nexport interface Dependency {\r\n previous_rp: string | number\r\n depends_on: number[]\r\n}\r\n\r\nexport interface TieringDependency {\r\n [reportingPeriod: string]: Dependency\r\n}\r\n\r\nexport interface ReportingPeriodCalculation {\r\n [reportingPeriod: string]: Calculator\r\n}\r\n\r\nexport interface ForeignAffiliateOption {\r\n value: any\r\n text: string\r\n min_date?: Date | string\r\n max_date?: Date | string\r\n fa?: ForeignAffiliate\r\n}\r\n\r\nexport interface AdjustmentGetValue {\r\n date: string\r\n amount: number\r\n type: string\r\n}\r\nexport interface DispositionAdjustmentGetValue {\r\n date: string\r\n amount: number\r\n type: string\r\n}\r\nexport interface SEPAdjustmentGetValue {\r\n date: string\r\n amount: number\r\n type: string\r\n}\r\nexport interface DividendTierGetValue {\r\n date: string\r\n payer_name: string\r\n receiver_name: string | null\r\n amount: number\r\n}\r\nexport interface DividendGetValue {\r\n date: string\r\n payer_name: string\r\n amount: number\r\n foreign_affiliate: string\r\n type: string\r\n category: string\r\n}\r\n\r\nexport interface DividendTierIssue {\r\n dt_id: number\r\n dt_value: DividendTierGetValue\r\n rp_id: number\r\n}\r\n\r\nexport interface ModelObjectIssue {\r\n action: string\r\n id: number\r\n model: string\r\n value:\r\n | AdjustmentGetValue\r\n | DispositionAdjustmentGetValue\r\n | SEPAdjustmentGetValue\r\n | DividendTierGetValue\r\n | DividendGetValue\r\n}\r\n\r\nexport interface ReportingPeriodShifted {\r\n after: string\r\n before: string\r\n id: number | string | undefined\r\n valid: boolean\r\n value: { end_date: string; start_date: string }\r\n valueBefore: { end_date: string; start_date: string }\r\n}\r\n\r\nexport interface ReportingPeriodList {\r\n text: string\r\n value: ReportingPeriod\r\n}\r\n\r\nexport interface ReportingPeriodListFromBackend {\r\n id: number\r\n text: string\r\n}\r\n\r\nexport interface EditStatus {\r\n position: string\r\n action: string\r\n}\r\n\r\nexport interface EditPayload {\r\n affected_DT: DividendTierIssue[]\r\n affected_obj: ModelObjectIssue[]\r\n commit: boolean\r\n periodList: ReportingPeriodListFromBackend[]\r\n stub_id: number | null\r\n}\r\n\r\n// export interface TreePayload {\r\n// faID: string | number | undefined\r\n// rpID: string | number | undefined\r\n// rp: ReportingPeriod\r\n// }\r\n\r\nexport interface BusPayload {\r\n field: string\r\n section: string\r\n subGroup: string\r\n}\r\n\r\nexport interface FieldComplexCopySettings {\r\n show: boolean\r\n entireSection?: boolean\r\n}\r\nexport interface FieldOptionField {\r\n label: string\r\n meta_id: string | number\r\n selected: boolean\r\n}\r\n\r\nexport interface PeriodProfileModified {\r\n value?: string | number\r\n periodProfileEdited: boolean\r\n}\r\n\r\nexport interface ReportingPeriodOptions {\r\n text: string\r\n value?: string | number\r\n startDate: string\r\n}\r\n\r\nexport interface PeriodProfilePayload {\r\n id?: string | number\r\n periodProfile: {\r\n [key: string]: boolean\r\n }\r\n}\r\n\r\nexport interface SelectedPayload {\r\n id?: string | number\r\n label: string\r\n period_profile: {\r\n [key: string]: boolean\r\n }\r\n selected: TreePayload[]\r\n}\r\n\r\nexport interface ReportingPeriodTreePayload {\r\n children: TreePayload[]\r\n id?: string | number\r\n label: string\r\n level: string\r\n startDate: string\r\n periodProfile: {\r\n [key: string]: boolean\r\n }\r\n periodProfileModified: {\r\n [key: string]: boolean\r\n }\r\n}\r\nexport interface TreePayload {\r\n children?: TreePayload[]\r\n id: string\r\n label?: string\r\n level?: string\r\n optionField?: FieldOptionField[]\r\n selected: boolean\r\n schedule?: string\r\n settings?: FieldComplexCopySettings\r\n}\r\n\r\nexport interface CalculatorSection {\r\n name: string\r\n complexCopySettings: FieldComplexCopySettings\r\n optionField: FieldOptionField[]\r\n required?: string[]\r\n section: string\r\n subGroups: any\r\n}\r\n\r\nexport interface CalculatorSectionSubgroup {\r\n desc: string\r\n fields: CalculatorSectionField\r\n name?: string\r\n altName?: string\r\n subtotal?: boolean\r\n zeroToggle?: boolean\r\n complexCopySettings?: FieldComplexCopySettings\r\n optionField?: FieldOptionField[]\r\n altFields?: CalculatorSectionField\r\n}\r\n\r\nexport interface CalculatorSectionField {\r\n [key: string]: {\r\n desc?: string\r\n name: string\r\n type: string\r\n sign?: string\r\n complexCopySettings?: FieldComplexCopySettings\r\n optionField?: FieldOptionField[]\r\n }\r\n}\r\n\r\nexport interface ACBAdjustmentType {\r\n id: number\r\n name: string\r\n user_created: boolean\r\n taxpayer: number\r\n}\r\n\r\nexport interface ACBPeriod {\r\n id?: number | string\r\n foreign_affiliate?: number | string\r\n date: Date | string\r\n value: boolean\r\n valueLabel?: string\r\n}\r\n\r\nexport interface CalculatorException {\r\n date?: Date\r\n message: string\r\n metaId: string\r\n}\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.showModal)?_c('b-modal',{attrs:{\"title\":_vm.formTitle,\"no-close-on-backdrop\":\"\",\"hide-footer\":\"\",\"size\":_vm.modalSize,\"data-cy\":\"add-form-modal\"},on:{\"show\":_vm.modalShow,\"close\":_vm.modalClose},model:{value:(_vm.showModal),callback:function ($$v) {_vm.showModal=$$v},expression:\"showModal\"}},[_c('b-form',{on:{\"submit\":function($event){$event.preventDefault();return _vm.validateForm($event)}}},[_vm._l((_vm.formFields),function(field,index){return _c('div',{key:((field.key) + \"-\" + index)},[(field.type)?_c('b-form-group',{directives:[{name:\"show\",rawName:\"v-show\",value:(field.show ? field.show(_vm.formValues) : true),expression:\"field.show ? field.show(formValues) : true\"}],key:field.key,attrs:{\"label\":((field.label) + \" \" + (field.rules && field.rules.includes('required') ? '*' : '')),\"invalid-feedback\":_vm.validator.errors.first(field.label),\"state\":_vm.validator.errors.first(field.label) == null},on:{\"value-change\":function (newValue) { return (_vm.formValues[field.key] = newValue); }}},[(field.type === 'checkbox')?_c('b-form-checkbox',{attrs:{\"data-cy\":field.key,\"name\":field.key,\"disabled\":field.editable !== undefined\n ? typeof field.editable === 'function'\n ? !field.editable(_vm.formValues)\n : !field.editable\n : false},on:{\"change\":function($event){field.onChange\n ? field.onChange(_vm.formValues[field.key], _vm.formValues)\n : undefined}},model:{value:(_vm.formValues[field.key]),callback:function ($$v) {_vm.$set(_vm.formValues, field.key, $$v)},expression:\"formValues[field.key]\"}}):(field.type === 'date')?_c('div',[_c('datepicker',{attrs:{\"disabled\":field.editable !== undefined ? !field.editable : false,\"input-class\":\"form-control\",\"data-cy\":field.key,\"name\":field.key,\"typeable\":true,\"format\":\"yyyy MM dd\",\"placeholder\":\"yyyy mm dd\",\"disabledDates\":field.dateConfig.disabledDates || {},\"openDate\":field.dateConfig.openDate || ''},on:{\"change\":function($event){field.onChange\n ? field.onChange(_vm.formValues[field.key], _vm.formValues)\n : undefined}},model:{value:(_vm.formValues[field.key]),callback:function ($$v) {_vm.$set(_vm.formValues, field.key, $$v)},expression:\"formValues[field.key]\"}}),_c('small',{staticClass:\"text-muted\"},[_vm._v(\"Note: Date format must include '/', or a space.\")])],1):(field.type === 'select')?_c('b-form-select',{ref:field.label,refInFor:true,attrs:{\"disabled\":field.editable !== undefined ? !field.editable : false,\"data-cy\":field.key,\"name\":field.key,\"options\":field.selectConfig.options},on:{\"change\":function($event){field.onChange\n ? field.onChange(_vm.formValues[field.key], _vm.formValues)\n : undefined}},model:{value:(_vm.formValues[field.key]),callback:function ($$v) {_vm.$set(_vm.formValues, field.key, $$v)},expression:\"formValues[field.key]\"}}):(field.type == 'textarea')?_c('b-form-textarea',{attrs:{\"data-cy\":field.key,\"readonly\":field.editable !== undefined ? !field.editable : false,\"name\":field.key},on:{\"change\":function($event){field.onChange\n ? field.onChange(_vm.formValues[field.key], _vm.formValues)\n : undefined}},model:{value:(_vm.formValues[field.key]),callback:function ($$v) {_vm.$set(_vm.formValues, field.key, $$v)},expression:\"formValues[field.key]\"}}):(field.type == 'number')?_c('b-form-input',{attrs:{\"data-cy\":field.key,\"lazy-formatter\":\"\",\"readonly\":field.editable !== undefined ? !field.editable : false,\"name\":field.key,\"formatter\":field.formatter ? field.formatter : _vm.formatter},on:{\"change\":function($event){field.onChange\n ? field.onChange(_vm.formValues[field.key], _vm.formValues)\n : undefined}},nativeOn:{\"focus\":function($event){return (function () { return ($event.target.value == 0 ? $event.target.select() : null); })($event)}},model:{value:(_vm.formValues[field.key]),callback:function ($$v) {_vm.$set(_vm.formValues, field.key, $$v)},expression:\"formValues[field.key]\"}}):(field.type == 'component')?_vm._t(field.key,null,{\"form\":_vm.formValues,\"passedData\":_vm.formData}):_c('b-form-input',{attrs:{\"data-cy\":field.key,\"name\":field.key,\"readonly\":field.editable !== undefined ? !field.editable : false},model:{value:(_vm.formValues[field.key]),callback:function ($$v) {_vm.$set(_vm.formValues, field.key, $$v)},expression:\"formValues[field.key]\"}})],2):_vm._e()],1)}),_c('hr'),_c('b-button',{attrs:{\"data-cy\":\"add-form-submit\",\"type\":\"submit\",\"block\":\"\",\"variant\":\"success\"}},[_vm._v(\"Done\")])],2)],1):_vm._e(),_c('b-button-group',[(!_vm.edit)?_c('b-button',{class:_vm.buttonClass,style:(_vm.buttonStyle),attrs:{\"variant\":_vm.buttonVariant,\"data-cy\":\"add-form-button\"},on:{\"click\":function () { return (_vm.showModal = true); }}},[(_vm.$slots['buttonContent'])?_vm._t(\"buttonContent\"):_c('div',[_vm._v(\"\\n Add\\n \"),_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"icon\":\"plus-square\"}})],1)],2):_vm._e(),(_vm.$slots['appendButton'])?_vm._t(\"appendButton\"):_vm._e()],2)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import { Vue, Component } from \"vue-property-decorator\"\r\nimport { Validator } from \"vee-validate\"\r\nimport { sumTotal } from \"@/util/formatMoney\"\r\nimport { getDate } from \"@/util/getDate\"\r\nimport accounting from \"accounting\"\r\n\r\n@Component\r\nexport default class ValidatorMixin extends Vue {\r\n public validator: Validator = new Validator()\r\n\r\n public created() {\r\n // Add extra validators\r\n this.validator.extend(\"verify_password\", {\r\n getMessage: field =>\r\n `${field} must contain at least: 1 uppercase letter, 1 lowercase letter, and 1 number.`,\r\n validate: value => {\r\n const strongRegex = new RegExp(\"^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])\")\r\n return strongRegex.test(value)\r\n },\r\n })\r\n\r\n this.validator.extend(\"dividend_tier_less_than_100\", {\r\n getMessage: field =>\r\n `In order to save, total percentage of dividends must equal 100%`,\r\n validate: value => {\r\n return accounting.unformat(sumTotal(value, \"percentage\", 8)) == 100\r\n },\r\n })\r\n\r\n this.validator.extend(\"dividend_tier_no_blank_allocation\", {\r\n getMessage: field =>\r\n `${field} allocated percentages must be greater than 0%.`,\r\n validate: value => {\r\n return value.every((item: any) => item.percentage > 0)\r\n },\r\n })\r\n\r\n this.validator.extend(\r\n \"date_picker_constraint\",\r\n {\r\n getMessage: field => `The date chosen is not within the Period.`,\r\n validate: (value: string, arg: any) => {\r\n let { to, from } = arg\r\n to = new Date(parseInt(to))\r\n from = new Date(parseInt(from))\r\n\r\n return to <= getDate(value) && from >= getDate(value)\r\n },\r\n },\r\n { paramNames: [\"to\", \"from\"] }\r\n )\r\n }\r\n\r\n public dateParamRules(rules: string, disabledDates: any = null) {\r\n // converts the date range to a string, so that it can pass as a param into vee-validator\r\n const newRules = rules.split(\"|\").map((el: string) => {\r\n if (el.includes(\"date_picker_constraint\") && disabledDates) {\r\n const paramStr = [\r\n disabledDates.to.getTime().toString(),\r\n disabledDates.from.getTime().toString(),\r\n ].join()\r\n // sample return: date_picker_constraint:1641024000000,1673049600000\r\n return el.concat(\":\").concat(paramStr)\r\n } else {\r\n return el\r\n }\r\n })\r\n\r\n return newRules.join(\"|\")\r\n }\r\n}\r\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\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\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\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Vue, Prop, Emit, Watch } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport Datepicker from \"vuejs-datepicker\"\r\nimport accounting from \"accounting\"\r\n// Project Imports\r\nimport ValidatorMixin from \"@/mixins/ValidatorMixin\"\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport { getDate } from \"@/util/getDate\"\r\n\r\n@Component({\r\n components: {\r\n Datepicker,\r\n },\r\n})\r\nexport default class AddForm extends mixins(ValidatorMixin) {\r\n // Button Props\r\n @Prop({ default: \"\" })\r\n public buttonClass!: object | string\r\n @Prop({ default: \"\" })\r\n public buttonStyle!: object | string\r\n @Prop({ default: \"primary\" })\r\n public buttonVariant!: string\r\n // Form Props\r\n @Prop({ default: false })\r\n public edit!: boolean\r\n @Prop({ required: true })\r\n public formFields!: any[]\r\n @Prop()\r\n public formData!: any\r\n @Prop({ default: \"\" })\r\n public formTitle!: string\r\n @Prop({ default: \"lg\" })\r\n public modalSize!: string\r\n\r\n public showModal: boolean = false\r\n public formValues: any = {}\r\n public watchers: any = []\r\n\r\n @Watch(\"formValues\", { deep: true })\r\n public formValuesChange() {\r\n this.formFields.forEach(({ type, key, label, rules, sign }) => {\r\n if (this.formValues[key]) {\r\n if (sign && type === \"number\") {\r\n const originalValue = accounting.unformat(this.formValues[key])\r\n let unformatted = Math.abs(originalValue)\r\n if (sign === \"-\") {\r\n unformatted *= -1\r\n }\r\n if (unformatted !== originalValue) {\r\n this.formValues[key] = unformatted\r\n }\r\n } else if (type === \"date\") {\r\n this.formValues[key] = getDate(this.formValues[key])\r\n }\r\n }\r\n })\r\n }\r\n\r\n @Watch(\"formData\", { immediate: true })\r\n public formDataChange() {\r\n if (this.formData && this.edit) {\r\n this.showModal = true\r\n }\r\n }\r\n\r\n public modalShow() {\r\n // Reset all values\r\n this.$set(this, \"formValues\", {})\r\n\r\n this.validator.reset()\r\n this.watchers.forEach((unwatch: any) => unwatch())\r\n\r\n // Create default values per fields passed in.\r\n this.formFields.forEach(({ type, key, label, rules, formatter, show }) => {\r\n if (type && label) {\r\n if (this.formData && this.formData[key] != undefined) {\r\n let value = this.formData[key]\r\n if (formatter) {\r\n value = formatter(value)\r\n }\r\n this.$set(this.formValues, key, value)\r\n } else {\r\n this.$set(this.formValues, key, \"\")\r\n }\r\n\r\n this.validator.detach(label)\r\n\r\n if (type === \"date\") {\r\n const { disabledDates } = this.formFields.find(\r\n e => e.key === key\r\n ).dateConfig\r\n rules = this.dateParamRules(rules, disabledDates)\r\n }\r\n\r\n // For fields that pass in a show function, need to add and removes its rules if its being shown or hidden\r\n if (show && typeof show == \"function\" && rules) {\r\n this.watchers.push(\r\n this.$watch(\r\n `formValues`,\r\n (newValue: any) => {\r\n const isShown = show(newValue)\r\n if (isShown) {\r\n this.validator.attach({\r\n name: label,\r\n rules,\r\n getter: () => {\r\n return this.formValues[key]\r\n },\r\n })\r\n } else {\r\n this.validator.detach(label)\r\n }\r\n },\r\n {\r\n deep: true,\r\n immediate: true,\r\n }\r\n )\r\n )\r\n return\r\n }\r\n\r\n this.validator.attach({\r\n name: label,\r\n rules,\r\n getter: () => {\r\n return this.formValues[key]\r\n },\r\n })\r\n }\r\n })\r\n }\r\n\r\n public validateForm() {\r\n this.validator.validate().then(result => {\r\n if (result) {\r\n this.formSubmit()\r\n }\r\n })\r\n }\r\n\r\n public formatter(value: string, evt: any) {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n }\r\n\r\n @Emit()\r\n public formSubmit() {\r\n this.showModal = false\r\n return this.formValues\r\n }\r\n\r\n @Emit()\r\n public modalClose() {\r\n return true\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AddForm.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AddForm.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./AddForm.vue?vue&type=template&id=348072e8&\"\nimport script from \"./AddForm.vue?vue&type=script&lang=ts&\"\nexport * from \"./AddForm.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-card',[_c('p',[_vm._v(\"\\n Add or remove dividend recipients.\\n \"),_c('br'),_c('small',{staticClass:\"text-muted\"},[_vm._v(\"\\n Only eligible Foreign Affiliates can be selected. (Foreign Affiliate\\n must have taxation year that lines up with the date of the dividend.) If\\n a selected Foreign Affiliate has a different currency, please enter an\\n FX rate.\\n \")])]),(_vm.currency && _vm.currency.fx_currency)?_c('div',{staticClass:\"mb-3 font-weight-bold\"},[_vm._v(\"\\n Calculating Currency\\n \"),_c('b-badge',[_vm._v(_vm._s(_vm.currency.fx_currency.toUpperCase().trim()))])],1):_vm._e(),(_vm.loading)?_c('loader'):_c('div',[_c('b-row',{attrs:{\"align-v\":\"center\"}},[_c('b-col',[_c('b-button',{attrs:{\"disabled\":_vm.previousDividendTiers.length == 0,\"size\":\"sm\",\"variant\":\"primary\",\"block\":\"\"},on:{\"click\":_vm.rollforwardTiers}},[_vm._v(\"Rollforward Recipients\")])],1),_c('b-col',{staticClass:\"border-left\",attrs:{\"cols\":\"9\"}},[_c('model-select',{attrs:{\"options\":_vm.allowedTierOptions,\"placeholder\":\"Select a recipient\"},model:{value:(_vm.selectedRecipient),callback:function ($$v) {_vm.selectedRecipient=$$v},expression:\"selectedRecipient\"}})],1)],1),_c('br'),_c('b-table',{attrs:{\"show-empty\":\"\",\"responsive\":\"\",\"small\":\"\",\"fields\":_vm.tableFields,\"items\":_vm.tableItems},scopedSlots:_vm._u([{key:\"empty\",fn:function(){return [_c('p',{staticClass:\"font-weight-light text-center\"},[_vm._v(\"No Recipients\")])]},proxy:true},{key:\"cell(name)\",fn:function(data){return [_c('span',[_vm._v(\"\\n \"+_vm._s(data.item.name)+\"\\n \"),_c('b-badge',[_vm._v(_vm._s(data.item.currency))])],1)]}},{key:\"cell(percentage)\",fn:function(data){return [_c('b-form-input',_vm._b({attrs:{\"formatter\":_vm.createFormatter(8)},on:{\"change\":function($event){return _vm.calculateAmount(data.item, 'percentage')}},nativeOn:{\"focus\":function($event){return (function () { return ($event.target.value == 0 ? $event.target.select() : null); })($event)}},model:{value:(data.item.percentage),callback:function ($$v) {_vm.$set(data.item, \"percentage\", $$v)},expression:\"data.item.percentage\"}},'b-form-input',_vm.inputProps,false))]}},{key:\"cell(amount)\",fn:function(data){return [_c('b-form-input',_vm._b({attrs:{\"formatter\":_vm.createFormatter(0)},on:{\"change\":function($event){return _vm.calculateAmount(data.item, 'amount')}},nativeOn:{\"focus\":function($event){return (function () { return ($event.target.value == 0 ? $event.target.select() : null); })($event)}},model:{value:(data.item.amount),callback:function ($$v) {_vm.$set(data.item, \"amount\", $$v)},expression:\"data.item.amount\"}},'b-form-input',_vm.inputProps,false))]}},{key:\"cell(tax_on_amount)\",fn:function(data){return [_c('b-form-input',_vm._b({attrs:{\"formatter\":_vm.createFormatter(0)},on:{\"change\":function($event){return _vm.calculateAmount(data.item, 'tax_on_amount')}},nativeOn:{\"focus\":function($event){return (function () { return ($event.target.value == 0 ? $event.target.select() : null); })($event)}},model:{value:(data.item.tax_on_amount),callback:function ($$v) {_vm.$set(data.item, \"tax_on_amount\", $$v)},expression:\"data.item.tax_on_amount\"}},'b-form-input',_vm.inputProps,false))]}},{key:\"cell(fx_rate)\",fn:function(data){return [(data.item.fxRateNeeded)?_c('b-form-input',_vm._b({attrs:{\"formatter\":_vm.createFormatter(4)},on:{\"change\":function($event){return _vm.calculateAmount(data.item, 'fx_rate')}},nativeOn:{\"focus\":function($event){return (function () { return ($event.target.value == 0 ? $event.target.select() : null); })($event)}},model:{value:(data.item.fx_rate),callback:function ($$v) {_vm.$set(data.item, \"fx_rate\", $$v)},expression:\"data.item.fx_rate\"}},'b-form-input',_vm.inputProps,false)):_c('div',{staticClass:\"font-weight-light text-center\"},[_vm._v(\"N/A\")])]}},{key:\"cell(fx_amount)\",fn:function(data){return [(data.item.fxRateNeeded)?_c('b-form-input',_vm._b({attrs:{\"formatter\":_vm.createFormatter(0)},on:{\"change\":function($event){return _vm.calculateAmount(data.item, 'fx_amount')}},nativeOn:{\"focus\":function($event){return (function () { return ($event.target.value == 0 ? $event.target.select() : null); })($event)}},model:{value:(data.item.fx_amount),callback:function ($$v) {_vm.$set(data.item, \"fx_amount\", $$v)},expression:\"data.item.fx_amount\"}},'b-form-input',_vm.inputProps,false)):_c('div',{staticClass:\"font-weight-light text-center\"},[_vm._v(\"N/A\")])]}},{key:\"cell(fx_tax_on_amount)\",fn:function(data){return [(data.item.fxRateNeeded)?_c('b-form-input',_vm._b({attrs:{\"formatter\":_vm.createFormatter(0)},on:{\"change\":function($event){return _vm.calculateAmount(data.item, 'fx_tax_on_amount')}},nativeOn:{\"focus\":function($event){return (function () { return ($event.target.value == 0 ? $event.target.select() : null); })($event)}},model:{value:(data.item.fx_tax_on_amount),callback:function ($$v) {_vm.$set(data.item, \"fx_tax_on_amount\", $$v)},expression:\"data.item.fx_tax_on_amount\"}},'b-form-input',_vm.inputProps,false)):_c('div',{staticClass:\"font-weight-light text-center\"},[_vm._v(\"N/A\")])]}},{key:\"cell(actions)\",fn:function(data){return [_c('b-button-group',{staticClass:\"float-right\"},[_c('b-button',{staticClass:\"text-danger\",attrs:{\"variant\":\"link\",\"size\":\"sm\"},on:{\"click\":function($event){return _vm.removeRecipient(data.item)}}},[_c('font-awesome-icon',{attrs:{\"icon\":\"trash\"}})],1)],1)]}},{key:\"custom-foot\",fn:function(){return [(_vm.tableItems.length > 0)?_c('b-tr',{staticClass:\"text-left font-weight-bold\"},[_c('b-td',[_vm._v(\"Total\")]),_c('b-td',[_vm._v(_vm._s(_vm.sumTotal(_vm.tableItems, \"percentage\", 8)))]),_c('b-td',[_vm._v(_vm._s(_vm.sumTotal(_vm.tableItems, \"amount\", 0)))]),_c('b-td',[_vm._v(_vm._s(_vm.sumTotal(_vm.tableItems, \"tax_on_amount\", 0)))]),_c('b-td'),_c('b-td',[_vm._v(\"\\n \"+_vm._s(_vm.sumTotal(_vm.tableItems.filter(function (i) { return i.fxRateNeeded; }), \"fx_amount\", 0))+\"\\n \")]),_c('b-td',[_vm._v(\"\\n \"+_vm._s(_vm.sumTotal(\n _vm.tableItems.filter(function (i) { return i.fxRateNeeded; }),\n \"fx_tax_on_amount\",\n 0\n ))+\"\\n \")])],1):_vm._e()]},proxy:true}])})],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\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\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\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\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\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport {\r\n Component,\r\n Vue,\r\n Prop,\r\n Watch,\r\n Mixins,\r\n Emit,\r\n} from \"vue-property-decorator\"\r\nimport { ModelSelect } from \"vue-search-select\"\r\nimport accounting from \"accounting\"\r\nimport dateFns from \"date-fns\"\r\n// Project Imports\r\nimport {\r\n DividendTier,\r\n Dividend,\r\n ReportingPeriod,\r\n ForeignAffiliate,\r\n ForeignAffiliateOption,\r\n} from \"../../../interfaces\"\r\nimport { formatMoney, sumTotal } from \"@/util/formatMoney\"\r\nimport ConfirmBoxMixin from \"../../../mixins/ConfirmBoxMixin\"\r\nimport LoadingMixin from \"../../../mixins/LoadingMixin\"\r\nimport { getDate } from \"@/util/getDate.ts\"\r\nimport { round } from \"@/util/round.ts\"\r\nimport ScheduleMixin from \"../../../mixins/ScheduleMixin\"\r\nimport { fa } from \"../../../services/api\"\r\nimport Loader from \"@/components/utils/Loader.vue\"\r\n\r\n@Component({ components: { ModelSelect, Loader } })\r\nexport default class DividendTiers extends Mixins(\r\n ScheduleMixin,\r\n ConfirmBoxMixin,\r\n LoadingMixin\r\n) {\r\n @Prop({\r\n required: true,\r\n })\r\n public form!: Dividend\r\n public currency: any = null\r\n public selectedRecipient: any = {\r\n value: null,\r\n text: null,\r\n }\r\n public inputProps: any = {\r\n lazyFormatter: true,\r\n size: \"sm\",\r\n }\r\n public allowedTiers: any[] = []\r\n public tableItems: any[] = []\r\n public tableFields: any[] = [\r\n {\r\n key: \"name\",\r\n label: \"Foreign Affiliate\",\r\n tdClass: \"centerCell\",\r\n },\r\n {\r\n key: \"percentage\",\r\n tdClass: \"text-center centerCell\",\r\n label: \"Percentage\",\r\n },\r\n {\r\n key: \"amount\",\r\n label: \"Amount Paid\",\r\n tdClass: \"centerCell\",\r\n },\r\n {\r\n key: \"tax_on_amount\",\r\n label: \"Tax on Amount\",\r\n tdClass: \"centerCell\",\r\n },\r\n {\r\n key: \"fx_rate\",\r\n label: \"FX Rate\",\r\n tdClass: \"centerCell\",\r\n },\r\n {\r\n key: \"fx_amount\",\r\n label: \"Amount Received\",\r\n tdClass: \"centerCell\",\r\n },\r\n {\r\n key: \"fx_tax_on_amount\",\r\n label: \"Tax on Amount Received\",\r\n tdClass: \"centerCell\",\r\n },\r\n {\r\n key: \"actions\",\r\n label: \"\",\r\n // thStyle: \"width: 10%\",\r\n tdClass: \"centerCell\",\r\n },\r\n ]\r\n\r\n public get previousDividendTiers() {\r\n if (this.priorDividends && this.date) {\r\n const priorToDate = this.priorDividends.filter(\r\n (d: Dividend) =>\r\n d.type == \"P\" &&\r\n d.dividend_tiers.length > 0 &&\r\n getDate(d.date).getTime() <= getDate(this.date).getTime()\r\n )\r\n if (priorToDate.length > 0) {\r\n return priorToDate[priorToDate.length - 1].dividend_tiers\r\n }\r\n }\r\n return []\r\n }\r\n\r\n public get amount() {\r\n return accounting.unformat(this.form.amount.toString())\r\n }\r\n\r\n public get date() {\r\n return getDate(this.form.date)\r\n }\r\n\r\n public get foreignAffiliateOptions(): ForeignAffiliateOption[] {\r\n const options: ForeignAffiliateOption[] = []\r\n options.push({\r\n value: \"direct_to_taxpayer\",\r\n text: this.activeTaxpayer\r\n ? `${this.activeTaxpayer.name} (Direct to taxpayer)`\r\n : \"Direct to taxpayer\",\r\n })\r\n\r\n this.allowedTiers.forEach(({ id, name, min_date, max_date }) => {\r\n const fa = this.activeTaxpayerForeignAffiliates.find(\r\n (fa: ForeignAffiliate) => fa.id === id\r\n )\r\n options.push({\r\n value: id,\r\n text: name,\r\n min_date,\r\n max_date,\r\n fa,\r\n })\r\n })\r\n\r\n options.push({\r\n value: \"\",\r\n text: \"Other recipient(s)\",\r\n })\r\n return options\r\n }\r\n\r\n public get allowedTierOptions() {\r\n return this.foreignAffiliateOptions.filter((option: any) => {\r\n const unselected =\r\n this.tableItems.findIndex(\r\n (item: any) => item.value == option.value && option.value != \"\"\r\n ) < 0\r\n const isPayable = this.isPayable({}, option)\r\n return unselected && isPayable\r\n })\r\n }\r\n\r\n public get remainingPercentage() {\r\n const remainder =\r\n 100 - accounting.unformat(sumTotal(this.tableItems, \"percentage\", 8))\r\n return remainder > 0 ? remainder : 0\r\n }\r\n\r\n public async mounted() {\r\n this.currency = this.usedCurrency(\r\n this.activeForeignAffiliate,\r\n this.selectedReportingPeriod,\r\n true\r\n )\r\n\r\n if (this.form.dividend_tiers && this.date) {\r\n // Fetch allowed tiers for this FA\r\n await this.fetchAllowedTiers()\r\n this.tableItems = this.form.dividend_tiers.map(\r\n (dividendTier: DividendTier) => {\r\n return this.createTableItem(dividendTier)\r\n }\r\n )\r\n }\r\n }\r\n\r\n public async fetchAllowedTiers() {\r\n // Can only fetch data if a date has been set.\r\n if (\r\n this.activeForeignAffiliate &&\r\n this.selectedReportingPeriod &&\r\n this.date &&\r\n getDate(this.selectedReportingPeriod.start_date).getTime() <=\r\n this.date.getTime() &&\r\n getDate(this.selectedReportingPeriod.end_date).getTime() >=\r\n this.date.getTime()\r\n ) {\r\n this.loading = true\r\n try {\r\n this.allowedTiers = await fa.allowedTiers(\r\n this.activeForeignAffiliate.id as string,\r\n dateFns.format(this.date, \"YYYY-MM-DD\")\r\n )\r\n } catch (e) {\r\n this.error = e\r\n }\r\n this.loading = false\r\n } else {\r\n this.allowedTiers = []\r\n }\r\n }\r\n\r\n @Watch(\"form.date\", { deep: true })\r\n public async formDateChange() {\r\n await this.fetchAllowedTiers()\r\n this.tableItems = this.tableItems.filter((item: any) =>\r\n this.isPayable(item)\r\n )\r\n // Need to calc again to take into account the RP currency\r\n this.updateAllTableItems()\r\n }\r\n\r\n @Watch(\"form.amount\", { deep: true })\r\n public formAmountChange() {\r\n this.updateAllTableItems()\r\n }\r\n\r\n @Watch(\"selectedRecipient.value\")\r\n public selectedRecipientChange() {\r\n this.addRecipient()\r\n }\r\n\r\n @Watch(\"tableItems\", { deep: true })\r\n public tableItemsChange() {\r\n this.emitChanges()\r\n }\r\n\r\n public updateAllTableItems() {\r\n this.tableItems.forEach((item: any) => {\r\n // If any changes to form, need to re e\r\n this.calculateAmount(item)\r\n this.fxRateNeeded(item)\r\n })\r\n }\r\n\r\n public async rollforwardTiers() {\r\n const rollforward: boolean = await this.confirmBox(\r\n `Rolling forward tiers will select the same recipient(s) and the same proportion(s) as the last dividend paid but\r\n it will not overwrite any inputs already made. Rollforward tiers?`,\r\n {\r\n size: \"md\",\r\n }\r\n )\r\n if (rollforward) {\r\n this.previousDividendTiers.forEach((dividendTier: DividendTier) => {\r\n const newTier = Object.assign(dividendTier, {\r\n fx_rate: 1,\r\n fx_amount: 0,\r\n fx_tax_on_amount: 0,\r\n amount: 0,\r\n tax_on_amount: 0,\r\n id: null,\r\n })\r\n const item = this.createTableItem(newTier)\r\n const recipientIndex = this.tableItems.findIndex(\r\n (i: any) => i.value === item.value\r\n )\r\n // Only add the tiers which don't already exist, and are payable\r\n if (recipientIndex < 0 && this.isPayable(item)) {\r\n this.tableItems.push(item)\r\n }\r\n })\r\n }\r\n }\r\n\r\n public isPayable(item: any, option?: ForeignAffiliateOption) {\r\n const foundOption = option\r\n ? option\r\n : ((this.foreignAffiliateOptions.find(\r\n (option: any) => option.value == item.value\r\n ) || {}) as ForeignAffiliateOption)\r\n\r\n if (Object.keys(foundOption).length === 0) {\r\n return false\r\n }\r\n const { value, min_date, max_date } = foundOption\r\n if (value === \"\" || value === \"direct_to_taxpayer\") {\r\n return true\r\n }\r\n if (\r\n min_date &&\r\n max_date &&\r\n this.date &&\r\n getDate(min_date).getTime() <= this.date.getTime() &&\r\n getDate(max_date).getTime() >= this.date.getTime()\r\n ) {\r\n return true\r\n } else {\r\n return false\r\n }\r\n }\r\n\r\n public createFormatter(precision: number) {\r\n return (value: string, evt: any) => {\r\n const formatted = formatMoney(value, precision)\r\n return formatted\r\n }\r\n }\r\n\r\n public sumTotal(array: any[], key: string, precision: number = 0) {\r\n return sumTotal(array, key, precision)\r\n }\r\n\r\n public createTableItem(data: any) {\r\n const item: any = {\r\n amount: 0,\r\n tax_on_amount: 0,\r\n percentage: 0,\r\n fx_rate: 1,\r\n fx_amount: 0,\r\n fx_tax_on_amount: 0,\r\n ...data,\r\n }\r\n if (!item.value) {\r\n if (item.foreign_affiliate) {\r\n item.value = item.foreign_affiliate\r\n } else if (item.direct_to_taxpayer) {\r\n item.value = \"direct_to_taxpayer\"\r\n } else {\r\n item.value = \"\"\r\n }\r\n }\r\n // Find FA\r\n const option = this.foreignAffiliateOptions.find(\r\n (option: any) => option.value == item.value\r\n )\r\n if (option) {\r\n item.name = option.text\r\n item.fa = option.fa\r\n }\r\n // Calculate amounts\r\n this.calculateAmount(item)\r\n this.fxRateNeeded(item)\r\n\r\n return item\r\n }\r\n\r\n public addRecipient() {\r\n if (this.selectedRecipient.value != null) {\r\n const percentage: number = this.remainingPercentage\r\n const newTier: any = {\r\n percentage,\r\n value: this.selectedRecipient.value,\r\n }\r\n const item = this.createTableItem(newTier)\r\n this.tableItems.push(item)\r\n this.selectedRecipient = {}\r\n }\r\n }\r\n\r\n public async removeRecipient(rowItem: any) {\r\n const recipient: any = rowItem\r\n const deleteOwner = await this.confirmBox(\r\n `Remove '${recipient.name}?'`,\r\n this.deleteOptions\r\n )\r\n if (deleteOwner) {\r\n const recipientIndex = this.tableItems.findIndex(\r\n (item: any) => JSON.stringify(item) === JSON.stringify(recipient)\r\n )\r\n if (recipientIndex >= 0) {\r\n this.tableItems.splice(recipientIndex, 1)\r\n }\r\n }\r\n }\r\n\r\n public calculateAmount(item: any, target: string = \"\") {\r\n let fx_rate\r\n let percentage\r\n let amount\r\n let fx_amount\r\n let tax_on_amount\r\n let fx_tax_on_amount\r\n\r\n switch (target) {\r\n case \"fx_amount\":\r\n fx_amount = accounting.unformat(item.fx_amount)\r\n amount = accounting.unformat(item.amount)\r\n item.fx_rate = amount != 0 ? (fx_amount / amount).toFixed(4) : 0\r\n break\r\n case \"fx_tax_on_amount\":\r\n fx_tax_on_amount = accounting.unformat(item.fx_tax_on_amount)\r\n tax_on_amount = accounting.unformat(item.tax_on_amount)\r\n item.fx_rate =\r\n amount != 0 ? (fx_tax_on_amount / tax_on_amount).toFixed(4) : 0\r\n break\r\n case \"fx_rate\":\r\n fx_rate = accounting.unformat(item.fx_rate)\r\n amount = accounting.unformat(item.amount)\r\n item.fx_amount = round(fx_rate * amount)\r\n break\r\n case \"amount\":\r\n amount = accounting.unformat(item.amount)\r\n item.percentage =\r\n this.amount != 0 ? ((amount / this.amount) * 100).toFixed(8) : 0\r\n fx_rate = accounting.unformat(item.fx_rate)\r\n item.fx_amount = round(fx_rate * amount)\r\n break\r\n case \"tax_on_amount\":\r\n tax_on_amount = accounting.unformat(item.tax_on_amount)\r\n amount = accounting.unformat(item.amount)\r\n\r\n // tax on amount can't be larger than be amount, nor can be negative\r\n if (tax_on_amount > amount) {\r\n tax_on_amount = amount\r\n } else if (tax_on_amount < 0) {\r\n tax_on_amount = 0\r\n }\r\n\r\n fx_rate = accounting.unformat(item.fx_rate)\r\n item.fx_amount = round(fx_rate * tax_on_amount)\r\n item.tax_on_amount = tax_on_amount\r\n break\r\n case \"percentage\":\r\n default:\r\n percentage = accounting.unformat(item.percentage) / 100\r\n item.amount = round(percentage * this.amount)\r\n fx_rate = accounting.unformat(item.fx_rate)\r\n item.fx_amount = round(fx_rate * item.amount)\r\n break\r\n }\r\n }\r\n\r\n public fxRateNeeded(item: any): boolean {\r\n if (!item.fa) {\r\n item.fxRateNeeded = false\r\n return false\r\n } else {\r\n const foreignAffiliate: ForeignAffiliate = item.fa\r\n const reportingPeriod:\r\n | ReportingPeriod\r\n | undefined = foreignAffiliate.reporting_periods.find(\r\n (rp: ReportingPeriod) =>\r\n getDate(rp.start_date).getTime() <= this.date.getTime() &&\r\n getDate(rp.end_date).getTime() >= this.date.getTime()\r\n )\r\n // Get the currency used by both this FA and the item being passed\r\n const itemCurrency = this.usedCurrency(\r\n foreignAffiliate,\r\n reportingPeriod,\r\n true\r\n )\r\n // If both currencies are the same then no fx rate needed\r\n if (this.currency && itemCurrency) {\r\n item.fxRateNeeded = !(\r\n this.currency.fx_currency.toUpperCase().trim() ===\r\n itemCurrency.fx_currency.toUpperCase().trim()\r\n )\r\n item.currency = itemCurrency.fx_currency.toUpperCase().trim()\r\n return item.fxRateNeeded\r\n }\r\n item.fxRateNeeded = false\r\n return false\r\n }\r\n }\r\n\r\n public emitChanges() {\r\n const dividendTiers = this.tableItems.map((item: any) => {\r\n const {\r\n amount,\r\n tax_on_amount,\r\n percentage,\r\n value,\r\n id,\r\n fx_rate,\r\n fx_amount,\r\n fx_tax_on_amount,\r\n fxRateNeeded,\r\n } = item\r\n const dividendTier: DividendTier = {\r\n id,\r\n amount: accounting.unformat(amount),\r\n tax_on_amount: accounting.unformat(tax_on_amount),\r\n percentage: accounting.unformat(percentage),\r\n foreign_affiliate:\r\n value && value != \"direct_to_taxpayer\" ? value : null,\r\n direct_to_taxpayer: value == \"direct_to_taxpayer\",\r\n fx_rate: fxRateNeeded ? accounting.unformat(fx_rate) : null,\r\n fx_amount: fxRateNeeded ? accounting.unformat(fx_amount) : null,\r\n fx_tax_on_amount: fxRateNeeded\r\n ? accounting.unformat(fx_tax_on_amount)\r\n : null,\r\n }\r\n return dividendTier\r\n })\r\n\r\n this.$parent.$emit(\"value-change\", dividendTiers)\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DividendTiers.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DividendTiers.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./DividendTiers.vue?vue&type=template&id=2c2172ca&scoped=true&\"\nimport script from \"./DividendTiers.vue?vue&type=script&lang=ts&\"\nexport * from \"./DividendTiers.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./DividendTiers.vue?vue&type=style&index=0&id=2c2172ca&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"2c2172ca\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.show)?_c('b-modal',{attrs:{\"size\":\"sm\",\"centered\":\"\",\"title\":_vm.title,\"hide-footer\":true},on:{\"hide\":_vm.cancelClick},model:{value:(_vm.show),callback:function ($$v) {_vm.show=$$v},expression:\"show\"}},[_c('b-row',[_c('b-col',[_c('p',[_vm._v(_vm._s(_vm.message))])])],1),_c('hr'),_c('b-row',[(_vm.showCancel)?_c('b-col',[_c('div',{on:{\"click\":_vm.cancelClick}},[(_vm.$slots['cancelButton'])?_vm._t(\"cancelButton\"):_c('b-button',{staticClass:\"w-100\",attrs:{\"variant\":\"danger\"}},[_vm._v(\"Cancel\")])],2)]):_vm._e(),_c('b-col',[_c('div',{on:{\"click\":_vm.confirmClick}},[(_vm.$slots['confirmButton'])?_vm._t(\"confirmButton\"):_c('b-button',{staticClass:\"w-100\",attrs:{\"variant\":\"success\"}},[_vm._v(\"OK\")])],2)])],1)],1):_vm._e()],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\n\n\n\n\n\n\n\r\nimport { Component, Vue, Prop, Emit, Watch } from \"vue-property-decorator\"\r\n\r\n@Component({})\r\nexport default class PromptWindow extends Vue {\r\n @Prop({ default: \"Prompt\" })\r\n public title!: string\r\n @Prop({ default: false })\r\n public showCancel!: boolean\r\n @Prop({ required: true })\r\n public message!: string\r\n\r\n public show: boolean = true\r\n\r\n @Emit()\r\n public promptResult(result: boolean) {\r\n return result\r\n }\r\n\r\n public confirmClick() {\r\n this.show = false\r\n this.promptResult(true)\r\n }\r\n\r\n public cancelClick() {\r\n this.show = false\r\n this.promptResult(false)\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PromptWindow.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PromptWindow.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./PromptWindow.vue?vue&type=template&id=23fb70ce&\"\nimport script from \"./PromptWindow.vue?vue&type=script&lang=ts&\"\nexport * from \"./PromptWindow.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-card',{attrs:{\"sub-title\":\"Amounts paid to dividend recipients\",\"sub-title-text-variant\":\"\",\"sub-title-tag\":\"h6\"}},_vm._l((_vm.dividend.dividend_tiers.filter(\n function (dt) { return dt.foreign_affiliate; }\n )),function(tier,index){return _c('div',{key:(\"tier-\" + index),staticClass:\"m-3\"},[_c('div',{staticClass:\"mb-2 font-weight-bold\"},[_vm._v(\"\\n \"+_vm._s(_vm.getForeignAffiliateName(tier.foreign_affiliate))+\"\\n \")]),_c('div',{staticClass:\"pl-3 pr-3\"},[_c('b-table',{attrs:{\"fixed\":\"\",\"borderless\":true,\"hover\":false,\"fields\":_vm.tableFields,\"items\":_vm.createTableItems(tier),\"show-empty\":\"\"},scopedSlots:_vm._u([{key:\"cell(empty)\",fn:function(){return [_vm._v(\"No entries.\")]},proxy:true},{key:\"cell(category)\",fn:function(row){return [_vm._v(_vm._s(_vm.getOptionText(_vm.dividendTypeOptions, row.item.category)))]}}],null,true)})],1)])}),0)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\n\n\n\n\n\n\n\n\r\nimport {\r\n Taxpayer,\r\n ReportingPeriod,\r\n Dividend,\r\n DividendTier,\r\n Deferred,\r\n ForeignAffiliate,\r\n} from \"@/interfaces\"\r\nimport {\r\n Component,\r\n Vue,\r\n Prop,\r\n Emit,\r\n Watch,\r\n Mixins,\r\n} from \"vue-property-decorator\"\r\n// Project imports\r\nimport ScheduleMixin from \"../../../mixins/ScheduleMixin\"\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport { round } from \"../../../util/round\"\r\n\r\n@Component({ inheritAttrs: false })\r\nexport default class DividendPaidBreakdown extends Mixins(ScheduleMixin) {\r\n @Prop({ required: true })\r\n public reportingPeriod!: ReportingPeriod\r\n @Prop({ required: true })\r\n public dividend!: Dividend\r\n\r\n public tableFields: any[] = [\r\n {\r\n key: \"category\",\r\n },\r\n {\r\n key: \"amount\",\r\n formatter: this.formatAmount,\r\n },\r\n {\r\n key: \"hut_amount\",\r\n label: \"HUT Applicable Amount\",\r\n formatter: this.formatAmount,\r\n },\r\n {\r\n key: \"uft_amount\",\r\n label: \"UFT Applicable Amount\",\r\n formatter: this.formatAmount,\r\n },\r\n ]\r\n\r\n public createTableItems(tier: DividendTier) {\r\n let items: Dividend[] = this.getPaidDividendTiers(\r\n this.reportingPeriod,\r\n tier.id as string\r\n )\r\n\r\n if (tier.fx_rate) {\r\n items = items.map((i: Dividend) => {\r\n const newItem = { ...i }\r\n newItem.amount = round(newItem.amount / (tier.fx_rate as number))\r\n newItem.tax_on_amount = round(\r\n newItem.tax_on_amount / (tier.fx_rate as number)\r\n )\r\n newItem.hut_amount = round(\r\n newItem.hut_amount / (tier.fx_rate as number)\r\n )\r\n newItem.uft_amount = round(\r\n newItem.uft_amount / (tier.fx_rate as number)\r\n )\r\n return newItem\r\n })\r\n }\r\n\r\n return items\r\n }\r\n\r\n public formatAmount(value: string, evt: any) {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DividendPaidBreakdown.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DividendPaidBreakdown.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./DividendPaidBreakdown.vue?vue&type=template&id=190615d2&\"\nimport script from \"./DividendPaidBreakdown.vue?vue&type=script&lang=ts&\"\nexport * from \"./DividendPaidBreakdown.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\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\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\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\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\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\n\n\r\nimport {\r\n Taxpayer,\r\n ReportingPeriod,\r\n Dividend,\r\n Deferred,\r\n ForeignAffiliate,\r\n} from \"@/interfaces\"\r\nimport { Component, Vue, Prop, Emit, Watch } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport dateFns from \"date-fns\"\r\n// Project imports\r\nimport Table from \"@/components/utils/Table.vue\"\r\nimport AddForm from \"@/components/utils/AddForm.vue\"\r\nimport DividendTiers from \"@/components/calculator/schedules/DividendTiers.vue\"\r\nimport PromptWindow from \"@/components/utils/PromptWindow.vue\"\r\nimport { sep, taxpayer } from \"@/services/api\"\r\nimport ScheduleMixin from \"../../../mixins/ScheduleMixin\"\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport DividendPaidBreakdown from \"@/components/calculator/schedules/DividendPaidBreakdown.vue\"\r\nimport ReviewSection from \"@/components/calculator/ReviewSection.vue\"\r\n\r\n@Component({\r\n components: {\r\n Table,\r\n AddForm,\r\n PromptWindow,\r\n ErrorAlert,\r\n DividendTiers,\r\n DividendPaidBreakdown,\r\n ReviewSection,\r\n },\r\n})\r\nexport default class DividendsPaidSchedule extends mixins(ScheduleMixin) {\r\n public get tableFields() {\r\n let fields: any[] = [\r\n {\r\n key: \"date\",\r\n label: \"Date\",\r\n sortable: true,\r\n type: \"date\",\r\n rules: \"required|date_picker_constraint\",\r\n dateConfig: {\r\n disabledDates: {\r\n to: dateFns.parse(this.reportingPeriod.start_date),\r\n from: dateFns.parse(this.reportingPeriod.end_date),\r\n },\r\n openDate: dateFns.parse(this.reportingPeriod.start_date),\r\n },\r\n },\r\n {\r\n key: \"amount\",\r\n label: \"Amount\",\r\n sortable: true,\r\n type: \"number\",\r\n rules: \"required\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"schedule_93\",\r\n label: \"Deemed dividend paid under S. 93(1) or (1.1)\",\r\n sortable: true,\r\n type: \"checkbox\",\r\n rules: \"\",\r\n editable: (formValues: any) => {\r\n return formValues && formValues[\"preacq_designation\"] == false\r\n },\r\n },\r\n {\r\n key: \"preacq_designation\",\r\n label: \"Designate dividend to be paid out of pre-acquisition surplus\",\r\n sortable: true,\r\n type: \"checkbox\",\r\n rules: \"\",\r\n editable: (formValues: any) => {\r\n return formValues && formValues[\"schedule_93\"] == false\r\n },\r\n },\r\n {\r\n key: \"dividend_tiers\",\r\n label: \"Recipients\",\r\n type: \"component\",\r\n rules: \"dividend_tier_less_than_100|dividend_tier_no_blank_allocation\",\r\n },\r\n {\r\n key: \"client_ref\",\r\n label: \"Working Paper Reference\",\r\n sortable: true,\r\n type: \"text\",\r\n editable: this.isClient,\r\n rules: this.isClient ? this.refValidationRules : \"\",\r\n },\r\n ]\r\n\r\n if (!this.isClient) {\r\n const staffFields = [\r\n {\r\n key: \"ref\",\r\n label: \"Working Paper Reference - KPMG\",\r\n sortable: true,\r\n type: \"text\",\r\n rules: this.refValidationRules,\r\n },\r\n ]\r\n\r\n fields = fields.concat(staffFields)\r\n }\r\n if (this.editable) {\r\n fields.push({ key: \"actions\", label: \"\" })\r\n }\r\n return fields\r\n }\r\n\r\n public get DividendsPaid() {\r\n if (this.reportingPeriod.dividends) {\r\n return this.reportingPeriod.dividends.filter(dividend => {\r\n return dividend.type === \"P\"\r\n })\r\n } else {\r\n return []\r\n }\r\n }\r\n @Prop({ required: true })\r\n public reportingPeriod!: ReportingPeriod\r\n @Prop({ required: true })\r\n public field!: any\r\n\r\n public tableSlots: any[] = [\r\n {\r\n name: \"actions\",\r\n field: \"actions\",\r\n },\r\n {\r\n name: \"category\",\r\n field: \"category\",\r\n },\r\n {\r\n name: \"schedule_93\",\r\n field: \"schedule_93\",\r\n },\r\n {\r\n name: \"preacq_designation\",\r\n field: \"preacq_designation\",\r\n },\r\n {\r\n name: \"dividend_tiers\",\r\n field: \"dividend_tiers\",\r\n },\r\n ]\r\n\r\n public mounted() {\r\n // Fetch taxpayer info\r\n this.fetchTaxpayer()\r\n }\r\n\r\n public addNewDividendPaid(dividendData: any) {\r\n const { id } = this.reportingPeriod\r\n\r\n this.error = \"\"\r\n this.loading = true\r\n if (id) {\r\n const newDividend: any = this.validateData(this.tableFields, {\r\n ...dividendData,\r\n type: \"P\",\r\n })\r\n\r\n this.addDividend(newDividend)\r\n .catch((error: any) => {\r\n this.error = error\r\n })\r\n .finally(() => {\r\n this.loading = false\r\n })\r\n } else {\r\n this.error = \"There was an error creating dividend.\"\r\n this.loading = false\r\n }\r\n }\r\n\r\n public formatDividendTiers(dividend: Dividend) {\r\n const faTiers = dividend.dividend_tiers.filter(dt => dt.foreign_affiliate)\r\n\r\n if (faTiers.length) {\r\n if (this.isClient) {\r\n return faTiers\r\n .map(t => this.getForeignAffiliateName(t.foreign_affiliate as string))\r\n .join(\", \")\r\n } else {\r\n return `${faTiers.length} recipient${faTiers.length > 1 ? \"s\" : \"\"}`\r\n }\r\n } else {\r\n return \"No recipients\"\r\n }\r\n }\r\n\r\n public removeDividendPaid(row: any) {\r\n this.prompt.show = true\r\n // Defer promise to be handled once resolved\r\n this.prompt.defer = new Deferred()\r\n this.prompt.defer.promise\r\n .then(() => {\r\n const dividend = row.item\r\n this.loading = true\r\n this.error = \"\"\r\n this.deleteDividend(dividend.id).finally(() => {\r\n this.loading = false\r\n })\r\n })\r\n .catch((error: any) => {\r\n if (error) {\r\n this.error = error\r\n }\r\n })\r\n }\r\n\r\n public editDividendPaid(dividendData: any) {\r\n let editedDividend = Object.assign(this.editData, dividendData)\r\n editedDividend = this.validateData(this.tableFields, {\r\n ...editedDividend,\r\n type: \"P\",\r\n })\r\n this.loading = true\r\n this.error = \"\"\r\n this.editDividend(editedDividend)\r\n .catch((error: any) => {\r\n if (error) {\r\n this.error = error\r\n }\r\n })\r\n .finally(() => (this.loading = false))\r\n\r\n this.editData = null\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DividendsPaidSchedule.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DividendsPaidSchedule.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./DividendsPaidSchedule.vue?vue&type=template&id=53aaceb0&\"\nimport script from \"./DividendsPaidSchedule.vue?vue&type=script&lang=ts&\"\nexport * from \"./DividendsPaidSchedule.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-row',{attrs:{\"align-v\":\"center\"}},[_c('b-col',[_c('h2',[_vm._v(\"Dividends Received\")]),_c('ScheduleHeader',{attrs:{\"foreignAffiliate\":_vm.activeForeignAffiliate,\"reportingPeriod\":_vm.reportingPeriod}})],1)],1),(_vm.prompt.show)?_c('prompt-window',{attrs:{\"title\":_vm.prompt.title,\"message\":_vm.prompt.message,\"showCancel\":true},on:{\"prompt-result\":_vm.onPromptCallback}},[_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"confirmButton\",\"variant\":\"danger\"},slot:\"confirmButton\"},[_vm._v(\"Delete\")]),_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"cancelButton\",\"variant\":\"success\"},slot:\"cancelButton\"},[_vm._v(\"Cancel\")])],1):_vm._e(),_c('AddForm',{attrs:{\"formTitle\":\"Edit Dividend\",\"formFields\":_vm.createFormFields(_vm.editData),\"formData\":_vm.editData,\"edit\":true},on:{\"form-submit\":_vm.editDividendReceived,\"modal-close\":function () { return (_vm.editData = null); }},scopedSlots:_vm._u([{key:\"tier_info\",fn:function(slotProps){return [_c('div',{staticClass:\"text-muted\"},[_vm._v(\"\\n Amount paid by\\n \"),_c('strong',[_vm._v(\"\\n \"+_vm._s(_vm.getForeignAffiliateName(slotProps.passedData.tier_owner))+\"\\n \")]),_vm._v(\"\\n before FX conversion was\\n \"),_c('strong',[_vm._v(_vm._s(_vm.originalAmount(slotProps.passedData)))])])]}}])}),(_vm.loading)?_c('b-row',[_c('b-col',{staticClass:\"text-center\"},[_c('b-spinner',{staticClass:\"large-spinner\"})],1)],1):_c('div',[(!_vm.isClient)?_c('div',[_c('ErrorAlert',{attrs:{\"error\":_vm.error}}),_c('Table',{attrs:{\"fields\":_vm.tableFields,\"items\":_vm.DividendsReceivedStaffView,\"slots\":_vm.tableSlots},scopedSlots:_vm._u([{key:\"schedule_93\",fn:function(data){return [_c('b-form-group',[_c('b-form-checkbox',{attrs:{\"disabled\":\"\",\"readonly\":\"\"},model:{value:(data.item.schedule_93),callback:function ($$v) {_vm.$set(data.item, \"schedule_93\", $$v)},expression:\"data.item.schedule_93\"}})],1)]}},{key:\"category\",fn:function(data){return [_vm._v(\"\\n \"+_vm._s(_vm.getOptionText(\n _vm.categoryOptions,\n data.item.category,\n _vm.getForeignAffiliateName(data.item.tier_owner)\n ))+\"\\n \")]}},{key:\"actions\",fn:function(data){return [_c('b-button-group',{staticClass:\"float-right w-100\"},[(!_vm.isClient)?_c('ReviewSection',{key:(\"calc-review-section-\" + (_vm.field.meta_id) + \"-\" + (_vm.reportingPeriod.id) + \"-\" + (data.item.id)),attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":_vm.field,\"object\":data.item}}):_vm._e(),_c('b-button',{attrs:{\"variant\":\"secondary\",\"size\":\"sm\"},on:{\"click\":function () { return (_vm.editData = data.item); }}},[_c('font-awesome-icon',{attrs:{\"icon\":\"cog\"}})],1),(!data.item.tier)?_c('b-button',{attrs:{\"variant\":\"danger\",\"size\":\"sm\"},on:{\"click\":function($event){return _vm.removeDividendReceived(data)}}},[_c('font-awesome-icon',{attrs:{\"icon\":\"trash\"}})],1):_vm._e()],1)]}}],null,false,427794558)},[(_vm.editable)?_c('template',{slot:\"action-bar\"},[_c('AddForm',{key:\"div-received-form\",attrs:{\"formTitle\":\"New Dividend\",\"formFields\":_vm.tableFields},on:{\"form-submit\":_vm.addNewDividendReceived}})],1):_vm._e()],2),_c('br'),_c('h5',[_vm._v(\"Dividend Tiers\")]),_c('ErrorAlert',{attrs:{\"error\":_vm.error}}),_c('Table',{attrs:{\"fields\":_vm.tableFieldsAgg,\"items\":_vm.DividendsTiersReceived,\"slots\":_vm.tableSlots},scopedSlots:_vm._u([{key:\"schedule_93\",fn:function(data){return [_c('b-form-group',[_c('b-form-checkbox',{attrs:{\"disabled\":\"\",\"readonly\":\"\"},model:{value:(data.item.schedule_93),callback:function ($$v) {_vm.$set(data.item, \"schedule_93\", $$v)},expression:\"data.item.schedule_93\"}})],1)]}},{key:\"category\",fn:function(data){return [_vm._v(\"\\n \"+_vm._s(_vm.getOptionText(\n _vm.categoryOptions,\n data.item.category,\n _vm.getForeignAffiliateName(data.item.tier_owner)\n ))+\"\\n \")]}},{key:\"actions\",fn:function(data){return [_c('b-button-group',{staticClass:\"float-right w-100\"},[_c('b-button',{attrs:{\"variant\":\"secondary\",\"size\":\"sm\"},on:{\"click\":function () { return (_vm.editData = data.item); }}},[_c('font-awesome-icon',{attrs:{\"icon\":\"cog\"}})],1),(!data.item.tier)?_c('b-button',{attrs:{\"variant\":\"danger\",\"size\":\"sm\"},on:{\"click\":function($event){return _vm.removeDividendReceived(data)}}},[_c('font-awesome-icon',{attrs:{\"icon\":\"trash\"}})],1):_vm._e()],1)]}}],null,false,552906880)})],1):_c('div',[_c('ErrorAlert',{attrs:{\"error\":_vm.error}}),_c('Table',{attrs:{\"fields\":_vm.tableFields,\"items\":_vm.DividendsReceivedClientView,\"slots\":_vm.tableSlots},scopedSlots:_vm._u([{key:\"schedule_93\",fn:function(data){return [_c('b-form-group',[_c('b-form-checkbox',{attrs:{\"disabled\":\"\",\"readonly\":\"\"},model:{value:(data.item.schedule_93),callback:function ($$v) {_vm.$set(data.item, \"schedule_93\", $$v)},expression:\"data.item.schedule_93\"}})],1)]}},{key:\"category\",fn:function(data){return [_vm._v(\"\\n \"+_vm._s(_vm.getOptionText(\n _vm.categoryOptions,\n data.item.category,\n _vm.getForeignAffiliateName(data.item.tier_owner)\n ))+\"\\n \")]}},{key:\"actions\",fn:function(data){return [_c('b-button-group',{staticClass:\"float-right w-100\"},[_c('b-button',{attrs:{\"variant\":\"secondary\",\"size\":\"sm\"},on:{\"click\":function () { return (_vm.editData = data.item); }}},[_c('font-awesome-icon',{attrs:{\"icon\":\"cog\"}})],1),(!data.item.tier)?_c('b-button',{attrs:{\"variant\":\"danger\",\"size\":\"sm\"},on:{\"click\":function($event){return _vm.removeDividendReceived(data)}}},[_c('font-awesome-icon',{attrs:{\"icon\":\"trash\"}})],1):_vm._e()],1)]}}])},[(_vm.editable)?_c('template',{slot:\"action-bar\"},[_c('AddForm',{key:\"div-received-form\",attrs:{\"formTitle\":\"New Dividend\",\"formFields\":_vm.tableFields},on:{\"form-submit\":_vm.addNewDividendReceived}})],1):_vm._e()],2),_c('br'),_c('h5',[_vm._v(\"Dividend Tiers\")]),_c('ErrorAlert',{attrs:{\"error\":_vm.error}}),_c('Table',{attrs:{\"fields\":_vm.tableFieldsAgg,\"items\":_vm.DividendsTiersReceived,\"slots\":_vm.tableSlots},scopedSlots:_vm._u([{key:\"schedule_93\",fn:function(data){return [_c('b-form-group',[_c('b-form-checkbox',{attrs:{\"disabled\":\"\",\"readonly\":\"\"},model:{value:(data.item.schedule_93),callback:function ($$v) {_vm.$set(data.item, \"schedule_93\", $$v)},expression:\"data.item.schedule_93\"}})],1)]}},{key:\"category\",fn:function(data){return [_vm._v(\"\\n \"+_vm._s(_vm.getOptionText(\n _vm.categoryOptions,\n data.item.category,\n _vm.getForeignAffiliateName(data.item.tier_owner)\n ))+\"\\n \")]}},{key:\"actions\",fn:function(data){return [_c('b-button-group',{staticClass:\"float-right w-100\"},[_c('b-button',{attrs:{\"variant\":\"secondary\",\"size\":\"sm\"},on:{\"click\":function () { return (_vm.editData = data.item); }}},[_c('font-awesome-icon',{attrs:{\"icon\":\"cog\"}})],1),(!data.item.tier)?_c('b-button',{attrs:{\"variant\":\"danger\",\"size\":\"sm\"},on:{\"click\":function($event){return _vm.removeDividendReceived(data)}}},[_c('font-awesome-icon',{attrs:{\"icon\":\"trash\"}})],1):_vm._e()],1)]}}])})],1)])],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\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\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\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\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\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\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport {\r\n Taxpayer,\r\n ReportingPeriod,\r\n Dividend,\r\n Deferred,\r\n ForeignAffiliate,\r\n} from \"@/interfaces\"\r\nimport { Component, Vue, Prop, Emit, Watch } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport dateFns from \"date-fns\"\r\n// Project imports\r\nimport Table from \"@/components/utils/Table.vue\"\r\nimport AddForm from \"@/components/utils/AddForm.vue\"\r\nimport PromptWindow from \"@/components/utils/PromptWindow.vue\"\r\nimport { sep, taxpayer } from \"@/services/api\"\r\nimport ScheduleMixin from \"../../../mixins/ScheduleMixin\"\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport { unformat } from \"accounting\"\r\nimport ReviewSection from \"@/components/calculator/ReviewSection.vue\"\r\n\r\n@Component({\r\n components: { Table, AddForm, PromptWindow, ErrorAlert, ReviewSection },\r\n})\r\nexport default class DividendsReceivedSchedule extends mixins(ScheduleMixin) {\r\n @Prop({ required: true })\r\n public reportingPeriod!: ReportingPeriod\r\n @Prop({ required: true })\r\n public field!: any\r\n\r\n public get tableFields() {\r\n let fields: any[] = [\r\n {\r\n key: \"date\",\r\n label: \"Date\",\r\n sortable: true,\r\n type: \"date\",\r\n rules: `required|date_picker_constraint`,\r\n dateConfig: {\r\n disabledDates: {\r\n to: dateFns.parse(this.reportingPeriod.start_date),\r\n from: dateFns.parse(this.reportingPeriod.end_date),\r\n },\r\n openDate: dateFns.parse(this.reportingPeriod.start_date),\r\n },\r\n },\r\n {\r\n key: \"amount\",\r\n label: \"Amount\",\r\n sortable: true,\r\n type: \"number\",\r\n rules: \"required\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"tax_on_amount\",\r\n label: \"Tax on Amount\",\r\n sortable: true,\r\n type: \"number\",\r\n rules: \"required\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n onChange: (value: string, form: any) => {\r\n // Want to only allow negative values if the category is \"Exempt Surplus\"\r\n if (form[\"category\"] === \"E\") {\r\n return\r\n }\r\n const unformatted = unformat(value)\r\n form[\"tax_on_amount\"] = Math.abs(unformatted)\r\n },\r\n },\r\n {\r\n key: \"schedule_93\",\r\n label: \"Deemed dividend received under S. 93(1) or (1.1)\",\r\n sortable: true,\r\n type: \"checkbox\",\r\n rules: \"\",\r\n show: (formValues: any) => {\r\n return formValues && formValues[\"category\"] !== \"S112\"\r\n },\r\n },\r\n {\r\n key: \"category\",\r\n label: \"Category\",\r\n sortable: true,\r\n type: \"select\",\r\n rules: \"required\",\r\n selectConfig: {\r\n options: this.categoryOptions,\r\n },\r\n onChange: (value: string, form: any) => {\r\n // Want to only allow negative values if the category is \"Exempt Surplus\"\r\n if (form[\"category\"] !== \"E\") {\r\n const unformatted = unformat(form[\"tax_on_amount\"])\r\n form[\"tax_on_amount\"] = Math.abs(unformatted)\r\n }\r\n },\r\n },\r\n {\r\n key: \"hut_amount\",\r\n label: \"Hybrid Underlying Tax Applicable\",\r\n sortable: true,\r\n type: \"number\",\r\n rules: \"\",\r\n show: (formValues: any) => {\r\n return formValues && formValues[\"category\"] == \"H\"\r\n },\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"uft_amount\",\r\n label: \"Underlying Foreign Tax Applicable\",\r\n sortable: true,\r\n type: \"number\",\r\n rules: \"\",\r\n show: (formValues: any) => {\r\n return formValues && formValues[\"category\"] == \"T\"\r\n },\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"client_ref\",\r\n label: \"Working Paper Reference\",\r\n editable: this.isClient,\r\n sortable: true,\r\n rules: this.isClient ? this.refValidationRules : \"\",\r\n type: \"textarea\",\r\n },\r\n ]\r\n if (!this.isClient) {\r\n const staffFields = [\r\n {\r\n key: \"ref\",\r\n label: \"Working Paper Reference - KPMG\",\r\n sortable: true,\r\n type: \"text\",\r\n rules: this.refValidationRules,\r\n },\r\n ]\r\n\r\n fields = fields.concat(staffFields)\r\n }\r\n if (this.editable) {\r\n fields.push({ key: \"actions\", label: \"\" })\r\n }\r\n return fields\r\n }\r\n\r\n public get tableFieldsAgg() {\r\n const fields: any[] = [\r\n {\r\n key: \"date\",\r\n label: \"Date\",\r\n sortable: true,\r\n type: \"date\",\r\n rules: `required`,\r\n dateConfig: {\r\n disabledDates: {\r\n to: dateFns.parse(this.reportingPeriod.start_date),\r\n from: dateFns.parse(this.reportingPeriod.end_date),\r\n },\r\n openDate: dateFns.parse(this.reportingPeriod.start_date),\r\n },\r\n },\r\n {\r\n key: \"amount\",\r\n label: \"Amount\",\r\n sortable: true,\r\n type: \"number\",\r\n rules: \"required\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"tax_on_amount\",\r\n label: \"Tax on Amount\",\r\n sortable: true,\r\n type: \"number\",\r\n rules: \"required\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"schedule_93\",\r\n label: \"Deemed dividend received under S. 93(1) or (1.1)\",\r\n sortable: true,\r\n type: \"checkbox\",\r\n rules: \"\",\r\n show: (formValues: any) => {\r\n return formValues && formValues[\"category\"] !== \"S112\"\r\n },\r\n },\r\n {\r\n key: \"payer_name\",\r\n label: \"From\",\r\n sortable: true,\r\n type: \"string\",\r\n rules: \"\",\r\n },\r\n ]\r\n\r\n return fields\r\n }\r\n\r\n public tableSlots: any[] = [\r\n {\r\n name: \"actions\",\r\n field: \"actions\",\r\n },\r\n {\r\n name: \"schedule_93\",\r\n field: \"schedule_93\",\r\n },\r\n {\r\n name: \"category\",\r\n field: \"category\",\r\n },\r\n ]\r\n\r\n public get DividendsReceived() {\r\n if (this.reportingPeriod.dividends) {\r\n if (this.isClient) {\r\n return this.reportingPeriod.dividends.filter(dividend => {\r\n return dividend.type === \"R\" && !dividend.tier\r\n })\r\n } else {\r\n return this.reportingPeriod.dividends.filter(dividend => {\r\n return dividend.type === \"R\"\r\n })\r\n }\r\n } else {\r\n return []\r\n }\r\n }\r\n\r\n public get DividendsReceivedClientView() {\r\n if (this.reportingPeriod.dividends) {\r\n return this.reportingPeriod.dividends.filter(dividend => {\r\n return dividend.type === \"R\" && !dividend.tier\r\n })\r\n } else {\r\n return []\r\n }\r\n }\r\n\r\n public get DividendsReceivedStaffView() {\r\n if (this.reportingPeriod.dividends) {\r\n return this.reportingPeriod.dividends.filter(dividend => {\r\n return dividend.type === \"R\"\r\n })\r\n } else {\r\n return []\r\n }\r\n }\r\n\r\n public get DividendsTiersReceived() {\r\n if (this.reportingPeriod.dividend_tiers) {\r\n return this.reportingPeriod.dividend_tiers\r\n } else {\r\n return []\r\n }\r\n }\r\n\r\n public mounted() {\r\n // Fetch taxpayer info\r\n this.fetchTaxpayer()\r\n }\r\n\r\n public createFormFields(dividend: Dividend) {\r\n if (dividend && dividend.tier) {\r\n const tierEditableFields: string[] = [\"ref\", \"tax_on_amount\"]\r\n const newTableFields = this.tableFields.map((f: any) => {\r\n const newField = Object.assign({}, f)\r\n newField[\"editable\"] = tierEditableFields.includes(newField.key)\r\n return newField\r\n })\r\n // Insert the amount reference slot, IF there is an fx rate in the tier\r\n if (dividend.tier.fx_rate != null) {\r\n const amountIndex = newTableFields.findIndex(f => f.key == \"amount\")\r\n if (amountIndex >= 0) {\r\n newTableFields.splice(amountIndex, 0, {\r\n key: \"tier_info\",\r\n type: \"component\",\r\n label: \"\",\r\n })\r\n }\r\n }\r\n return newTableFields\r\n }\r\n return this.tableFields\r\n }\r\n\r\n public originalAmount(dividend: Dividend) {\r\n if (dividend.tier && dividend.tier.fx_rate) {\r\n return formatMoney(dividend.amount / dividend.tier.fx_rate)\r\n }\r\n }\r\n\r\n public addNewDividendReceived(dividendData: any) {\r\n const { id } = this.reportingPeriod\r\n this.loading = true\r\n if (id) {\r\n const newDividend: any = this.validateData(this.tableFields, {\r\n ...dividendData,\r\n type: \"R\",\r\n })\r\n\r\n this.addDividend(newDividend)\r\n .then((res: Dividend) => {\r\n this.loading = false\r\n })\r\n .catch((error: any) => {\r\n this.loading = false\r\n this.error = error\r\n })\r\n } else {\r\n this.error = \"There was an error creating dividend.\"\r\n this.loading = false\r\n }\r\n }\r\n\r\n public removeDividendReceived(row: any) {\r\n this.prompt.show = true\r\n // Defer promise to be handled once resolved\r\n this.prompt.defer = new Deferred()\r\n this.prompt.defer.promise\r\n .then(() => {\r\n const dividend = row.item\r\n this.loading = true\r\n this.deleteDividend(dividend.id).finally(() => {\r\n this.loading = false\r\n })\r\n })\r\n .catch((error: any) => {\r\n if (error) {\r\n this.error = error\r\n }\r\n })\r\n }\r\n\r\n public editDividendReceived(dividendData: any) {\r\n let editedDividend = Object.assign(this.editData, dividendData)\r\n editedDividend = this.validateData(this.tableFields, {\r\n ...editedDividend,\r\n type: \"R\",\r\n })\r\n this.loading = true\r\n this.editDividend(editedDividend)\r\n .catch((error: any) => {\r\n if (error) {\r\n this.error = error\r\n }\r\n })\r\n .finally(() => (this.loading = false))\r\n\r\n this.editData = null\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DividendsReceivedSchedule.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./DividendsReceivedSchedule.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./DividendsReceivedSchedule.vue?vue&type=template&id=63db5e4a&\"\nimport script from \"./DividendsReceivedSchedule.vue?vue&type=script&lang=ts&\"\nexport * from \"./DividendsReceivedSchedule.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-row',{attrs:{\"align-v\":\"center\"}},[_c('b-col',[_c('h2',[_vm._v(\"SEP Adjustments\")]),_c('ScheduleHeader',{attrs:{\"foreignAffiliate\":_vm.activeForeignAffiliate,\"reportingPeriod\":_vm.reportingPeriod}})],1)],1),(_vm.prompt.show)?_c('prompt-window',{attrs:{\"title\":_vm.prompt.title,\"message\":_vm.prompt.message,\"showCancel\":true},on:{\"prompt-result\":_vm.onPromptCallback}},[_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"confirmButton\",\"variant\":\"danger\"},slot:\"confirmButton\"},[_vm._v(\"Delete\")]),_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"cancelButton\",\"variant\":\"success\"},slot:\"cancelButton\"},[_vm._v(\"Cancel\")])],1):_vm._e(),_c('AddForm',{attrs:{\"formTitle\":\"Edit SEP\",\"formFields\":_vm.tableFields,\"formData\":_vm.editData,\"edit\":true},on:{\"form-submit\":_vm.editSEP,\"modal-close\":function () { return (_vm.editData = null); }}}),(_vm.loading)?_c('b-row',[_c('b-col',{staticClass:\"text-center\"},[_c('b-spinner',{staticClass:\"large-spinner\"})],1)],1):_c('div',[_c('ErrorAlert',{attrs:{\"error\":_vm.error}}),_c('Table',{attrs:{\"fields\":_vm.tableFields,\"items\":_vm.SEPAdjustments,\"slots\":_vm.tableSlots},scopedSlots:_vm._u([{key:\"result_of_share_issuance\",fn:function(data){return [_c('b-form-group',[_c('b-form-checkbox',{attrs:{\"disabled\":\"\",\"readonly\":\"\"},model:{value:(data.item.result_of_share_issuance),callback:function ($$v) {_vm.$set(data.item, \"result_of_share_issuance\", $$v)},expression:\"data.item.result_of_share_issuance\"}})],1)]}},{key:\"actions\",fn:function(data){return [_c('b-button-group',{staticClass:\"float-right w-100\"},[(!_vm.isClient)?_c('ReviewSection',{key:(\"calc-review-section-\" + (_vm.field.meta_id) + \"-\" + (_vm.reportingPeriod.id) + \"-\" + (data.item.id)),attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":_vm.field,\"object\":data.item}}):_vm._e(),_c('b-button',{attrs:{\"variant\":\"secondary\",\"size\":\"sm\"},on:{\"click\":function () { return (_vm.editData = data.item); }}},[_c('font-awesome-icon',{attrs:{\"icon\":\"cog\"}})],1),_c('b-button',{attrs:{\"variant\":\"danger\",\"size\":\"sm\"},on:{\"click\":function($event){return _vm.removeSEPAdjustment(data)}}},[_c('font-awesome-icon',{attrs:{\"icon\":\"trash\"}})],1)],1)]}}])},[(_vm.editable)?_c('template',{slot:\"action-bar\"},[_c('AddForm',{attrs:{\"formTitle\":\"New SEP Adjustment\",\"formFields\":_vm.tableFields},on:{\"form-submit\":_vm.addNewAdjustment}})],1):_vm._e()],2)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\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\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport {\r\n Taxpayer,\r\n ReportingPeriod,\r\n SEPAdjustment,\r\n Deferred,\r\n} from \"@/interfaces\"\r\nimport { Component, Vue, Prop, Emit, Watch } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport dateFns from \"date-fns\"\r\n// Project imports\r\nimport Table from \"@/components/utils/Table.vue\"\r\nimport AddForm from \"@/components/utils/AddForm.vue\"\r\nimport PromptWindow from \"@/components/utils/PromptWindow.vue\"\r\nimport { sep } from \"@/services/api\"\r\nimport ScheduleMixin from \"../../../mixins/ScheduleMixin\"\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport ReviewSection from \"@/components/calculator/ReviewSection.vue\"\r\n\r\n@Component({\r\n components: { Table, AddForm, PromptWindow, ErrorAlert, ReviewSection },\r\n})\r\nexport default class SepAdjusmentsSchedule extends mixins(ScheduleMixin) {\r\n @Prop({ required: true })\r\n public reportingPeriod!: ReportingPeriod\r\n @Prop({ required: true })\r\n public field!: any\r\n\r\n public get tableFields() {\r\n let fields: any[] = [\r\n {\r\n key: \"date\",\r\n label: \"Date\",\r\n sortable: true,\r\n type: \"date\",\r\n rules: \"required|date_picker_constraint\",\r\n dateConfig: {\r\n disabledDates: {\r\n to: dateFns.parse(this.reportingPeriod.start_date),\r\n from: dateFns.parse(this.reportingPeriod.end_date),\r\n },\r\n openDate: dateFns.parse(this.reportingPeriod.start_date),\r\n },\r\n },\r\n {\r\n key: \"amount\",\r\n label: \"New Percentage\",\r\n sortable: true,\r\n type: \"number\",\r\n rules: \"required\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value, 10)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"client_ref\",\r\n label: \"Working Paper Reference\",\r\n sortable: true,\r\n type: \"text\",\r\n editable: this.isClient,\r\n rules: this.isClient ? this.refValidationRules : \"\",\r\n },\r\n ]\r\n if (!this.isClient) {\r\n const staffFields = [\r\n {\r\n key: \"ref\",\r\n label: \"Working Paper Reference - KPMG\",\r\n sortable: true,\r\n type: \"text\",\r\n rules: this.refValidationRules,\r\n },\r\n ]\r\n\r\n fields = fields.concat(staffFields)\r\n }\r\n if (this.editable) {\r\n fields.push({ key: \"actions\", label: \"\" })\r\n }\r\n return fields\r\n }\r\n\r\n public tableSlots: any[] = [\r\n {\r\n name: \"result_of_share_issuance\",\r\n field: \"result_of_share_issuance\",\r\n },\r\n {\r\n name: \"actions\",\r\n field: \"actions\",\r\n },\r\n ]\r\n\r\n public get SEPAdjustments() {\r\n return this.reportingPeriod.sep_adjustments\r\n }\r\n\r\n public mounted() {\r\n this.prompt.message = \"Delete SEP Adjustment?\"\r\n\r\n if (this.editable) {\r\n this.tableFields.push({ key: \"actions\", label: \"\" })\r\n }\r\n }\r\n\r\n public addNewAdjustment(SEPAdjustmentData: any) {\r\n const { id } = this.reportingPeriod\r\n\r\n this.loading = true\r\n if (id) {\r\n const newSEPAdjustment: any = this.validateData(\r\n this.tableFields,\r\n SEPAdjustmentData\r\n )\r\n\r\n this.addSEPAdjustment(newSEPAdjustment)\r\n .then((res: SEPAdjustment) => {\r\n this.loading = false\r\n })\r\n .catch((error: any) => {\r\n this.loading = false\r\n this.error = error\r\n })\r\n } else {\r\n this.error = \"There was an error creating adjustment.\"\r\n this.loading = false\r\n }\r\n }\r\n\r\n public removeSEPAdjustment(row: any) {\r\n this.prompt.show = true\r\n // Defer promise to be handled once resolved\r\n this.prompt.defer = new Deferred()\r\n this.prompt.defer.promise\r\n .then(() => {\r\n const SEPAdjustmentItem = row.item\r\n this.loading = true\r\n this.deleteSEPAdjustment(SEPAdjustmentItem.id).finally(() => {\r\n this.loading = false\r\n })\r\n })\r\n .catch((error: any) => {\r\n if (error) {\r\n this.error = error\r\n }\r\n })\r\n }\r\n\r\n public editSEP(sepData: any) {\r\n let editedSEP = Object.assign(this.editData, sepData)\r\n editedSEP = this.validateData(this.tableFields, {\r\n ...editedSEP,\r\n })\r\n this.loading = true\r\n this.editSEPAdjustment(editedSEP)\r\n .catch((error: any) => {\r\n if (error) {\r\n this.error = error\r\n }\r\n })\r\n .finally(() => (this.loading = false))\r\n\r\n this.editData = null\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SepAdjustmentsSchedule.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SepAdjustmentsSchedule.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./SepAdjustmentsSchedule.vue?vue&type=template&id=61218afe&\"\nimport script from \"./SepAdjustmentsSchedule.vue?vue&type=script&lang=ts&\"\nexport * from \"./SepAdjustmentsSchedule.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-row',{attrs:{\"align-v\":\"center\"}},[_c('b-col',[_c('h2',[_vm._v(\"Other Inclusions/(Deductions)\")]),_c('ScheduleHeader',{attrs:{\"foreignAffiliate\":_vm.activeForeignAffiliate,\"reportingPeriod\":_vm.reportingPeriod}})],1)],1),(_vm.prompt.show)?_c('prompt-window',{attrs:{\"title\":_vm.prompt.title,\"message\":_vm.prompt.message,\"showCancel\":true},on:{\"prompt-result\":_vm.onPromptCallback}},[_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"confirmButton\",\"variant\":\"danger\"},slot:\"confirmButton\"},[_vm._v(\"Delete\")]),_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"cancelButton\",\"variant\":\"success\"},slot:\"cancelButton\"},[_vm._v(\"Cancel\")])],1):_vm._e(),_c('AddForm',{attrs:{\"formTitle\":\"Edit Adjustment\",\"formFields\":_vm.tableFields,\"formData\":_vm.editData,\"edit\":true},on:{\"form-submit\":_vm.editAdjust,\"modal-close\":function () { return (_vm.editData = null); }}}),(_vm.loading)?_c('b-row',[_c('b-col',{staticClass:\"text-center\"},[_c('b-spinner',{staticClass:\"large-spinner\"})],1)],1):_c('div',[_c('ErrorAlert',{attrs:{\"error\":_vm.error}}),_c('Table',{attrs:{\"fields\":_vm.tableFields,\"items\":_vm.Adjusmtents,\"slots\":_vm.tableSlots},scopedSlots:_vm._u([{key:\"type\",fn:function(data){return [_vm._v(\"\\n \"+_vm._s(_vm.getOptionText(_vm.adjustmentTypeOptions, data.item.type))+\"\\n \")]}},{key:\"actions\",fn:function(data){return [_c('b-button-group',{staticClass:\"float-right w-100\"},[(!_vm.isClient)?_c('ReviewSection',{key:(\"calc-review-section-\" + (_vm.field.meta_id) + \"-\" + (_vm.reportingPeriod.id) + \"-\" + (data.item.id)),attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":_vm.field,\"object\":data.item}}):_vm._e(),_c('b-button',{attrs:{\"variant\":\"secondary\",\"size\":\"sm\"},on:{\"click\":function () { return (_vm.editData = data.item); }}},[_c('font-awesome-icon',{attrs:{\"icon\":\"cog\"}})],1),_c('b-button',{attrs:{\"variant\":\"danger\",\"size\":\"sm\"},on:{\"click\":function($event){return _vm.removeAdjusment(data)}}},[_c('font-awesome-icon',{attrs:{\"icon\":\"trash\"}})],1)],1)]}}])},[(_vm.editable)?_c('template',{slot:\"action-bar\"},[_c('AddForm',{key:\"div-paid-form\",attrs:{\"formTitle\":\"New Adjustment\",\"formFields\":_vm.tableFields},on:{\"form-submit\":_vm.addNewAdjustment}},[(_vm.loading)?_c('b-spinner',{attrs:{\"slot\":\"buttonContent\"},slot:\"buttonContent\"}):_vm._e()],1)],1):_vm._e()],2)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\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\n\n\n\n\n\r\nimport {\r\n Taxpayer,\r\n ReportingPeriod,\r\n Deferred,\r\n ForeignAffiliate,\r\n Adjustment,\r\n} from \"@/interfaces\"\r\nimport { Component, Vue, Prop, Emit, Watch } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport dateFns from \"date-fns\"\r\n// Project imports\r\nimport Table from \"@/components/utils/Table.vue\"\r\nimport AddForm from \"@/components/utils/AddForm.vue\"\r\nimport PromptWindow from \"@/components/utils/PromptWindow.vue\"\r\nimport ScheduleMixin from \"../../../mixins/ScheduleMixin\"\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport ReviewSection from \"@/components/calculator/ReviewSection.vue\"\r\n\r\n@Component({\r\n components: { Table, AddForm, PromptWindow, ErrorAlert, ReviewSection },\r\n})\r\nexport default class OtherInclusionsSchedule extends mixins(ScheduleMixin) {\r\n @Prop({ required: true })\r\n public reportingPeriod!: ReportingPeriod\r\n @Prop({ required: true })\r\n public field!: any\r\n\r\n public metaId: string = \"other_inclusions\"\r\n\r\n public get tableFields() {\r\n let fields: any[] = [\r\n {\r\n key: \"date\",\r\n label: \"Date\",\r\n sortable: true,\r\n type: \"date\",\r\n rules: `required|date_picker_constraint`,\r\n dateConfig: {\r\n disabledDates: {\r\n to: dateFns.parse(this.reportingPeriod.start_date),\r\n from: dateFns.parse(this.reportingPeriod.end_date),\r\n },\r\n openDate: dateFns.parse(this.reportingPeriod.start_date),\r\n },\r\n },\r\n {\r\n key: \"amount\",\r\n label: \"Amount\",\r\n sortable: true,\r\n type: \"number\",\r\n rules: \"required\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"type\",\r\n label: \"Type\",\r\n sortable: true,\r\n type: \"select\",\r\n rules: \"required\",\r\n selectConfig: {\r\n options: this.adjustmentTypeOptions,\r\n },\r\n },\r\n {\r\n key: \"client_description\",\r\n label: \"Description\",\r\n sortable: true,\r\n editable: this.isClient,\r\n type: \"textarea\",\r\n rules: this.isClient ? \"required\" : \"\",\r\n },\r\n {\r\n key: \"client_ref\",\r\n label: \"Working Paper Reference\",\r\n sortable: true,\r\n type: \"text\",\r\n editable: this.isClient,\r\n rules: this.isClient ? this.refValidationRules : \"\",\r\n },\r\n ]\r\n if (!this.isClient) {\r\n const staffFields = [\r\n {\r\n key: \"description\",\r\n label: \"Description - KPMG\",\r\n sortable: true,\r\n type: \"textarea\",\r\n rules: \"\",\r\n },\r\n {\r\n key: \"ref\",\r\n label: \"Working Paper Reference - KPMG\",\r\n sortable: true,\r\n type: \"text\",\r\n rules: this.refValidationRules,\r\n },\r\n ]\r\n\r\n fields = fields.concat(staffFields)\r\n }\r\n if (this.editable) {\r\n fields.push({ key: \"actions\", label: \"\" })\r\n }\r\n return fields\r\n }\r\n\r\n public tableSlots: any[] = [\r\n {\r\n name: \"actions\",\r\n field: \"actions\",\r\n },\r\n {\r\n name: \"type\",\r\n field: \"type\",\r\n },\r\n ]\r\n\r\n public get Adjusmtents() {\r\n if (this.reportingPeriod.adjustments) {\r\n return this.reportingPeriod.adjustments.filter(\r\n adj => JSON.parse(adj.metadata).meta_id === this.metaId\r\n )\r\n } else {\r\n return []\r\n }\r\n }\r\n\r\n public mounted() {\r\n // Fetch taxpayer info\r\n this.fetchTaxpayer()\r\n // Set Prompt message\r\n this.prompt.message = \"Delete Adjustment?\"\r\n }\r\n\r\n public addNewAdjustment(adjustmentData: any) {\r\n const { id } = this.reportingPeriod\r\n\r\n this.loading = true\r\n if (id) {\r\n const newAdjustment: any = this.validateData(this.tableFields, {\r\n ...adjustmentData,\r\n metadata: JSON.stringify({\r\n meta_id: this.metaId,\r\n }),\r\n })\r\n\r\n this.addAdjustment(newAdjustment)\r\n .then((res: Adjustment) => {\r\n this.loading = false\r\n })\r\n .catch((error: any) => {\r\n this.loading = false\r\n this.error = error\r\n })\r\n } else {\r\n this.error = \"There was an error creating adjustment.\"\r\n this.loading = false\r\n }\r\n }\r\n\r\n public removeAdjusment(row: any) {\r\n this.prompt.show = true\r\n // Defer promise to be handled once resolved\r\n this.prompt.defer = new Deferred()\r\n this.prompt.defer.promise\r\n .then(() => {\r\n const adjustment = row.item\r\n this.loading = true\r\n this.deleteAdjustment(adjustment.id).finally(() => {\r\n this.loading = false\r\n })\r\n })\r\n .catch((error: any) => {\r\n if (error) {\r\n this.error = error\r\n }\r\n })\r\n }\r\n\r\n public editAdjust(adjData: any) {\r\n let editedAdjust = Object.assign(this.editData, adjData)\r\n editedAdjust = this.validateData(this.tableFields, {\r\n ...editedAdjust,\r\n })\r\n this.loading = true\r\n this.editAdjustment(editedAdjust)\r\n .catch((error: any) => {\r\n if (error) {\r\n this.error = error\r\n }\r\n })\r\n .finally(() => (this.loading = false))\r\n\r\n this.editData = null\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./OtherInclusionsSchedule.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./OtherInclusionsSchedule.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./OtherInclusionsSchedule.vue?vue&type=template&id=82a869a0&\"\nimport script from \"./OtherInclusionsSchedule.vue?vue&type=script&lang=ts&\"\nexport * from \"./OtherInclusionsSchedule.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-row',{attrs:{\"align-v\":\"center\"}},[_c('b-col',[_c('h2',[_vm._v(\"Foreign Tax Consolidation\")]),_c('ScheduleHeader',{attrs:{\"foreignAffiliate\":_vm.activeForeignAffiliate,\"reportingPeriod\":_vm.reportingPeriod}})],1)],1),(_vm.prompt.show)?_c('prompt-window',{attrs:{\"title\":_vm.prompt.title,\"message\":_vm.prompt.message,\"showCancel\":true},on:{\"prompt-result\":_vm.onPromptCallback}},[_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"confirmButton\",\"variant\":\"danger\"},slot:\"confirmButton\"},[_vm._v(\"Delete\")]),_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"cancelButton\",\"variant\":\"success\"},slot:\"cancelButton\"},[_vm._v(\"Cancel\")])],1):_vm._e(),_c('AddForm',{attrs:{\"formTitle\":\"Edit Adjustment\",\"formFields\":_vm.tableFields,\"formData\":_vm.editData,\"edit\":true},on:{\"form-submit\":_vm.editAdjust,\"modal-close\":function () { return (_vm.editData = null); }}}),(_vm.loading)?_c('b-row',[_c('b-col',{staticClass:\"text-center\"},[_c('b-spinner',{staticClass:\"large-spinner\"})],1)],1):_c('div',[_c('ErrorAlert',{attrs:{\"error\":_vm.error}}),_c('Table',{attrs:{\"fields\":_vm.tableFields,\"items\":_vm.Adjusmtents,\"slots\":_vm.tableSlots},scopedSlots:_vm._u([{key:\"type\",fn:function(data){return [_vm._v(_vm._s(_vm.getOptionText(_vm.FTCAdjustmentTypeOptions, data.item.type)))]}},{key:\"actions\",fn:function(data){return [_c('b-button-group',{staticClass:\"float-right w-100\"},[(!_vm.isClient)?_c('ReviewSection',{key:(\"calc-review-section-\" + (_vm.field.meta_id) + \"-\" + (_vm.reportingPeriod.id) + \"-\" + (data.item.id)),attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":_vm.field,\"object\":data.item}}):_vm._e(),_c('b-button',{attrs:{\"variant\":\"secondary\",\"size\":\"sm\"},on:{\"click\":function () { return (_vm.editData = data.item); }}},[_c('font-awesome-icon',{attrs:{\"icon\":\"cog\"}})],1),_c('b-button',{attrs:{\"variant\":\"danger\",\"size\":\"sm\"},on:{\"click\":function($event){return _vm.removeAdjusment(data)}}},[_c('font-awesome-icon',{attrs:{\"icon\":\"trash\"}})],1)],1)]}}])},[(_vm.editable)?_c('template',{slot:\"action-bar\"},[_c('AddForm',{key:\"div-paid-form\",attrs:{\"formTitle\":\"New Adjustment\",\"formFields\":_vm.tableFields},on:{\"form-submit\":_vm.addNewAdjustment}},[(_vm.loading)?_c('b-spinner',{attrs:{\"slot\":\"buttonContent\"},slot:\"buttonContent\"}):_vm._e()],1)],1):_vm._e()],2)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\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\n\n\n\n\n\r\nimport {\r\n Taxpayer,\r\n ReportingPeriod,\r\n Deferred,\r\n ForeignAffiliate,\r\n Adjustment,\r\n} from \"@/interfaces\"\r\nimport { Component, Vue, Prop, Emit, Watch } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport dateFns from \"date-fns\"\r\n// Project imports\r\nimport Table from \"@/components/utils/Table.vue\"\r\nimport AddForm from \"@/components/utils/AddForm.vue\"\r\nimport PromptWindow from \"@/components/utils/PromptWindow.vue\"\r\nimport ScheduleMixin from \"../../../mixins/ScheduleMixin\"\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport ReviewSection from \"@/components/calculator/ReviewSection.vue\"\r\n\r\n@Component({\r\n components: { Table, AddForm, PromptWindow, ErrorAlert, ReviewSection },\r\n})\r\nexport default class ForeignTaxConsolidationSchedule extends mixins(\r\n ScheduleMixin\r\n) {\r\n @Prop({ required: true })\r\n public reportingPeriod!: ReportingPeriod\r\n @Prop({ required: true })\r\n public field!: any\r\n\r\n public metaId: string = \"foreign_tax_consolidation\"\r\n\r\n public get tableFields() {\r\n let fields: any[] = [\r\n {\r\n key: \"date\",\r\n label: \"Date\",\r\n sortable: true,\r\n type: \"date\",\r\n rules: `required|date_picker_constraint`,\r\n dateConfig: {\r\n disabledDates: {\r\n to: dateFns.parse(this.reportingPeriod.start_date),\r\n from: dateFns.parse(this.reportingPeriod.end_date),\r\n },\r\n openDate: dateFns.parse(this.reportingPeriod.start_date),\r\n },\r\n },\r\n {\r\n key: \"amount\",\r\n label: \"Amount\",\r\n sortable: true,\r\n type: \"number\",\r\n rules: \"required\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"type\",\r\n label: \"Type\",\r\n sortable: true,\r\n type: \"select\",\r\n rules: \"required\",\r\n selectConfig: {\r\n options: this.FTCAdjustmentTypeOptions,\r\n },\r\n },\r\n {\r\n key: \"client_description\",\r\n label: \"Description\",\r\n sortable: true,\r\n editable: this.isClient,\r\n type: \"textarea\",\r\n rules: this.isClient ? \"required\" : \"\",\r\n },\r\n {\r\n key: \"client_ref\",\r\n label: \"Working Paper Reference\",\r\n sortable: true,\r\n type: \"text\",\r\n editable: this.isClient,\r\n rules: this.isClient ? this.refValidationRules : \"\",\r\n },\r\n ]\r\n if (!this.isClient) {\r\n const staffFields = [\r\n {\r\n key: \"description\",\r\n label: \"Description - KPMG\",\r\n sortable: true,\r\n type: \"textarea\",\r\n rules: \"\",\r\n },\r\n {\r\n key: \"ref\",\r\n label: \"Working Paper Reference - KPMG\",\r\n sortable: true,\r\n type: \"text\",\r\n rules: this.refValidationRules,\r\n },\r\n ]\r\n\r\n fields = fields.concat(staffFields)\r\n }\r\n if (this.editable) {\r\n fields.push({ key: \"actions\", label: \"\" })\r\n }\r\n return fields\r\n }\r\n\r\n public tableSlots: any[] = [\r\n {\r\n name: \"actions\",\r\n field: \"actions\",\r\n },\r\n {\r\n name: \"type\",\r\n field: \"type\",\r\n },\r\n ]\r\n\r\n public get Adjusmtents() {\r\n if (this.reportingPeriod.adjustments) {\r\n return this.reportingPeriod.adjustments.filter(\r\n adj => JSON.parse(adj.metadata).meta_id === this.metaId\r\n )\r\n } else {\r\n return []\r\n }\r\n }\r\n\r\n public mounted() {\r\n // Fetch taxpayer info\r\n this.fetchTaxpayer()\r\n // Set Prompt message\r\n this.prompt.message = \"Delete Adjustment?\"\r\n }\r\n\r\n public addNewAdjustment(adjustmentData: any) {\r\n const { id } = this.reportingPeriod\r\n\r\n this.loading = true\r\n if (id) {\r\n const newAdjustment: any = this.validateData(this.tableFields, {\r\n ...adjustmentData,\r\n metadata: JSON.stringify({\r\n meta_id: this.metaId,\r\n }),\r\n })\r\n\r\n this.addAdjustment(newAdjustment)\r\n .then((res: Adjustment) => {\r\n this.loading = false\r\n })\r\n .catch((error: any) => {\r\n this.loading = false\r\n this.error = error\r\n })\r\n } else {\r\n this.error = \"There was an error creating adjustment.\"\r\n this.loading = false\r\n }\r\n }\r\n\r\n public removeAdjusment(row: any) {\r\n this.prompt.show = true\r\n // Defer promise to be handled once resolved\r\n this.prompt.defer = new Deferred()\r\n this.prompt.defer.promise\r\n .then(() => {\r\n const adjustment = row.item\r\n this.loading = true\r\n this.deleteAdjustment(adjustment.id).finally(() => {\r\n this.loading = false\r\n })\r\n })\r\n .catch((error: any) => {\r\n if (error) {\r\n this.error = error\r\n }\r\n })\r\n }\r\n\r\n public editAdjust(adjData: any) {\r\n let editedAdjust = Object.assign(this.editData, adjData)\r\n editedAdjust = this.validateData(this.tableFields, {\r\n ...editedAdjust,\r\n })\r\n this.loading = true\r\n this.editAdjustment(editedAdjust)\r\n .catch((error: any) => {\r\n if (error) {\r\n this.error = error\r\n }\r\n })\r\n .finally(() => (this.loading = false))\r\n\r\n this.editData = null\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ForeignTaxConsolidationSchedule.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ForeignTaxConsolidationSchedule.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./ForeignTaxConsolidationSchedule.vue?vue&type=template&id=83b65656&\"\nimport script from \"./ForeignTaxConsolidationSchedule.vue?vue&type=script&lang=ts&\"\nexport * from \"./ForeignTaxConsolidationSchedule.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-row',{attrs:{\"align-v\":\"center\"}},[_c('b-col',[_c('h2',[_vm._v(_vm._s(_vm.field.name))]),_c('ScheduleHeader',{attrs:{\"foreignAffiliate\":_vm.activeForeignAffiliate,\"reportingPeriod\":_vm.reportingPeriod}})],1)],1),(_vm.prompt.show)?_c('prompt-window',{attrs:{\"title\":_vm.prompt.title,\"message\":_vm.prompt.message,\"showCancel\":true},on:{\"prompt-result\":_vm.onPromptCallback}},[_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"confirmButton\",\"variant\":\"danger\"},slot:\"confirmButton\"},[_vm._v(\"Delete\")]),_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"cancelButton\",\"variant\":\"success\"},slot:\"cancelButton\"},[_vm._v(\"Cancel\")])],1):_vm._e(),_c('b-alert',{attrs:{\"variant\":\"success\",\"show\":_vm.successMessage != '',\"dismissible\":\"\"}},[_vm._v(_vm._s(_vm.successMessage))]),_c('AddForm',{attrs:{\"formTitle\":\"Edit Adjustment\",\"formFields\":_vm.tableFields,\"formData\":_vm.editData,\"edit\":true},on:{\"form-submit\":_vm.editUserCreatedField,\"modal-close\":function () { return (_vm.editData = null); }}}),(_vm.loading)?_c('b-row',[_c('b-col',{staticClass:\"text-center\"},[_c('b-spinner',{staticClass:\"large-spinner\"})],1)],1):_c('div',[_c('ErrorAlert',{attrs:{\"error\":_vm.error}}),_c('Table',{attrs:{\"fields\":_vm.tableFields,\"items\":_vm.userCreatedFields,\"slots\":_vm.tableSlots},scopedSlots:_vm._u([{key:\"actions\",fn:function(data){return [_c('b-button-group',{staticClass:\"float-right w-100\"},[(!_vm.isClient)?_c('ReviewSection',{key:(\"calc-review-section-\" + (_vm.field.meta_id) + \"-\" + (_vm.reportingPeriod.id) + \"-\" + (data.item.id)),attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":_vm.field,\"object\":data.item}}):_vm._e(),_c('b-button',{attrs:{\"variant\":\"secondary\",\"size\":\"sm\"},on:{\"click\":function () { return (_vm.editData = data.item); }}},[_c('font-awesome-icon',{attrs:{\"icon\":\"cog\"}})],1),_c('b-button',{attrs:{\"variant\":\"danger\",\"size\":\"sm\"},on:{\"click\":function($event){return _vm.removeUserCreatedField(Object.assign({}, data))}}},[_c('font-awesome-icon',{attrs:{\"icon\":\"trash\"}})],1)],1)]}}])},[(_vm.editable)?_c('template',{slot:\"action-bar\"},[_c('AddForm',{key:\"div-paid-form\",attrs:{\"formTitle\":\"New Adjustment\",\"formFields\":_vm.tableFields},on:{\"form-submit\":_vm.addUserCreatedField}},[(_vm.loading)?_c('b-spinner',{attrs:{\"slot\":\"buttonContent\"},slot:\"buttonContent\"}):_vm._e(),_c('b-button',{attrs:{\"slot\":\"appendButton\",\"disabled\":!_vm.priorReportingPeriods || _vm.priorReportingPeriods.length === 0},on:{\"click\":_vm.rollforwardFieldsButtonClick},slot:\"appendButton\"},[_vm._v(\"Rollforward Adjustments\")])],1)],1):_vm._e()],2)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\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\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\r\nimport {\r\n Taxpayer,\r\n ReportingPeriod,\r\n Deferred,\r\n ForeignAffiliate,\r\n Adjustment,\r\n} from \"@/interfaces\"\r\nimport { Component, Vue, Prop, Emit, Watch } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport dateFns from \"date-fns\"\r\n// Project imports\r\nimport Table from \"@/components/utils/Table.vue\"\r\nimport AddForm from \"@/components/utils/AddForm.vue\"\r\nimport PromptWindow from \"@/components/utils/PromptWindow.vue\"\r\nimport ScheduleMixin from \"../../../mixins/ScheduleMixin\"\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport ReviewSection from \"@/components/calculator/ReviewSection.vue\"\r\n\r\n@Component({\r\n components: { Table, AddForm, PromptWindow, ErrorAlert, ReviewSection },\r\n})\r\nexport default class FieldCreationSchedule extends mixins(ScheduleMixin) {\r\n @Prop({ required: true })\r\n public reportingPeriod!: ReportingPeriod\r\n @Prop({ required: true })\r\n public field!: any\r\n\r\n public successMessage: string = \"\"\r\n\r\n public get tableFields() {\r\n let fields: any[] = [\r\n {\r\n key: \"value\",\r\n label: \"Amount\",\r\n sortable: true,\r\n type: \"number\",\r\n sign: this.field.sign,\r\n rules: \"required\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"client_description\",\r\n label: \"Description\",\r\n sortable: true,\r\n editable: this.isClient,\r\n type: \"textarea\",\r\n rules: this.isClient ? \"required\" : \"\",\r\n },\r\n {\r\n key: \"client_ref\",\r\n label: \"Working Paper Reference\",\r\n sortable: true,\r\n type: \"text\",\r\n editable: this.isClient,\r\n rules: this.isClient ? this.refValidationRules : \"\",\r\n },\r\n ]\r\n if (!this.isClient) {\r\n const descriptionRequired: string[] = [\r\n \"ctr_amounts_increase_exempt\",\r\n \"ctr_amounts_increase_taxable\",\r\n \"952a_amounts_increase_exempt\",\r\n \"952a_amounts_increase_taxable\",\r\n \"fapi_before_deductible_loss\",\r\n ]\r\n\r\n const staffFields = [\r\n {\r\n key: \"description\",\r\n label: \"Description - KPMG\",\r\n sortable: true,\r\n type: \"textarea\",\r\n rules: `${\r\n descriptionRequired.indexOf(this.field.meta_id) >= 0\r\n ? \"required\"\r\n : \"\"\r\n }`,\r\n },\r\n {\r\n key: \"ref\",\r\n label: \"Working Paper Reference - KPMG\",\r\n sortable: true,\r\n type: \"text\",\r\n rules: this.refValidationRules,\r\n },\r\n ]\r\n\r\n fields = fields.concat(staffFields)\r\n }\r\n if (this.editable) {\r\n fields.push({ key: \"actions\", label: \"\" })\r\n }\r\n return fields\r\n }\r\n\r\n public tableSlots: any[] = [\r\n {\r\n name: \"actions\",\r\n field: \"actions\",\r\n },\r\n ]\r\n\r\n public get userCreatedFields() {\r\n if (this.reportingPeriod.fields && this.parentField) {\r\n return (\r\n this.reportingPeriod.fields\r\n .filter(\r\n f =>\r\n f.field_name.user_created &&\r\n f.field_name.parent == this.parentField.field_name.id\r\n )\r\n // Include the metadata as part of the field\r\n .map((f: any) => {\r\n const metadata = this.getMetadata(f.field_name.metadata)\r\n const obj = { ...f }\r\n for (const key of Object.keys(metadata)) {\r\n if (obj[key] === undefined) {\r\n obj[key] = metadata[key]\r\n }\r\n }\r\n return obj\r\n })\r\n )\r\n } else {\r\n return []\r\n }\r\n }\r\n\r\n public get parentField() {\r\n return this.periodField(this.field.meta_id, this.reportingPeriod.id)\r\n }\r\n\r\n public mounted() {\r\n // Fetch taxpayer info\r\n this.fetchTaxpayer()\r\n // Set Prompt message\r\n this.prompt.message = \"Delete Adjustment?\"\r\n }\r\n\r\n public addUserCreatedField(fieldData: any) {\r\n const { id } = this.reportingPeriod\r\n\r\n this.loading = true\r\n if (id) {\r\n const newField: any = this.createField(\r\n this.validateData(this.tableFields, {\r\n ...fieldData,\r\n }),\r\n this.reportingPeriod,\r\n this.parentField\r\n )\r\n this.addField(newField)\r\n .catch((error: any) => {\r\n this.error = error\r\n })\r\n .finally(() => {\r\n this.loading = false\r\n })\r\n } else {\r\n this.error = \"There was an error creating field.\"\r\n this.loading = false\r\n }\r\n }\r\n\r\n public rollforwardFieldsButtonClick() {\r\n if (this.priorReportingPeriods && this.priorReportingPeriods.length > 0) {\r\n this.loading = true\r\n this.successMessage = \"\"\r\n this.rollforwardFields({\r\n parent: this.parentField.field_name.id,\r\n // The first of the prior periods is the one before the currently selected one\r\n reporting_period: this.priorReportingPeriods[0].id,\r\n })\r\n .then((res: any) => {\r\n if (res && res.data && res.data.length > 0) {\r\n this.successMessage = `${res.data.length} new field${\r\n res.data.length > 1 ? \"s\" : \"\"\r\n } added.`\r\n }\r\n })\r\n .finally(() => (this.loading = false))\r\n }\r\n }\r\n\r\n public removeUserCreatedField(row: any) {\r\n this.prompt.show = true\r\n // Defer promise to be handled once resolved\r\n this.prompt.defer = new Deferred()\r\n this.prompt.defer.promise\r\n .then(() => {\r\n const field = row.item\r\n this.loading = true\r\n this.deleteField(field.id).finally(() => {\r\n this.loading = false\r\n })\r\n })\r\n .catch((error: any) => {\r\n if (error) {\r\n this.error = error\r\n }\r\n })\r\n }\r\n\r\n public editUserCreatedField(adjData: any) {\r\n const editedField: any = this.updateField(\r\n this.validateData(this.tableFields, {\r\n ...adjData,\r\n }),\r\n this.editData\r\n )\r\n this.loading = true\r\n this.editField(editedField)\r\n .catch((error: any) => {\r\n if (error) {\r\n this.error = error\r\n }\r\n })\r\n .finally(() => (this.loading = false))\r\n\r\n this.editData = null\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FieldCreationSchedule.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FieldCreationSchedule.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./FieldCreationSchedule.vue?vue&type=template&id=28dcda2d&\"\nimport script from \"./FieldCreationSchedule.vue?vue&type=script&lang=ts&\"\nexport * from \"./FieldCreationSchedule.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-row',{attrs:{\"align-v\":\"center\"}},[_c('b-col',[_c('h2',[_vm._v(\"Foreign Income Tax (Paid)/Refunded\")]),_c('ScheduleHeader',{attrs:{\"foreignAffiliate\":_vm.activeForeignAffiliate,\"reportingPeriod\":_vm.reportingPeriod}})],1)],1),(_vm.prompt.show)?_c('prompt-window',{attrs:{\"title\":_vm.prompt.title,\"message\":_vm.prompt.message,\"showCancel\":true},on:{\"prompt-result\":_vm.onPromptCallback}},[_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"confirmButton\",\"variant\":\"danger\"},slot:\"confirmButton\"},[_vm._v(\"Delete\")]),_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"cancelButton\",\"variant\":\"success\"},slot:\"cancelButton\"},[_vm._v(\"Cancel\")])],1):_vm._e(),(_vm.loading)?_c('b-row',[_c('b-col',{staticClass:\"text-center\"},[_c('b-spinner',{staticClass:\"large-spinner\"})],1)],1):_c('div',[_c('ErrorAlert',{attrs:{\"error\":_vm.error}}),_c('div',[_c('b-row',[_c('b-col',[_c('b-alert',{staticClass:\"text-danger\",staticStyle:{\"font-size\":\"17px\"},attrs:{\"variant\":\"warning\",\"show\":!_vm.capitalGainsSet && !_vm.fitrManuallyAllocate}},[_vm._v(\"\\n In the case of automatic allocations, in order for the allocation\\n factors to be calculated, the\\n \"),_c('strong',[_vm._v(\"Capital Gains/(Losses) from Dispostions\")]),_vm._v(\" in\\n Section D must be completed.\\n \"),_c('strong',[_vm._v(\"Where earnings are calculated using Section D, please use the\\n manual allocation feature.\")])]),_c('hr'),_c('b-form',{on:{\"submit\":function($event){$event.preventDefault();return _vm.validateForm($event)}}},[_c('b-form-group',{attrs:{\"label\":\"Income tax (paid and deducted from)/refunded and previously included in earnings\",\"label-cols-sm\":\"12\",\"label-cols-lg\":\"8\"}},[_c('b-input-group',[(!_vm.isClient)?_c('ReviewSection',{key:(\"calc-review-section-fitr_income_tax_refunded-\" + (_vm.reportingPeriod.id)),attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":{ meta_id: 'fitr_income_tax_refunded' }}}):_vm._e(),_c('b-form-input',{attrs:{\"formatter\":_vm.formatter,\"disabled\":true,\"name\":\"fitr_income_tax_refunded\"},model:{value:(_vm.formValues.fitr_income_tax_refunded),callback:function ($$v) {_vm.$set(_vm.formValues, \"fitr_income_tax_refunded\", $$v)},expression:\"formValues.fitr_income_tax_refunded\"}})],1)],1),_c('b-form-group',{attrs:{\"label\":\"Capital Gains/(Losses) - Hybrid Taxes\",\"label-cols-sm\":\"12\",\"label-cols-lg\":\"8\"}},[_c('b-input-group',[(!_vm.isClient)?_c('ReviewSection',{key:(\"calc-review-section-fitr_capital_gain_loss_hybrid-\" + (_vm.reportingPeriod.id)),attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":{ meta_id: 'fitr_capital_gain_loss_hybrid' }}}):_vm._e(),_c('b-form-input',{attrs:{\"formatter\":_vm.formatter,\"disabled\":true,\"name\":\"fitr_capital_gain_loss_hybrid\"},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0 ? $event.target.select() : null; })($event)}},model:{value:(_vm.formValues.fitr_capital_gain_loss_hybrid),callback:function ($$v) {_vm.$set(_vm.formValues, \"fitr_capital_gain_loss_hybrid\", $$v)},expression:\"formValues.fitr_capital_gain_loss_hybrid\"}})],1)],1),_c('b-form-group',{attrs:{\"label\":\"Other foreign income tax (paid)/refunded related to taxable income\",\"label-cols-sm\":\"12\",\"label-cols-lg\":\"8\"}},[_c('b-input-group',[(!_vm.isClient)?_c('ReviewSection',{key:(\"calc-review-section-fitr_other_foreign_income_tax-\" + (_vm.reportingPeriod.id)),attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":{ meta_id: 'fitr_other_foreign_income_tax' }}}):_vm._e(),_c('b-form-input',{attrs:{\"formatter\":_vm.formatter,\"lazy-formatter\":\"\",\"disabled\":!_vm.editable,\"name\":\"fitr_other_foreign_income_tax\"},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0 ? $event.target.select() : null; })($event)}},model:{value:(_vm.formValues.fitr_other_foreign_income_tax),callback:function ($$v) {_vm.$set(_vm.formValues, \"fitr_other_foreign_income_tax\", $$v)},expression:\"formValues.fitr_other_foreign_income_tax\"}})],1)],1),_c('hr'),_c('b-form-group',{attrs:{\"label\":\"Total\",\"label-cols-sm\":\"12\",\"label-cols-lg\":\"8\"}},[_c('b-form-input',{attrs:{\"formatter\":_vm.formatter,\"disabled\":\"\"},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0 ? $event.target.select() : null; })($event)}},model:{value:(_vm.FITRTotal),callback:function ($$v) {_vm.FITRTotal=$$v},expression:\"FITRTotal\"}})],1),_c('b-form-checkbox',{attrs:{\"disabled\":!_vm.editable,\"name\":\"fitrManuallyAllocate\",\"value\":true,\"unchecked-value\":false},model:{value:(_vm.fitrManuallyAllocate),callback:function ($$v) {_vm.fitrManuallyAllocate=$$v},expression:\"fitrManuallyAllocate\"}},[_vm._v(\"Manually allocate foreign taxes\\n (paid)/refunded?\")]),(!_vm.fitrManuallyAllocate)?_c('small',{staticClass:\"text-danger\",staticStyle:{\"font-size\":\"17px\"}},[_vm._v(\"\\n By default, the taxes will be prorated to positive income\\n portions. Note that when box above is left unchecked, the user\\n is relying on an automatic allocation of the foreign taxes.\\n Automatic allocation does \"),_c('strong',[_vm._v(\"not\")]),_vm._v(\" necessarily\\n allocate the full amount of taxes.\\n\\n \"),_c('strong',[_vm._v(\"Please carefully check the output to ensure that foreign\\n taxes have been properly allocated to the various surplus\\n pools.\")]),_vm._v(\"\\n If taxes are not appropriately allocated,\"),_c('strong',[_vm._v(\"\\n do not rely\\n \")]),_vm._v(\"\\n on automatic allocation but instead manually allocate the\\n foreign taxes accordingly.\\n \")]):_vm._e(),_c('transition',{attrs:{\"name\":\"fade\"}},[(_vm.fitrManuallyAllocate)?_c('div',[_c('hr'),_c('div',[_c('h5',{staticClass:\"font-weight-bold\"},[_vm._v(\"Manual Allocation\")]),_c('b-form-group',{attrs:{\"label\":\"Foreign active earnings/(loss) after Reg. 5907(2) adjustments\",\"label-cols-sm\":\"12\",\"label-cols-lg\":\"8\"}},[_c('b-input-group',[(!_vm.isClient)?_c('ReviewSection',{key:(\"calc-review-section-fitr_foreign_active_earnings_before_reg5907-\" + (_vm.reportingPeriod.id)),attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":{\n meta_id:\n 'fitr_foreign_active_earnings_before_reg5907',\n }}}):_vm._e(),_c('b-form-input',{attrs:{\"formatter\":_vm.formatter,\"lazy-formatter\":\"\",\"disabled\":!_vm.editable,\"name\":\"fitr_foreign_active_earnings_before_reg5907\"},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0\n ? $event.target.select()\n : null; })($event)}},model:{value:(\n _vm.formValues.fitr_foreign_active_earnings_before_reg5907\n ),callback:function ($$v) {_vm.$set(_vm.formValues, \"fitr_foreign_active_earnings_before_reg5907\", $$v)},expression:\"\\n formValues.fitr_foreign_active_earnings_before_reg5907\\n \"}})],1)],1),_c('b-form-group',{attrs:{\"label\":\"Capital Gains/(Losses) - Exempt\",\"label-cols-sm\":\"12\",\"label-cols-lg\":\"8\"}},[_c('b-input-group',[(!_vm.isClient)?_c('ReviewSection',{key:(\"calc-review-section-fitr_capital_gain_loss-\" + (_vm.reportingPeriod.id)),attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":{ meta_id: 'fitr_capital_gain_loss' }}}):_vm._e(),_c('b-form-input',{attrs:{\"lazy-formatter\":\"\",\"formatter\":_vm.formatter,\"disabled\":!_vm.editable,\"name\":\"fitr_capital_gain_loss\"},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0\n ? $event.target.select()\n : null; })($event)}},model:{value:(_vm.formValues.fitr_capital_gain_loss),callback:function ($$v) {_vm.$set(_vm.formValues, \"fitr_capital_gain_loss\", $$v)},expression:\"formValues.fitr_capital_gain_loss\"}})],1)],1),_c('b-form-group',{attrs:{\"label\":\"Capital Gains/(Losses) - Taxable\",\"label-cols-sm\":\"12\",\"label-cols-lg\":\"8\"}},[_c('b-input-group',[(!_vm.isClient)?_c('ReviewSection',{key:(\"calc-review-section-fitr_capital_gain_loss_taxable-\" + (_vm.reportingPeriod.id)),attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":{\n meta_id: 'fitr_capital_gain_loss_taxable',\n }}}):_vm._e(),_c('b-form-input',{attrs:{\"formatter\":_vm.formatter,\"lazy-formatter\":\"\",\"disabled\":!_vm.editable,\"name\":\"fitr_capital_gain_loss_taxable\"},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0\n ? $event.target.select()\n : null; })($event)}},model:{value:(_vm.formValues.fitr_capital_gain_loss_taxable),callback:function ($$v) {_vm.$set(_vm.formValues, \"fitr_capital_gain_loss_taxable\", $$v)},expression:\"formValues.fitr_capital_gain_loss_taxable\"}})],1)],1),_c('b-form-group',{attrs:{\"label\":\"Capital Gains/(Losses) - FAPI\",\"label-cols-sm\":\"12\",\"label-cols-lg\":\"8\"}},[_c('b-input-group',[(!_vm.isClient)?_c('ReviewSection',{key:(\"calc-review-section-fitr_capital_gain_loss_fapi-\" + (_vm.reportingPeriod.id)),attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":{\n meta_id: 'fitr_capital_gain_loss_fapi',\n }}}):_vm._e(),_c('b-form-input',{attrs:{\"formatter\":_vm.formatter,\"lazy-formatter\":\"\",\"disabled\":!_vm.editable,\"name\":\"fitr_capital_gain_loss_fapi\"},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0\n ? $event.target.select()\n : null; })($event)}},model:{value:(_vm.formValues.fitr_capital_gain_loss_fapi),callback:function ($$v) {_vm.$set(_vm.formValues, \"fitr_capital_gain_loss_fapi\", $$v)},expression:\"formValues.fitr_capital_gain_loss_fapi\"}})],1)],1),_c('b-form-group',{attrs:{\"label\":\"FAPI/(FAPL)\",\"label-cols-sm\":\"12\",\"label-cols-lg\":\"8\"}},[_c('b-input-group',[(!_vm.isClient)?_c('ReviewSection',{key:(\"calc-review-section-fitr_fapi-\" + (_vm.reportingPeriod.id)),attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":{ meta_id: 'fitr_fapi' }}}):_vm._e(),_c('b-form-input',{attrs:{\"formatter\":_vm.formatter,\"lazy-formatter\":\"\",\"disabled\":!_vm.editable,\"name\":\"fitr_fapi\"},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0\n ? $event.target.select()\n : null; })($event)}},model:{value:(_vm.formValues.fitr_fapi),callback:function ($$v) {_vm.$set(_vm.formValues, \"fitr_fapi\", $$v)},expression:\"formValues.fitr_fapi\"}})],1)],1),_c('b-form-group',{attrs:{\"label\":\"Income/(Loss) recharacterized under paragraph 95(2)(a) - Exempt\",\"label-cols-sm\":\"12\",\"label-cols-lg\":\"8\"}},[_c('b-input-group',[(!_vm.isClient)?_c('ReviewSection',{key:(\"calc-review-section-fitr_income_loss_recharacterized_952a-\" + (_vm.reportingPeriod.id)),attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":{\n meta_id: 'fitr_income_loss_recharacterized_952a',\n }}}):_vm._e(),_c('b-form-input',{attrs:{\"formatter\":_vm.formatter,\"lazy-formatter\":\"\",\"disabled\":!_vm.editable,\"name\":\"fitr_income_loss_recharacterized_952a\"},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0\n ? $event.target.select()\n : null; })($event)}},model:{value:(\n _vm.formValues.fitr_income_loss_recharacterized_952a\n ),callback:function ($$v) {_vm.$set(_vm.formValues, \"fitr_income_loss_recharacterized_952a\", $$v)},expression:\"\\n formValues.fitr_income_loss_recharacterized_952a\\n \"}})],1)],1),_c('b-form-group',{attrs:{\"label\":\"Income/(Loss) recharacterized under paragraph 95(2)(a) - Taxable\",\"label-cols-sm\":\"12\",\"label-cols-lg\":\"8\"}},[_c('b-input-group',[(!_vm.isClient)?_c('ReviewSection',{key:(\"calc-review-section-fitr_income_loss_recharacterized_952a_taxable-\" + (_vm.reportingPeriod.id)),attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":{\n meta_id:\n 'fitr_income_loss_recharacterized_952a_taxable',\n }}}):_vm._e(),_c('b-form-input',{attrs:{\"formatter\":_vm.formatter,\"lazy-formatter\":\"\",\"disabled\":!_vm.editable,\"name\":\"fitr_income_loss_recharacterized_952a_taxable\"},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0\n ? $event.target.select()\n : null; })($event)}},model:{value:(\n _vm.formValues.fitr_income_loss_recharacterized_952a_taxable\n ),callback:function ($$v) {_vm.$set(_vm.formValues, \"fitr_income_loss_recharacterized_952a_taxable\", $$v)},expression:\"\\n formValues.fitr_income_loss_recharacterized_952a_taxable\\n \"}})],1)],1),_c('b-form-group',{attrs:{\"label\":\"Items which are not earnings or are NIL for Canadian income tax purposes\",\"label-cols-sm\":\"12\",\"label-cols-lg\":\"8\"}},[_c('b-input-group',[(!_vm.isClient)?_c('ReviewSection',{key:(\"calc-review-section-fitr_items_not_earnings_nil-\" + (_vm.reportingPeriod.id)),attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":{\n meta_id: 'fitr_items_not_earnings_nil',\n }}}):_vm._e(),_c('b-form-input',{attrs:{\"formatter\":_vm.formatter,\"lazy-formatter\":\"\",\"disabled\":!_vm.editable,\"name\":\"fitr_items_not_earnings_nil\"},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0\n ? $event.target.select()\n : null; })($event)}},model:{value:(_vm.formValues.fitr_items_not_earnings_nil),callback:function ($$v) {_vm.$set(_vm.formValues, \"fitr_items_not_earnings_nil\", $$v)},expression:\"formValues.fitr_items_not_earnings_nil\"}})],1)],1),_c('hr'),_c('b-form-group',{attrs:{\"label\":\"Remaining (Excluding Hybrid Taxes)\",\"label-cols-sm\":\"12\",\"label-cols-lg\":\"8\"}},[_c('b-form-input',{attrs:{\"formatter\":_vm.formatter,\"disabled\":\"\",\"state\":_vm.NilRemaining},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0\n ? $event.target.select()\n : null; })($event)}},model:{value:(_vm.FITRManualRemaining),callback:function ($$v) {_vm.FITRManualRemaining=$$v},expression:\"FITRManualRemaining\"}})],1)],1)]):_vm._e()]),(_vm.editable)?_c('b-row',[_c('b-col',[_c('hr'),_c('b-button',{staticClass:\"float-right\",attrs:{\"block\":\"\",\"type\":\"submit\",\"variant\":\"success\"}},[_vm._v(\"Done\")])],1)],1):_vm._e()],1)],1)],1)],1)],1)],1)}\nvar staticRenderF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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\n\n\n\n\n\n\r\nimport { Taxpayer, ReportingPeriod, Deferred } from \"@/interfaces\"\r\nimport { Component, Vue, Prop, Emit, Watch } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport dateFns from \"date-fns\"\r\nimport accounting from \"accounting\"\r\nimport _ from \"lodash\"\r\n// Project imports\r\nimport PromptWindow from \"@/components/utils/PromptWindow.vue\"\r\nimport ScheduleMixin from \"../../../mixins/ScheduleMixin\"\r\nimport ValidatorMixin from \"../../../mixins/ValidatorMixin\"\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport { period, fa } from \"../../../services/api\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport ReviewSection from \"@/components/calculator/ReviewSection.vue\"\r\n\r\n@Component({ components: { PromptWindow, ErrorAlert, ReviewSection } })\r\nexport default class FitrSchedule extends mixins(ScheduleMixin) {\r\n @Prop({ required: true })\r\n public reportingPeriod!: ReportingPeriod\r\n @Prop({ required: true })\r\n public field!: any\r\n\r\n public formValues: any = {\r\n fitr_income_tax_refunded: \"\",\r\n fitr_other_foreign_income_tax: \"\",\r\n fitr_foreign_active_earnings_before_reg5907: \"\",\r\n fitr_capital_gain_loss: \"\",\r\n fitr_capital_gain_loss_taxable: \"\",\r\n fitr_capital_gain_loss_fapi: \"\",\r\n fitr_capital_gain_loss_hybrid: \"\",\r\n fitr_fapi: \"\",\r\n fitr_income_loss_recharacterized_952a: \"\",\r\n fitr_income_loss_recharacterized_952a_taxable: \"\",\r\n fitr_items_not_earnings_nil: \"\",\r\n }\r\n\r\n public fitrManuallyAllocate: boolean = true\r\n\r\n public get capitalGainsSet() {\r\n if (this.reportingPeriod && this.reportingPeriod.calculator) {\r\n const portions = this.reportingPeriod.calculator.capitalGainsPortions\r\n\r\n return Object.keys(portions).some(key => portions[key] != 0)\r\n }\r\n return false\r\n }\r\n\r\n public get taxAllocationFactors() {\r\n if (this.reportingPeriod && this.reportingPeriod.calculator) {\r\n const factors = this.reportingPeriod.calculator.taxAllocationFactors\r\n return Object.keys(factors).map(key => {\r\n return { item: _.toUpper(key), factor: formatMoney(factors[key], 4) }\r\n })\r\n }\r\n return []\r\n }\r\n\r\n public get refundAllocationFactors() {\r\n if (this.reportingPeriod && this.reportingPeriod.calculator) {\r\n const factors = this.reportingPeriod.calculator.refundAllocationFactors\r\n return Object.keys(factors).map(key => {\r\n return { item: _.toUpper(key), factor: formatMoney(factors[key], 4) }\r\n })\r\n }\r\n return []\r\n }\r\n\r\n public get FITRTotal() {\r\n const sum =\r\n accounting.unformat(this.formValues.fitr_income_tax_refunded) +\r\n accounting.unformat(this.formValues.fitr_capital_gain_loss_hybrid) +\r\n accounting.unformat(this.formValues.fitr_other_foreign_income_tax)\r\n return this.formatter(sum.toString())\r\n }\r\n\r\n public get FITRManualRemaining() {\r\n const sum =\r\n accounting.unformat(this.FITRTotal) -\r\n (accounting.unformat(\r\n this.formValues.fitr_foreign_active_earnings_before_reg5907\r\n ) +\r\n accounting.unformat(this.formValues.fitr_capital_gain_loss) +\r\n accounting.unformat(this.formValues.fitr_capital_gain_loss_fapi) +\r\n accounting.unformat(this.formValues.fitr_capital_gain_loss_hybrid) +\r\n accounting.unformat(this.formValues.fitr_capital_gain_loss_taxable) +\r\n accounting.unformat(this.formValues.fitr_fapi) +\r\n accounting.unformat(\r\n this.formValues.fitr_income_loss_recharacterized_952a\r\n ) +\r\n accounting.unformat(\r\n this.formValues.fitr_income_loss_recharacterized_952a_taxable\r\n ) +\r\n accounting.unformat(this.formValues.fitr_items_not_earnings_nil))\r\n return this.formatter(sum.toString())\r\n }\r\n\r\n public get NilRemaining() {\r\n return accounting.unformat(this.FITRManualRemaining) === 0\r\n }\r\n\r\n public created() {\r\n // Set up default values\r\n this.setInitialValues()\r\n }\r\n\r\n public setInitialValues() {\r\n // Set up default values\r\n this.fitrManuallyAllocate =\r\n this.reportingPeriod.fitr_manually_allocate || false\r\n\r\n Object.keys(this.formValues).forEach(key => {\r\n if (key === \"fitr_income_tax_refunded\") {\r\n if (this.reportingPeriod.calculator) {\r\n // Since the input for this comes from the EARNINGS FROM FA's ACTIVE BUSINESS section, we use a getter that sums them up\r\n this.formValues[\r\n key\r\n ] = this.reportingPeriod.calculator.foreignIncomeDeductedIncluded\r\n }\r\n } else if (key === \"fitr_capital_gain_loss_hybrid\") {\r\n // Since the taxes are input from the hybrid dispositions, we must set them to be those, and not allow overriding\r\n if (this.reportingPeriod.calculator) {\r\n this.formValues[\r\n key\r\n ] = this.reportingPeriod.calculator.hybridDispositionTaxes\r\n }\r\n } else {\r\n this.formValues[key] = this.periodFieldValue(\r\n key,\r\n this.reportingPeriod.id\r\n )\r\n }\r\n })\r\n }\r\n\r\n public validateForm() {\r\n this.error = \"\"\r\n let saveValues: any = {}\r\n const promises: Array> = []\r\n const { fitr_other_foreign_income_tax } = this.formValues\r\n // Need to check that if an amount was allocated, there was no remaing amount\r\n if (this.fitrManuallyAllocate) {\r\n if (this.NilRemaining) {\r\n // Save all the fields\r\n saveValues = {\r\n ...this.formValues,\r\n }\r\n } else {\r\n // Cannot save if the remainder is not nil\r\n this.error = { message: \"Remainder allocation must be nil.\" }\r\n return\r\n }\r\n } else {\r\n // Only save the high level distribution\r\n saveValues = {\r\n fitr_other_foreign_income_tax,\r\n fitr_foreign_active_earnings_before_reg5907: \"\",\r\n fitr_capital_gain_loss: \"\",\r\n fitr_capital_gain_loss_fapi: \"\",\r\n fitr_capital_gain_loss_hybrid: \"\",\r\n fitr_capital_gain_loss_taxable: \"\",\r\n fitr_fapi: \"\",\r\n fitr_income_loss_recharacterized_952a: \"\",\r\n fitr_income_loss_recharacterized_952a_taxable: \"\",\r\n fitr_items_not_earnings_nil: \"\",\r\n }\r\n }\r\n\r\n // Save the state of the reporting if changed\r\n if (\r\n this.fitrManuallyAllocate !==\r\n this.reportingPeriod.fitr_manually_allocate &&\r\n this.reportingPeriod.id\r\n ) {\r\n this.reportingPeriod.fitr_manually_allocate = this.fitrManuallyAllocate\r\n promises.push(\r\n period.update(\r\n {\r\n fitr_manually_allocate: this.reportingPeriod.fitr_manually_allocate,\r\n },\r\n this.reportingPeriod.id\r\n )\r\n )\r\n }\r\n\r\n const allFields: any[] = []\r\n\r\n Object.keys(saveValues).forEach(key => {\r\n const newValue = accounting.unformat(saveValues[key])\r\n if (newValue !== undefined) {\r\n const fieldMatch = this.periodField(key, this.reportingPeriod.id)\r\n if (fieldMatch) {\r\n this.calculatorValueChange({\r\n metaId: key,\r\n reportingPeriodId: this.reportingPeriod.id,\r\n value: newValue,\r\n })\r\n allFields.push(fieldMatch)\r\n }\r\n }\r\n })\r\n\r\n promises.push(\r\n this.saveFieldValues({\r\n fields: allFields,\r\n })\r\n )\r\n this.calculateSurplus()\r\n // Wait for all requests to be done\r\n this.loading = true\r\n Promise.all(promises)\r\n .then(() => this.setInitialValues())\r\n .catch(err => (err ? (this.error = err) : false))\r\n .finally(() => {\r\n this.loading = false\r\n // Trigger the closing of the modal\r\n this.$emit(\"schedule-done\")\r\n })\r\n }\r\n\r\n public formatter(value: string, evt: any = null) {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FitrSchedule.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FitrSchedule.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./FitrSchedule.vue?vue&type=template&id=3d855764&\"\nimport script from \"./FitrSchedule.vue?vue&type=script&lang=ts&\"\nexport * from \"./FitrSchedule.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./FitrSchedule.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-row',{attrs:{\"align-v\":\"center\"}},[_c('b-col',[_c('h2',[_vm._v(\"Disposition Schedule\")]),_c('ScheduleHeader',{attrs:{\"foreignAffiliate\":_vm.activeForeignAffiliate,\"reportingPeriod\":_vm.reportingPeriod}})],1)],1),(_vm.prompt.show)?_c('prompt-window',{attrs:{\"title\":_vm.prompt.title,\"message\":_vm.prompt.message,\"showCancel\":true},on:{\"prompt-result\":_vm.onPromptCallback}},[_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"confirmButton\",\"variant\":\"danger\"},slot:\"confirmButton\"},[_vm._v(\"Delete\")]),_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"cancelButton\",\"variant\":\"success\"},slot:\"cancelButton\"},[_vm._v(\"Cancel\")])],1):_vm._e(),_c('AddForm',{attrs:{\"formTitle\":\"Edit Adjustment\",\"formFields\":_vm.tableFields,\"formData\":_vm.editData,\"edit\":true},on:{\"form-submit\":_vm.editAdjust,\"modal-close\":function () { return (_vm.editData = null); }}}),(_vm.loading)?_c('b-row',[_c('b-col',{staticClass:\"text-center\"},[_c('b-spinner',{staticClass:\"large-spinner\"})],1)],1):_c('div',[_c('ErrorAlert',{attrs:{\"error\":_vm.error}}),_c('Table',{attrs:{\"fields\":_vm.tableFields,\"items\":_vm.DispositionAdjustments,\"slots\":_vm.tableSlots},scopedSlots:_vm._u([{key:\"type\",fn:function(data){return [_vm._v(\"\\n \"+_vm._s(_vm.getOptionText(_vm.dispositionTypeOptions, data.item.type))+\"\\n \")]}},{key:\"actions\",fn:function(data){return [_c('b-button-group',{staticClass:\"float-right w-100\"},[(!_vm.isClient)?_c('ReviewSection',{key:(\"calc-review-section-\" + (_vm.field.meta_id) + \"-\" + (_vm.reportingPeriod.id) + \"-\" + (data.item.id)),attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":_vm.field,\"object\":data.item}}):_vm._e(),_c('b-button',{attrs:{\"variant\":\"secondary\",\"size\":\"sm\"},on:{\"click\":function () { return (_vm.editData = data.item); }}},[_c('font-awesome-icon',{attrs:{\"icon\":\"cog\"}})],1),_c('b-button',{attrs:{\"variant\":\"danger\",\"size\":\"sm\"},on:{\"click\":function($event){return _vm.removeAdjusment(data)}}},[_c('font-awesome-icon',{attrs:{\"icon\":\"trash\"}})],1)],1)]}}])},[(_vm.editable)?_c('template',{slot:\"action-bar\"},[_c('AddForm',{key:\"add-disposition-form\",attrs:{\"formTitle\":\"New Disposition\",\"formFields\":_vm.tableFields},on:{\"form-submit\":_vm.addNewAdjustment}},[(_vm.loading)?_c('b-spinner',{attrs:{\"slot\":\"buttonContent\"},slot:\"buttonContent\"}):_vm._e()],1)],1):_vm._e()],2)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\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\n\n\n\n\n\n\n\n\n\r\nimport {\r\n Taxpayer,\r\n ReportingPeriod,\r\n Deferred,\r\n ForeignAffiliate,\r\n Adjustment,\r\n DispositionAdjustment,\r\n} from \"@/interfaces\"\r\nimport { Component, Vue, Prop, Emit, Watch } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport dateFns from \"date-fns\"\r\n// Project imports\r\nimport Table from \"@/components/utils/Table.vue\"\r\nimport AddForm from \"@/components/utils/AddForm.vue\"\r\nimport PromptWindow from \"@/components/utils/PromptWindow.vue\"\r\nimport ScheduleMixin from \"../../../mixins/ScheduleMixin\"\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport ReviewSection from \"@/components/calculator/ReviewSection.vue\"\r\n\r\n@Component({\r\n components: { Table, AddForm, PromptWindow, ErrorAlert, ReviewSection },\r\n})\r\nexport default class OtherInclusionsSchedule extends mixins(ScheduleMixin) {\r\n @Prop({ required: true })\r\n public reportingPeriod!: ReportingPeriod\r\n @Prop({ required: true })\r\n public field!: any\r\n\r\n public get tableFields() {\r\n let fields: any[] = [\r\n {\r\n key: \"date\",\r\n label: \"Date\",\r\n sortable: true,\r\n type: \"date\",\r\n rules: `required|date_picker_constraint`,\r\n dateConfig: {\r\n disabledDates: {\r\n to: dateFns.parse(this.reportingPeriod.start_date),\r\n from: dateFns.parse(this.reportingPeriod.end_date),\r\n },\r\n openDate: dateFns.parse(this.reportingPeriod.start_date),\r\n },\r\n },\r\n {\r\n key: \"amount\",\r\n label: \"Amount\",\r\n sortable: true,\r\n type: \"number\",\r\n rules: \"required\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"tax_on_amount\",\r\n label: \"Taxes (paid)/refunded on Amount\",\r\n sortable: true,\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"type\",\r\n label: \"Type\",\r\n sortable: true,\r\n type: \"select\",\r\n rules: \"required\",\r\n selectConfig: {\r\n options: this.dispositionTypeOptions,\r\n },\r\n },\r\n {\r\n key: \"client_ref\",\r\n label: \"Working Paper Reference\",\r\n sortable: true,\r\n rules: this.isClient ? this.refValidationRules : \"\",\r\n type: \"text\",\r\n editable: this.isClient,\r\n },\r\n ]\r\n if (!this.isClient) {\r\n const staffFields = [\r\n {\r\n key: \"ref\",\r\n label: \"Working Paper Reference - KPMG\",\r\n sortable: true,\r\n type: \"text\",\r\n rules: this.refValidationRules,\r\n },\r\n ]\r\n\r\n fields = fields.concat(staffFields)\r\n }\r\n if (this.editable) {\r\n fields.push({ key: \"actions\", label: \"\" })\r\n }\r\n return fields\r\n }\r\n\r\n public tableSlots: any[] = [\r\n {\r\n name: \"actions\",\r\n field: \"actions\",\r\n },\r\n {\r\n name: \"type\",\r\n field: \"type\",\r\n },\r\n ]\r\n\r\n public get DispositionAdjustments() {\r\n if (this.reportingPeriod.disposition_adjustments) {\r\n return this.reportingPeriod.disposition_adjustments\r\n } else {\r\n return []\r\n }\r\n }\r\n\r\n public mounted() {\r\n // Fetch taxpayer info\r\n this.fetchTaxpayer()\r\n // Set Prompt message\r\n this.prompt.message = \"Delete Adjustment?\"\r\n }\r\n\r\n public addNewAdjustment(adjustmentData: DispositionAdjustment) {\r\n const { id } = this.reportingPeriod\r\n\r\n this.loading = true\r\n if (id) {\r\n const newAdjustment: any = this.validateData(this.tableFields, {\r\n ...adjustmentData,\r\n })\r\n\r\n this.addDispositionAdjustment(newAdjustment)\r\n .catch((error: any) => {\r\n this.error = error\r\n })\r\n .finally(() => {\r\n this.loading = false\r\n })\r\n } else {\r\n this.error = \"There was an error creating adjustment.\"\r\n this.loading = false\r\n }\r\n }\r\n\r\n public removeAdjusment(row: any) {\r\n this.prompt.show = true\r\n // Defer promise to be handled once resolved\r\n this.prompt.defer = new Deferred()\r\n this.prompt.defer.promise\r\n .then(() => {\r\n const adjustment = row.item\r\n this.loading = true\r\n this.deleteDispositionAdjustment(adjustment.id).finally(() => {\r\n this.loading = false\r\n })\r\n })\r\n .catch((error: any) => {\r\n if (error) {\r\n this.error = error\r\n }\r\n })\r\n }\r\n\r\n public editAdjust(adjData: any) {\r\n let editedAdjust = Object.assign(this.editData, adjData)\r\n editedAdjust = this.validateData(this.tableFields, {\r\n ...editedAdjust,\r\n })\r\n this.loading = true\r\n this.editDispositionAdjustment(editedAdjust)\r\n .catch((error: any) => {\r\n if (error) {\r\n this.error = error\r\n }\r\n })\r\n .finally(() => (this.loading = false))\r\n\r\n this.editData = null\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./HybridDispositionSchedule.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./HybridDispositionSchedule.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./HybridDispositionSchedule.vue?vue&type=template&id=4dcea549&\"\nimport script from \"./HybridDispositionSchedule.vue?vue&type=script&lang=ts&\"\nexport * from \"./HybridDispositionSchedule.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-row',{attrs:{\"align-v\":\"center\"}},[_c('b-col',[_c('h2',[_vm._v(\"Reconciliation\")]),_c('ScheduleHeader',{attrs:{\"foreignAffiliate\":_vm.activeForeignAffiliate,\"reportingPeriod\":_vm.reportingPeriod}})],1)],1),(_vm.prompt.show)?_c('prompt-window',{attrs:{\"title\":_vm.prompt.title,\"message\":_vm.prompt.message,\"showCancel\":true},on:{\"prompt-result\":_vm.onPromptCallback}},[_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"confirmButton\",\"variant\":\"danger\"},slot:\"confirmButton\"},[_vm._v(\"Delete\")]),_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"cancelButton\",\"variant\":\"success\"},slot:\"cancelButton\"},[_vm._v(\"Cancel\")])],1):_vm._e(),_c('AddForm',{attrs:{\"formTitle\":\"Edit Adjustment\",\"formFields\":_vm.tableFields,\"formData\":_vm.editData,\"edit\":true},on:{\"form-submit\":_vm.editUserCreatedField,\"modal-close\":function () { return (_vm.editData = null); }}}),(_vm.loading)?_c('b-row',[_c('b-col',{staticClass:\"text-center\"},[_c('b-spinner',{staticClass:\"large-spinner\"})],1)],1):_c('div',[_c('transition',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[(_vm.error)?_c('ErrorAlert',{attrs:{\"error\":_vm.error}}):(_vm.success)?_c('b-alert',{key:\"successAlert\",staticClass:\"text-center\",attrs:{\"fade\":\"\",\"variant\":\"success\",\"show\":\"\"}},[_vm._v(\"Saved successfully\")]):_vm._e()],1),_c('div',[_c('b-row',[_c('b-col',[_c('b-form',{on:{\"submit\":function($event){$event.preventDefault();}}},[_c('h5',[_vm._v(\"Reconciliation Items\")]),_c('hr'),_vm._l((_vm.reconciliationBucketValues),function(reconBucket,index){return _c('b-form-group',{key:index,attrs:{\"label\":reconBucket.fieldName,\"label-cols-sm\":\"12\",\"label-cols-lg\":\"8\"}},[_c('b-form-input',{staticClass:\"text-right\",attrs:{\"formatter\":_vm.formatter,\"disabled\":\"\"},model:{value:(reconBucket.value),callback:function ($$v) {_vm.$set(reconBucket, \"value\", $$v)},expression:\"reconBucket.value\"}})],1)}),_c('hr'),_c('b-form-group',{attrs:{\"label\":\"Current Year Difference - Book v. Taxable Income/(Loss) - before Reconciling Adjustments\",\"label-cols-sm\":\"12\",\"label-cols-lg\":\"8\"}},[_c('b-form-input',{staticClass:\"text-right\",attrs:{\"formatter\":_vm.formatter,\"disabled\":\"\"},model:{value:(_vm.total),callback:function ($$v) {_vm.total=$$v},expression:\"total\"}})],1),_c('hr'),_c('b-card',[_c('b-alert',{attrs:{\"variant\":\"success\",\"show\":_vm.successMessage != '',\"dismissible\":\"\"}},[_vm._v(_vm._s(_vm.successMessage))]),_c('h5',[_vm._v(\"Reconciling Adjustments\")]),_c('hr'),_c('Table',{attrs:{\"fields\":_vm.tableFields,\"items\":_vm.userCreatedFields,\"slots\":_vm.tableSlots},scopedSlots:_vm._u([{key:\"actions\",fn:function(data){return [_c('b-button-group',{staticClass:\"float-right w-100\"},[(!_vm.isClient)?_c('ReviewSection',{key:(\"calc-review-section-\" + (_vm.field.meta_id) + \"-\" + (_vm.reportingPeriod.id) + \"-\" + (data.item.id)),attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":_vm.field,\"object\":data.item}}):_vm._e(),_c('b-button',{attrs:{\"variant\":\"secondary\",\"size\":\"sm\"},on:{\"click\":function () { return (_vm.editData = data.item); }}},[_c('font-awesome-icon',{attrs:{\"icon\":\"cog\"}})],1),_c('b-button',{attrs:{\"variant\":\"danger\",\"size\":\"sm\"},on:{\"click\":function($event){return _vm.removeUserCreatedField(Object.assign({}, data))}}},[_c('font-awesome-icon',{attrs:{\"icon\":\"trash\"}})],1)],1)]}}])},[(_vm.editable)?_c('template',{slot:\"action-bar\"},[_c('AddForm',{key:\"div-paid-form\",attrs:{\"formTitle\":\"New Adjustment\",\"formFields\":_vm.tableFields},on:{\"form-submit\":_vm.addUserCreatedField}},[(_vm.loading)?_c('b-spinner',{attrs:{\"slot\":\"buttonContent\"},slot:\"buttonContent\"}):_vm._e(),_c('b-button',{attrs:{\"slot\":\"appendButton\",\"disabled\":!_vm.priorReportingPeriods ||\n _vm.priorReportingPeriods.length === 0},on:{\"click\":_vm.rollforwardFieldsButtonClick},slot:\"appendButton\"},[_vm._v(\"Rollforward Adjustments\")])],1)],1):_vm._e()],2),_c('hr'),_c('b-form-group',{attrs:{\"label\":\"Remaining Unreconciled Difference - Book v. Taxable Income/(Loss)\",\"label-cols-sm\":\"12\",\"label-cols-lg\":\"8\"}},[_c('b-form-input',{staticClass:\"text-right\",attrs:{\"formatter\":_vm.formatter,\"disabled\":\"\",\"state\":_vm.NilRemaining},nativeOn:{\"focus\":function($event){return (function () { return $event.target.value == 0 ? $event.target.select() : null; })($event)}},model:{value:(_vm.remaining),callback:function ($$v) {_vm.remaining=$$v},expression:\"remaining\"}})],1)],1)],2)],1)],1)],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\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\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\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Taxpayer, ReportingPeriod, Deferred } from \"@/interfaces\"\r\nimport { Component, Vue, Prop, Emit, Watch } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport dateFns from \"date-fns\"\r\nimport accounting from \"accounting\"\r\n// Project imports\r\nimport Table from \"@/components/utils/Table.vue\"\r\nimport AddForm from \"@/components/utils/AddForm.vue\"\r\nimport PromptWindow from \"@/components/utils/PromptWindow.vue\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport ScheduleMixin from \"../../../mixins/ScheduleMixin\"\r\nimport ValidatorMixin from \"../../../mixins/ValidatorMixin\"\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport { period, fa } from \"../../../services/api\"\r\nimport ReviewSection from \"@/components/calculator/ReviewSection.vue\"\r\n\r\n@Component({\r\n components: { Table, AddForm, PromptWindow, ErrorAlert, ReviewSection },\r\n})\r\nexport default class CyDifferenceReconciliationSchedule extends mixins(\r\n ScheduleMixin\r\n) {\r\n @Prop({ required: true })\r\n public reportingPeriod!: ReportingPeriod\r\n @Prop({ required: true })\r\n public field!: any\r\n\r\n public successMessage: string = \"\"\r\n\r\n public get tableFields() {\r\n let fields: any[] = [\r\n {\r\n key: \"value\",\r\n label: \"Amount\",\r\n sortable: true,\r\n type: \"number\",\r\n sign: this.field.sign,\r\n rules: \"required\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"client_description\",\r\n label: \"Description\",\r\n sortable: true,\r\n editable: this.isClient,\r\n type: \"textarea\",\r\n rules: this.isClient ? \"required\" : \"\",\r\n },\r\n {\r\n key: \"client_ref\",\r\n label: \"Working Paper Reference\",\r\n sortable: true,\r\n type: \"text\",\r\n editable: this.isClient,\r\n rules: this.isClient ? this.refValidationRules : \"\",\r\n },\r\n ]\r\n if (!this.isClient) {\r\n const staffFields = [\r\n {\r\n key: \"description\",\r\n label: \"Description - KPMG\",\r\n sortable: true,\r\n type: \"textarea\",\r\n rules: `required`,\r\n },\r\n {\r\n key: \"ref\",\r\n label: \"Working Paper Reference - KPMG\",\r\n sortable: true,\r\n type: \"text\",\r\n rules: this.refValidationRules,\r\n },\r\n ]\r\n\r\n fields = fields.concat(staffFields)\r\n }\r\n if (this.editable) {\r\n fields.push({ key: \"actions\", label: \"\" })\r\n }\r\n return fields\r\n }\r\n\r\n public tableSlots: any[] = [\r\n {\r\n name: \"actions\",\r\n field: \"actions\",\r\n },\r\n ]\r\n\r\n public mounted() {\r\n // Set up default values\r\n this.success = false\r\n this.prompt.message = \"Delete Adjustment?\"\r\n this.error = \"\"\r\n }\r\n\r\n public get parentField() {\r\n return this.periodField(this.field.meta_id, this.reportingPeriod.id)\r\n }\r\n\r\n public get total() {\r\n return this.formatter(\r\n this.reconciliationTotal(this.reportingPeriod).toString()\r\n )\r\n }\r\n\r\n public get reconciliationBucketValues() {\r\n const reconciliationBuckets = this.reconciliationBuckets(\r\n this.reportingPeriod\r\n )\r\n return Object.keys(reconciliationBuckets).map((key: string) => {\r\n return {\r\n fieldName: this.periodFieldName(key),\r\n value: this.formatter(reconciliationBuckets[key].toString()),\r\n }\r\n })\r\n }\r\n\r\n public get remaining() {\r\n const sumReconItems = this.userCreatedFields.reduce(\r\n (acc, curr) => (acc = acc + accounting.unformat(curr.value.toString())),\r\n 0\r\n )\r\n const sum = accounting.unformat(this.total) + sumReconItems\r\n return this.formatter(sum.toString())\r\n }\r\n\r\n public get NilRemaining() {\r\n return accounting.unformat(this.remaining) === 0\r\n }\r\n\r\n public get userCreatedFields() {\r\n if (this.reportingPeriod.fields && this.parentField) {\r\n return (\r\n this.reportingPeriod.fields\r\n .filter(\r\n f =>\r\n f.field_name.user_created &&\r\n f.field_name.parent == this.parentField.field_name.id\r\n )\r\n // Include the metadata as part of the field\r\n .map((f: any) => {\r\n const metadata = this.getMetadata(f.field_name.metadata)\r\n const obj = { ...f }\r\n for (const key of Object.keys(metadata)) {\r\n if (obj[key] === undefined) {\r\n obj[key] = metadata[key]\r\n }\r\n }\r\n return obj\r\n })\r\n )\r\n } else {\r\n return []\r\n }\r\n }\r\n\r\n public addUserCreatedField(fieldData: any) {\r\n const { id } = this.reportingPeriod\r\n\r\n this.loading = true\r\n if (id) {\r\n const newField: any = this.createField(\r\n this.validateData(this.tableFields, {\r\n ...fieldData,\r\n }),\r\n this.reportingPeriod,\r\n this.parentField\r\n )\r\n this.addField(newField)\r\n .catch((error: any) => {\r\n this.error = error\r\n })\r\n .finally(() => {\r\n this.loading = false\r\n })\r\n } else {\r\n this.error = \"There was an error creating field.\"\r\n this.loading = false\r\n }\r\n }\r\n\r\n public rollforwardFieldsButtonClick() {\r\n if (this.priorReportingPeriods && this.priorReportingPeriods.length > 0) {\r\n this.loading = true\r\n this.successMessage = \"\"\r\n this.rollforwardFields({\r\n parent: this.parentField.field_name.id,\r\n // The first of the prior periods is the one before the currently selected one\r\n reporting_period: this.priorReportingPeriods[0].id,\r\n })\r\n .then((res: any) => {\r\n if (res && res.data && res.data.length > 0) {\r\n this.successMessage = `${res.data.length} new field${\r\n res.data.length > 1 ? \"s\" : \"\"\r\n } added.`\r\n }\r\n })\r\n .finally(() => {\r\n this.loading = false\r\n })\r\n }\r\n }\r\n\r\n public removeUserCreatedField(row: any) {\r\n this.prompt.show = true\r\n // Defer promise to be handled once resolved\r\n this.prompt.defer = new Deferred()\r\n this.prompt.defer.promise\r\n .then(() => {\r\n const field = row.item\r\n this.loading = true\r\n this.deleteField(field.id).finally(() => {\r\n this.loading = false\r\n })\r\n })\r\n .catch((error: any) => {\r\n if (error) {\r\n this.error = error\r\n }\r\n })\r\n }\r\n\r\n public editUserCreatedField(adjData: any) {\r\n const editedField: any = this.updateField(\r\n this.validateData(this.tableFields, {\r\n ...adjData,\r\n }),\r\n this.editData\r\n )\r\n this.loading = true\r\n this.editField(editedField)\r\n .catch((error: any) => {\r\n if (error) {\r\n this.error = error\r\n }\r\n })\r\n .finally(() => (this.loading = false))\r\n\r\n this.editData = null\r\n }\r\n\r\n public formatter(value: string, evt: any = null) {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CyDifferenceReconciliationSchedule.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CyDifferenceReconciliationSchedule.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./CyDifferenceReconciliationSchedule.vue?vue&type=template&id=52f47cd7&\"\nimport script from \"./CyDifferenceReconciliationSchedule.vue?vue&type=script&lang=ts&\"\nexport * from \"./CyDifferenceReconciliationSchedule.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-row',{attrs:{\"align-v\":\"center\"}},[_c('b-col',[_c('h2',[_vm._v(\"ACB Adjustments\")]),_c('ScheduleHeader',{attrs:{\"foreignAffiliate\":_vm.activeForeignAffiliate,\"reportingPeriod\":_vm.reportingPeriod}})],1)],1),(_vm.prompt.show)?_c('prompt-window',{attrs:{\"title\":_vm.prompt.title,\"message\":_vm.prompt.message,\"showCancel\":true},on:{\"prompt-result\":_vm.onPromptCallback}},[_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"confirmButton\",\"variant\":\"danger\"},slot:\"confirmButton\"},[_vm._v(\"Delete\")]),_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"cancelButton\",\"variant\":\"success\"},slot:\"cancelButton\"},[_vm._v(\"Cancel\")])],1):_vm._e(),_c('AddForm',{attrs:{\"formTitle\":\"Edit ACB Adjustment\",\"formFields\":_vm.tableFields,\"formData\":_vm.editData,\"edit\":true},on:{\"form-submit\":_vm.editAdjust,\"modal-close\":function () { return (_vm.editData = null); }}}),(_vm.loading)?_c('b-row',[_c('b-col',{staticClass:\"text-center\"},[_c('b-spinner',{staticClass:\"large-spinner\"})],1)],1):_c('div',[_c('ErrorAlert',{attrs:{\"error\":_vm.error}}),_c('b-alert',{staticStyle:{\"font-size\":\"0.9rem\"},attrs:{\"variant\":\"warning\",\"show\":_vm.exceptions.length > 0}},[_vm._v(\"\\n The following exceptions were found:\\n \"),_c('ul',_vm._l((_vm.exceptions),function(exception,index){return _c('li',{key:index},[(exception.date)?_c('strong',{staticClass:\"mr-1\"},[_vm._v(\"\\n \"+_vm._s(exception.date)+\":\")]):_vm._e(),_vm._v(_vm._s(exception.message)+\"\\n \")])}),0)]),_c('h4',[_vm._v(\"ACB Adjustments by Entry\")]),_c('Table',{attrs:{\"fields\":_vm.filteredTableFields,\"items\":_vm.Adjusmtents,\"slots\":_vm.tableSlots},scopedSlots:_vm._u([{key:\"type\",fn:function(data){return [_vm._v(\"\\n \"+_vm._s(_vm.getOptionText(_vm.acbAdjustmentTypeOptions, data.item.type))+\"\\n \")]}},{key:\"actions\",fn:function(data){return [_c('b-button-group',{staticClass:\"float-right w-100\"},[(!_vm.isClient)?_c('ReviewSection',{key:(\"calc-review-section-\" + (_vm.field.meta_id) + \"-\" + (_vm.reportingPeriod.id) + \"-\" + (data.item.id)),attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"field\":_vm.field,\"object\":data.item}}):_vm._e(),_c('b-button',{attrs:{\"variant\":\"secondary\",\"size\":\"sm\"},on:{\"click\":function () { return (_vm.editData = data.item); }}},[_c('font-awesome-icon',{attrs:{\"icon\":\"cog\"}})],1),_c('b-button',{attrs:{\"variant\":\"danger\",\"size\":\"sm\"},on:{\"click\":function($event){return _vm.removeAdjusment(data)}}},[_c('font-awesome-icon',{attrs:{\"icon\":\"trash\"}})],1)],1)]}}])},[(_vm.editable)?_c('template',{slot:\"action-bar\"},[_c('AddForm',{key:\"div-paid-form\",attrs:{\"formTitle\":\"New ACB Adjustment\",\"formFields\":_vm.tableFields},on:{\"form-submit\":_vm.addNewAdjustment}},[(_vm.loading)?_c('b-spinner',{attrs:{\"slot\":\"buttonContent\"},slot:\"buttonContent\"}):_vm._e()],1)],1):_vm._e()],2),_c('h4',[_vm._v(\"ACB Adjustments by Date\")]),_c('b-collapse',{model:{value:(_vm.showAcbBreakdown),callback:function ($$v) {_vm.showAcbBreakdown=$$v},expression:\"showAcbBreakdown\"}},[_c('ACBBreakdown',{attrs:{\"reportingPeriod\":_vm.reportingPeriod}})],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('Table',{attrs:{\"fields\":_vm.tableFields,\"items\":_vm.alterations,\"slots\":[\n {\n name: 'movement',\n field: 'movement',\n } ]},scopedSlots:_vm._u([{key:\"movement\",fn:function(data){return [(data.item.movement.from)?_c('div',[_vm._v(\"\\n From:\\n \"+_vm._s(_vm.formatText(data.item.movement.from))+\"\\n \")]):_vm._e(),(data.item.movement.to)?_c('div',[_vm._v(\"\\n To:\\n \"+_vm._s(_vm.formatText(data.item.movement.to))+\"\\n \")]):_vm._e()]}}])})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\r\nimport dateFns from \"date-fns\"\r\nimport _ from \"lodash\"\r\nimport { Component, Prop, Mixins } from \"vue-property-decorator\"\r\n// Project Imports\r\nimport Table from \"../utils/Table.vue\"\r\nimport CalculatorMixin from \"../../mixins/CalculatorMixin\"\r\nimport Alteration from \"@/services/calculator/Alteration\"\r\nimport { ACBAdjustment, BalanceTypes, ReportingPeriod } from \"@/interfaces\"\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport OptionTypesMixin from \"@/mixins/OptionTypesMixin\"\r\n\r\n@Component({ components: { Table } })\r\nexport default class ACBBreakdown extends Mixins(\r\n CalculatorMixin,\r\n OptionTypesMixin\r\n) {\r\n @Prop({ required: true })\r\n public reportingPeriod!: ReportingPeriod\r\n\r\n private movementLabels: {\r\n [key: string]: string\r\n } = {\r\n pre_acq_acb_adjustment: \"Pre-Acquisition Surplus Dividend Paid\",\r\n dividend_paid_rechar:\r\n \"Recharacterized Pre-Acquisition Surplus Dividend (90-day Rule)\",\r\n }\r\n\r\n public get tableFields() {\r\n const fields: any[] = [\r\n {\r\n key: \"date\",\r\n label: \"Date\",\r\n sortable: true,\r\n type: \"date\",\r\n thStyle: {\r\n width: \"12.5%\",\r\n },\r\n },\r\n {\r\n key: \"amount\",\r\n label: \"Amount\",\r\n sortable: true,\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"type\",\r\n label: \"Type\",\r\n sortable: true,\r\n type: \"text\",\r\n },\r\n {\r\n key: \"acbBalance\",\r\n label: \"ACB\",\r\n sortable: true,\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n ]\r\n return fields\r\n }\r\n\r\n public get alterations() {\r\n if (this.reportingPeriod && this.reportingPeriod.calculator) {\r\n return this.reportingPeriod.calculator.getAlterations\r\n .filter((alteration: Alteration) => {\r\n return alteration.getType === \"acb_adjustment\"\r\n })\r\n .map((alteration: Alteration) => {\r\n const { date, metadata, localOrder, movement } = alteration\r\n let { amount } = alteration\r\n const { from } = movement\r\n let type = \"N/A\"\r\n\r\n // Get the ACB adjustment type from the metadata\r\n if (metadata.acbAdjustment) {\r\n const acbType = this.acbAdjustmentTypes.find(\r\n option =>\r\n option.id == (metadata.acbAdjustment as ACBAdjustment).type\r\n )\r\n if (acbType) {\r\n type = acbType.name\r\n }\r\n } else if (from) {\r\n type = this.movementLabels[from.toString()]\r\n\r\n switch (from) {\r\n case \"pre_acq_acb_adjustment\":\r\n amount = Math.abs(amount) * -1\r\n break\r\n case \"dividend_paid_rechar\":\r\n amount = Math.abs(amount)\r\n break\r\n default:\r\n break\r\n }\r\n }\r\n\r\n let item: any = {\r\n date: dateFns.format(date, \"YYYY-MM-DD\"),\r\n amount,\r\n metadata,\r\n type,\r\n localOrder,\r\n movement,\r\n }\r\n\r\n if (metadata.runningBalances) {\r\n const balance: BalanceTypes = metadata.runningBalances\r\n const { acbBalance } = balance.surplusBalances\r\n\r\n item = {\r\n ...item,\r\n acbBalance,\r\n }\r\n }\r\n\r\n return item\r\n })\r\n }\r\n return []\r\n }\r\n\r\n public formatText(movementType: string) {\r\n const text = this.movementLabels[movementType] || _.startCase(movementType)\r\n return text\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ACBBreakdown.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ACBBreakdown.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./ACBBreakdown.vue?vue&type=template&id=54d1dbac&\"\nimport script from \"./ACBBreakdown.vue?vue&type=script&lang=ts&\"\nexport * from \"./ACBBreakdown.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\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\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\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\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\n\n\n\n\n\n\n\n\r\nimport { ReportingPeriod, Deferred, CalculatorException } from \"@/interfaces\"\r\nimport { Component, Vue, Prop, Emit, Watch } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport dateFns from \"date-fns\"\r\n// Project imports\r\nimport Table from \"@/components/utils/Table.vue\"\r\nimport AddForm from \"@/components/utils/AddForm.vue\"\r\nimport PromptWindow from \"@/components/utils/PromptWindow.vue\"\r\nimport ScheduleMixin from \"../../../mixins/ScheduleMixin\"\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport ReviewSection from \"@/components/calculator/ReviewSection.vue\"\r\nimport { ACBAdjustment } from \"../../../interfaces\"\r\nimport ACBBreakdown from \"../ACBBreakdown.vue\"\r\n\r\n@Component({\r\n components: {\r\n Table,\r\n AddForm,\r\n PromptWindow,\r\n ErrorAlert,\r\n ReviewSection,\r\n ACBBreakdown,\r\n },\r\n})\r\nexport default class AcbAdjustmentsSchedule extends mixins(ScheduleMixin) {\r\n @Prop({ required: true })\r\n public reportingPeriod!: ReportingPeriod\r\n @Prop({ required: true })\r\n public field!: any\r\n\r\n public metaId: string = \"acb_adjustments\"\r\n public showAcbBreakdown: boolean = true\r\n\r\n public get exceptions() {\r\n return (this.reportingPeriod.calculator\r\n ? this.reportingPeriod.calculator.exceptions.filter(\r\n ex => ex.metaId == this.metaId\r\n )\r\n : []\r\n ).map((ex: CalculatorException) => ({\r\n ...ex,\r\n date: ex.date ? dateFns.format(ex.date, \"YYYY MM DD\") : undefined,\r\n }))\r\n }\r\n\r\n public get tableFields() {\r\n let fields: any[] = [\r\n {\r\n key: \"date\",\r\n label: \"Date\",\r\n sortable: true,\r\n type: \"date\",\r\n rules: `required|date_picker_constraint`,\r\n dateConfig: {\r\n disabledDates: {\r\n to: dateFns.parse(this.reportingPeriod.start_date),\r\n from: dateFns.parse(this.reportingPeriod.end_date),\r\n },\r\n openDate: dateFns.parse(this.reportingPeriod.start_date),\r\n },\r\n },\r\n {\r\n key: \"amount\",\r\n label: \"Amount\",\r\n sortable: true,\r\n type: \"number\",\r\n rules: \"required\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"type\",\r\n label: \"Type\",\r\n sortable: true,\r\n type: \"select\",\r\n rules: \"required\",\r\n selectConfig: {\r\n options: this.acbAdjustmentTypeOptions,\r\n },\r\n },\r\n {\r\n key: \"new_type\",\r\n label: \"New Type\",\r\n sortable: true,\r\n type: \"text\",\r\n show: (formValues: any) => {\r\n return formValues && formValues[\"type\"] === 0\r\n },\r\n rules: \"required\",\r\n },\r\n {\r\n key: \"client_description\",\r\n label: \"Description\",\r\n sortable: true,\r\n editable: this.isClient,\r\n type: \"textarea\",\r\n rules: this.isClient ? \"required\" : \"\",\r\n },\r\n {\r\n key: \"client_ref\",\r\n label: \"Working Paper Reference\",\r\n sortable: true,\r\n type: \"text\",\r\n editable: this.isClient,\r\n rules: this.isClient ? this.refValidationRules : \"\",\r\n },\r\n ]\r\n if (!this.isClient) {\r\n const staffFields = [\r\n {\r\n key: \"description\",\r\n label: \"Description - KPMG\",\r\n sortable: true,\r\n type: \"textarea\",\r\n rules: \"\",\r\n },\r\n {\r\n key: \"ref\",\r\n label: \"Working Paper Reference - KPMG\",\r\n sortable: true,\r\n type: \"text\",\r\n rules: this.refValidationRules,\r\n },\r\n ]\r\n\r\n fields = fields.concat(staffFields)\r\n }\r\n if (this.editable) {\r\n fields.push({ key: \"actions\", label: \"\" })\r\n }\r\n return fields\r\n }\r\n\r\n public get filteredTableFields() {\r\n return this.tableFields.filter(field => field.key != \"new_type\")\r\n }\r\n\r\n public tableSlots: any[] = [\r\n {\r\n name: \"actions\",\r\n field: \"actions\",\r\n },\r\n {\r\n name: \"type\",\r\n field: \"type\",\r\n },\r\n ]\r\n\r\n public get Adjusmtents() {\r\n if (this.reportingPeriod.acb_adjustments) {\r\n return this.reportingPeriod.acb_adjustments\r\n } else {\r\n return []\r\n }\r\n }\r\n\r\n public mounted() {\r\n // Fetch taxpayer info\r\n this.fetchTaxpayer()\r\n // Set Prompt message\r\n this.prompt.message = \"Delete ACB Adjustment?\"\r\n }\r\n\r\n public addNewAdjustment(adjustmentData: any) {\r\n const { id } = this.reportingPeriod\r\n\r\n this.loading = true\r\n if (id) {\r\n const newAdjustment: any = this.validateData(this.tableFields, {\r\n ...adjustmentData,\r\n })\r\n\r\n this.addAcbAdjustment(newAdjustment)\r\n .then((res: ACBAdjustment) => {\r\n this.loading = false\r\n })\r\n .catch((error: any) => {\r\n this.loading = false\r\n this.error = error\r\n })\r\n } else {\r\n this.error = \"There was an error creating ACB adjustment.\"\r\n this.loading = false\r\n }\r\n }\r\n\r\n public removeAdjusment(row: any) {\r\n this.prompt.show = true\r\n // Defer promise to be handled once resolved\r\n this.prompt.defer = new Deferred()\r\n this.prompt.defer.promise\r\n .then(() => {\r\n const adjustment = row.item\r\n this.loading = true\r\n this.deleteAcbAdjustment(adjustment.id).finally(() => {\r\n this.loading = false\r\n })\r\n })\r\n .catch((error: any) => {\r\n if (error) {\r\n this.error = error\r\n }\r\n })\r\n }\r\n\r\n public editAdjust(adjData: any) {\r\n let editedAdjust = Object.assign(this.editData, adjData)\r\n editedAdjust = this.validateData(this.tableFields, {\r\n ...editedAdjust,\r\n })\r\n this.loading = true\r\n this.editAcbAdjustment(editedAdjust)\r\n .catch((error: any) => {\r\n if (error) {\r\n this.error = error\r\n }\r\n })\r\n .finally(() => (this.loading = false))\r\n\r\n this.editData = null\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AcbAdjustmentsSchedule.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AcbAdjustmentsSchedule.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./AcbAdjustmentsSchedule.vue?vue&type=template&id=2ba15e54&\"\nimport script from \"./AcbAdjustmentsSchedule.vue?vue&type=script&lang=ts&\"\nexport * from \"./AcbAdjustmentsSchedule.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import DividendsPaidSchedule from \"@/components/calculator/schedules/DividendsPaidSchedule.vue\"\r\nimport DividendsReceivedSchedule from \"@/components/calculator/schedules/DividendsReceivedSchedule.vue\"\r\nimport SepAdjustmentsSchedule from \"@/components/calculator/schedules/SepAdjustmentsSchedule.vue\"\r\nimport OtherInclusionsSchedule from \"@/components/calculator/schedules/OtherInclusionsSchedule.vue\"\r\nimport ForeignTaxConsolidationSchedule from \"@/components/calculator/schedules/ForeignTaxConsolidationSchedule.vue\"\r\nimport FieldCreationSchedule from \"@/components/calculator/schedules/FieldCreationSchedule.vue\"\r\nimport FitrSchedule from \"@/components/calculator/schedules/FitrSchedule.vue\"\r\nimport HybridDispositionSchedule from \"@/components/calculator/schedules/HybridDispositionSchedule.vue\"\r\n// tslint:disable-next-line\r\nimport CyDifferenceReconciliationSchedule from \"@/components/calculator/schedules/CyDifferenceReconciliationSchedule.vue\"\r\nimport AcbAdjustmentsSchedule from \"@/components/calculator/schedules/AcbAdjustmentsSchedule.vue\"\r\n\r\nexport default {\r\n DividendsPaidSchedule,\r\n SepAdjustmentsSchedule,\r\n DividendsReceivedSchedule,\r\n OtherInclusionsSchedule,\r\n FieldCreationSchedule,\r\n FitrSchedule,\r\n HybridDispositionSchedule,\r\n ForeignTaxConsolidationSchedule,\r\n CyDifferenceReconciliationSchedule,\r\n AcbAdjustmentsSchedule,\r\n}\r\n","import _ from \"lodash\"\r\n\r\nexport const pascalCase = (stringToConvert: string) =>\r\n _.chain(stringToConvert)\r\n .camelCase()\r\n .upperFirst()\r\n .value()\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('h4',[_vm._v(\"\\n Comments\\n \")]),(!this.isClient)?_c('b-tabs',{attrs:{\"content-class\":\"mt-3\"}},[_c('b-tab',{attrs:{\"active\":_vm.commentType == 'K'},on:{\"click\":function($event){return _vm.changeType('K')}},scopedSlots:_vm._u([{key:\"title\",fn:function(){return [_c('div',{staticClass:\"d-flex justify-content-center\"},[_vm._v(\"\\n Internal\\n \"),_c('CommentResolutionStatus',{staticClass:\"ml-2\",attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"metaId\":_vm.metaId,\"commentType\":\"K\"}})],1)]},proxy:true}],null,false,2176261365)},[_vm._v(\"\\n Only visible to KPMG users.\\n \")]),_c('b-tab',{attrs:{\"active\":_vm.commentType == 'C'},on:{\"click\":function($event){return _vm.changeType('C')}},scopedSlots:_vm._u([{key:\"title\",fn:function(){return [_c('div',{staticClass:\"d-flex justify-content-center\"},[_vm._v(\"\\n Client\\n \"),_c('CommentResolutionStatus',{staticClass:\"ml-2\",attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"metaId\":_vm.metaId,\"commentType\":\"C\"}})],1)]},proxy:true}],null,false,3536610147)},[_vm._v(\"\\n Clients users comments can be seen and replied to here.\\n \")])],1):_vm._e(),(_vm.readonly)?_c('b-row',{staticClass:\"mt-3 mb-3 comment-top-container\"},[_c('b-form',{on:{\"submit\":_vm.onSubmit}},[_c('b-row',{staticClass:\"mb-2 comment-textarea\"},[_c('b-form-textarea',{staticClass:\"comment-textarea-area\",attrs:{\"id\":\"comment\",\"rows\":\"2\",\"placeholder\":\"Add a Comment\"},model:{value:(_vm.textComment),callback:function ($$v) {_vm.textComment=$$v},expression:\"textComment\"}})],1),_c('b-row',{staticClass:\"comment-add-button\"},[_c('b-button',{attrs:{\"variant\":\"outline-secondary\",\"disabled\":_vm.textComment.length === 0 || _vm.loading || !_vm.readonly,\"type\":\"submit\"}},[(_vm.loading)?[_c('b-spinner',{attrs:{\"variant\":\"secondary\",\"label\":\"Text Centered\",\"small\":\"\"}}),_vm._v(\"\\n Sending\\n \")]:[_c('font-awesome-icon',{attrs:{\"size\":\"sm\",\"icon\":\"paper-plane\"}}),_vm._v(\"\\n Send\\n \")]],2)],1)],1)],1):_vm._e(),(_vm.filterComments.length > 0)?_c('b-row',{staticClass:\"comment\"},_vm._l((_vm.filterComments.slice(0, _vm.commentsToShow)),function(comment,index){return _c('CommentRow',{key:index,staticClass:\"mb-3\",attrs:{\"reportingPeriod\":_vm.reportingPeriod,\"comment\":comment}})}),1):_c('b-row',{staticClass:\"comment\"},[_c('b-card',{staticClass:\"mb-1 comment-return-is-none\"},[_vm._v(\"\\n No comments\\n \")])],1),_c('b-row',{staticClass:\"comment\"},[(_vm.filterComments.length > _vm.commentsToShow)?_c('b-button',{attrs:{\"size\":\"sm\",\"variant\":\"outline-secondary\",\"block\":\"\"},on:{\"click\":function($event){_vm.commentsToShow += 4}}},[_vm._v(\"\\n View More Comments\\n \"),_c('font-awesome-icon',{attrs:{\"icon\":\"chevron-down\",\"size\":\"sm\"}})],1):_vm._e()],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.comment)?_c('b-card',{class:(\"mb-1 comment-return-exist \\n \" + (_vm.comment.resolved_by ? 'comment-return-exist-resolved' : ''))},[(_vm.prompt.show)?_c('prompt-window',{attrs:{\"title\":_vm.prompt.title,\"message\":_vm.prompt.message,\"showCancel\":true},on:{\"prompt-result\":_vm.onPromptCallback}},[(_vm.error)?_c('prompt-window',{attrs:{\"title\":\"Error\",\"message\":_vm.error.message,\"showCancel\":false}},[_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"confirmButton\",\"variant\":\"danger\"},slot:\"confirmButton\"},[_vm._v(\"\\n Close\\n \")])],1):_vm._e(),_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"confirmButton\",\"variant\":\"danger\"},slot:\"confirmButton\"},[_vm._v(\"Delete\")]),_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"cancelButton\",\"variant\":\"success\"},slot:\"cancelButton\"},[_vm._v(\"Cancel\")])],1):_vm._e(),_c('b-row',{staticClass:\"pb-1 comment-details\"},[_c('b-col',[_c('span',{staticClass:\"comment-details-username\"},[_vm._v(_vm._s(_vm.formatUsername(_vm.comment.user_details)))]),_c('span',[_vm._v(\"  \")]),_c('span',{staticClass:\"text-muted\",attrs:{\"id\":(\"comment-popover-id-\" + (_vm.reportingPeriod.id) + \"-\" + (_vm.comment.id))}},[_vm._v(_vm._s(_vm.formatDateDistanceToNow(_vm.comment.date_created)))]),_c('b-popover',{attrs:{\"target\":(\"comment-popover-id-\" + (_vm.reportingPeriod.id) + \"-\" + (_vm.comment.id)),\"triggers\":\"hover\",\"placement\":\"top\"}},[_vm._v(\"\\n \"+_vm._s(_vm.formatDate(_vm.comment.date_created))+\"\\n \")])],1),(_vm.$store.state.user.data.id === _vm.comment.user)?_c('b-col',{staticClass:\"comment-details-delete col-md-auto\"},[_c('b-button',{attrs:{\"size\":\"sm\",\"variant\":\"outline-danger\",\"disabled\":_vm.loading || _vm.deleting || !_vm.readonly},on:{\"click\":function($event){return _vm.removeComment(_vm.comment.id)}}},[_c('font-awesome-icon',{attrs:{\"size\":\"sm\",\"icon\":\"trash-alt\"}})],1)],1):_vm._e()],1),_c('b-row',{staticClass:\"comment-text\"},[_vm._v(\"\\n \"+_vm._s(_vm.comment.comment)+\"\\n \")]),(!_vm.isClient)?_c('b-row',{staticClass:\"comment-footer\"},[_c('div',{attrs:{\"id\":(\"resolved-\" + (_vm.reportingPeriod.id) + \"-\" + (_vm.comment.id))}},[_c('b-button',{key:(\"resolved-\" + (_vm.reportingPeriod.id) + \"-\" + (_vm.comment.id)),attrs:{\"size\":\"sm\",\"disabled\":_vm.loading || _vm.resolving || !_vm.readonly,\"variant\":_vm.resolved(_vm.comment.resolved_by) ? 'outline-primary' : 'primary'},on:{\"click\":function($event){_vm.resolvedChange(_vm.comment, _vm.resolved(_vm.comment.resolved_by))}}},[(_vm.resolving)?[_c('b-spinner',{attrs:{\"variant\":\"success\",\"label\":\"Text Centered\",\"small\":\"\"}})]:[_vm._v(\"\\n ✔\\n \")],_vm._v(\"\\n \"+_vm._s(_vm.resolved(_vm.comment.resolved_by) ? \"Resolved\" : \"Mark Resolved\")+\"\\n \")],2)],1),(_vm.comment.resolved_by)?_c('b-popover',{attrs:{\"target\":(\"resolved-\" + (_vm.reportingPeriod.id) + \"-\" + (_vm.comment.id)),\"triggers\":\"hover focus\",\"placement\":\"lefttop\"},scopedSlots:_vm._u([{key:\"title\",fn:function(){return [_vm._v(\"\\n Resolved By\")]},proxy:true}],null,false,572431012)},[_vm._v(\"\\n \"+_vm._s(_vm.formatUsername(_vm.comment.resolver_details))+\" \"),_c('br'),_vm._v(\"\\n \"+_vm._s(_vm.formatDate(_vm.comment.resolved_on))+\"\\n \")]):_vm._e()],1):_vm._e()],1):_c('b-card',{staticClass:\"mb-1 comment-return-is-none\"},[_vm._v(\"\\n No Comments\\n\")])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\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\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\r\nimport {\r\n Taxpayer,\r\n ReportingPeriod,\r\n Deferred,\r\n ForeignAffiliate,\r\n Adjustment,\r\n Comment,\r\n} from \"@/interfaces\"\r\nimport { Component, Prop, Mixins } from \"vue-property-decorator\"\r\nimport _ from \"lodash\"\r\nimport { VueContext } from \"vue-context\"\r\nimport dateFns from \"date-fns\"\r\n\r\nimport ScheduleMixin from \"../../mixins/ScheduleMixin\"\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport ConfirmBoxMixin from \"../../mixins/ConfirmBoxMixin\"\r\n\r\nimport PromptWindow from \"@/components/utils/PromptWindow.vue\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\n\r\n@Component({ components: { VueContext, PromptWindow, ErrorAlert } })\r\nexport default class CommentRow extends Mixins(\r\n ScheduleMixin,\r\n LoadingMixin,\r\n ConfirmBoxMixin\r\n) {\r\n @Prop({ required: true })\r\n public reportingPeriod!: ReportingPeriod\r\n @Prop({ required: true })\r\n public comment!: Comment\r\n\r\n public resolving = false\r\n public deleting = false\r\n\r\n public mounted() {\r\n this.prompt.message = \"Delete Comment?\"\r\n }\r\n\r\n public formatUsername(user_details: any) {\r\n const { username, first_name, last_name } = user_details\r\n\r\n if (first_name && last_name) {\r\n return first_name + \" \" + last_name\r\n } else if (first_name && !last_name) {\r\n return user_details.first_name\r\n } else {\r\n return username\r\n }\r\n }\r\n\r\n public formatDateDistanceToNow(date: any) {\r\n return dateFns.distanceInWordsToNow(date, {\r\n addSuffix: true,\r\n })\r\n }\r\n\r\n public formatDate(date: any) {\r\n // Timezone shorthand was retrived from here: https://stackoverflow.com/a/66180857\r\n\r\n const dateObj = new Date(date)\r\n const intlObj: any = new Intl.DateTimeFormat(\"en-us\", {\r\n timeZoneName: \"short\",\r\n })\r\n\r\n const timeZone = intlObj\r\n .formatToParts(dateObj)\r\n .find((part: any) => part.type == \"timeZoneName\").value\r\n\r\n return dateFns.format(date, \"MMM DD, YYYY hh:mm:ss A\").concat(\" \", timeZone)\r\n }\r\n\r\n public get readonly() {\r\n return this.isReportingPeriodEditable(this.reportingPeriod)\r\n }\r\n\r\n public removeComment(comment_id: number) {\r\n this.prompt.show = true\r\n // Defer promise to be handled once resolved\r\n this.prompt.defer = new Deferred()\r\n this.prompt.defer.promise\r\n .then(() => {\r\n this.deleting = true\r\n this.error = \"\"\r\n this.deleteComment(comment_id)\r\n .finally(() => {\r\n this.deleting = false\r\n })\r\n .catch((error: any) => {\r\n if (error) {\r\n this.deleting = false\r\n this.error = error\r\n }\r\n })\r\n })\r\n .catch((error: any) => {\r\n if (error) {\r\n this.deleting = false\r\n this.error = error\r\n }\r\n })\r\n }\r\n\r\n public resolved(e: any | null) {\r\n if (e) {\r\n return true\r\n }\r\n return false\r\n }\r\n\r\n public resolvedChange(comment: Comment, event: boolean) {\r\n event = !event\r\n const commentPayload = { ...comment, resolved: event }\r\n\r\n this.resolving = true\r\n\r\n this.updateCommentResolve(commentPayload)\r\n .finally((res: any) => {\r\n this.resolving = false\r\n })\r\n .catch((error: any) => {\r\n if (error) {\r\n this.resolving = false\r\n this.error = error\r\n }\r\n })\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CommentRow.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CommentRow.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./CommentRow.vue?vue&type=template&id=16e2e2fc&scoped=true&\"\nimport script from \"./CommentRow.vue?vue&type=script&lang=ts&\"\nexport * from \"./CommentRow.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./CommentRow.vue?vue&type=style&index=0&id=16e2e2fc&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"16e2e2fc\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.commentsCount)?_c(_vm.wrapper,_vm._b({tag:\"component\"},'component',_vm.wrapperProps,false),[_c('span',{attrs:{\"id\":(\"popover-calculator-schedule-id-\" + _vm.metaId + \"-\" + (_vm.reportingPeriod.id) + \"-\" + _vm.id)}},[_c('font-awesome-icon',{staticClass:\"mr-1\",style:(_vm.commentsCount == _vm.resolvedCommentsCount\n ? { color: 'green' }\n : { color: 'goldenrod' }),attrs:{\"size\":\"sm\",\"icon\":\"comments\"}}),_vm._v(\"\\n \"+_vm._s(_vm.commentsCount)+\"\\n \")],1),_c('b-popover',{attrs:{\"target\":(\"popover-calculator-schedule-id-\" + _vm.metaId + \"-\" + (_vm.reportingPeriod.id) + \"-\" + _vm.id),\"triggers\":\"hover\",\"placement\":\"top\"}},[_vm._v(\"\\n \"+_vm._s((_vm.commentsCount + \" comment(s)\"))+\" \"),_c('br'),(!_vm.isClient)?_c('span',[_vm._v(\"\\n Resolved: \"+_vm._s(_vm.resolvedCommentsCount)+\" / \"+_vm._s(_vm.commentsCount)+\"\\n \")]):_vm._e()])],1):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","// Generate unique IDs for use as pseudo-private/protected names.\r\n// Similar in concept to\r\n// .\r\n//\r\n// The goals of this function are twofold:\r\n//\r\n// * Provide a way to generate a string guaranteed to be unique when compared\r\n// to other strings generated by this function.\r\n// * Make the string complex enough that it is highly unlikely to be\r\n// accidentally duplicated by hand (this is key if you're using `ID`\r\n// as a private/protected name on an object).\r\n//\r\n// Use:\r\n//\r\n// var privateName = ID();\r\n// var o = { 'public': 'foo' };\r\n// o[privateName] = 'bar';\r\nconst ID = () => {\r\n // Math.random should be unique because of its seeding algorithm.\r\n // Convert it to base 36 (numbers + letters), and grab the first 9 characters\r\n // after the decimal.\r\n return (\r\n \"_\" +\r\n Math.random()\r\n .toString(36)\r\n .substr(2, 9)\r\n )\r\n}\r\n\r\nexport default ID\r\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\n\n\n\n\n\n\r\nimport { Component, Mixins, Prop } from \"vue-property-decorator\"\r\nimport { Comment, CommentType, ReportingPeriod } from \"../../interfaces\"\r\nimport CalculatorMixin from \"../../mixins/CalculatorMixin\"\r\nimport UserMixin from \"../../mixins/UserMixin\"\r\nimport id from \"../../util/id\"\r\n\r\n@Component\r\nexport default class CommentResolutionStatus extends Mixins(\r\n CalculatorMixin,\r\n UserMixin\r\n) {\r\n @Prop({ required: true })\r\n public reportingPeriod!: ReportingPeriod\r\n @Prop({ required: true })\r\n public metaId!: string\r\n @Prop({ default: null })\r\n public commentType!: CommentType | null\r\n @Prop({ default: \"div\" })\r\n public wrapper!: string\r\n @Prop({ default: () => null })\r\n public wrapperProps!: any\r\n\r\n public id: string = id()\r\n\r\n public get comments() {\r\n return this.reportingPeriod.comments.filter(\r\n (c: Comment) =>\r\n c.meta_id === this.metaId &&\r\n // If user is client, only look at client comments\r\n (this.isClient\r\n ? c.type == \"C\"\r\n : // Else, if commentType was passed, then only look at those comments\r\n this.commentType\r\n ? c.type == this.commentType\r\n : // Else look at all of the comments\r\n true)\r\n )\r\n }\r\n\r\n public get commentsCount() {\r\n return this.comments.length\r\n }\r\n\r\n public get resolvedCommentsCount() {\r\n return this.comments.filter((el: any) => el.resolved_by).length\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CommentResolutionStatus.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CommentResolutionStatus.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./CommentResolutionStatus.vue?vue&type=template&id=2975ffcd&\"\nimport script from \"./CommentResolutionStatus.vue?vue&type=script&lang=ts&\"\nexport * from \"./CommentResolutionStatus.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\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\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { ReportingPeriod, Comment, CommentType } from \"@/interfaces\"\r\nimport { Component, Prop, Watch } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\n\r\n// Project imports\r\nimport Table from \"@/components/utils/Table.vue\"\r\nimport AddForm from \"@/components/utils/AddForm.vue\"\r\nimport PromptWindow from \"@/components/utils/PromptWindow.vue\"\r\nimport ScheduleMixin from \"../../mixins/ScheduleMixin\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport { comment } from \"@/services/api\"\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport ConfirmBoxMixin from \"../../mixins/ConfirmBoxMixin\"\r\nimport CommentRow from \"./CommentRow.vue\"\r\nimport CommentResolutionStatus from \"@/components/calculator/CommentResolutionStatus.vue\"\r\n\r\n@Component({\r\n components: {\r\n Table,\r\n AddForm,\r\n PromptWindow,\r\n ErrorAlert,\r\n CommentRow,\r\n CommentResolutionStatus,\r\n },\r\n})\r\nexport default class CommentSection extends mixins(\r\n ScheduleMixin,\r\n LoadingMixin,\r\n ConfirmBoxMixin\r\n) {\r\n @Prop({ required: true })\r\n public reportingPeriod!: ReportingPeriod\r\n @Prop({ required: true })\r\n public metaId!: string\r\n\r\n public comments!: Comment[]\r\n public newComment!: Comment[]\r\n\r\n public textComment: string = \"\"\r\n public commentsToShow: number = 4\r\n public commentType: CommentType = this.isClient ? \"C\" : \"K\"\r\n\r\n public resolving = false\r\n public deleting = false\r\n\r\n public get readonly() {\r\n return this.isReportingPeriodEditable(this.reportingPeriod)\r\n }\r\n\r\n public get filterComments() {\r\n const output = this.reportingPeriod.comments.filter(\r\n (c: Comment) => c.meta_id === this.metaId && c.type === this.commentType\r\n )\r\n return output\r\n }\r\n\r\n public get checkCommentNullId() {\r\n return this.filterComments.filter((f: Comment) => !f.id)\r\n }\r\n\r\n public mounted() {\r\n this.commentType = this.isClient ? \"C\" : \"K\"\r\n }\r\n\r\n public changeType(type: CommentType) {\r\n this.commentsToShow = 4\r\n this.textComment = \"\"\r\n this.commentType = type\r\n }\r\n\r\n public onSubmit(event: any) {\r\n event.preventDefault()\r\n this.addNewComment()\r\n }\r\n\r\n public addNewComment() {\r\n const newComment = {\r\n meta_id: this.metaId,\r\n comment: this.textComment,\r\n reporting_period: this.reportingPeriod.id,\r\n type: this.commentType,\r\n }\r\n\r\n this.loading = true\r\n if (this.textComment.length > 0) {\r\n this.addComment(newComment)\r\n .then(() => {\r\n this.textComment = \"\" // if successful, clear comment\r\n })\r\n .catch((error: any) => {\r\n this.error = error\r\n })\r\n .finally(() => (this.loading = false))\r\n } else {\r\n this.error = \"There was an error creating the Comment\"\r\n this.loading = false\r\n }\r\n }\r\n\r\n public retrieveComments() {\r\n const { id } = this.reportingPeriod\r\n\r\n if (id) {\r\n this.loading = true\r\n\r\n return comment.get(id).then((res: any) => {\r\n this.loading = false\r\n this.comments = res\r\n\r\n return res\r\n })\r\n }\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CommentSection.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CommentSection.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./CommentSection.vue?vue&type=template&id=10fb10a6&scoped=true&\"\nimport script from \"./CommentSection.vue?vue&type=script&lang=ts&\"\nexport * from \"./CommentSection.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./CommentSection.vue?vue&type=style&index=0&id=10fb10a6&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"10fb10a6\",\n null\n \n)\n\nexport default component.exports","\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\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\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport {\r\n Taxpayer,\r\n ReportingPeriod,\r\n Dividend,\r\n DividendTier,\r\n Comment,\r\n} from \"@/interfaces\"\r\nimport { Component, Vue, Prop, Emit, Watch } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\n// Project imports\r\nimport CalculatorMixin from \"@/mixins/CalculatorMixin\"\r\nimport schedules from \"@/components/calculator/schedules\"\r\nimport { pascalCase } from \"@/util/pascalCase\"\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport UserMixin from \"../../mixins/UserMixin\"\r\nimport CommentSection from \"@/components/calculator/CommentSection.vue\"\r\nimport ReviewSection from \"@/components/calculator/ReviewSection.vue\"\r\nimport CommentResolutionStatus from \"@/components/calculator/CommentResolutionStatus.vue\"\r\n\r\n@Component({\r\n components: {\r\n ...schedules,\r\n CommentSection,\r\n ReviewSection,\r\n CommentResolutionStatus,\r\n },\r\n})\r\nexport default class CalculatorSchedule extends mixins(\r\n CalculatorMixin,\r\n UserMixin\r\n) {\r\n public showModal: boolean = false\r\n public componentKey: number = 0\r\n\r\n @Prop({ required: true })\r\n public reportingPeriod!: ReportingPeriod\r\n @Prop({ required: true })\r\n public field!: any\r\n\r\n public total: string = \"\"\r\n public noConsolFields: string[] = [\"sep_adjustments\"]\r\n\r\n public mounted() {\r\n this.setTotal()\r\n }\r\n\r\n public get scheduleName() {\r\n // The name of the component comes from the composition of the pascal case convetion from the meta ID and \"Schedule\"\r\n let componentName = `${pascalCase(this.field.meta_id)}Schedule`\r\n if (!this.scheduleExists(componentName)) {\r\n componentName = \"FieldCreationSchedule\"\r\n }\r\n return componentName\r\n }\r\n\r\n public scheduleExists(scheduleName: string) {\r\n return (\r\n this.$options.components &&\r\n this.$options.components[scheduleName] !== undefined\r\n )\r\n }\r\n\r\n public get editable() {\r\n return this.isReportingPeriodEditable(this.reportingPeriod)\r\n }\r\n\r\n public get locked() {\r\n return (\r\n this.isSelectedReportingPeriod(this.reportingPeriod) &&\r\n this.isReportingPeriodLocked(this.reportingPeriod)\r\n )\r\n }\r\n\r\n public get buttonVariant() {\r\n return this.isSelectedReportingPeriod(this.reportingPeriod)\r\n ? \"active-blue\"\r\n : \"outline-secondary\"\r\n }\r\n\r\n public get value() {\r\n if (this.reportingPeriod) {\r\n const field = this.periodField(\r\n this.field.meta_id,\r\n this.reportingPeriod.id\r\n )\r\n if (field) {\r\n return field.value\r\n } else {\r\n // For the case that we don't want to show the tiered dividends\r\n if (\r\n this.field.meta_id == \"dividends_received\" &&\r\n this.isClient &&\r\n this.reportingPeriod.dividends\r\n ) {\r\n // excludes dividend amounts that are tiered and allocated\r\n const dividend_amt = this.reportingPeriod.dividends\r\n .filter(d => d.type == \"R\" && !d.tier)\r\n .reduce(\r\n (acc: number, curr: Dividend) => (acc = acc + curr.amount),\r\n 0\r\n )\r\n\r\n // the amt of aggregate amount in a dividend tier before tiering\r\n // this value is applied regardless if the diviend tier was able to be allocated or not.\r\n const dividend_tiers_agg_amt = this.reportingPeriod.dividend_tiers\r\n .filter(dt => dt.amount)\r\n .reduce(\r\n (acc: number, curr: DividendTier) => (acc = acc + curr.amount),\r\n 0\r\n )\r\n\r\n return dividend_amt + dividend_tiers_agg_amt\r\n }\r\n return (\r\n (this.reportingPeriod.localFields &&\r\n this.reportingPeriod.localFields[this.field.meta_id]) ||\r\n 0\r\n )\r\n }\r\n }\r\n }\r\n\r\n @Watch(\"value\")\r\n public setTotal() {\r\n this.total = this.formatter(this.value, null)\r\n }\r\n\r\n public formatter(value: string, evt: any) {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorSchedule.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorSchedule.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./CalculatorSchedule.vue?vue&type=template&id=efa8b966&\"\nimport script from \"./CalculatorSchedule.vue?vue&type=script&lang=ts&\"\nexport * from \"./CalculatorSchedule.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./CalculatorSchedule.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{\"name\":\"fade\"}},[(_vm.shouldShow)?_c('div',{staticClass:\"text-center font-weight-bold\"},[_vm._v(\"\\n \"+_vm._s(_vm.formattedValue)+\"\\n \")]):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\r\nimport { Taxpayer, ReportingPeriod } from \"@/interfaces\"\r\nimport { Component, Vue, Prop, Emit, Watch } from \"vue-property-decorator\"\r\nimport { formatMoney } from \"../../util/formatMoney\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport CalculatorMixin from \"../../mixins/CalculatorMixin\"\r\n\r\n@Component({})\r\nexport default class CalculatorReadOnly extends mixins(CalculatorMixin) {\r\n @Prop({ required: true })\r\n public field!: any\r\n @Prop({ required: true })\r\n public reportingPeriod!: ReportingPeriod\r\n\r\n private showOnce: string[] = [\"\"]\r\n\r\n public get metaId() {\r\n return this.field.meta_id\r\n }\r\n\r\n public get value() {\r\n const { openings, id, closings } = this.reportingPeriod\r\n if (this.field.type === \"opening\") {\r\n if (this.metaId === \"opening_sep\") {\r\n return this.reportingPeriod.sepOpening\r\n }\r\n if (openings && openings[this.metaId]) {\r\n return openings[this.metaId]\r\n }\r\n } else if (this.field.type === \"closing\") {\r\n if (closings && closings[this.metaId]) {\r\n return closings[this.metaId]\r\n }\r\n } else if (this.field.type === \"calculated\") {\r\n // Since there are values taht need to be calculated per period, need to use a function that accepts a reporting period\r\n const valueFunction = this.calculatedValuesMap[this.metaId]\r\n if (valueFunction) {\r\n return valueFunction(this.reportingPeriod)\r\n }\r\n return 0\r\n } else {\r\n return this.periodFieldValue(this.metaId, id)\r\n }\r\n }\r\n\r\n public get shouldShow() {\r\n // if (this.showOnce.includes(this.metaId)) {\r\n // if (this.priorReportingPeriods && this.priorReportingPeriods.length > 0) {\r\n // return (\r\n // this.priorReportingPeriods[this.priorReportingPeriods.length - 1] ===\r\n // this.reportingPeriod\r\n // )\r\n // } else {\r\n // return this.selectedReportingPeriod === this.reportingPeriod\r\n // }\r\n // }\r\n return true\r\n }\r\n\r\n public get formattedValue() {\r\n if (this.metaId === \"opening_sep\") {\r\n return formatMoney(this.value, 4)\r\n } else {\r\n return formatMoney(this.value)\r\n }\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorReadOnly.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorReadOnly.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./CalculatorReadOnly.vue?vue&type=template&id=7d570fc3&\"\nimport script from \"./CalculatorReadOnly.vue?vue&type=script&lang=ts&\"\nexport * from \"./CalculatorReadOnly.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\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\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Taxpayer, ReportingPeriod } from \"@/interfaces\"\r\nimport { Component, Vue, Prop, Emit, Watch } from \"vue-property-decorator\"\r\nimport { State, Action, Getter } from \"vuex-class\"\r\nimport _ from \"lodash\"\r\n// Project imports\r\nimport CalculatorMixin from \"@/mixins/CalculatorMixin\"\r\nimport CalculatorInput from \"@/components/calculator/CalculatorInput.vue\"\r\nimport CalculatorSchedule from \"@/components/calculator/CalculatorSchedule.vue\"\r\nimport CalculatorReadOnly from \"@/components/calculator/CalculatorReadOnly.vue\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport { formatMoney } from \"../../util/formatMoney\"\r\n\r\n@Component({\r\n components: { CalculatorInput, CalculatorSchedule, CalculatorReadOnly },\r\n})\r\nexport default class CalculatorRow extends mixins(CalculatorMixin) {\r\n @Prop({ required: true })\r\n public field!: any\r\n\r\n public isReadOnlyField(type: string) {\r\n return [\"opening\", \"closing\", \"calculated\"].includes(type)\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorRow.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorRow.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./CalculatorRow.vue?vue&type=template&id=5dcb78d3&scoped=true&\"\nimport script from \"./CalculatorRow.vue?vue&type=script&lang=ts&\"\nexport * from \"./CalculatorRow.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./CalculatorRow.vue?vue&type=style&index=0&id=5dcb78d3&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"5dcb78d3\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-row',{staticClass:\"pt-2 pb-2 mb-4 border-top border-bottom\",attrs:{\"align-v\":\"center\"}},[_c('b-col',{attrs:{\"cols\":\"3\"}},[_c('strong',[_vm._v(\"Subtotal\")])]),_vm._l((_vm.displayedPriorPeriods),function(reportingPeriod,index){return _c('b-col',{key:(\"prior-period-col-\" + index)},[(reportingPeriod)?_c('div',{staticClass:\"text-center font-weight-bold\"},[_vm._v(\"\\n \"+_vm._s(_vm.calculateSubtotal(reportingPeriod))+\"\\n \")]):_vm._e()])}),_c('b-col',[(_vm.selectedReportingPeriod)?_c('div',{staticClass:\"text-center font-weight-bold\"},[_vm._v(\"\\n \"+_vm._s(_vm.calculateSubtotal(_vm.selectedReportingPeriod))+\"\\n \")]):_vm._e()]),_c('b-col',[(_vm.nextReportingPeriod)?_c('div',{staticClass:\"text-center font-weight-bold\"},[_vm._v(\"\\n \"+_vm._s(_vm.calculateSubtotal(_vm.nextReportingPeriod))+\"\\n \")]):_vm._e()])],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\n\n\r\nimport { Taxpayer, ReportingPeriod } from \"@/interfaces\"\r\nimport { Component, Vue, Prop, Emit, Watch } from \"vue-property-decorator\"\r\nimport { State, Action, Getter } from \"vuex-class\"\r\nimport _ from \"lodash\"\r\nimport { unformat } from \"accounting\"\r\n// Project imports\r\nimport CalculatorMixin from \"@/mixins/CalculatorMixin\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport { formatMoney } from \"../../util/formatMoney\"\r\n\r\n@Component\r\nexport default class CalculatorRowSubtotal extends mixins(CalculatorMixin) {\r\n @Prop({ required: true })\r\n public fields!: any[]\r\n\r\n public calculateSubtotal(reportingPeriod: ReportingPeriod) {\r\n const sum = this.fields.reduce(\r\n (acc: number, field: any) =>\r\n (acc =\r\n acc +\r\n unformat(\r\n this.periodFieldValue(field.meta_id, reportingPeriod.id)\r\n ) || 0),\r\n 0\r\n )\r\n return formatMoney(sum)\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorRowSubtotal.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorRowSubtotal.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./CalculatorRowSubtotal.vue?vue&type=template&id=3c05c8f0&\"\nimport script from \"./CalculatorRowSubtotal.vue?vue&type=script&lang=ts&\"\nexport * from \"./CalculatorRowSubtotal.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\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\n\n\n\n\r\nimport { Taxpayer, ReportingPeriod } from \"@/interfaces\"\r\nimport { Component, Vue, Prop, Emit, Watch } from \"vue-property-decorator\"\r\nimport _ from \"lodash\"\r\nimport { mixins } from \"vue-class-component\"\r\n// Project Imports\r\nimport CalculatorRow from \"@/components/calculator/CalculatorRow.vue\"\r\nimport CalculatorRowSubtotal from \"@/components/calculator/CalculatorRowSubtotal.vue\"\r\nimport CalculatorMixin from \"../../mixins/CalculatorMixin\"\r\nimport UserMixin from \"../../mixins/UserMixin\"\r\n\r\n@Component({ components: { CalculatorRowSubtotal, CalculatorRow } })\r\nexport default class CalculatoSubSection extends mixins(\r\n CalculatorMixin,\r\n UserMixin\r\n) {\r\n @Prop({ required: true })\r\n public subGroup?: any[]\r\n public showZeroes: boolean = true\r\n\r\n public getValue(metaId: any, rpId: any) {\r\n return this.periodFieldValue(metaId, rpId) || 0\r\n }\r\n\r\n public isZeroRow(metaId: any) {\r\n let allDisplayedReportingPeriods: ReportingPeriod[] = []\r\n if (this.displayedPriorPeriods) {\r\n allDisplayedReportingPeriods = [...this.displayedPriorPeriods]\r\n }\r\n if (this.selectedReportingPeriod) {\r\n allDisplayedReportingPeriods.push(this.selectedReportingPeriod)\r\n }\r\n if (this.nextReportingPeriod) {\r\n allDisplayedReportingPeriods.push(this.nextReportingPeriod)\r\n }\r\n return allDisplayedReportingPeriods.every(\r\n (rp: ReportingPeriod) => this.getValue(metaId, rp.id) == 0\r\n )\r\n }\r\n\r\n public mapFields(fields: any[]) {\r\n const newFields = Object.keys(fields).map((key: any) => {\r\n const field = fields[key]\r\n return { ...field, meta_id: key }\r\n })\r\n return newFields\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorSubSection.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorSubSection.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./CalculatorSubSection.vue?vue&type=template&id=1eeaf63d&\"\nimport script from \"./CalculatorSubSection.vue?vue&type=script&lang=ts&\"\nexport * from \"./CalculatorSubSection.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Taxpayer, ReportingPeriod } from \"@/interfaces\"\r\nimport { Component, Vue, Prop, Emit, Watch } from \"vue-property-decorator\"\r\nimport _ from \"lodash\"\r\nimport { mixins } from \"vue-class-component\"\r\n// Project Imports\r\nimport CalculatorSubSection from \"@/components/calculator/CalculatorSubSection.vue\"\r\nimport CalculatorMixin from \"../../mixins/CalculatorMixin\"\r\nimport UserMixin from \"../../mixins/UserMixin\"\r\n\r\n@Component({ components: { CalculatorSubSection } })\r\nexport default class CalculatorSection extends mixins(\r\n CalculatorMixin,\r\n UserMixin\r\n) {\r\n @Prop({ required: true })\r\n public section?: any\r\n\r\n @Prop()\r\n public collapseAll?: boolean\r\n @Prop()\r\n public expandAll?: boolean\r\n\r\n public showing: boolean = false\r\n public reviewed: boolean = false\r\n\r\n @Watch(\"collapseAll\")\r\n public collapseAllTrigger(oldVal: boolean, newVal: boolean) {\r\n if (oldVal != newVal) {\r\n this.showing = false\r\n }\r\n }\r\n @Watch(\"expandAll\")\r\n public expandAllTrigger(oldVal: boolean, newVal: boolean) {\r\n if (oldVal != newVal) {\r\n this.showing = true\r\n }\r\n }\r\n\r\n @Watch(\"selectedReportingPeriodMetadata\")\r\n public selectedReportingPeriodMetadataChange() {\r\n const rpMetadata = this.selectedReportingPeriodMetadata\r\n if (rpMetadata && rpMetadata.hasOwnProperty(\"review\")) {\r\n this.reviewed = rpMetadata[\"review\"][this.section.key]\r\n } else {\r\n this.reviewed = false\r\n }\r\n }\r\n\r\n public get subGroups() {\r\n return this.section.subGroups\r\n }\r\n\r\n public get requiredSection() {\r\n if (this.section && this.section.required && this.selectedReportingPeriod) {\r\n const { required } = this.section\r\n return required.some(\r\n (req: string) => (this.selectedReportingPeriod as any)[req]\r\n )\r\n }\r\n return false\r\n }\r\n\r\n public reviewCheckboxChange(value: boolean) {\r\n this.updateMetadata({\r\n meta: \"review\",\r\n value: {\r\n [this.section.key]: value,\r\n },\r\n })\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorSection.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorSection.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./CalculatorSection.vue?vue&type=template&id=bead8878&scoped=true&\"\nimport script from \"./CalculatorSection.vue?vue&type=script&lang=ts&\"\nexport * from \"./CalculatorSection.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./CalculatorSection.vue?vue&type=style&index=0&id=bead8878&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"bead8878\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.showModal)?_c('b-modal',{attrs:{\"size\":\"xxl\",\"no-close-on-backdrop\":\"\",\"hide-footer\":\"\"},model:{value:(_vm.showModal),callback:function ($$v) {_vm.showModal=$$v},expression:\"showModal\"}},[_c('b-row',[_c('b-col',[_c('h2',[_vm._v(\"Transactions\")])])],1),_c('hr'),_c('b-tabs',[_c('b-tab',{attrs:{\"title\":\"Transactions\"}},[_c('Table',{attrs:{\"fields\":_vm.transactionsTableFields,\"items\":_vm.transactions,\"slots\":_vm.tableSlots}})],1),_c('b-tab',{attrs:{\"title\":\"Alterations\"}},[_c('Table',{attrs:{\"fields\":_vm.alterationsTableFields,\"items\":_vm.alterations,\"slots\":[\n {\n name: 'movement',\n field: 'movement',\n },\n {\n name: 'category',\n field: 'category',\n } ]},scopedSlots:_vm._u([{key:\"movement\",fn:function(data){return [(data.item.movement.to)?_c('div',[_vm._v(\"\\n To:\\n \"+_vm._s(_vm.formatText(data.item.movement.to))+\"\\n \")]):_vm._e(),(data.item.movement.from)?_c('div',[_vm._v(\"\\n From:\\n \"+_vm._s(_vm.formatText(data.item.movement.from))+\"\\n \")]):_vm._e()]}}],null,false,1419662155)})],1)],1)],1):_vm._e(),_c('b-row',[_c('b-col',[_c('b-button',{attrs:{\"block\":\"\",\"variant\":\"secondary\",\"data-cy\":\"transactions\"},on:{\"click\":function () { return (_vm.showModal = true); }}},[_vm._v(\"Transactions\")])],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Vue, Watch, Prop } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport _ from \"lodash\"\r\nimport dateFns from \"date-fns\"\r\nimport { State, Action, Getter } from \"vuex-class\"\r\n// Project Imports\r\nimport CalculatorMixin from \"@/mixins/CalculatorMixin\"\r\nimport {\r\n ReportingPeriod,\r\n Dividend,\r\n Adjustment,\r\n DispositionAdjustment,\r\n ACBAdjustment,\r\n} from \"../../interfaces\"\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport Transaction from \"../../services/transaction/Transaction\"\r\nimport Table from \"@/components/utils/Table.vue\"\r\nimport ScheduleMixin from \"../../mixins/ScheduleMixin\"\r\nimport Alteration from \"../../services/calculator/Alteration\"\r\n\r\n@Component({ components: { Table } })\r\nexport default class CalculatorBreakdown extends mixins(\r\n CalculatorMixin,\r\n ScheduleMixin\r\n) {\r\n public showModal: boolean = false\r\n\r\n public get transactionsTableFields() {\r\n const fields: any[] = [\r\n {\r\n key: \"date\",\r\n label: \"Date\",\r\n sortable: true,\r\n type: \"date\",\r\n },\r\n {\r\n key: \"actionName\",\r\n label: \"Action\",\r\n sortable: true,\r\n type: \"text\",\r\n thStyle: {\r\n width: \"15%\",\r\n },\r\n },\r\n {\r\n key: \"type\",\r\n label: \"Type\",\r\n sortable: true,\r\n type: \"text\",\r\n },\r\n {\r\n key: \"amount\",\r\n label: \"Amount\",\r\n sortable: true,\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"exemptBalance\",\r\n label: \"ES\",\r\n sortable: true,\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"hybridBalance\",\r\n label: \"HS\",\r\n sortable: true,\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"taxableBalance\",\r\n label: \"TS\",\r\n sortable: true,\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"hutBalance\",\r\n label: \"HUT\",\r\n sortable: true,\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"uftBalance\",\r\n label: \"UFT\",\r\n sortable: true,\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"preAcqBalance\",\r\n label: \"PreAcq\",\r\n sortable: true,\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"exemptEarnings\",\r\n label: \"EE\",\r\n sortable: true,\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"taxableEarnings\",\r\n label: \"TE\",\r\n sortable: true,\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n ]\r\n return fields\r\n }\r\n\r\n public get alterationsTableFields() {\r\n const fields: any[] = [\r\n {\r\n key: \"localOrder\",\r\n label: \"Order\",\r\n sortable: true,\r\n type: \"text\",\r\n },\r\n {\r\n key: \"date\",\r\n label: \"Date\",\r\n sortable: true,\r\n type: \"date\",\r\n },\r\n {\r\n key: \"type\",\r\n label: \"Type\",\r\n sortable: true,\r\n type: \"text\",\r\n },\r\n {\r\n key: \"movement\",\r\n label: \"Movement\",\r\n sortable: true,\r\n type: \"text\",\r\n },\r\n {\r\n key: \"amount\",\r\n label: \"Amount\",\r\n sortable: true,\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"exemptBalance\",\r\n label: \"ES\",\r\n sortable: true,\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"hybridBalance\",\r\n label: \"HS\",\r\n sortable: true,\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"taxableBalance\",\r\n label: \"TS\",\r\n sortable: true,\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"hutBalance\",\r\n label: \"HUT\",\r\n sortable: true,\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"uftBalance\",\r\n label: \"UFT\",\r\n sortable: true,\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"preAcqBalance\",\r\n label: \"PreAcq\",\r\n sortable: true,\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"exemptEarnings\",\r\n label: \"EE\",\r\n sortable: true,\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"taxableEarnings\",\r\n label: \"TE\",\r\n sortable: true,\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n ]\r\n return fields\r\n }\r\n public tableSlots: any[] = []\r\n\r\n public get transactions() {\r\n if (\r\n this.selectedReportingPeriod &&\r\n this.selectedReportingPeriod.calculator\r\n ) {\r\n return this.selectedReportingPeriod.calculator.getTransactions.map(\r\n (transaction: Transaction) => {\r\n const action = transaction.getAction\r\n const actionType = transaction.getActionType\r\n const balance = transaction.getBalance\r\n const { date, amount } = action\r\n const {\r\n exemptBalance,\r\n hybridBalance,\r\n taxableBalance,\r\n hutBalance,\r\n uftBalance,\r\n preAcqBalance,\r\n } = balance.surplusBalances\r\n const { exemptEarnings, taxableEarnings } = balance.earnings\r\n let actionName = \"\"\r\n let type = \"\"\r\n // Rename Action type\r\n switch (actionType) {\r\n case \"dividend\":\r\n const dividendType = (action as Dividend).type\r\n type = dividendType === \"P\" ? \"Paid\" : \"Received\"\r\n actionName = `Dividend`\r\n\r\n break\r\n case \"sepAdjustment\":\r\n actionName = `SEP Adjustment`\r\n break\r\n case \"adjustment\":\r\n const adjustmentType = (action as Adjustment).type\r\n type = this.getOptionText(\r\n this.adjustmentTypeOptions,\r\n adjustmentType\r\n )\r\n actionName = `Adjustment`\r\n break\r\n case \"dispositionAdjustment\":\r\n const dispostionAdjustmentType = (action as DispositionAdjustment)\r\n .type\r\n type = this.getOptionText(\r\n this.dispositionTypeOptions,\r\n dispostionAdjustmentType\r\n )\r\n actionName = `Disposition Adjustment`\r\n break\r\n case \"acbAdjustment\":\r\n const acbAdjustmentType = (action as ACBAdjustment).type\r\n type = this.getOptionText(\r\n this.acbAdjustmentTypeOptions,\r\n acbAdjustmentType.toString()\r\n )\r\n actionName = `ACB Adjustment`\r\n break\r\n }\r\n\r\n return {\r\n date,\r\n amount,\r\n exemptBalance,\r\n hybridBalance,\r\n taxableBalance,\r\n hutBalance,\r\n uftBalance,\r\n preAcqBalance,\r\n exemptEarnings,\r\n taxableEarnings,\r\n actionName,\r\n type,\r\n }\r\n }\r\n )\r\n }\r\n return []\r\n }\r\n\r\n public get alterations() {\r\n if (\r\n this.selectedReportingPeriod &&\r\n this.selectedReportingPeriod.calculator\r\n ) {\r\n return this.selectedReportingPeriod.calculator.getAlterations.map(\r\n (alteration: Alteration) => {\r\n const {\r\n date,\r\n amount,\r\n metadata,\r\n type,\r\n localOrder,\r\n movement,\r\n } = alteration\r\n\r\n let item: any = {\r\n date: dateFns.format(date, \"YYYY MM DD\"),\r\n amount,\r\n metadata,\r\n type: _.startCase(type),\r\n localOrder,\r\n movement,\r\n }\r\n\r\n if (metadata.runningBalances) {\r\n const balance = metadata.runningBalances\r\n const {\r\n exemptBalance,\r\n hybridBalance,\r\n taxableBalance,\r\n hutBalance,\r\n uftBalance,\r\n preAcqBalance,\r\n } = balance.surplusBalances\r\n\r\n item = {\r\n ...item,\r\n exemptBalance,\r\n hybridBalance,\r\n taxableBalance,\r\n hutBalance,\r\n uftBalance,\r\n preAcqBalance,\r\n }\r\n }\r\n\r\n return item\r\n }\r\n )\r\n }\r\n return []\r\n }\r\n\r\n public formatText(text: string) {\r\n return _.startCase(text)\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorBreakdown.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorBreakdown.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./CalculatorBreakdown.vue?vue&type=template&id=46c404e0&\"\nimport script from \"./CalculatorBreakdown.vue?vue&type=script&lang=ts&\"\nexport * from \"./CalculatorBreakdown.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-row',{staticClass:\"sticky-top bg-white pt-2 calc-header\",attrs:{\"align-v\":\"end\"}},[_c('b-col',{attrs:{\"cols\":\"3\"}},[_c('b-row',{attrs:{\"align-v\":\"center\"}},[_c('b-col',{attrs:{\"cols\":\"1\"}},[_c('div',{directives:[{name:\"b-toggle\",rawName:\"v-b-toggle.period-nav-collapse\",modifiers:{\"period-nav-collapse\":true}}],staticStyle:{\"cursor\":\"pointer\"}},[_c('font-awesome-icon',{staticClass:\"ml-1\",attrs:{\"icon\":\"bars\"}})],1),_c('b-collapse',{attrs:{\"id\":\"period-nav-collapse\"}},[_c('b-list-group',{directives:[{name:\"b-toggle\",rawName:\"v-b-toggle.period-nav-collapse\",modifiers:{\"period-nav-collapse\":true}}],staticClass:\"shadow\"},[_c('b-list-group-item',{attrs:{\"variant\":\"light\",\"href\":\"#\",\"data-cy\":\"collapse-all\"},on:{\"click\":function($event){return _vm.$emit('collapse-all')}}},[_vm._v(\"\\n Collapse All\\n \")]),_c('b-list-group-item',{attrs:{\"variant\":\"light\",\"href\":\"#\",\"data-cy\":\"expand-all\"},on:{\"click\":function($event){return _vm.$emit('expand-all')}}},[_vm._v(\"\\n Expand All\\n \")])],1)],1)],1),_c('b-col',{staticClass:\"p-3 mr-3\"},[_c('transition',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[(_vm.loading)?_c('b-spinner',{key:\"loader\",staticClass:\"text-center\",attrs:{\"small\":\"\"}}):_c('div',{key:\"select\"},[_c('div',{staticClass:\"font-weight-bold\"},[_vm._v(\"Select Taxation Year\")]),_c('div',{attrs:{\"id\":\"popover-period-select\"}},[_c('b-form-select',{staticClass:\"calc-period-select-dropdown\",attrs:{\"options\":_vm.periodOptions},model:{value:(_vm.selectedReportingPeriodModel),callback:function ($$v) {_vm.selectedReportingPeriodModel=$$v},expression:\"selectedReportingPeriodModel\"}})],1),_c('OptionsDropdown',{attrs:{\"dropdownClass\":\"my-dropdown align-self-end\"}},[_c('b-dropdown-form',[_c('div',{staticClass:\"font-weight-bold\"},[_vm._v(\"\\n Prior Taxation Year Displayed\\n \")]),_c('b-form-select',{attrs:{\"options\":_vm.selectedNumberOfPriorYearOptions,\"size\":\"sm\"},model:{value:(_vm.selectedNumberOfPriorYear),callback:function ($$v) {_vm.selectedNumberOfPriorYear=$$v},expression:\"selectedNumberOfPriorYear\"}})],1)],1)],1)],1)],1)],1)],1),_vm._l((_vm.displayedPriorPeriods),function(priorReportingPeriod,index){return _c('b-col',{key:index,staticClass:\"text-center calc-period-col pb-3\"},[_c('b-row',{staticClass:\"calc-period-row\",attrs:{\"align-v\":\"center\"}},[_c('b-col',{attrs:{\"cols\":\"1\"}},[_c('a',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.showShuffleLeft(priorReportingPeriod, index)),expression:\"showShuffleLeft(priorReportingPeriod, index)\"}],attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();return _vm.shufflePriorPeriodsLeft($event)}}},[_c('font-awesome-icon',{attrs:{\"size\":\"lg\",\"icon\":\"chevron-left\"}})],1)]),_c('transition',{attrs:{\"name\":\"fade\"}},[(priorReportingPeriod)?_c('b-col',{staticClass:\"clearfix text-muted pointer navigatable-period\",on:{\"click\":function($event){_vm.selectedReportingPeriodModel = priorReportingPeriod}}},[_vm._v(\"\\n \"+_vm._s((\"\" + (priorReportingPeriod.start_date)))+\" to\\n \"+_vm._s((\"\" + (priorReportingPeriod.end_date)))+\"\\n \"),_c('font-awesome-icon',{staticClass:\"text-secondary ml-1\",attrs:{\"icon\":_vm.lockStatusIcon(priorReportingPeriod)}})],1):_vm._e()],1),_c('b-col',{attrs:{\"cols\":\"1\"}},[_c('a',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.showShuffleRight(priorReportingPeriod, index)),expression:\"showShuffleRight(priorReportingPeriod, index)\"}],attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();return _vm.shufflePriorPeriodsRight($event)}}},[_c('font-awesome-icon',{attrs:{\"size\":\"lg\",\"icon\":\"chevron-right\"}})],1)])],1)],1)}),_c('b-col',{staticClass:\"active-period pb-3 h-100\",staticStyle:{\"font-size\":\"1.2rem\"}},[_c('div',{staticClass:\"text-center font-weight-bold\"},[_vm._v(\"\\n \"+_vm._s((\"\" + (_vm.selectedReportingPeriod.start_date)))+\"\\n to\\n \"+_vm._s((\"\" + (_vm.selectedReportingPeriod.end_date)))+\"\\n \"),_c('font-awesome-icon',{staticClass:\"text-secondary ml-1\",attrs:{\"icon\":_vm.lockStatusIcon(_vm.selectedReportingPeriod)}})],1)]),_c('b-col',{staticClass:\"text-center pb-3\"},[_c('b-row',{staticClass:\"calc-period-row\",attrs:{\"align-v\":\"center\"}},[_c('b-col',{attrs:{\"cols\":\"1\"}},[_c('a',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.showNextShuffleLeft(_vm.nextReportingPeriod)),expression:\"showNextShuffleLeft(nextReportingPeriod)\"}],attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();return _vm.shuffleNextPeriodsLeft($event)}}},[_c('font-awesome-icon',{attrs:{\"size\":\"lg\",\"icon\":\"chevron-left\"}})],1)]),_c('transition',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[(_vm.nextReportingPeriod)?_c('b-col',{key:\"nextPeriod\",staticClass:\"clearfix text-muted pointer navigatable-period\",on:{\"click\":function($event){_vm.selectedReportingPeriodModel = _vm.nextReportingPeriod}}},[_vm._v(\"\\n \"+_vm._s((\"\" + (_vm.nextReportingPeriod.start_date)))+\" to\\n \"+_vm._s((\"\" + (_vm.nextReportingPeriod.end_date)))+\"\\n \"),_c('font-awesome-icon',{staticClass:\"text-secondary ml-1\",attrs:{\"icon\":_vm.lockStatusIcon(_vm.nextReportingPeriod)}})],1):_c('b-col',{key:\"missingNextPeriod\"},[_c('span',{staticClass:\"text-muted\"},[_vm._v(\"No following taxation year.\")])])],1),_c('b-col',{attrs:{\"cols\":\"1\"}},[_c('a',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.showNextShuffleRight(_vm.nextReportingPeriod)),expression:\"showNextShuffleRight(nextReportingPeriod)\"}],attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();return _vm.shuffleNextPeriodsRight($event)}}},[_c('font-awesome-icon',{attrs:{\"size\":\"lg\",\"icon\":\"chevron-right\"}})],1)])],1)],1)],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\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\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\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\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Vue, Watch, Prop } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport dateFns from \"date-fns\"\r\nimport { State, Action, Getter } from \"vuex-class\"\r\n// Project Imports\r\nimport { ReportingPeriod, ForeignAffiliate } from \"@/interfaces\"\r\nimport CalculatorMixin from \"@/mixins/CalculatorMixin\"\r\nimport UserMixin from \"../../mixins/UserMixin\"\r\nimport LoadingMixin from \"../../mixins/LoadingMixin\"\r\nimport OptionsDropdown from \"@/components/utils/OptionsDropdown.vue\"\r\n\r\n@Component({\r\n components: {\r\n OptionsDropdown,\r\n },\r\n})\r\nexport default class CalculatorPeriodNavigation extends mixins(\r\n CalculatorMixin,\r\n UserMixin,\r\n LoadingMixin\r\n) {\r\n @Prop({ required: true })\r\n public foreignAffiliate!: ForeignAffiliate\r\n public selectedReportingPeriodModel: any = \"\"\r\n public selectedNumberOfPriorYear: number = 3\r\n public selectedNumberOfPriorYearOptions: any[] = [\r\n { value: 3, text: 3 },\r\n { value: 2, text: 2 },\r\n { value: 1, text: 1 },\r\n { value: 0, text: 0 },\r\n ]\r\n\r\n @Watch(\"selectedNumberOfPriorYear\")\r\n public getSelectedNumberOfPriorYear(newVal: number, oldVal: number) {\r\n if (newVal !== oldVal) {\r\n this.editPriorYearDisplay(newVal)\r\n }\r\n }\r\n\r\n @Watch(\"selectedReportingPeriodModel\")\r\n public selectedReportingPeriodChange(\r\n newVal: ReportingPeriod | undefined,\r\n oldVal: ReportingPeriod | undefined\r\n ) {\r\n if (newVal !== oldVal) {\r\n this.loading = true\r\n const p = new Promise((res, err) => {\r\n this.setSelectedReportingPeriod(newVal)\r\n this.calculateSurplus()\r\n res()\r\n }).then(() => (this.loading = false))\r\n }\r\n }\r\n\r\n //#region Navigation\r\n public showShuffleRight(reportingPeriod: ReportingPeriod, index: number) {\r\n if (this.priorReportingPeriods && this.displayedPriorPeriods) {\r\n return (\r\n index === this.displayedPriorPeriods.length - 1 &&\r\n reportingPeriod !== this.priorReportingPeriods[0]\r\n )\r\n } else {\r\n return false\r\n }\r\n }\r\n\r\n public showShuffleLeft(reportingPeriod: ReportingPeriod, index: number) {\r\n if (this.priorReportingPeriods) {\r\n return (\r\n index === 0 &&\r\n reportingPeriod !==\r\n this.priorReportingPeriods[this.priorReportingPeriods.length - 1]\r\n )\r\n } else {\r\n return false\r\n }\r\n }\r\n\r\n public showNextShuffleLeft(reportingPeriod: ReportingPeriod) {\r\n if (this.nextReportingPeriods && this.displayedPriorPeriods) {\r\n return reportingPeriod !== this.nextReportingPeriods[0]\r\n } else {\r\n return false\r\n }\r\n }\r\n\r\n public showNextShuffleRight(reportingPeriod: ReportingPeriod) {\r\n if (this.nextReportingPeriods) {\r\n return (\r\n reportingPeriod !==\r\n this.nextReportingPeriods[this.nextReportingPeriods.length - 1]\r\n )\r\n } else {\r\n return false\r\n }\r\n }\r\n\r\n public shufflePriorPeriodsRight() {\r\n this.changeLookbackShuffle({ shuffle: -1, direction: \"prior\" })\r\n }\r\n\r\n public shufflePriorPeriodsLeft() {\r\n this.changeLookbackShuffle({ shuffle: 1, direction: \"prior\" })\r\n }\r\n\r\n public shuffleNextPeriodsRight() {\r\n this.changeLookbackShuffle({ shuffle: 1, direction: \"next\" })\r\n }\r\n\r\n public shuffleNextPeriodsLeft() {\r\n this.changeLookbackShuffle({ shuffle: -1, direction: \"next\" })\r\n }\r\n //#endregion\r\n\r\n public mounted() {\r\n this.selectedReportingPeriodModel = this.selectedReportingPeriod\r\n }\r\n\r\n public lockStatusIcon(reportingPeriod: ReportingPeriod) {\r\n if (this.isClient) {\r\n switch (reportingPeriod.lock_status) {\r\n case \"CL\":\r\n case \"L\":\r\n return \"lock\"\r\n case \"U\":\r\n return \"lock-open\"\r\n }\r\n } else {\r\n switch (reportingPeriod.lock_status) {\r\n case \"CL\":\r\n return \"user-lock\"\r\n case \"L\":\r\n return \"lock\"\r\n case \"U\":\r\n return \"lock-open\"\r\n }\r\n }\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorPeriodNavigation.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorPeriodNavigation.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./CalculatorPeriodNavigation.vue?vue&type=template&id=c7e27794&scoped=true&\"\nimport script from \"./CalculatorPeriodNavigation.vue?vue&type=script&lang=ts&\"\nexport * from \"./CalculatorPeriodNavigation.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./CalculatorPeriodNavigation.vue?vue&type=style&index=0&id=c7e27794&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"c7e27794\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-form',[_c('b-row',[_c('b-col',[_c('b-form-group',{attrs:{\"label-cols\":\"2\",\"label\":\"From\"}},[_c('b-form-select',{attrs:{\"options\":_vm.fromPeriodOptions,\"data-cy\":\"export-start-date\"},model:{value:(_vm.fromReportingPeriod),callback:function ($$v) {_vm.fromReportingPeriod=$$v},expression:\"fromReportingPeriod\"}})],1)],1),_c('b-col',[_c('b-form-group',{attrs:{\"label-cols\":\"2\",\"label\":\"To\"}},[_c('b-form-select',{attrs:{\"options\":_vm.toPeriodOptions,\"data-cy\":\"export-end-date\"},model:{value:(_vm.toReportingPeriod),callback:function ($$v) {_vm.toReportingPeriod=$$v},expression:\"toReportingPeriod\"}})],1)],1)],1)],1),_c('b-tabs',{attrs:{\"content-class\":\"mt-3\"},model:{value:(_vm.tabIndex),callback:function ($$v) {_vm.tabIndex=$$v},expression:\"tabIndex\"}},[_c('b-tab',{attrs:{\"title\":\"Surplus Calculator\"}},[(_vm.shownSections.length > 0)?_c('b-card',{attrs:{\"no-body\":\"\"}},[_c('b-tabs',{attrs:{\"card\":\"\",\"vertical\":\"\",\"pills\":\"\",\"nav-wrapper-class\":\"col-2\",\"nav-class\":\"font-weight-light\"}},_vm._l((_vm.shownSections),function(section,index){return _c('b-tab',{key:(\"output-section-\" + (section.id)),scopedSlots:_vm._u([{key:\"title\",fn:function(){return [_c('span',{attrs:{\"data-cy\":((section.id) + \"-tab\")}},[_vm._v(_vm._s(section.tabName))])]},proxy:true}],null,true)},[_c('table',{directives:[{name:\"show\",rawName:\"v-show\",value:(false),expression:\"false\"}],attrs:{\"id\":((section.id) + \"-\" + index)}},[_c('thead',[_c('tr',[_c('td',{staticClass:\"font-weight-bold\"},[_c('h4',[_vm._v(_vm._s(section.name))])])])])]),_c('b-card',{attrs:{\"no-body\":\"\"}},[_c('b-tabs',{attrs:{\"card\":\"\"}},_vm._l((_vm.sectionPeriodBatches(\n section\n )),function(periodBatch,periodIndex){return _c('b-tab',{key:(\"period-batch-section-\" + (periodBatch[0].id)),attrs:{\"title\":((periodBatch[0].start_date) + \" to \" + (periodBatch[periodBatch.length - 1].end_date)),\"active\":periodIndex === _vm.reportTabState},on:{\"click\":function () { return (_vm.reportTabState = periodIndex); }}},[_c('div',{staticClass:\"p-4 border rounded\",staticStyle:{\"height\":\"450px\",\"overflow\":\"auto\"}},_vm._l((_vm.periodBatchSubSections(\n section,\n periodBatch,\n section.subSections\n )),function(subSection){return _c('div',{key:(\"output-subsection-\" + (subSection.id) + \"-\" + periodIndex)},[_c('b-table',{staticClass:\"output-table\",attrs:{\"id\":((subSection.id) + \"-\" + periodIndex),\"fixed\":\"\",\"small\":\"\",\"bordered\":\"\",\"striped\":false,\"items\":_vm.subSectionsTableContent(\n section,\n periodBatch,\n subSection\n ),\"fields\":_vm.createTableStructure(periodBatch, subSection.name)},scopedSlots:_vm._u([{key:\"thead-top\",fn:function(){return [_c('tr',[_c('th',{staticClass:\"text-center\",attrs:{\"colspan\":_vm.createTableStructure(\n periodBatch,\n subSection.name\n ).length}},[_vm._v(\"\\n \"+_vm._s(subSection.name)+\"\\n \")])])]},proxy:true},_vm._l((_vm.createTableStructure(\n periodBatch,\n subSection.name\n )),function(col,index){return {key:\"cell()\",fn:function(data){return [_c('span',{key:index,domProps:{\"innerHTML\":_vm._s(data.value)}})]}}})],null,true)}),_c('br')],1)}),0)])}),1)],1)],1)}),1)],1):_c('h3',{staticClass:\"text-center font-weight-light\"},[_vm._v(\"\\n No sections selected.\\n \")])],1),_c('b-tab',{attrs:{\"title\":\"ACB Calculator\",\"disabled\":!_vm.isAcbEnabled}},[_c('b-card',[_c('b-tabs',{attrs:{\"card\":\"\"}},[(_vm.outputProfile.showAcbOutput['adjustments-by-date'])?_c('b-tab',{attrs:{\"title\":\"By Date\"}},[_c('table',{directives:[{name:\"show\",rawName:\"v-show\",value:(false),expression:\"false\"}],attrs:{\"id\":\"adjustments-by-date-title\"}},[_c('thead',[_c('tr',[_c('td',{staticClass:\"font-weight-bold\"},[_c('h4',[_vm._v(\"Adjusted Cost Base Adjustments By Date\")])])])])]),_c('b-table',{staticClass:\"output-date-table\",attrs:{\"id\":\"adjustments-by-date-table\",\"fixed\":\"\",\"small\":\"\",\"bordered\":\"\",\"striped\":\"\",\"items\":_vm.getAlternationEntries,\"fields\":_vm.tableFieldsACBAdjustmentByDate},scopedSlots:_vm._u([{key:\"cell(movement)\",fn:function(data){return [(data.item.movement.from)?_c('div',[_vm._v(\"\\n From:\\n \"+_vm._s(_vm.formatText(data.item.movement.from))+\"\\n \")]):_vm._e(),(data.item.movement.to)?_c('div',[_vm._v(\"\\n To:\\n \"+_vm._s(_vm.formatText(data.item.movement.to))+\"\\n \")]):_vm._e()]}}],null,false,1643180972)})],1):_vm._e(),(_vm.outputProfile.showAcbOutput['adjustments-by-entry'])?_c('b-tab',{attrs:{\"title\":\"By Entry\"}},[_c('table',{directives:[{name:\"show\",rawName:\"v-show\",value:(false),expression:\"false\"}],attrs:{\"id\":\"adjustments-by-entry-title\"}},[_c('thead',[_c('tr',[_c('td',{staticClass:\"font-weight-bold\"},[_c('h4',[_vm._v(\"Adjusted Cost Base Adjustments By Entry\")])])])])]),_c('b-table',{staticClass:\"output-entry-table-openingBalance\",attrs:{\"id\":\"adjustments-by-entry-openingBalance\",\"fixed\":\"\",\"small\":\"\",\"bordered\":\"\",\"striped\":\"\",\"items\":[_vm.getOpeningBalance],\"fields\":_vm.tableFieldsACBAdjustmentByEntry(),\"no-local-sorting\":true}}),_c('b-table',{staticClass:\"output-entry-table\",attrs:{\"id\":\"adjustments-by-entry-table\",\"fixed\":\"\",\"small\":\"\",\"bordered\":\"\",\"striped\":\"\",\"items\":_vm.getACBAdjustmentEntries,\"fields\":_vm.tableFieldsACBAdjustmentByEntry(true),\"sort-by\":_vm.outputProfile.sortACBAdjustmentsByEntryColumn,\"sort-desc\":_vm.outputProfile.isDescendingACBAdjustmentsByEntryColumn,\"label-sort-asc\":\"\",\"label-sort-desc\":\"\",\"label-sort-clear\":\"\"},on:{\"update:sortBy\":function($event){return _vm.$set(_vm.outputProfile, \"sortACBAdjustmentsByEntryColumn\", $event)},\"update:sort-by\":function($event){return _vm.$set(_vm.outputProfile, \"sortACBAdjustmentsByEntryColumn\", $event)},\"update:sortDesc\":function($event){return _vm.$set(_vm.outputProfile, \"isDescendingACBAdjustmentsByEntryColumn\", $event)},\"update:sort-desc\":function($event){return _vm.$set(_vm.outputProfile, \"isDescendingACBAdjustmentsByEntryColumn\", $event)}}})],1):_vm._e()],1)],1)],1)],1),_c('hr',{staticClass:\"mt-2 mb-2\"}),_c('div',[_c('b-row',[_c('b-col',[_c('b-row',[_c('b-col',{staticClass:\"border-right\",attrs:{\"lg\":\"4\"}},[_c('ProfileSelector',{attrs:{\"outputProfile\":_vm.outputProfile,\"defaultOutputProfile\":_vm.defaultOutputProfile,\"profileType\":'CA'},on:{\"update:outputProfile\":function($event){_vm.outputProfile=$event},\"update:output-profile\":function($event){_vm.outputProfile=$event},\"calc-output-change\":function ($event) { return (_vm.profileChangeType = $event); }}})],1),_c('b-col',{attrs:{\"lg\":\"2\"}},[_c('b-form-group',{staticClass:\"mb-0\",attrs:{\"label\":\"Print Mode\"}},[_c('b-form-radio',{attrs:{\"value\":true,\"data-cy\":\"landscape\"},model:{value:(_vm.outputProfile.landscape),callback:function ($$v) {_vm.$set(_vm.outputProfile, \"landscape\", $$v)},expression:\"outputProfile.landscape\"}},[_vm._v(\"Landscape\")]),_c('b-form-radio',{attrs:{\"value\":false,\"data-cy\":\"portrait\"},model:{value:(_vm.outputProfile.landscape),callback:function ($$v) {_vm.$set(_vm.outputProfile, \"landscape\", $$v)},expression:\"outputProfile.landscape\"}},[_vm._v(\"Portrait\")]),(_vm.tabIndex === 0)?_c('b-form-checkbox',{attrs:{\"value\":true,\"unchecked-value\":false},model:{value:(_vm.outputProfile.pageBreak),callback:function ($$v) {_vm.$set(_vm.outputProfile, \"pageBreak\", $$v)},expression:\"outputProfile.pageBreak\"}},[_vm._v(\"Auto Page Break\")]):_vm._e()],1)],1),(_vm.tabIndex === 0)?_c('b-col',[_c('b-form-group',{staticClass:\"mb-0\",attrs:{\"label\":\"Show/Hide\"}},[_c('b-form-checkbox',{attrs:{\"value\":true,\"unchecked-value\":false},model:{value:(_vm.outputProfile.hideZeroRows),callback:function ($$v) {_vm.$set(_vm.outputProfile, \"hideZeroRows\", $$v)},expression:\"outputProfile.hideZeroRows\"}},[_vm._v(\"Hide 0 rows\")]),_c('b-form-checkbox',{attrs:{\"value\":true,\"unchecked-value\":false},model:{value:(_vm.outputProfile.hideEmptySections),callback:function ($$v) {_vm.$set(_vm.outputProfile, \"hideEmptySections\", $$v)},expression:\"outputProfile.hideEmptySections\"}},[_vm._v(\"Hide empty sections\")]),_c('b-form-checkbox',{attrs:{\"value\":true,\"unchecked-value\":false},model:{value:(_vm.outputProfile.showRef),callback:function ($$v) {_vm.$set(_vm.outputProfile, \"showRef\", $$v)},expression:\"outputProfile.showRef\"}},[_vm._v(\"Show Working Paper References\")])],1)],1):_vm._e(),_c('b-col',[_c('b-form-group',{staticClass:\"mb-0\",attrs:{\"label\":\"Draft Label\"}},[_c('b-form-radio',{attrs:{\"value\":\"no-draft\",\"data-cy\":\"no-draft\"},model:{value:(_vm.outputProfile.draft),callback:function ($$v) {_vm.$set(_vm.outputProfile, \"draft\", $$v)},expression:\"outputProfile.draft\"}},[_vm._v(\"None\")]),_c('b-form-radio',{attrs:{\"value\":\"draft-normal\",\"data-cy\":\"draft-normal\"},model:{value:(_vm.outputProfile.draft),callback:function ($$v) {_vm.$set(_vm.outputProfile, \"draft\", $$v)},expression:\"outputProfile.draft\"}},[_vm._v(\"Draft\")]),_c('b-form-radio',{attrs:{\"value\":\"draft\",\"data-cy\":\"draft\"},model:{value:(_vm.outputProfile.draft),callback:function ($$v) {_vm.$set(_vm.outputProfile, \"draft\", $$v)},expression:\"outputProfile.draft\"}},[_vm._v(\"Draft - Not Reviewed by KPMG\")])],1)],1),(_vm.tabIndex === 0)?_c('b-col',[_c('b-form-group',{staticClass:\"mb-0\",attrs:{\"label\":\"90-day Dividend Layout\"}},[_c('b-form-radio',{attrs:{\"value\":\"v2\",\"data-cy\":\"v2\"},on:{\"change\":_vm.toggleRecharLayout},model:{value:(_vm.outputProfile.recharLayout),callback:function ($$v) {_vm.$set(_vm.outputProfile, \"recharLayout\", $$v)},expression:\"outputProfile.recharLayout\"}},[_vm._v(\"End of Current Year\")]),_c('b-form-radio',{attrs:{\"value\":\"v1\",\"data-cy\":\"v1\"},on:{\"change\":_vm.toggleRecharLayout},model:{value:(_vm.outputProfile.recharLayout),callback:function ($$v) {_vm.$set(_vm.outputProfile, \"recharLayout\", $$v)},expression:\"outputProfile.recharLayout\"}},[_vm._v(\"Beginning of Following Year\")])],1)],1):_vm._e(),(_vm.tabIndex === 1)?_c('b-col',[_c('b-form-group',{staticClass:\"mb-0\",attrs:{\"label\":\"By Entry - Sort\"}},[_c('b-form-select',{attrs:{\"options\":_vm.acbByEntrySortParam,\"disabled\":!_vm.outputProfile.showAcbOutput['adjustments-by-entry'],\"size\":\"sm\"},model:{value:(_vm.outputProfile.sortACBAdjustmentsByEntryColumn),callback:function ($$v) {_vm.$set(_vm.outputProfile, \"sortACBAdjustmentsByEntryColumn\", $$v)},expression:\"outputProfile.sortACBAdjustmentsByEntryColumn\"}}),_c('b-form-checkbox',{attrs:{\"value\":true,\"unchecked-value\":false,\"disabled\":!_vm.outputProfile.showAcbOutput['adjustments-by-entry']},model:{value:(\n _vm.outputProfile.isDescendingACBAdjustmentsByEntryColumn\n ),callback:function ($$v) {_vm.$set(_vm.outputProfile, \"isDescendingACBAdjustmentsByEntryColumn\", $$v)},expression:\"\\n outputProfile.isDescendingACBAdjustmentsByEntryColumn\\n \"}},[_vm._v(\"\\n Descending\\n \")])],1)],1):_vm._e(),_c('b-col',{attrs:{\"cols\":\"2\"}},[_c('modal-button',{attrs:{\"buttonLabel\":\"Section Settings\",\"buttonProps\":{\n class: 'text-secondary',\n variant: 'link',\n block: true,\n },\"modalProps\":{\n size: 'lg',\n 'no-close-on-backdrop': true,\n title: 'Section Settings',\n 'hide-footer': true,\n }},on:{\"show-modal-change\":function ($event) { return (_vm.showDraggable = $event); }},scopedSlots:_vm._u([{key:\"buttonIcon\",fn:function(){return [_c('font-awesome-icon',{staticClass:\"text-secondary\",attrs:{\"icon\":\"cog\"}})]},proxy:true}])},[(_vm.tabIndex === 0)?_c('div',[_c('b-row',[_c('b-col',[_c('p',{staticClass:\"font-weight-light\"},[_vm._v(\"\\n Select the sections to display in output.\\n \")]),_c('b-button-group',{attrs:{\"size\":\"sm\"}},[_c('b-button',{attrs:{\"variant\":\"outline-secondary\"},on:{\"click\":function($event){_vm.toggleAllSections(true)\n _vm.toggleRecharLayout(_vm.outputProfile.recharLayout)}}},[_vm._v(\"Select All\")]),_c('b-button',{attrs:{\"variant\":\"outline-secondary\"},on:{\"click\":function($event){return _vm.toggleAllSections(false)}}},[_vm._v(\"Unselect All\")])],1)],1),_c('b-col',[_c('p',{staticClass:\"font-weight-light\"},[_vm._v(\"\\n Output Organization\\n \")]),_c('b-button-group',{attrs:{\"size\":\"sm\"}},[_c('b-button',{attrs:{\"variant\":\"outline-secondary\"},on:{\"click\":_vm.resetOrdering}},[_vm._v(\"Reset Ordering\")])],1)],1)],1),_c('hr'),_c('b-row',[_c('b-col',[(_vm.showDraggable)?_c('draggable',_vm._b({staticClass:\"list-group\",attrs:{\"tag\":\"div\",\"handle\":\".handle\",\"group\":\"section\"},model:{value:(_vm.sectionHierarchyDraggable),callback:function ($$v) {_vm.sectionHierarchyDraggable=$$v},expression:\"sectionHierarchyDraggable\"}},'draggable',_vm.dragOptions,false),_vm._l((_vm.sectionHierarchyDraggable),function(section){return _c('div',{key:section.id},[_c('b-row',{staticClass:\"border-bottom m-2\"},[_c('b-col',[_c('b-form-checkbox',{key:_vm.outputProfile.showSection[section.id],on:{\"change\":function (e) { return _vm.toggleChildren(section, e); }},model:{value:(_vm.outputProfile.showSection[section.id]),callback:function ($$v) {_vm.$set(_vm.outputProfile.showSection, section.id, $$v)},expression:\"outputProfile.showSection[section.id]\"}},[_vm._v(_vm._s(section.label))])],1),(_vm.showSection(section))?_c('b-col',{directives:[{name:\"b-toggle\",rawName:\"v-b-toggle\",value:(((section.id) + \"-collapse\")),expression:\"`${section.id}-collapse`\"}],staticClass:\"text-primary\",attrs:{\"cols\":\"2\"}},[_c('font-awesome-icon',{staticClass:\"when-closed float-right\",attrs:{\"icon\":\"plus-circle\"}}),_c('font-awesome-icon',{staticClass:\"when-opened float-right\",attrs:{\"icon\":\"minus-circle\"}})],1):_vm._e(),_c('font-awesome-icon',{staticClass:\"float-right handle text-secondary\",attrs:{\"icon\":\"bars\"}})],1),(_vm.showSection(section))?_c('b-collapse',{attrs:{\"id\":((section.id) + \"-collapse\"),\"accordion\":\"top-accordion\"}},[(_vm.showDraggable)?_c('draggable',_vm._b({staticClass:\"list-group2\",attrs:{\"tag\":\"div\",\"handle\":\".handle\",\"group\":\"sectionChildren\"},model:{value:(section.children),callback:function ($$v) {_vm.$set(section, \"children\", $$v)},expression:\"section.children\"}},'draggable',_vm.dragOptions,false),_vm._l((section.children),function(section){return _c('div',{key:section.id,staticClass:\"pl-3 pr-3\"},[_c('b-row',{staticClass:\"border-bottom m-2\"},[_c('b-col',[_c('b-form-checkbox',{key:_vm.outputProfile.showSection[section.id],on:{\"change\":function (e) { return _vm.toggleChildren(section, e); }},model:{value:(\n _vm.outputProfile.showSection[section.id]\n ),callback:function ($$v) {_vm.$set(_vm.outputProfile.showSection, section.id, $$v)},expression:\"\\n outputProfile.showSection[section.id]\\n \"}},[_vm._v(_vm._s(section.label))])],1),(_vm.showSection(section))?_c('b-col',{directives:[{name:\"b-toggle\",rawName:\"v-b-toggle\",value:(((section.id) + \"-collapse\")),expression:\"`${section.id}-collapse`\"}],staticClass:\"text-primary\",attrs:{\"cols\":\"2\"}},[_c('font-awesome-icon',{staticClass:\"when-closed float-right\",attrs:{\"icon\":\"plus-circle\"}}),_c('font-awesome-icon',{staticClass:\"when-opened float-right\",attrs:{\"icon\":\"minus-circle\"}})],1):_vm._e(),_c('font-awesome-icon',{staticClass:\"float-right handle text-secondary\",attrs:{\"icon\":\"bars\"}})],1),(_vm.showSection(section))?_c('b-collapse',{attrs:{\"id\":((section.id) + \"-collapse\")}},_vm._l((section.children),function(section){return (\n section.label !== undefined &&\n (section.recharLayout ===\n _vm.outputProfile.recharLayout ||\n section.recharLayout === undefined)\n )?_c('div',{key:section.id,staticClass:\"pl-3 pr-3\"},[_c('b-row',{staticClass:\"m-2\"},[_c('b-col',[_c('b-form-checkbox',{key:_vm.outputProfile.showSection[\n section.id\n ],on:{\"change\":function (e) { return _vm.toggleChildren(section, e); }},model:{value:(\n _vm.outputProfile.showSection[\n section.id\n ]\n ),callback:function ($$v) {_vm.$set(_vm.outputProfile.showSection, \n section.id\n , $$v)},expression:\"\\n outputProfile.showSection[\\n section.id\\n ]\\n \"}},[_vm._v(_vm._s(section.label))])],1),(_vm.showSection(section))?_c('b-col',{directives:[{name:\"b-toggle\",rawName:\"v-b-toggle\",value:(((section.id) + \"-collapse\")),expression:\"`${section.id}-collapse`\"}],staticClass:\"text-primary\",attrs:{\"cols\":\"2\"}},[_c('font-awesome-icon',{staticClass:\"when-closed float-right\",attrs:{\"icon\":\"plus-circle\"}}),_c('font-awesome-icon',{staticClass:\"when-opened float-right\",attrs:{\"icon\":\"minus-circle\"}})],1):_vm._e()],1),(_vm.showSection(section))?_c('b-collapse',{attrs:{\"id\":((section.id) + \"-collapse\")}},_vm._l((section.children),function(section){return (section.label !== undefined)?_c('div',{key:section.id,staticClass:\"pl-3\"},[_c('b-row',{staticClass:\"m-2\"},[_c('b-col',[_c('b-form-checkbox',{key:_vm.outputProfile.showSection[\n section.id\n ],model:{value:(\n _vm.outputProfile.showSection[\n section.id\n ]\n ),callback:function ($$v) {_vm.$set(_vm.outputProfile.showSection, \n section.id\n , $$v)},expression:\"\\n outputProfile.showSection[\\n section.id\\n ]\\n \"}},[_vm._v(_vm._s(section.label))])],1)],1)],1):_vm._e()}),0):_vm._e()],1):_vm._e()}),0):_vm._e()],1)}),0):_vm._e()],1):_vm._e()],1)}),0):_vm._e()],1)],1)],1):(_vm.tabIndex === 1)?_vm._l((_vm.outputACBCalculator),function(sections){return _c('div',{key:(\"row-\" + (sections.id))},[_c('b-row',{staticClass:\"border-bottom m-2\"},[_c('b-col',[_c('b-form-checkbox',{key:(\"checkbox-\" + (sections.id)),model:{value:(_vm.outputProfile.showAcbOutput[sections.id]),callback:function ($$v) {_vm.$set(_vm.outputProfile.showAcbOutput, sections.id, $$v)},expression:\"outputProfile.showAcbOutput[sections.id]\"}},[_vm._v(\"\\n \"+_vm._s(sections.name)+\"\\n \")])],1)],1)],1)}):_vm._e()],2)],1)],1)],1),_c('b-col',{attrs:{\"cols\":\"2\"}},[(_vm.tabIndex === 0)?_c('b-button',{attrs:{\"variant\":\"primary\",\"block\":\"\",\"data-cy\":\"export-button\"},on:{\"click\":_vm.exportPdf}},[_vm._v(\"Create PDF\")]):(_vm.tabIndex === 1)?_c('b-button',{attrs:{\"variant\":\"primary\",\"block\":\"\"},on:{\"click\":function($event){return _vm.exportACBPdf(_vm.outputProfile)}}},[_vm._v(\"Create PDF\\n \")]):_vm._e()],1)],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","// tslint:disable\r\n\r\nconst outputFields: any[] = [\r\n {\r\n name: \"Summary of Surplus Balances\",\r\n tabName: \"Summary of Surplus Balances\",\r\n id: \"summary-balances\",\r\n subSections: [\r\n {\r\n name: \"Summary of Closing Surplus Balances (90-Day Rule Considered)\",\r\n id: \"summary-closing\",\r\n fields: [\r\n {\r\n desc: \"Exempt Surplus/(Deficit)\",\r\n type: \"closingAfterRechar\",\r\n metaId: \"exemptBalance\",\r\n printId: \"exempt_surplus_deficit.0.0.0\",\r\n },\r\n {\r\n desc: \"Hybrid Surplus/(Deficit)\",\r\n type: \"closingAfterRechar\",\r\n metaId: \"hybridBalance\",\r\n printId: \"hybrid_surplus_deficit.0.0.1\",\r\n },\r\n {\r\n desc: \"Taxable Surplus/(Deficit)\",\r\n type: \"closingAfterRechar\",\r\n metaId: \"taxableBalance\",\r\n printId: \"taxable_surplus_deficit.0.0.2\",\r\n },\r\n {\r\n desc: \"Net Surplus/(Deficit)\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"closingAfterRechar\",\r\n metaId: \"netBalance\",\r\n printId: \"net_surplus_deficit.0.0.3\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"HUT balance\",\r\n type: \"closingAfterRechar\",\r\n metaId: \"hutBalance\",\r\n printId: \"hut_balance.0.0.4\",\r\n },\r\n {\r\n desc: \"UFT balance\",\r\n type: \"closingAfterRechar\",\r\n metaId: \"uftBalance\",\r\n printId: \"uft_balance.0.0.5\",\r\n },\r\n ],\r\n printId:\r\n \"summary_of_closing_surplus_balances_90_day_rule_considered.0.0\",\r\n },\r\n {\r\n name:\r\n \"Summary of Closing Surplus Balances (90-Day Rule NOT Considered)\",\r\n id: \"summary-closing-90-days\",\r\n fields: [\r\n {\r\n desc: \"Exempt Surplus/(Deficit)\",\r\n type: \"closing\",\r\n metaId: \"exemptBalance\",\r\n printId: \"exempt_surplus_deficit.0.1.0\",\r\n },\r\n {\r\n desc: \"Hybrid Surplus/(Deficit)\",\r\n type: \"closing\",\r\n metaId: \"hybridBalance\",\r\n printId: \"hybrid_surplus_deficit.0.1.1\",\r\n },\r\n {\r\n desc: \"Taxable Surplus/(Deficit)\",\r\n type: \"closing\",\r\n metaId: \"taxableBalance\",\r\n printId: \"taxable_surplus_deficit.0.1.2\",\r\n },\r\n {\r\n desc: \"Net Surplus/(Deficit)\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"closing\",\r\n metaId: \"netBalance\",\r\n printId: \"net_surplus_deficit.0.1.3\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"HUT balance\",\r\n type: \"closing\",\r\n metaId: \"hutBalance\",\r\n printId: \"hut_balance.0.1.4\",\r\n },\r\n {\r\n desc: \"UFT balance\",\r\n type: \"closing\",\r\n metaId: \"uftBalance\",\r\n printId: \"uft_balance.0.1.5\",\r\n },\r\n ],\r\n printId:\r\n \"summary_of_closing_surplus_balances_90_day_rule_not_considered.0.1\",\r\n },\r\n {\r\n name: \"Summary of Exempt Surplus Balance\",\r\n id: \"summary-exempt\",\r\n fields: [\r\n {\r\n desc: \"Opening Exempt Surplus/(Deficit)\",\r\n metaId: \"exemptBalance\",\r\n type: \"opening\",\r\n cellClass: \"text-primary font-weight-bold\",\r\n printId: \"v1_opening_exempt_surplus_balance.0.2.0\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"v1_less.0.2.0\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc:\r\n \"Recharacterized pre-acquisition surplus dividend(s) paid in prior year\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"summary_es\", \"rechar_preacq_dividend_paid_by\"],\r\n printId:\r\n \"v1_recharacterized_pre_acq_dividend_paid_in_prior_year.0.2.1\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Adjusted Opening Exempt Surplus/(Deficit)\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"summary_es\", \"adjusted_opening\"],\r\n printId: \"v1_adjusted_opening_exempt_surplus_deficit.0.2.2\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Opening Exempt Surplus/(Deficit)\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n path: [\"summary_es\", \"adjusted_opening\"],\r\n printId: \"v2_opening_exempt_surplus_deficit.0.2.2\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Add\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"add.0.2.1\",\r\n },\r\n {\r\n desc:\r\n \"Dividend(s) from exempt surplus of another foreign affiliate or deductible under section 112\",\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n path: [\r\n \"summary_es\",\r\n \"dividends_received_from_es_of_another_fa_or_s112\",\r\n ],\r\n printId:\r\n \"dividends_from_es_of_other_fa_or_deductible_under_s_112.0.2.3\",\r\n },\r\n {\r\n desc: \"Other adjustment(s) to exempt surplus\",\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n path: [\"summary_es\", \"other_adjustments\"],\r\n printId: \"other_adjustments_to_es.0.2.4\",\r\n },\r\n {\r\n desc: \"Total Adjustments Before Exempt Surplus Dividend(s) Paid\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"calculated\",\r\n path: [\"summary_es\", \"total_adjustments_before_dividends_paid\"],\r\n printId: \"total_adjustments_before_exempt_dividends_paid.0.2.5\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Adjusted Exempt Surplus/(Deficit) Before Dividend(s) Paid\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"calculated\",\r\n path: [\"summary_es\", \"adjusted_surplus_before_dividends_paid\"],\r\n printId:\r\n \"adjusted_exempt_surplus_deficit_before_dividends_paid.0.2.6\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"less.0.2.2\",\r\n },\r\n {\r\n desc:\r\n \"Dividend(s) paid or deemed to have been paid out of exempt surplus\",\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n path: [\"summary_es\", \"dividends_paid\"],\r\n printId:\r\n \"dividends_paid_or_deemed_to_have_been_paid_out_from_es.0.2.7\",\r\n },\r\n {\r\n desc:\r\n \"Total Exempt Surplus/(Deficit) Before Exempt Earnings/(Loss)\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"calculated\",\r\n path: [\"summary_es\", \"total_surplus_before_earnings\"],\r\n printId:\r\n \"total_exempt_surplus_deficit_before_exempt_earnings_loss.0.2.8\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Exempt Earnings/(Loss) for the Year\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"summary_es\", \"earnings_cy\"],\r\n printId: \"exempt_earnings_loss_for_the_year.0.2.9\",\r\n },\r\n {\r\n desc: \"Closing Exempt Surplus/(Deficit)\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n metaId: \"exemptBalance\",\r\n type: \"closing\",\r\n printId: \"v1_exempt_surplus_deficit_ending_balance.0.2.10\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc:\r\n \"Exempt Surplus/(Deficit) - Ending Balance Before Recharacterized Dividend(s)\",\r\n cellClass: \"font-weight-bold\",\r\n metaId: \"exemptBalance\",\r\n type: \"closing\",\r\n printId: \"v2_exempt_surplus_deficit_ending_balance.0.2.10\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"v2_less.0.2.0\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Recharacterized pre-acquisition surplus dividend(s) paid\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"summary_es\", \"rechar_preacq_dividend_paid_by_2\"],\r\n printId:\r\n \"v2_recharacterized_pre_acq_dividend_paid_in_prior_year.0.2.1\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Closing Exempt Surplus/(Deficit)\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n metaId: \"exemptBalance\",\r\n type: \"closingAfterRechar\",\r\n printId: \"v2_exempt_surplus_deficit_ending_balance.0.2.11\",\r\n recharLayout: \"v2\",\r\n },\r\n ],\r\n printId: \"summary_of_exempt_surplus_balance.0.2\",\r\n },\r\n {\r\n name: \"Summary of Hybrid Surplus Balance\",\r\n id: \"summary-hybrid\",\r\n fields: [\r\n {\r\n desc: \"Opening Hybrid Surplus/(Deficit)\",\r\n metaId: \"hybridBalance\",\r\n type: \"opening\",\r\n cellClass: \"text-primary font-weight-bold\",\r\n printId: \"v1_opening_hybrid_surplus_balance.0.3.0\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"v1_less.0.3.0\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc:\r\n \"Recharacterized pre-acquisition surplus dividend(s) paid in prior year\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"summary_hs\", \"rechar_preacq_dividend_paid_by\"],\r\n printId:\r\n \"v1_recharacterized_pre_acq_dividend_paid_in_prior_year.0.3.1\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Adjusted Opening Hybrid Surplus/(Deficit)\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"summary_hs\", \"adjusted_opening\"],\r\n printId: \"v1_opening_hybrid_surplus_deficit.0.3.2\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Opening Hybrid Surplus/(Deficit)\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold text-primary \",\r\n path: [\"summary_hs\", \"adjusted_opening\"],\r\n printId: \"v2_opening_hybrid_surplus_deficit.0.3.2\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Add\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"add.0.3.1\",\r\n },\r\n {\r\n desc:\r\n \"Dividend(s) from hybrid surplus of another foreign affiliate\",\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n path: [\"summary_hs\", \"dividends_received_from_hs\"],\r\n printId: \"dividends_from_hs_of_other_fa.0.3.3\",\r\n },\r\n {\r\n desc: \"Other adjustment(s) to hybrid surplus\",\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n path: [\"summary_hs\", \"other_adjustments\"],\r\n printId: \"other_adjustments_to_hs.0.3.4\",\r\n },\r\n {\r\n desc: \"Total Adjustments Before Hybrid Surplus Dividend(s) Paid\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"calculated\",\r\n path: [\"summary_hs\", \"total_adjustments_before_dividends_paid\"],\r\n printId: \"total_adjustments_before_hybrid_dividends_paid.0.3.5\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Adjusted Hybrid Surplus/(Deficit) Before Dividend(s) Paid\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"calculated\",\r\n path: [\"summary_hs\", \"adjusted_surplus_before_dividends_paid\"],\r\n printId:\r\n \"adjusted_hybrid_surplus_deficit_before_dividends_paid.0.3.6\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"less.0.3.2\",\r\n },\r\n {\r\n desc:\r\n \"Dividend(s) paid or deemed to have been paid out of hybrid surplus\",\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n path: [\"summary_hs\", \"dividends_paid\"],\r\n printId:\r\n \"dividends_paid_or_deemed_to_have_been_paid_out_from_hs.0.3.7\",\r\n },\r\n {\r\n desc: \"Closing Hybrid Surplus/(Deficit)\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n metaId: \"hybridBalance\",\r\n type: \"closing\",\r\n printId: \"v1_hybrid_surplus_deficit_ending_balance.0.3.8\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc:\r\n \"Hybrid Surplus/(Deficit) - Ending Balance Before Recharacterized Dividend(s)\",\r\n cellClass: \"font-weight-bold\",\r\n metaId: \"hybridBalance\",\r\n type: \"closing\",\r\n printId: \"v2_hybrid_surplus_deficit_ending_balance.0.3.8\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"v2_less.0.3.0\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Recharacterized pre-acquisition surplus dividend(s) paid\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"summary_hs\", \"rechar_preacq_dividend_paid_by_2\"],\r\n printId:\r\n \"v2_recharacterized_pre_acq_dividend_paid_in_prior_year.0.3.1\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Closing Hybrid Surplus/(Deficit)\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n metaId: \"hybridBalance\",\r\n type: \"closingAfterRechar\",\r\n printId: \"v2_hybrid_surplus_deficit_ending_balance.0.3.9\",\r\n recharLayout: \"v2\",\r\n },\r\n ],\r\n printId: \"summary_of_hybrid_surplus_balance.0.3\",\r\n },\r\n {\r\n name: \"Summary of Taxable Surplus Balance\",\r\n id: \"summary-taxable\",\r\n fields: [\r\n {\r\n desc: \"Opening Taxable Surplus/(Deficit)\",\r\n metaId: \"taxableBalance\",\r\n type: \"opening\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n printId: \"v1_opening_taxable_surplus_balance.0.4.0\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"v1_less.0.4.0\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc:\r\n \"Recharacterized pre-acquisition surplus dividend(s) paid in prior year\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"summary_ts\", \"rechar_preacq_dividend_paid_by\"],\r\n printId:\r\n \"v1_recharacterized_pre_acq_dividend_paid_in_prior_year.0.4.1\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Adjusted Opening Taxable Surplus/(Deficit)\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"summary_ts\", \"adjusted_opening\"],\r\n printId: \"v1_opening_taxable_surplus_deficit.0.4.2\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Opening Taxable Surplus/(Deficit)\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n path: [\"summary_ts\", \"adjusted_opening\"],\r\n printId: \"v2_opening_taxable_surplus_deficit.0.4.2\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Add\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"add.0.4.1\",\r\n },\r\n {\r\n desc:\r\n \"Dividend(s) from taxable surplus of another foreign affiliate\",\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n path: [\"summary_ts\", \"dividends_recieved_from_ts\"],\r\n printId: \"dividends_from_ts_of_other_fa.0.4.3\",\r\n },\r\n {\r\n desc: \"Other adjustment(s) to taxable surplus\",\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n path: [\"summary_ts\", \"other_adjustments\"],\r\n printId: \"other_adjustments_to_ts.0.4.4\",\r\n },\r\n {\r\n desc: \"Total Adjustments Before Taxable Surplus Dividend(s) Paid\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"calculated\",\r\n path: [\"summary_ts\", \"total_adjustments_before_dividends_paid\"],\r\n printId: \"total_adjustments_before_taxable_dividends_paid.0.4.5\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Adjusted Taxable Surplus/(Deficit) Before Dividend(s) Paid\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"calculated\",\r\n path: [\"summary_ts\", \"adjusted_surplus_before_dividends_paid\"],\r\n printId:\r\n \"adjusted_taxable_surplus_deficit_before_dividends_paid.0.4.6\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"less.0.4.2\",\r\n },\r\n {\r\n desc:\r\n \"Dividend(s) paid or deemed to have been paid out of taxable surplus\",\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n path: [\"summary_ts\", \"dividends_paid\"],\r\n printId:\r\n \"dividends_paid_or_deemed_to_have_been_paid_out_from_ts.0.4.7\",\r\n },\r\n {\r\n desc:\r\n \"Total Taxable Surplus/(Deficit) Before Taxable Earnings/(Loss)\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"calculated\",\r\n path: [\"summary_ts\", \"total_surplus_before_earnings\"],\r\n printId:\r\n \"total_taxable_surplus_deficit_before_taxable_earnings_loss.0.4.8\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Taxable Earnings/(Loss) for the Year\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"summary_ts\", \"earnings_cy\"],\r\n printId: \"taxable_earnings_loss_for_the_year.0.4.9\",\r\n },\r\n {\r\n desc: \"Closing Taxable Surplus/(Deficit)\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n metaId: \"taxableBalance\",\r\n type: \"closing\",\r\n printId: \"v1_taxable_surplus_deficit_ending_balance.0.4.10\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc:\r\n \"Taxable Surplus/(Deficit) - Ending Balance Before Recharacterized Dividend(s)\",\r\n cellClass: \"font-weight-bold\",\r\n metaId: \"taxableBalance\",\r\n type: \"closing\",\r\n printId: \"v2_taxable_surplus_deficit_ending_balance.0.4.10\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"v2_less.0.4.0\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Recharacterized pre-acquisition surplus dividend(s) paid\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"summary_ts\", \"rechar_preacq_dividend_paid_by_2\"],\r\n printId:\r\n \"v2_recharacterized_pre_acq_dividend_paid_in_prior_year.0.4.1\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Closing Taxable Surplus/(Deficit)\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n metaId: \"taxableBalance\",\r\n type: \"closingAfterRechar\",\r\n printId: \"v2_taxable_surplus_deficit_ending_balance.0.4.11\",\r\n recharLayout: \"v2\",\r\n },\r\n ],\r\n printId: \"summary_of_taxable_surplus_balance.0.4\",\r\n },\r\n {\r\n name: \"Summary of HUT Balance\",\r\n id: \"summary-hut\",\r\n fields: [\r\n {\r\n desc: \"Opening HUT\",\r\n metaId: \"hutBalance\",\r\n type: \"opening\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n printId: \"v1_opening_hut_balance.0.5.0\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"v1_less.0.5.0\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"HUT applicable to the recharacterized 90-day dividend(s)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"summary_hut\", \"rechar_preacq_dividend_paid_by\"],\r\n printId:\r\n \"v1_hut_applicable_to_the_recharacterized_90_day_dividend.0.5.1\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Adjusted Opening HUT\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"summary_hut\", \"adjusted_opening\"],\r\n printId: \"v1_adjusted_opening_hut_balance.0.5.2\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Opening HUT\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n path: [\"summary_hut\", \"adjusted_opening\"],\r\n printId: \"v2_opening_hut_balance.0.5.2\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Add\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"add.0.5.1\",\r\n },\r\n {\r\n desc:\r\n \"HUT applicable to dividend(s) received from hybrid surplus of another foreign affiliate\",\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n path: [\"summary_hut\", \"hut_applicable_from_dividends\"],\r\n printId:\r\n \"hut_applicable_to_dividends_received_from_hybrid_surplus_of_another_fa.0.5.3\",\r\n },\r\n {\r\n desc: \"HUT applicable to capital gain(s)/(loss(es))\",\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n path: [\"summary_hut\", \"capital_gains\"],\r\n printId: \"hut_applicable_to_capital_gains_losses.0.5.4\",\r\n },\r\n {\r\n desc: \"Other adjustment(s) to HUT\",\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n path: [\"summary_hut\", \"other_adjustments\"],\r\n printId: \"other_adjustments_to_hut.0.5.5\",\r\n },\r\n {\r\n desc:\r\n \"Total Adjustments Before Allocation to Hybrid Surplus Dividend(s)\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"summary_hut\", \"total_adjustments_before_hybrid_dividends\"],\r\n printId:\r\n \"total_adjustments_before_allocations_to_hybrid_dividends.0.5.6\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc:\r\n \"Adjusted HUT Balance Before Allocation to Hybrid Surplus Dividend(s)\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"summary_hut\", \"total_adjustments_before_taxable_dividends\"],\r\n printId:\r\n \"adjusted_hut_balance_before_allocations_to_hybrid_surplus_dividends.0.5.7\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"less.0.5.2\",\r\n },\r\n {\r\n desc: \"HUT applicable to dividend(s) paid out of hybrid surplus\",\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n path: [\"summary_hut\", \"dividends_paid\"],\r\n printId:\r\n \"hut_applicable_to_dividends_paid_out_from_hybrid_surplus.0.5.8\",\r\n },\r\n {\r\n desc: \"Closing HUT\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n metaId: \"hutBalance\",\r\n type: \"closing\",\r\n printId: \"v1_hut_ending_balance.0.5.9\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"HUT - Ending Balance Before Recharacterized Dividend(s)\",\r\n cellClass: \"font-weight-bold\",\r\n metaId: \"hutBalance\",\r\n type: \"closing\",\r\n printId: \"v2_hut_ending_balance.0.5.9\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"v2_less.0.5.0\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc:\r\n \"HUT applicable to the recharacterized 90-day dividend(s) paid\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"summary_hut\", \"rechar_preacq_dividend_paid_by_2\"],\r\n printId:\r\n \"v2_hut_applicable_to_the_recharacterized_90_day_dividend.0.5.1\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Closing HUT\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n metaId: \"hutBalance\",\r\n type: \"closingAfterRechar\",\r\n printId: \"v2_hut_ending_balance.0.5.10\",\r\n recharLayout: \"v2\",\r\n },\r\n ],\r\n printId: \"summary_of_hut_balance.0.5\",\r\n },\r\n {\r\n name: \"Summary of UFT Balance\",\r\n id: \"summary-uft\",\r\n fields: [\r\n {\r\n desc: \"Opening UFT\",\r\n metaId: \"uftBalance\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n type: \"opening\",\r\n printId: \"v1_opening_uft_balance.0.6.0\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"v1_less.0.6.0\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"UFT applicable to the recharacterized 90-day dividend(s)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"summary_uft\", \"rechar_preacq_dividend_paid_by\"],\r\n printId:\r\n \"v1_uft_applicable_to_the_recharacterized_90_day_dividend.0.6.1\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Adjusted Opening UFT\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"summary_uft\", \"adjusted_opening\"],\r\n printId: \"v1_adjusted_opening_uft_balance.0.6.2\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Opening UFT\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n path: [\"summary_uft\", \"adjusted_opening\"],\r\n printId: \"v2_opening_uft_balance.0.6.2\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Add\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"add.0.6.1\",\r\n },\r\n {\r\n desc:\r\n \"UFT applicable to dividend(s) received from taxable surplus of another foreign affiliate\",\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n path: [\"summary_uft\", \"uft_applicable_from_dividends\"],\r\n printId:\r\n \"uft_applicable_to_dividends_received_from_taxable_surplus_of_another_fa.0.6.3\",\r\n },\r\n {\r\n desc: \"Other adjustment(s) to UFT\",\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n path: [\"summary_uft\", \"other_adjustments\"],\r\n printId: \"other_adjustments_to_uft.0.6.4\",\r\n },\r\n {\r\n desc:\r\n \"Total Adjustments Before Allocation to Taxable Surplus Dividends\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"calculated\",\r\n path: [\r\n \"summary_uft\",\r\n \"total_adjustments_before_allocation_to_taxable_dividends\",\r\n ],\r\n printId:\r\n \"total_adjustments_before_allocations_to_taxable_dividends.0.6.5\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc:\r\n \"Adjusted UFT Before Allocation to Taxable Surplus Dividend(s)\",\r\n type: \"calculated\",\r\n path: [\r\n \"summary_uft\",\r\n \"adjusted_uft_before_allocations_to_taxable_dividends\",\r\n ],\r\n cellClass: \"font-weight-bold\",\r\n printId:\r\n \"adjusted_uft_before_allocations_to_taxable_dividends.0.6.6\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"less.0.6.2\",\r\n },\r\n {\r\n desc: \"UFT applicable to dividend(s) paid out of taxable surplus\",\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n path: [\"summary_uft\", \"dividends_paid\"],\r\n printId:\r\n \"uft_applicable_to_dividends_paid_out_from_taxable_surplus.0.6.7\",\r\n },\r\n {\r\n desc: \"Total UFT Before Tax(es) Applicable to Taxable Earnings\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"calculated\",\r\n path: [\"summary_uft\", \"total_uft_before_taxable_earnings\"],\r\n printId:\r\n \"total_uft_before_taxes_applicable_to_taxable_earnings.0.6.8\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Tax(es) Applicable to Taxable Earnings for the Year\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"summary_uft\", \"taxes_applicable_to_taxable_earnings\"],\r\n printId: \"taxes_applicable_to_taxable_earnings_for_the_year.0.6.9\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Closing UFT\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n metaId: \"uftBalance\",\r\n type: \"closing\",\r\n printId: \"v1_uft_ending_balance.0.6.10\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"UFT - Ending Balance Before Recharacterized Dividend(s)\",\r\n cellClass: \"font-weight-bold\",\r\n metaId: \"uftBalance\",\r\n type: \"closing\",\r\n printId: \"v2_uft_ending_balance.0.6.10\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"v2_less.0.6.0\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc:\r\n \"UFT applicable to the recharacterized 90-day dividend(s) paid\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"summary_uft\", \"rechar_preacq_dividend_paid_by_2\"],\r\n printId:\r\n \"v2_uft_applicable_to_the_recharacterized_90_day_dividend.0.6.1\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Closing UFT\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n metaId: \"uftBalance\",\r\n type: \"closingAfterRechar\",\r\n printId: \"v2_uft_ending_balance.0.6.11\",\r\n recharLayout: \"v2\",\r\n },\r\n ],\r\n printId: \"summary_of_uft_balance.0.6\",\r\n },\r\n ],\r\n printId: \"summary_of_balances.0\",\r\n },\r\n {\r\n name: \"Summary of Dividends\",\r\n tabName: \"Summary of Dividends\",\r\n id: \"summary-dividends-header\",\r\n subSections: [\r\n {\r\n name: \"Dividends Received\",\r\n id: \"summary-dividends-received\",\r\n fields: [\r\n {\r\n desc: \"Summary of Dividends Received\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"blank\",\r\n printId: \"summary_of_dividends_received.1.0.0\",\r\n },\r\n {\r\n desc: \"Exempt Surplus Dividend(s)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"summary_d\", \"exempt_dividends_received\"],\r\n printId: \"exempt_surplus_dividends.1.1.0\",\r\n },\r\n {\r\n desc: \"Hybrid Surplus Dividend(s)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"summary_d\", \"hybrid_dividends_received\"],\r\n printId: \"hybrid_surplus_dividends.1.1.1\",\r\n },\r\n {\r\n desc: \"Taxable Surplus Dividend(s)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"summary_d\", \"taxable_dividends_received\"],\r\n printId: \"taxable_surplus_dividends.1.1.2\",\r\n },\r\n {\r\n desc: \"Total Dividends Received\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"calculated\",\r\n path: [\"summary_d\", \"total_dividends_received_from_accounts\"],\r\n printId: \"subtotal.1.1.3\",\r\n },\r\n ],\r\n printId: \"dividends_received.1.0\",\r\n },\r\n {\r\n name: \"Dividend(s) Paid\",\r\n id: \"summary-dividends-paid\",\r\n fields: [\r\n {\r\n desc:\r\n \"Total Dividend(s) Paid or Deemed to have been Paid During the Year\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"blank\",\r\n printId:\r\n \"total_dividends_paid_or_deemed_to_have_been_paid_during_the_year.1.1.0\",\r\n },\r\n {\r\n desc: \"Total dividend(s) paid in the year\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"summary_d\", \"dividends_paid_tax_year\"],\r\n printId: \"total_dividend_paid_in_tax_year.1.0.0\",\r\n },\r\n {\r\n desc: \"Deemed dividend(s) paid - section 93(1) or (1.1)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"summary_d\", \"deemed_dividends_paid_s93_or_11\"],\r\n printId: \"deemed_dividends_paid_s_93_1_or_1_1.1.0.1\",\r\n },\r\n {\r\n desc: \"Total Dividend(s) Paid or Deemed Paid During the Year\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"calculated\",\r\n path: [\"summary_d\", \"total_dividends_paid\"],\r\n printId:\r\n \"total_dividends_paid_or_deemed_paid_during_the_year.1.0.2\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc:\r\n \"Summary of Dividend(s) Paid in the Year out of Various Surplus Accounts (90-day Rule Considered)\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"blank\",\r\n printId:\r\n \"summary_of_dividends_paid_in_the_year_out_of_various_surplus_accounts_90_day_rule_considered.1.1.1\",\r\n },\r\n {\r\n desc: \"Exempt Surplus Dividend(s)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"summary_d\", \"exempt_dividends\"],\r\n printId: \"exempt_surplus_dividends.1.0.3\",\r\n },\r\n {\r\n desc: \"Hybrid Surplus Dividend(s)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"summary_d\", \"hybrid_dividends\"],\r\n printId: \"hybrid_surplus_dividends.1.0.4\",\r\n },\r\n {\r\n desc: \"Taxable Surplus Dividend(s)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"summary_d\", \"taxable_dividends\"],\r\n printId: \"taxable_surplus_dividends.1.0.5\",\r\n },\r\n {\r\n desc: \"Subtotal\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"calculated\",\r\n path: [\"summary_d\", \"total_dividends_from_accounts\"],\r\n printId: \"subtotal.1.0.6\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"HUT applicable to hybrid surplus dividend(s)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"summary_d\", \"hut_dividends\"],\r\n printId: \"hut_applicable_to_hybrid_surplus_dividends.1.0.7\",\r\n },\r\n {\r\n desc: \"UFT applicable to taxable surplus dividend(s)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"summary_d\", \"uft_dividends\"],\r\n printId: \"uft_applicable_to_taxable_surplus_dividends.1.0.8\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc:\r\n \"Summary of Pre-Acquisition Surplus Dividend(s) Paid During the Year\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"blank\",\r\n printId:\r\n \"summary_of_pre_acquisition_surplus_dividends_paid_during_the_year.1.1.2\",\r\n },\r\n {\r\n desc:\r\n \"Total pre-acquisition surplus dividend(s) (before 90-Day Rule)\",\r\n cellClass: \"\",\r\n type: \"calculated\",\r\n path: [\"summary_d\", \"preacq_dividends\"],\r\n printId:\r\n \"total_pre_acquisition_surplus_dividends_before_90_day_rule.1.0.9\",\r\n },\r\n {\r\n desc:\r\n \"Less: recharacterized pre-acquisition surplus dividend(s) (90-Day Rule)\",\r\n cellClass: \"\",\r\n type: \"calculated\",\r\n path: [\"summary_d\", \"dividends_paid_90_days\"],\r\n printId:\r\n \"less_recharacterized_pre_acquisition_dividends_90_day_rule.1.0.10\",\r\n },\r\n {\r\n desc: \"Net pre-acquisition surplus dividend(s)\",\r\n cellClass: \"\",\r\n type: \"calculated\",\r\n path: [\"summary_d\", \"net_preacq_dividends\"],\r\n printId:\r\n \"net_pre_acquisition_surplus_dividends_to_adjust_the_acb_of_shares.1.0.11\",\r\n },\r\n ],\r\n printId: \"dividends_paid.1.1\",\r\n },\r\n ],\r\n printId: \"summary_of_dividends.1\",\r\n },\r\n {\r\n name: \"Computation of Income/(Loss)\",\r\n tabName: \"Computation of Income/(Loss)\",\r\n id: \"computation-of-income-loss\",\r\n subSections: [\r\n {\r\n name: \"Earnings from an Active Business\",\r\n id: \"summary-exempt-earnings\",\r\n fields: [\r\n {\r\n metaId: \"taxable_income_per_foreign_tax_return\",\r\n desc: \"Taxable Income/(Loss) per Foreign Tax Return\",\r\n type: \"input\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"taxable_income_loss_per_foreign_tax_return.2.0.0\",\r\n },\r\n {\r\n type: \"blank\",\r\n desc: \"Less:\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"less.2.0.0\",\r\n },\r\n {\r\n metaId: \"income_recharacterized_foreign_tax_rules\",\r\n desc: \"(Income)/loss that would be recharacterized\",\r\n cellClass: \"indent-4\",\r\n type: \"input\",\r\n printId: \"income_loss_that_would_be_recharacterized.2.0.1\",\r\n },\r\n {\r\n desc:\r\n \"Adjustments for Items that are not Included in Earnings or are Nil\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"blank\",\r\n printId:\r\n \"change_to_adjustments_for_items_that_are_not_included_in_earnings_or_are_nil.2.0.1\",\r\n },\r\n {\r\n desc:\r\n \"Dividend(s) from other foreign affiliates included in taxable income (-)\",\r\n metaId: \"dividends_from_other_fas\",\r\n cellClass: \"indent-4\",\r\n type: \"input\",\r\n printId:\r\n \"dividends_from_other_f_as_included_in_taxable_income.2.0.2\",\r\n },\r\n {\r\n desc: \"(Income)/loss of other companies included above\",\r\n metaId: \"income_of_other_companies\",\r\n cellClass: \"indent-4\",\r\n type: \"input\",\r\n printId: \"income_loss_of_other_companies_included_above.2.0.3\",\r\n },\r\n {\r\n desc: \"Foreign imputed income (-)\",\r\n metaId: \"foreign_imputed_income\",\r\n cellClass: \"indent-4\",\r\n type: \"input\",\r\n printId: \"foreign_imputed_income.2.0.4\",\r\n },\r\n {\r\n desc: \"Other adjustment(s)\",\r\n metaId: \"other_adjustments_not_earnings_nil\",\r\n cellClass: \"indent-4\",\r\n type: \"input\",\r\n printId: \"other_adjustments.2.0.5\",\r\n },\r\n {\r\n desc: \"Total Adjustments\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"calculated_efab\", \"calculated_efab_total_adjustments\"],\r\n printId: \"total_adjustments.2.0.6\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n type: \"blank\",\r\n desc: \"Additions\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"additions.2.0.2\",\r\n },\r\n {\r\n type: \"input\",\r\n desc: \"Income/profits tax deducted from earnings\",\r\n metaId: \"income_tax_deducted_from_earnings\",\r\n cellClass: \"indent-4\",\r\n printId: \"income_profits_tax_deducted_from_earnings.2.0.7\",\r\n },\r\n {\r\n type: \"input\",\r\n desc:\r\n \"Deduction(s) claimed for tax in excess of actual expenditure\",\r\n metaId: \"deductions_claimed_for_tax\",\r\n cellClass: \"indent-4\",\r\n printId:\r\n \"deductions_claimed_for_tax_in_excess_of_actual_expenditure.2.0.8\",\r\n },\r\n {\r\n type: \"input\",\r\n desc: \"Loss(es) from non-active business or property\",\r\n metaId: \"losses_from_non_abi_or_property\",\r\n cellClass: \"indent-4\",\r\n printId: \"losses_from_non_abi_or_property.2.0.9\",\r\n },\r\n {\r\n type: \"input\",\r\n desc: \"Capital loss(es) deducted\",\r\n metaId: \"capital_loss_deducted\",\r\n cellClass: \"indent-4\",\r\n printId: \"capital_loss_deducted.2.0.10\",\r\n },\r\n {\r\n type: \"input\",\r\n desc: \"Loss(es) deducted from prior or subsequent year\",\r\n metaId: \"losses_deducted_from_prior\",\r\n cellClass: \"indent-4\",\r\n printId: \"losses_deducted_from_prior_or_subsequent_year.2.0.11\",\r\n },\r\n {\r\n type: \"input\",\r\n desc: \"Revenue/income earned but not included\",\r\n metaId: \"income_not_included\",\r\n cellClass: \"indent-4\",\r\n printId: \"revenue_income_earned_but_not_included.2.0.12\",\r\n },\r\n {\r\n type: \"input\",\r\n desc: \"Government assistance not taxed\",\r\n metaId: \"government_assistance_not_taxed\",\r\n cellClass: \"indent-4\",\r\n printId: \"government_assistance_not_taxed.2.0.13\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n type: \"blank\",\r\n desc: \"Deductions\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"deductions.2.0.3\",\r\n },\r\n {\r\n type: \"input\",\r\n desc: \"Income or profits tax refunded and included in earnings\",\r\n metaId: \"income_tax_refunded_and_included_in_earnings\",\r\n cellClass: \"indent-4\",\r\n printId:\r\n \"income_or_profits_tax_refunded_and_included_in_earnings.2.0.14\",\r\n },\r\n {\r\n type: \"input\",\r\n desc: \"Capital gain(s) included\",\r\n metaId: \"capital_gain_included\",\r\n cellClass: \"indent-4\",\r\n printId: \"capital_gain_included.2.0.15\",\r\n },\r\n {\r\n type: \"input\",\r\n desc: \"FAPI of the affiliate included in earnings\",\r\n metaId: \"fapi_included_in_earnings\",\r\n cellClass: \"indent-4\",\r\n printId: \"fapi_of_the_affiliate_included_in_earnings.2.0.16\",\r\n },\r\n {\r\n type: \"input\",\r\n desc:\r\n \"Expense(s) deducted for book but not for tax (permanent difference)\",\r\n metaId: \"expenses_deducated_for_book\",\r\n cellClass: \"indent-4\",\r\n printId:\r\n \"expenses_deducted_for_book_but_not_for_tax_permanent_difference.2.0.17\",\r\n },\r\n {\r\n type: \"input\",\r\n desc: \"Government assistance repaid\",\r\n metaId: \"government_assistance_repaid\",\r\n cellClass: \"indent-4\",\r\n printId: \"government_assistance_repaid.2.0.18\",\r\n },\r\n {\r\n type: \"input\",\r\n desc: \"Sale of property acquired from another foreign affiliate\",\r\n metaId: \"sale_of_property_from_other_fa\",\r\n cellClass: \"indent-4\",\r\n printId: \"sale_of_property_acquired_from_other_fa.2.0.19\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n type: \"calculated\",\r\n path: [\r\n \"calculated_efab\",\r\n \"calculated_adjusted_earnings_before_depreciation_election\",\r\n ],\r\n desc: \"Adjusted Earnings Before Depreciation Election\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"adjusted_earnings_before_depreciation_election.2.0.20\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n type: \"blank\",\r\n desc: \"Reg. 5907(2.1) - Depreciation Election\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n printId: \"reg_5907_2_1_depreciation_election.2.0.4\",\r\n },\r\n {\r\n type: \"input\",\r\n desc: \"Depreciation for tax purposes (+/-)\",\r\n metaId: \"depreciation_for_tax_purposes\",\r\n cellClass: \"indent-4\",\r\n printId: \"depreciation_for_tax_purposes.2.0.21\",\r\n },\r\n {\r\n type: \"input\",\r\n desc: \"Depreciation per financial statement (+/-)\",\r\n metaId: \"depreciation_per_financial_statement\",\r\n cellClass: \"indent-4\",\r\n printId: \"depreciation_per_financial_statements.2.0.22\",\r\n },\r\n {\r\n type: \"calculated\",\r\n desc: \"Reg 5907(2.1)(a) and (b) adjustment(s)\",\r\n path: [\"calculated_efab\", \"calculated_5907_adjustment\"],\r\n cellClass: \"font-weight-bold indent-2\",\r\n printId: \"reg_5907_2_1_a_and_b_adjustment.2.0.23\",\r\n },\r\n {\r\n type: \"input\",\r\n desc: \"Cumulative Reg. 5907(2.1) adjustment re: prior years (+/-)\",\r\n metaId: \"cumulative_reg_5907_prior_year\",\r\n cellClass: \"indent-4\",\r\n printId: \"cumulative_reg_5907_2_1_adjustment_re_prior_years.2.0.24\",\r\n },\r\n {\r\n type: \"input\",\r\n desc:\r\n \"Reg 5907(2.1)(c) adjustment for capital property disposal (+/-)\",\r\n metaId: \"cumulative_reg_5907_property_disposal\",\r\n cellClass: \"indent-4\",\r\n printId:\r\n \"reg_5907_2_1_c_adjustment_for_capital_property_disposal.2.0.25\",\r\n },\r\n {\r\n type: \"calculated\",\r\n desc: \"Total Adjustment for Depreciation Election\",\r\n path: [\r\n \"calculated_efab\",\r\n \"calculated_total_depreciation_adjustment\",\r\n ],\r\n cellClass: \"font-weight-bold\",\r\n printId: \"total_adjustment_for_depreciation_election.2.0.26\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n type: \"calculated\",\r\n desc:\r\n \"Total Earnings per. Reg. 5907(1), paragraph (a) of the Definition of Earnings\",\r\n path: [\"calculated_efab\", \"calculated_total_5907_earnings\"],\r\n cellClass: \"font-weight-bold\",\r\n printId:\r\n \"total_earnings_per_reg_5907_1_paragraph_a_of_the_definition_of_earnings.2.0.27\",\r\n },\r\n {\r\n type: \"calculated\",\r\n desc:\r\n \"Income tax (paid)/refunded re: earnings from an active business\",\r\n path: [\r\n \"calculated_efab\",\r\n \"calculated_fitr_active_earnings_before_5907\",\r\n ],\r\n printId:\r\n \"income_tax_paid_refunded_re_earnings_from_an_active_business.2.0.28\",\r\n },\r\n {\r\n type: \"calculated\",\r\n desc: \"Net Earnings from an Active Business\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n path: [\"calculated_efab\", \"calculated_net_earnings\"],\r\n printId: \"net_earnings_from_an_active_business.2.0.29\",\r\n },\r\n ],\r\n printId: \"earnings_from_an_active_business.2.0\",\r\n },\r\n {\r\n name: \"Active Earnings Calculated using Canadian Tax Rules\",\r\n id: \"detail-ctr-adjustments\",\r\n fields: [\r\n {\r\n desc: \"Exempt Earnings per Canadian Tax Rules\",\r\n metaId: \"ctr_amounts_increase_exempt\",\r\n type: \"detailed_input\",\r\n order: [\"accounting_income\"],\r\n printId: \"exempt_earnings_per_canadian_tax_rules.4.0.0\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Taxable Earnings per Canadian Tax Rules\",\r\n metaId: \"ctr_amounts_increase_taxable\",\r\n type: \"detailed_input\",\r\n order: [\"accounting_income\"],\r\n printId: \"taxable_earnings_per_canadian_tax_rules.4.0.1\",\r\n },\r\n ],\r\n printId: \"active_earnings_calculated_under_canadian_tax_rules.2.1\",\r\n },\r\n {\r\n name: \"Paragraph 95(2)(a) – Income/(Loss)\",\r\n id: \"detail-952a-adjustments\",\r\n fields: [\r\n {\r\n desc: \"Amounts that Increase/Decrease Exempt Earnings\",\r\n metaId: \"952a_amounts_increase_exempt\",\r\n type: \"detailed_input\",\r\n order: [\"accounting_income\"],\r\n totalLineText: \"Earnings Before Tax\",\r\n printId: \"amounts_that_increase_decrease_exempt_earnings.4.1.0\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Amounts that Increase/Decrease Taxable Earnings\",\r\n metaId: \"952a_amounts_increase_taxable\",\r\n type: \"detailed_input\",\r\n order: [\"accounting_income\"],\r\n totalLineText: \"Earnings Before Tax\",\r\n printId: \"amounts_that_increase_decrease_taxable_earnings.4.1.1\",\r\n },\r\n ],\r\n printId: \"paragraph_95_2_a_income_loss.2.2\",\r\n },\r\n {\r\n name: \"FAPI/(FAPL)\",\r\n id: \"detail-fapi-adjustments\",\r\n fields: [\r\n {\r\n desc: \"FAPI/(FAPL) Items\",\r\n metaId: \"fapi_before_deductible_loss\",\r\n type: \"detailed_input\",\r\n order: [\"accounting_income\"],\r\n totalLineText: \"Total FAPI/(FAPL) Items\",\r\n printId: \"fapi_fapl_items.4.2.0\",\r\n },\r\n {\r\n desc: \"FAPI/(FAPL) portion of capital gain(s)\",\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n path: [\"calculated_te\", \"fapi_cg_portion\"],\r\n printId: \"fapi_fapl_portion_of_capital_gains.4.2.1\",\r\n },\r\n {\r\n desc: \"Total FAPI/(FAPL) Before Tax\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"calculated_te\", \"fapi_including_cg_portion\"],\r\n printId: \"total_fapi_fapl_before_tax.4.2.2\",\r\n },\r\n ],\r\n printId: \"fapi_fapl.2.3\",\r\n },\r\n ],\r\n printId: \"computation_of_income_loss.2\",\r\n },\r\n {\r\n name: \"Capital Gain(s)/(Loss(es))\",\r\n tabName: \"Capital Gains/(Losses)\",\r\n id: \"capital-gains-losses-section\",\r\n subSections: [\r\n {\r\n name: \"Capital Gain(s)/(Loss(es))\",\r\n id: \"capital-gains-losses-subsection\",\r\n fields: [\r\n {\r\n metaId: \"capital_gain_inclusion_rate\",\r\n desc: \"Capital Gains Inclusion Rate\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"input\",\r\n precision: 2,\r\n printId: \"capital_gain_inclusion_rate.5.0.0\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc:\r\n \"Capital Gain(s)/(Loss(es)) from Dispositions (Excluding Hybrid Surplus Dispositions)\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"blank\",\r\n printId:\r\n \"capital_gains_loss_from_dispositions_excluding_hybrid_surplus.3.0.0\",\r\n },\r\n {\r\n metaId: \"non_excluded_property_facl\",\r\n desc: \"Non-excluded property\",\r\n cellClass: \"indent-4\",\r\n type: \"input\",\r\n printId: \"non_excluded_property_facl.5.0.0\",\r\n },\r\n {\r\n metaId: \"active_business_assets_non_dtc\",\r\n desc: \"Active business assets - non-DTC\",\r\n cellClass: \"indent-4\",\r\n type: \"input\",\r\n printId: \"active_business_assets_non_dtc.5.0.1\",\r\n },\r\n {\r\n metaId: \"active_business_assets_dtc\",\r\n desc: \"Active business assets - DTC\",\r\n cellClass: \"indent-4\",\r\n type: \"input\",\r\n printId: \"active_business_assets_dtc.5.0.2\",\r\n },\r\n {\r\n metaId: \"other_excluded_property\",\r\n desc: \"Other excluded property not described above\",\r\n cellClass: \"indent-4\",\r\n type: \"input\",\r\n printId: \"other_excluded_property.5.0.3\",\r\n },\r\n {\r\n metaId: \"shares_of_fa_or_partnership_interest_before_hybrid\",\r\n desc:\r\n \"Shares of foreign affiliate/partnership interest (excluded property) before hybrid surplus application\",\r\n cellClass: \"indent-4\",\r\n type: \"input\",\r\n printId: \"shares_of_fa_or_partnership_interest_before_hybrid.5.0.4\",\r\n },\r\n {\r\n type: \"calculated\",\r\n desc:\r\n \"Total Capital Gain(s)/(Loss(es)) (Excluding Hybrid Surplus Dispositions) \",\r\n path: [\r\n \"calculated_capital_gains_loss\",\r\n \"total_capital_gain_loss_excluding_hybrid\",\r\n ],\r\n cellClass: \"font-weight-bold\",\r\n printId: \"total_capital_gain_loss_excluding_hybrid.5.0.7\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n metaId: \"hybrid_disposition\",\r\n cellClass: \"font-weight-bold\",\r\n desc: \"Capital Gain(s)/(Loss(es)) – Hybrid Surplus Dispositions\",\r\n type: \"input\",\r\n details: false,\r\n printId: \"hybrid_disposition.5.0.5\",\r\n },\r\n {\r\n type: \"calculated\",\r\n desc: \"Total Capital Gain(s)/(Loss(es))\",\r\n path: [\"calculated_capital_gains_loss\", \"total_capital_gain_loss\"],\r\n cellClass: \"font-weight-bold\",\r\n printId: \"total_capital_gain_loss.5.0.6\",\r\n },\r\n ],\r\n printId: \"capital_gains_lossses.5.0\",\r\n },\r\n ],\r\n printId: \"capital_gains_lossses.5\",\r\n },\r\n {\r\n name: \"Allocation of Taxes\",\r\n tabName: \"Allocation of Taxes\",\r\n id: \"allocation-of-taxes\",\r\n subSections: [\r\n {\r\n name: \"Allocation of Taxes\",\r\n id: \"taxable-income-per-foreign-tax-return\",\r\n fields: [\r\n {\r\n type: \"input\",\r\n desc: \"Taxable Income/(Loss) per Foreign Tax Return - A\",\r\n cellClass: \"font-weight-bold\",\r\n metaId: \"taxable_income_per_foreign_tax_return\",\r\n printId: \"taxable_income_loss_per_foreign_tax_return_a.3.0.0\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n type: \"blank\",\r\n desc: \"Taxable Income/(Loss) Allocated To:\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"taxable_income_loss_allocated_to.4.0.0\",\r\n },\r\n {\r\n type: \"calculated\",\r\n desc: \"Foreign active earnings/(loss(es)) excluding the following:\",\r\n path: [\r\n \"calculated_allocation\",\r\n \"taxable_income_active_earnings_before_59072_adjustments\",\r\n ],\r\n cellClass: \"indent-4\",\r\n printId:\r\n \"foreign_active_earnings_loss_excluding_the_following.3.0.1\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"indent-6\",\r\n desc: \"Capital gain(s)/(loss(es))\",\r\n path: [\"calculated_allocation\", \"taxable_income_capital_gains\"],\r\n printId: \"capital_gains_losses.3.0.2\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"indent-6\",\r\n desc: \"FAPI/(FAPL)\",\r\n path: [\"calculated_allocation\", \"taxable_income_fapi\"],\r\n printId: \"fapi_fapl.3.0.3\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"indent-6\",\r\n desc: \"Income/(loss) recharacterized under paragraph 95(2)(a)\",\r\n path: [\r\n \"calculated_allocation\",\r\n \"taxable_income_income_recharacterized_under_952a\",\r\n ],\r\n printId: \"income_loss_recharacterized_under_paragraph_95_2_a.3.0.4\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"indent-6\",\r\n desc:\r\n \"Items which are not earnings or are nil for Canadian income tax purposes\",\r\n path: [\r\n \"calculated_allocation\",\r\n \"taxable_income_items_not_nil_for_cdn_income_tax\",\r\n ],\r\n printId:\r\n \"items_which_are_not_earnings_or_are_nil_for_canadian_income_tax_purposes.3.0.5\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n type: \"calculated\",\r\n desc: \"Foreign Income Taxes (Paid)/Refunded - B\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"calculated_allocation\", \"foreign_income_tax_refunded\"],\r\n printId: \"foreign_income_taxes_paid_refunded_b.3.0.6\",\r\n },\r\n {\r\n type: \"blank\",\r\n desc: \"Taxable Income/(Loss) Allocated to:\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"taxable_income_loss_allocated_to.4.0.1\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n desc:\r\n \"Foreign active earning(s)/(loss(es)) excluding the following:\",\r\n path: [\r\n \"calculated_allocation\",\r\n \"calculated_fitr_active_earnings_before_5907\",\r\n ],\r\n printId:\r\n \"foreign_active_earnings_loss_excluding_the_following.3.0.7\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"indent-6\",\r\n desc: \"Capital Gain(s)/(Loss(es)) - Exempt\",\r\n path: [\r\n \"calculated_allocation\",\r\n \"calculated_fitr_capital_gain_loss\",\r\n ],\r\n printId: \"capital_gains_losses_exempt.3.0.8\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"indent-6\",\r\n desc: \"Capital Gain(s)/(Loss(es)) - Taxable\",\r\n path: [\r\n \"calculated_allocation\",\r\n \"calculated_fitr_capital_gain_loss_taxable\",\r\n ],\r\n printId: \"capital_gains_losses_taxable.3.0.9\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"indent-6\",\r\n desc: \"Capital Gain(s)/(Loss(es)) - FAPI\",\r\n path: [\r\n \"calculated_allocation\",\r\n \"calculated_fitr_capital_gain_loss_fapi\",\r\n ],\r\n printId: \"capital_gains_losses_fapi.3.0.10\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"indent-6\",\r\n desc: \"Capital Gain(s)/(Loss(es)) - Hybrid\",\r\n path: [\r\n \"calculated_allocation\",\r\n \"calculated_fitr_capital_gain_loss_hybrid\",\r\n ],\r\n printId: \"capital_gains_losses_hybrid.3.0.11\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"indent-6\",\r\n desc: \"FAPI/(FAPL)\",\r\n path: [\"calculated_allocation\", \"calculated_fitr_fapi\"],\r\n printId: \"fapi_fapl.3.0.12\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"indent-6\",\r\n desc:\r\n \"(Income)/Loss recharacterized under paragraph 95(2)(a) - Exempt\",\r\n path: [\r\n \"calculated_allocation\",\r\n \"calculated_fitr_income_loss_recharacterized_952a\",\r\n ],\r\n printId:\r\n \"income_loss_recharacterized_under_paragraph_95_2_a_exempt.3.0.13\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"indent-6\",\r\n desc:\r\n \"(Income)/Loss recharacterized under paragraph 95(2)(a) - Taxable\",\r\n path: [\r\n \"calculated_allocation\",\r\n \"calculated_fitr_income_loss_recharacterized_952a_taxable\",\r\n ],\r\n printId:\r\n \"income_loss_recharacterized_under_paragraph_95_2_a_taxable.3.0.14\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"indent-6\",\r\n desc:\r\n \"Items which are not earnings or are nil for Canadian income tax purposes\",\r\n path: [\r\n \"calculated_allocation\",\r\n \"calculated_fitr_items_not_earnings_nil\",\r\n ],\r\n printId:\r\n \"items_which_are_not_earnings_or_are_nil_for_canadian_income_tax_purposes.3.0.15\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n desc: \"Total\",\r\n path: [\"calculated_allocation\", \"calculated_fitr_total\"],\r\n printId: \"total.3.0.16\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n type: \"blank\",\r\n desc: \"Capital Gain(s) Portion Excluding Hybrid Surplus Gain(s)\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"capital_gains_portions_excluding_hybrid.4.0.2\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n desc: \"Capital gain(s) - exempt portion\",\r\n path: [\r\n \"calculated_allocation\",\r\n \"calculated_exempt_capital_gains_portion\",\r\n ],\r\n printId: \"capital_gains_exempt_portion.3.0.17\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n desc: \"Capital gain(s) - FAPI portion\",\r\n path: [\r\n \"calculated_allocation\",\r\n \"calculated_fapi_capital_gains_portion\",\r\n ],\r\n printId: \"capital_gains_fapi_portion.3.0.19\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n desc: \"Capital gain(s) - taxable portion\",\r\n path: [\r\n \"calculated_allocation\",\r\n \"calculated_taxable_capital_gains_portion\",\r\n ],\r\n printId: \"capital_gains_taxable_portion.3.0.20\",\r\n },\r\n {\r\n type: \"calculated\",\r\n desc: \"Subtotal\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"calculated_allocation\", \"calculated_capital_gains_total\"],\r\n printId: \"capital_gains_subtotal.3.0.21\",\r\n },\r\n {\r\n type: \"blank\",\r\n desc:\r\n \"Tax Allocation - Capital Gain(s) Excluding Hybrid Surplus Gain(s)\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"tax_allocation_capital_gains_excluding_hybrid.4.0.3\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n desc: \"Exempt surplus allocation factor\",\r\n precision: 2,\r\n path: [\r\n \"calculated_allocation\",\r\n \"calculated_tax_exempt_allocation_factor\",\r\n ],\r\n printId: \"es_allocation_factor.3.0.21\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n desc: \"FAPI allocation factor\",\r\n precision: 2,\r\n path: [\r\n \"calculated_allocation\",\r\n \"calculated_tax_fapi_allocation_factor\",\r\n ],\r\n printId: \"fapi_allocation_factor.3.0.23\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n desc: \"Taxable surplus allocation factor\",\r\n precision: 2,\r\n path: [\r\n \"calculated_allocation\",\r\n \"calculated_tax_taxable_allocation_factor\",\r\n ],\r\n printId: \"ts_allocation_factor.3.0.24\",\r\n },\r\n {\r\n type: \"calculated\",\r\n desc: \"Subtotal\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"calculated_allocation\", \"calculated_tax_allocation_total\"],\r\n printId: \"ts_subtotal_3.0.25\",\r\n },\r\n {\r\n type: \"blank\",\r\n desc:\r\n \"Refund Allocation - Capital Gain(s) Excluding Hybrid Surplus Gain(s)\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"refund_allocation_capital_gains_excluding_hybrid.4.0.4\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n desc: \"Exempt surplus allocation factor\",\r\n precision: 2,\r\n path: [\r\n \"calculated_allocation\",\r\n \"calculated_refund_exempt_allocation_factor\",\r\n ],\r\n printId: \"es_allocation_factor.3.0.25\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n desc: \"FAPI allocation factor\",\r\n precision: 2,\r\n path: [\r\n \"calculated_allocation\",\r\n \"calculated_refund_fapi_allocation_factor\",\r\n ],\r\n printId: \"fapi_allocation_factor.3.0.27\",\r\n },\r\n {\r\n type: \"calculated\",\r\n cellClass: \"indent-4\",\r\n desc: \"Taxable surplus allocation factor\",\r\n precision: 2,\r\n path: [\r\n \"calculated_allocation\",\r\n \"calculated_refund_taxable_allocation_factor\",\r\n ],\r\n printId: \"ts_allocation_factor.3.0.28\",\r\n },\r\n {\r\n type: \"calculated\",\r\n desc: \"Subtotal\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\r\n \"calculated_allocation\",\r\n \"calculated_refund_allocation_total\",\r\n ],\r\n printId: \"ra_subtotal.3.0.29\",\r\n },\r\n ],\r\n printId: \"allocation_of_taxes.3.0\",\r\n },\r\n ],\r\n printId: \"allocation_of_taxes.3\",\r\n },\r\n {\r\n name: \"Calculation of Earnings and Surplus\",\r\n tabName: \"Calculation of Earnings and Surplus\",\r\n id: \"calculation-of-earnings-and-surplus\",\r\n subSections: [\r\n {\r\n name: \"Calculation of Exempt Earnings\",\r\n id: \"detail-exempt-earnings\",\r\n fields: [\r\n {\r\n desc:\r\n \"Net active business earnings/(loss(es)) from DTC, net of tax(es) (from above)\",\r\n type: \"calculated\",\r\n path: [\"calculated_ee\", \"net_active_business_earnings\"],\r\n printId:\r\n \"net_active_business_earnings_loss_from_dtc_net_of_taxes_from_above.4.3.0\",\r\n },\r\n {\r\n desc:\r\n \"Income/(loss) recharacterized as active business income under paragraph 95(2)(a)\",\r\n metaId: \"952a_amounts_increase_exempt\",\r\n details: false,\r\n type: \"input\",\r\n printId: \"income_loss_recharacterized_as_abi_under_95_2_a.4.3.1\",\r\n },\r\n {\r\n desc: \"Active earnings per Canadian tax rules, before tax\",\r\n metaId: \"ctr_amounts_increase_exempt\",\r\n details: false,\r\n type: \"input\",\r\n printId: \"active_earnings_per_canadian_tax_rules_before_tax.4.3.2\",\r\n },\r\n {\r\n desc: \"Capital gain(s)/(loss(es)) – exempt portion\",\r\n type: \"calculated\",\r\n path: [\"calculated_ee\", \"capital_gains_exempt\"],\r\n printId: \"capital_gains_loss_exempt_portion.4.3.3\",\r\n },\r\n {\r\n desc: \"Other inclusion(s)/(deduction(s))\",\r\n type: \"calculated\",\r\n path: [\"calculated_ee\", \"other_inclusions\"],\r\n printId: \"other_inclusions_deductions.4.3.4\",\r\n },\r\n {\r\n desc: \"Exempt Earnings/(Loss) Before Certain Taxes\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"calculated_ee\", \"earnings_before_taxes\"],\r\n printId: \"exempt_earnings_loss_before_certain_taxes.4.3.5\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc:\r\n \"Taxes (paid)/refunded applicable to income/(loss) recharacterized as active\",\r\n type: \"calculated\",\r\n path: [\"calculated_ee\", \"taxes_paid_rechar_active\"],\r\n printId:\r\n \"taxes_paid_refunded_applicable_to_income_loss_recharacterized_as_active.4.3.6\",\r\n },\r\n {\r\n desc:\r\n \"Taxes (paid)/refunded applicable to capital gain(s)/(loss(es)) - excluded property\",\r\n type: \"calculated\",\r\n path: [\"calculated_ee\", \"taxes_paid_capital_gain\"],\r\n printId:\r\n \"taxes_paid_refunded_applicable_to_capital_gains_losses_ep.4.3.7\",\r\n },\r\n {\r\n desc: \"Total Taxes (Paid)/Refunded\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"calculated_ee\", \"total_taxes\"],\r\n printId: \"total_taxes_paid_refunded.4.3.8\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Exempt Earnings/(Loss) for the Year (Net of Taxes)\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n path: [\"calculated_ee\", \"earnings_cy\"],\r\n printId: \"exempt_earnings_loss_for_the_year_net_of_taxes.4.3.9\",\r\n },\r\n ],\r\n printId: \"calculation_of_exempt_earnings.4.3\",\r\n },\r\n {\r\n name: \"Calculation of Taxable Earnings\",\r\n id: \"detail-taxable-earnings\",\r\n fields: [\r\n {\r\n desc:\r\n \"Net active business earnings/(loss(es)) from non-DTC (from above)\",\r\n type: \"calculated\",\r\n path: [\"calculated_te\", \"net_active_business_earnings\"],\r\n printId:\r\n \"net_active_business_earnings_loss_from_non_dtc_from_above.4.4.0\",\r\n },\r\n {\r\n desc: \"FAPI/(FAPL), before applicable tax\",\r\n type: \"calculated\",\r\n path: [\"calculated_te\", \"fapi_including_cg_portion\"],\r\n printId: \"fapi_fapl_before_applicable_tax.4.4.1\",\r\n },\r\n {\r\n desc: \"Income recharacterized under paragraph 95(2)(a), before tax\",\r\n metaId: \"952a_amounts_increase_taxable\",\r\n details: false,\r\n type: \"input\",\r\n printId: \"income_recharacterized_under_95_2_a_before_tax.4.4.2\",\r\n },\r\n {\r\n desc: \"Active earnings per Canadian tax rules, before tax\",\r\n metaId: \"ctr_amounts_increase_taxable\",\r\n details: false,\r\n type: \"input\",\r\n printId: \"active_earnings_per_canadian_tax_rules_before_tax.4.4.3\",\r\n },\r\n {\r\n desc: \"Taxable capital gain(s)/(loss(es)), before tax\",\r\n type: \"calculated\",\r\n path: [\"calculated_te\", \"capital_gains_taxable\"],\r\n printId: \"taxable_capital_gain_loss_before_tax.4.4.4\",\r\n },\r\n {\r\n desc: \"Other inclusion(s)/(deduction(s))\",\r\n type: \"calculated\",\r\n path: [\"calculated_te\", \"other_inclusions\"],\r\n printId: \"other_inclusions_deductions.4.4.5\",\r\n },\r\n {\r\n desc: \"Taxable Earnings/(Loss) Before Certain Taxes\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"calculated_te\", \"earnings_before_taxes\"],\r\n printId: \"taxable_earnings_loss_before_certain_taxes.4.4.6\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc:\r\n \"Tax(es) (paid)/refunded applicable to property income/(loss) - FAPI\",\r\n type: \"calculated\",\r\n path: [\"calculated_te\", \"taxes_paid_property_income_fapi\"],\r\n printId:\r\n \"taxes_paid_refunded_applicable_to_property_income_loss_fapi.4.4.7\",\r\n },\r\n {\r\n desc:\r\n \"Tax(es) (paid)/refunded applicable to capital gain(s)/(loss(es)) - FAPI\",\r\n type: \"calculated\",\r\n path: [\"calculated_te\", \"taxes_paid_capital_gain_fapi\"],\r\n printId:\r\n \"taxes_paid_refunded_applicable_to_capital_gains_losses_fapi.4.4.8\",\r\n },\r\n {\r\n desc:\r\n \"Tax(es) (paid)/refunded applicable to income/(loss) recharacterized as active\",\r\n type: \"calculated\",\r\n path: [\"calculated_te\", \"taxes_paid_rechar_active\"],\r\n printId:\r\n \"taxes_paid_refunded_applicable_to_income_loss_recharacterized_as_active.4.4.9\",\r\n },\r\n {\r\n desc:\r\n \"Tax(es) (paid)/refunded applicable to capital gain(s)/(loss(es))\",\r\n type: \"calculated\",\r\n path: [\"calculated_te\", \"taxes_paid_capital_gain\"],\r\n printId:\r\n \"taxes_paid_refunded_applicable_to_capital_gains_losses.4.4.10\",\r\n },\r\n {\r\n desc: \"Total Tax(es) (Paid)/Refunded\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"calculated_te\", \"total_taxes\"],\r\n printId: \"total_taxes_paid_refunded.4.4.11\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Taxable Earnings/(Loss) for the Year (Net of Taxes)\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n path: [\"calculated_te\", \"earnings_cy\"],\r\n printId: \"taxable_earnings_loss_for_the_year_net_of_taxes.4.4.12\",\r\n },\r\n ],\r\n printId: \"calculation_of_taxable_earnings.4.4\",\r\n },\r\n {\r\n name: \"Calculation of Exempt Surplus\",\r\n id: \"detail-exempt-surplus\",\r\n fields: [\r\n {\r\n desc: \"Opening Exempt Surplus/(Deficit)\",\r\n metaId: \"exemptBalance\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"opening\",\r\n printId: \"v1_opening_exempt_surplus_deficit.4.5.0\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"v1_less.4.5.0\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc:\r\n \"Recharacterized pre-acquisition surplus dividend(s) paid in prior year\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"calculated_es\", \"rechar_preacq_dividend_paid_by\"],\r\n printId:\r\n \"v1_recharacterized_pre_acq_dividend_paid_in_prior_year.4.5.1\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Adjusted Opening Exempt Surplus/(Deficit)\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"calculated_es\", \"adjusted_opening\"],\r\n printId: \"v1_adjusted_opening_exempt_surplus_deficit.4.5.2\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Opening Exempt Surplus/(Deficit)\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"calculated_es\", \"adjusted_opening\"],\r\n printId: \"v2_opening_exempt_surplus_deficit.4.5.2\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n type: \"sep_periods\",\r\n path: [\"calculated_es\", \"sep_periods\"],\r\n fields: [\r\n {\r\n desc: \"SEP Period\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"blank\",\r\n metaId: \"sep_period_title\",\r\n },\r\n {\r\n desc: \"SEP Adjustment Multiplier\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n type: \"calculated\",\r\n metaId: \"sep_adjustment\",\r\n precision: 4,\r\n },\r\n {\r\n desc: \"Closing Exempt Surplus/(Deficit) After SEP Adjustment\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n type: \"calculated\",\r\n metaId: \"closing_after_last_sep\",\r\n },\r\n {\r\n desc: \"Addition(s)/(Deduction(s)) After SEP Adjustment\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n type: \"blank\",\r\n metaId: \"addition_deductions_after_sep_adj\",\r\n },\r\n {\r\n desc:\r\n \"Dividend(s) from exempt surplus of another foreign affiliate\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"dividends_received_from_surplus_of_another_fa\",\r\n },\r\n {\r\n desc:\r\n \"Deemed dividend(s) received from exempt surplus - subsection 93(1) or (1.1)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"deemed_dividends_received_from_surplus_s93_or_11\",\r\n },\r\n {\r\n cellClass: \"indent-4\",\r\n desc:\r\n \"Dividend(s) that would be deductible under section 112 received\",\r\n type: \"calculated\",\r\n metaId: \"dividends_received_deductible_under_s112\",\r\n },\r\n {\r\n cellClass: \"indent-4\",\r\n desc: \"Tax refunded/(paid) re: exempt surplus dividend(s)\",\r\n type: \"calculated\",\r\n metaId: \"tax_refunded_paid\",\r\n },\r\n {\r\n cellClass: \"indent-4\",\r\n desc: \"Tax adjustment re: consolidation and group relief\",\r\n type: \"calculated\",\r\n metaId: \"tax_adj_consolidation\",\r\n },\r\n {\r\n cellClass: \"indent-4\",\r\n desc: \"Other addition(s)/(deduction(s))\",\r\n type: \"calculated\",\r\n metaId: \"other_additions\",\r\n },\r\n {\r\n desc: \"Subtotal Addition(s)/(Deduction(s))\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n metaId: \"total_change\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Exempt Surplus/(Deficit) Before Dividend Payout\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n metaId: \"surplus_before_dividend_payout\",\r\n },\r\n {\r\n desc: \"Dividend(s) paid in the year out of exempt surplus\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"dividends_paid\",\r\n },\r\n {\r\n desc: \"Deemed dividend(s) paid - susbection 93(1) or (1.1)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"deemed_dividends_paid_s93_11\",\r\n },\r\n {\r\n desc: \"Closing Exempt Surplus/(Deficit)\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n metaId: \"closing_surplus\",\r\n },\r\n ],\r\n printId: \"sep.4.5\",\r\n },\r\n {\r\n desc: \"Exempt Earnings/(Loss) for the Year\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"calculated_es\", \"earnings_cy\"],\r\n printId: \"exempt_earnings_loss_for_the_year.4.5.3\",\r\n },\r\n {\r\n desc: \"Closing Exempt Surplus/(Deficit)\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n metaId: \"exemptBalance\",\r\n type: \"closing\",\r\n printId: \"v1_exempt_surplus_deficit_ending_balance.4.5.4\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc:\r\n \"Exempt Surplus/(Deficit) - Ending Balance Before Recharacterized Dividend(s)\",\r\n cellClass: \"font-weight-bold\",\r\n metaId: \"exemptBalance\",\r\n type: \"closing\",\r\n printId: \"v2_exempt_surplus_deficit_ending_balance.4.5.4\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"v2_less.4.5.0\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Recharacterized pre-acquisition surplus dividend(s) paid\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"calculated_es\", \"rechar_preacq_dividend_paid_by_2\"],\r\n printId:\r\n \"v2_recharacterized_pre_acq_dividend_paid_in_prior_year.4.5.1\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Exempt Surplus/(Deficit) - Ending Balance\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n metaId: \"exemptBalance\",\r\n type: \"closingAfterRechar\",\r\n printId: \"v2_exempt_surplus_deficit_ending_balance.4.5.5\",\r\n recharLayout: \"v2\",\r\n },\r\n ],\r\n printId: \"calculation_of_exempt_surplus.4.5\",\r\n },\r\n {\r\n name: \"Calculation of Hybrid Surplus\",\r\n id: \"detail-hybrid-surplus\",\r\n fields: [\r\n {\r\n desc: \"Opening Hybrid Surplus/(Deficit)\",\r\n metaId: \"hybridBalance\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"opening\",\r\n printId: \"v1_opening_hybrid_surplus_deficit.4.6.0\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"v1_less.4.6.0\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc:\r\n \"Recharacterized pre-acquisition surplus dividend(s) paid in prior year\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"calculated_hs\", \"rechar_preacq_dividend_paid_by\"],\r\n printId:\r\n \"v1_recharacterized_pre_acq_dividend_paid_in_prior_year.4.6.1\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Adjusted Opening Hybrid Surplus/(Deficit)\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"calculated_hs\", \"adjusted_opening\"],\r\n printId: \"v1_adjusted_opening_hybrid_surplus_deficit.4.6.2\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Opening Hybrid Surplus/(Deficit)\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"calculated_hs\", \"adjusted_opening\"],\r\n printId: \"v2_opening_hybrid_surplus_deficit.4.6.2\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n type: \"sep_periods\",\r\n path: [\"calculated_hs\", \"sep_periods\"],\r\n fields: [\r\n {\r\n desc: \"SEP Period\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"blank\",\r\n metaId: \"sep_period_title\",\r\n },\r\n {\r\n desc: \"SEP Adjustment Multiplier\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n type: \"calculated\",\r\n metaId: \"sep_adjustment\",\r\n precision: 4,\r\n },\r\n {\r\n desc: \"Closing Hybrid Surplus/(Deficit) After SEP Adjustment\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n type: \"calculated\",\r\n metaId: \"closing_after_last_sep\",\r\n },\r\n {\r\n desc: \"Addition(s)/(Deduction(s)) After SEP Adjustment\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n type: \"blank\",\r\n metaId: \"addition_deductions_after_sep_adj\",\r\n },\r\n {\r\n desc: \"Taxable capital gain(s)/(loss(es)), before tax\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"disposition_adjustment_before_taxes\",\r\n },\r\n {\r\n desc: \"Taxable capital gain(s)/(loss(es)), tax amounts\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"disposition_adjustment_taxes\",\r\n },\r\n {\r\n desc:\r\n \"Dividend(s) from hybrid surplus of another foreign affiliate\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"dividends_received_from_surplus_of_another_fa\",\r\n },\r\n {\r\n desc:\r\n \"Deemed dividend(s) received from hybrid surplus - subsection 93(1) or (1.1)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"deemed_dividends_received_from_surplus_s93_or_11\",\r\n },\r\n {\r\n desc:\r\n \"Tax paid by foreign affiliate on hybrid surplus dividend(s) received\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"tax_paid_on_dividends_received\",\r\n },\r\n {\r\n desc: \"Adjustment for group relief and consolidate returns\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"tax_adj_consolidation\",\r\n },\r\n {\r\n desc: \"Other addition(s)/(deduction(s))\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"other_additions\",\r\n },\r\n {\r\n desc: \"Subtotal Addition(s)/(Deduction(s))\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n metaId: \"total_change\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Hybrid Surplus/(Deficit) Before Dividend Payout\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n metaId: \"surplus_before_dividend_payout\",\r\n },\r\n {\r\n desc: \"Dividend(s) paid in the year out of hybrid surplus\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"dividends_paid\",\r\n },\r\n {\r\n desc: \"Deemed dividend(s) paid - subsection 93(1) or (1.1)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"deemed_dividends_paid_s93_11\",\r\n },\r\n {\r\n desc: \"Closing Hybrid Surplus/(Deficit)\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n metaId: \"closing_surplus\",\r\n },\r\n ],\r\n printId: \"sep.4.6\",\r\n },\r\n {\r\n desc: \"Closing Hybrid Surplus/(Deficit)\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n metaId: \"hybridBalance\",\r\n type: \"closing\",\r\n printId: \"v1_hybrid_surplus_deficit_ending_balance.4.6.3\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc:\r\n \"Hybrid Surplus/(Deficit) - Ending Balance Before Recharacterized Dividend(s)\",\r\n cellClass: \"font-weight-bold\",\r\n metaId: \"hybridBalance\",\r\n type: \"closing\",\r\n printId: \"v2_hybrid_surplus_deficit_ending_balance.4.6.3\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"v2_less.4.6.0\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Recharacterized pre-acquisition surplus dividend(s) paid\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"calculated_hs\", \"rechar_preacq_dividend_paid_by_2\"],\r\n printId:\r\n \"v2_recharacterized_pre_acq_dividend_paid_in_prior_year.4.6.1\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Hybrid Surplus/(Deficit) - Ending Balance\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n metaId: \"hybridBalance\",\r\n type: \"closingAfterRechar\",\r\n printId: \"v2_hybrid_surplus_deficit_ending_balance.4.6.4\",\r\n recharLayout: \"v2\",\r\n },\r\n ],\r\n printId: \"calculation_of_hybrid_surplus.4.6\",\r\n },\r\n {\r\n name: \"Calculation of Taxable Surplus\",\r\n id: \"detail-taxable-surplus\",\r\n fields: [\r\n {\r\n desc: \"Opening Taxable Surplus/(Deficit)\",\r\n metaId: \"taxableBalance\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"opening\",\r\n printId: \"v1_opening_taxable_surplus_deficit.4.7.0\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"v1_less.4.7.0\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc:\r\n \"Recharacterized pre-acquisition surplus dividend(s) paid in prior year\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"calculated_ts\", \"rechar_preacq_dividend_paid_by\"],\r\n printId:\r\n \"v1_recharacterized_pre_acq_dividend_paid_in_prior_year.4.7.1\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Adjusted Opening Taxable Surplus/(Deficit)\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"calculated_ts\", \"adjusted_opening\"],\r\n printId: \"v1_adjusted_opening_taxable_surplus_deficit.4.7.2\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Opening Taxable Surplus/(Deficit)\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"calculated_ts\", \"adjusted_opening\"],\r\n printId: \"v2_opening_taxable_surplus_deficit.4.7.2\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n type: \"sep_periods\",\r\n path: [\"calculated_ts\", \"sep_periods\"],\r\n fields: [\r\n {\r\n desc: \"SEP Period\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"blank\",\r\n metaId: \"sep_period_title\",\r\n },\r\n {\r\n desc: \"SEP Adjustment Multiplier\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n type: \"calculated\",\r\n metaId: \"sep_adjustment\",\r\n precision: 4,\r\n },\r\n {\r\n desc: \"Closing Taxable Surplus/(Deficit) After SEP Adjustment\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n type: \"calculated\",\r\n metaId: \"closing_after_last_sep\",\r\n },\r\n {\r\n desc: \"Addition(s)/(Deduction(s)) After SEP Adjustment\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n type: \"blank\",\r\n metaId: \"addition_deductions_after_sep_adj\",\r\n },\r\n {\r\n desc:\r\n \"Dividend(s) from taxable surplus of another foreign affiliate\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"dividends_received_from_surplus_of_another_fa\",\r\n },\r\n {\r\n desc:\r\n \"Deemed dividend(s) received from taxable surplus - subsection 93(1) or (1.1)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"deemed_dividends_received_from_surplus_s93_or_11\",\r\n },\r\n {\r\n desc: \"Tax refunded/(paid) re: taxable surplus dividend(s)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"tax_refunded_paid\",\r\n },\r\n {\r\n desc: \"Tax adjustment re: consolidation and group relief\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"tax_adj_consolidation\",\r\n },\r\n {\r\n desc: \"Other addition(s)/(deduction(s))\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"other_additions\",\r\n },\r\n {\r\n desc: \"Subtotal Addition(s)/(Deduction(s))\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n metaId: \"total_change\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Taxable Surplus/(Deficit) Before Dividend Payout\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n metaId: \"surplus_before_dividend_payout\",\r\n },\r\n {\r\n desc: \"Dividend(s) paid in the year out of taxable surplus\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"dividends_paid\",\r\n },\r\n {\r\n desc: \"Deemed dividend(s) paid - subsection 93(1) or (1.1)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"deemed_dividends_paid_s93_11\",\r\n },\r\n {\r\n desc: \"Closing Taxable Surplus/(Deficit)\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n metaId: \"closing_surplus\",\r\n },\r\n ],\r\n printId: \"sep.4.7\",\r\n },\r\n {\r\n desc: \"Taxable Earnings/(Loss) for the Year\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"calculated_ts\", \"earnings_cy\"],\r\n printId: \"taxable_earnings_loss_for_the_year.4.7.3\",\r\n },\r\n {\r\n desc: \"Closing Taxable Surplus/(Deficit)\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n metaId: \"taxableBalance\",\r\n type: \"closing\",\r\n printId: \"v1_taxable_surplus_deficit_ending_balance.4.7.4\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc:\r\n \"Taxable Surplus/(Deficit) - Ending Balance Before Recharacterized Dividend(s)\",\r\n cellClass: \"font-weight-bold\",\r\n metaId: \"taxableBalance\",\r\n type: \"closing\",\r\n printId: \"v2_taxable_surplus_deficit_ending_balance.4.7.4\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"v2_less.4.7.0\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Recharacterized pre-acquisition surplus dividend(s) paid\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"calculated_ts\", \"rechar_preacq_dividend_paid_by_2\"],\r\n printId:\r\n \"v2_recharacterized_pre_acq_dividend_paid_in_prior_year.4.7.1\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Taxable Surplus/(Deficit) - Ending Balance\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n metaId: \"taxableBalance\",\r\n type: \"closingAfterRechar\",\r\n printId: \"v2_taxable_surplus_deficit_ending_balance.4.7.5\",\r\n recharLayout: \"v2\",\r\n },\r\n ],\r\n printId: \"calculation_of_taxable_surplus.4.7\",\r\n },\r\n {\r\n name: \"Calculation of HUT\",\r\n id: \"detail-hut-surplus\",\r\n fields: [\r\n {\r\n desc: \"Opening HUT\",\r\n metaId: \"hutBalance\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"opening\",\r\n printId: \"v1_opening_hut_balance.4.8.0\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"v1_less.4.8.0\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc:\r\n \"Recharacterized pre-acquisition surplus dividend(s) paid in prior year\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"calculated_hut\", \"rechar_preacq_dividend_paid_by\"],\r\n printId:\r\n \"v1_recharacterized_pre_acq_dividend_paid_in_prior_year.4.8.1\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Adjusted Opening HUT\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"calculated_hut\", \"adjusted_opening\"],\r\n printId: \"v1_adjusted_opening_hut_balance.4.8.2\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Opening HUT Balance\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"calculated_hut\", \"adjusted_opening\"],\r\n printId: \"v2_opening_hut_balance.4.8.2\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n type: \"sep_periods\",\r\n path: [\"calculated_hut\", \"sep_periods\"],\r\n fields: [\r\n {\r\n desc: \"SEP Period\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"blank\",\r\n metaId: \"sep_period_title\",\r\n },\r\n {\r\n desc: \"SEP Adjustment Multiplier\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n type: \"calculated\",\r\n metaId: \"sep_adjustment\",\r\n precision: 4,\r\n },\r\n {\r\n desc: \"Closing HUT Balance After SEP Adjustment\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n type: \"calculated\",\r\n metaId: \"closing_after_last_sep\",\r\n },\r\n {\r\n desc: \"Addition(s)/(Deduction(s)) After SEP Adjustment\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n type: \"blank\",\r\n metaId: \"addition_deductions_after_sep_adj\",\r\n },\r\n {\r\n desc: \"Tax applicable to capital gain(s)/(loss(es))\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"tax_applicable_to_capital_gain\",\r\n },\r\n {\r\n desc:\r\n \"Tax applicable to dividend(s) paid out of hybrid surplus of another foreign affiliate (+)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"tax_applicable_to_dividends_paid_from_hs\",\r\n },\r\n {\r\n desc:\r\n \"HUT applicable to dividend(s) received from another foreign affiliate (+)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"hut_applicable_to_dividends_recieved\",\r\n },\r\n {\r\n desc: \"Tax adjustment(s) re: consolidation and group relief\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"tax_adj_consolidation\",\r\n },\r\n {\r\n desc: \"Other addition(s)/(deduction(s))\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"other_additions\",\r\n },\r\n {\r\n desc:\r\n \"HUT Applicable to dividend(s) paid out of hybrid surplus (-)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"hut_applicable_to_dividends_paid_from_hybrid\",\r\n },\r\n {\r\n desc: \"Total Adjustments\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n metaId: \"total_change\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Closing HUT\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n metaId: \"closing_surplus\",\r\n },\r\n ],\r\n printId: \"sep.4.8\",\r\n },\r\n {\r\n desc: \"Closing HUT\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n metaId: \"hutBalance\",\r\n type: \"closing\",\r\n printId: \"v1_hut_ending_balance.4.8.3\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"HUT - Ending Balance Before Recharacterized Dividend(s)\",\r\n cellClass: \"font-weight-bold\",\r\n metaId: \"hutBalance\",\r\n type: \"closing\",\r\n printId: \"v2_hut_ending_balance.4.8.3\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"v2_less.4.8.0\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Recharacterized pre-acquisition surplus dividend(s) paid\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"calculated_hut\", \"rechar_preacq_dividend_paid_by_2\"],\r\n printId:\r\n \"v2_recharacterized_pre_acq_dividend_paid_in_prior_year.4.8.1\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Closing HUT\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n metaId: \"hutBalance\",\r\n type: \"closingAfterRechar\",\r\n printId: \"v2_hut_ending_balance.4.8.4\",\r\n recharLayout: \"v2\",\r\n },\r\n ],\r\n printId: \"calculation_of_hybrid_underlying_tax_hut.4.8\",\r\n },\r\n {\r\n name: \"Calculation of UFT\",\r\n id: \"detail-uft-surplus\",\r\n fields: [\r\n {\r\n desc: \"Opening UFT\",\r\n metaId: \"uftBalance\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"opening\",\r\n printId: \"v1_opening_uft_balance.4.9.0\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"v1_less.4.9.0\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc:\r\n \"Recharacterized pre-acquisition surplus dividend(s) paid in prior year\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"calculated_uft\", \"rechar_preacq_dividend_paid_by\"],\r\n printId:\r\n \"v1_recharacterized_pre_acq_dividend_paid_in_prior_year.4.9.1\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Adjusted Opening UFT\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"calculated_uft\", \"adjusted_opening\"],\r\n printId: \"v1_adjusted_opening_uft_balance.4.9.2\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"Opening UFT\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"calculated_uft\", \"adjusted_opening\"],\r\n printId: \"v2_opening_uft_balance.4.9.2\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n type: \"sep_periods\",\r\n path: [\"calculated_uft\", \"sep_periods\"],\r\n fields: [\r\n {\r\n desc: \"SEP Period\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"blank\",\r\n metaId: \"sep_period_title\",\r\n },\r\n {\r\n desc: \"SEP Adjustment Multiplier\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n type: \"calculated\",\r\n metaId: \"sep_adjustment\",\r\n precision: 4,\r\n },\r\n {\r\n desc: \"Closing UFT Balance After SEP Adjustment\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n type: \"calculated\",\r\n metaId: \"closing_after_last_sep\",\r\n },\r\n {\r\n desc: \"Addition(s)/(Deduction(s)) After SEP Adjustment(s)\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n type: \"blank\",\r\n metaId: \"addition_deductions_after_sep_adj\",\r\n },\r\n {\r\n desc:\r\n \"Tax(es) applicable to dividend(s) paid out of taxable surplus of another foreign affiliate (+)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"tax_applicable_to_dividends_paid_from_ts\",\r\n },\r\n {\r\n desc:\r\n \"UFT applicable to dividend(s) received from another foreign affiliate (+)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"uft_applicable_to_dividends_recieved\",\r\n },\r\n {\r\n desc: \"Tax adjustment(s) re: consolidation and group relief\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"tax_adj_consolidation\",\r\n },\r\n {\r\n desc: \"Other addition(s)/(deduction(s))\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"other_additions\",\r\n },\r\n {\r\n desc:\r\n \"UFT applicable to dividend(s) paid out of taxable surplus (-)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n metaId: \"uft_applicable_to_dividends_paid_from_taxable\",\r\n },\r\n {\r\n desc: \"Total Adjustments\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n metaId: \"total_change\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Closing UFT\",\r\n type: \"calculated\",\r\n cellClass: \"font-weight-bold indent-2\",\r\n metaId: \"closing_surplus\",\r\n },\r\n ],\r\n printId: \"sep.4.9\",\r\n },\r\n {\r\n desc: \"Tax Applicable to Taxable Earnings\",\r\n cellClass: \"font-weight-bold\",\r\n path: [\"calculated_uft\", \"tax_applicable\"],\r\n type: \"calculated\",\r\n printId: \"tax_applicable_to_taxable_earnings.4.9.3\",\r\n },\r\n {\r\n desc: \"Closing UFT\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n metaId: \"uftBalance\",\r\n type: \"closing\",\r\n printId: \"v1_uft_ending_balance.4.9.4\",\r\n recharLayout: \"v1\",\r\n },\r\n {\r\n desc: \"UFT - Ending Balance Before Recharacterized Dividend(s)\",\r\n cellClass: \"font-weight-bold\",\r\n metaId: \"uftBalance\",\r\n type: \"closing\",\r\n printId: \"v2_uft_ending_balance.4.9.4\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Less\",\r\n type: \"blank\",\r\n cellClass: \"font-weight-bold\",\r\n printId: \"v2_less.4.9.0\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Recharacterized pre-acquisition surplus dividend(s) paid\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"calculated_uft\", \"rechar_preacq_dividend_paid_by_2\"],\r\n printId:\r\n \"v2_recharacterized_pre_acq_dividend_paid_in_prior_year.4.9.1\",\r\n recharLayout: \"v2\",\r\n },\r\n {\r\n desc: \"Closing UFT\",\r\n cellClass: \"font-weight-bold text-primary\",\r\n metaId: \"uftBalance\",\r\n type: \"closingAfterRechar\",\r\n printId: \"v2_uft_ending_balance.4.9.5\",\r\n recharLayout: \"v2\",\r\n },\r\n ],\r\n printId: \"calculation_of_underlying_foreign_tax_uft.4.9\",\r\n },\r\n ],\r\n printId: \"calculation_of_earnings_and_surplus.4\",\r\n },\r\n {\r\n name: \"Continuity of Retained Earnings\",\r\n tabName: \"Continuity of Retained Earnings\",\r\n id: \"continuity-of-retained-earnings\",\r\n hideZeroRows: false,\r\n hideEmptySections: false,\r\n subSections: [\r\n {\r\n name: \"Retained Earnings\",\r\n id: \"retained-earnings\",\r\n fields: [\r\n {\r\n metaId: \"openingReDeficit\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"opening\",\r\n desc: \"Opening Retained Earnings/(Deficit)\",\r\n printId: \"opening_re_deficit.6.0.0\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Book Income/(Loss) After Tax\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"blank\",\r\n printId: \"book_income_loss_after_taxes.6.0.1\",\r\n },\r\n {\r\n metaId: \"book_income_before_taxes\",\r\n desc: \"Book income/(loss) before tax\",\r\n type: \"input\",\r\n printId: \"book_income_before_taxes.6.0.0\",\r\n },\r\n {\r\n metaId: \"deferred_income_taxes\",\r\n desc: \"Deferred income tax expense\",\r\n type: \"input\",\r\n printId: \"deferred_income_taxes.6.0.1\",\r\n },\r\n {\r\n metaId: \"current_income_taxes\",\r\n desc: \"Current income tax expense\",\r\n type: \"input\",\r\n printId: \"current_income_taxes.6.0.2\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Other Items\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"blank\",\r\n printId: \"other_items.6.0.2\",\r\n },\r\n {\r\n metaId: \"dividends_declared\",\r\n desc: \"Dividend(s) declared (-)\",\r\n type: \"input\",\r\n printId: \"dividends_declared.6.0.3\",\r\n },\r\n {\r\n metaId: \"currency_adjustments\",\r\n desc: \"Currency adjustment(s) (+/-)\",\r\n type: \"input\",\r\n printId: \"currency_adjustments.6.0.4\",\r\n },\r\n {\r\n metaId: \"prior_year_adjustments\",\r\n desc: \"Prior year adjustment(s) (+/-)\",\r\n type: \"input\",\r\n printId: \"prior_year_adjustments.6.0.5\",\r\n },\r\n {\r\n metaId: \"other_items_affecting_re\",\r\n desc: \"Other items affecting retained earnings\",\r\n type: \"input\",\r\n printId: \"other_items_affecting_re.6.0.6\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n metaId: \"closing_re\",\r\n type: \"calculatedMap\",\r\n desc: \"Closing Retained Earnings/(Deficit)\",\r\n printId: \"closing_re.6.0.7\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Current Year Difference - Book v. Taxable Income/(Loss)\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"blank\",\r\n printId: \"current_year_difference_book_v_taxable_income_loss.6.0.3\",\r\n },\r\n {\r\n metaId: \"cy_difference_reconciliation\",\r\n desc: \"Reconciliation Adjustment(s)\",\r\n type: \"detailed_input\",\r\n printId: \"cy_difference_reconciliation.6.0.8\",\r\n },\r\n {\r\n metaId: \"remaining_unreconciled_total\",\r\n desc: \"Unreconciled Difference – Book v. Taxable Income/(Loss)\",\r\n type: \"calculatedMap\",\r\n printId: \"remaining_unreconciled_total.6.0.9\",\r\n },\r\n ],\r\n printId: \"retained_earnings.6.0\",\r\n },\r\n ],\r\n printId: \"continuity_of_retained_earnings.6\",\r\n },\r\n {\r\n name: \"Calculation of Adjusted Cost Base\",\r\n tabName: \"Calculation of Adjusted Cost Base\",\r\n id: \"acb-balances\",\r\n subSections: [\r\n {\r\n name: \"Calculation of Adjusted Cost Base\",\r\n id: \"acb-closing\",\r\n fields: [\r\n {\r\n desc: \"Opening ACB\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"opening\",\r\n metaId: \"acbBalance\",\r\n printId: \"acb_balance.7.1\",\r\n },\r\n {\r\n metaId: \"acb_adjustment_type\",\r\n desc: \"ACB Adjustment(s)\",\r\n cellClass: \"\",\r\n type: \"acb_detailed_input\",\r\n printId: \"acb_balance.7.1.1\",\r\n },\r\n // {\r\n // desc: \"Total pre-acquisition surplus dividends\",\r\n // cellClass: \"indent-4\",\r\n // type: \"calculated\",\r\n // path: [\"summary_acb\", \"pre_acq_acb_adjustment\"],\r\n // printId: \"acb_balance.7.1.2\",\r\n // },\r\n // {\r\n // desc: \"Recharacterized pre-acquisition surplus dividend(s)\",\r\n // cellClass: \"indent-4\",\r\n // type: \"calculated\",\r\n // path: [\"summary_acb\", \"pre_acq_rechar_acb_adjustment\"],\r\n // printId: \"acb_balance.7.1.3\",\r\n // },\r\n {\r\n desc: \"Net pre-acquisition surplus dividend(s)\",\r\n cellClass: \"indent-4\",\r\n type: \"calculated\",\r\n path: [\"summary_acb\", \"net_pre_acq_rechar\"],\r\n printId: \"acb_balance.7.1.4\",\r\n },\r\n {\r\n type: \"blank\",\r\n },\r\n {\r\n desc: \"Closing ACB\",\r\n cellClass: \"font-weight-bold\",\r\n type: \"closingAfterRechar\",\r\n metaId: \"acbBalance\",\r\n printId: \"acb_balance.7.3\",\r\n },\r\n ],\r\n printId: \"acb_balances_summary.7\",\r\n },\r\n ],\r\n },\r\n]\r\n\r\nexport default outputFields\r\n","// tslint:disable\r\n\r\nconst outputACBCalculator: any[] = [\r\n {\r\n name: \"Adjusted Cost Base Adjustments By Date\",\r\n id: \"adjustments-by-date\",\r\n tables: [\"table\"],\r\n },\r\n {\r\n name: \"Adjusted Cost Base Adjustments By Entry\",\r\n id: \"adjustments-by-entry\",\r\n tables: [\"openingBalance\", \"table\"],\r\n },\r\n]\r\n\r\nexport default outputACBCalculator\r\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Watch, Prop, Mixins } from \"vue-property-decorator\"\r\nimport _ from \"lodash\"\r\nimport { unformat } from \"accounting\"\r\nimport dateFns from \"date-fns\"\r\n// Project Imports\r\nimport outputFields from \"@/fixtures/outputFields\"\r\nimport outputACBCalculator from \"@/fixtures/outputACBCalculator\"\r\nimport Transaction from \"@/services/transaction/Transaction\"\r\nimport ConfirmBoxMixin from \"../../mixins/ConfirmBoxMixin\"\r\nimport {\r\n ForeignAffiliate,\r\n ReportingPeriod,\r\n OutputProfile,\r\n ProfileType,\r\n ACBAdjustmentType,\r\n BalanceTypes,\r\n ACBAdjustment,\r\n} from \"@/interfaces\"\r\nimport { sortPeriods } from \"../../util/sortPeriods\"\r\nimport { formatOutputMoney } from \"../../util/formatMoney\"\r\nimport { getDeepProperty } from \"../../util/getDeepProperty\"\r\nimport Calculator from \"../../services/calculator/Calculator\"\r\nimport { getChildrenFields } from \"../../store/calculator/getters\"\r\nimport ScheduleMixin from \"../../mixins/ScheduleMixin\"\r\nimport ProfileEditor from \"./ProfileEditor.vue\"\r\nimport ProfileSelector from \"./ProfileSelector.vue\"\r\nimport { outputProfile } from \"../../services/api\"\r\nimport { CalculatorHelpers } from \"../../services/calculator/CalculatorHelpers\"\r\nimport ModalButton from \"../utils/ModalButton.vue\"\r\nimport PDFMixin from \"../../mixins/PDFMixin\"\r\nimport draggable from \"vuedraggable\"\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport Alteration from \"@/services/calculator/Alteration\"\r\n\r\n@Component({\r\n components: { ProfileEditor, ProfileSelector, ModalButton, draggable },\r\n})\r\nexport default class CalculatorOutput extends Mixins(\r\n PDFMixin,\r\n ConfirmBoxMixin,\r\n ScheduleMixin\r\n) {\r\n // Button Props\r\n @Prop({ default: \"\" })\r\n public buttonClass!: object | string\r\n @Prop({ default: \"\" })\r\n public buttonStyle!: object | string\r\n @Prop({ default: \"primary\" })\r\n public buttonVariant!: string\r\n // Output props\r\n @Prop({ required: true })\r\n public foreignAffiliate!: ForeignAffiliate\r\n\r\n public fromReportingPeriod: any = \"\"\r\n public toReportingPeriod: any = \"\"\r\n\r\n public showModal: boolean = false\r\n public showSectionsModal: boolean = false\r\n public showProfileModal: any = {\r\n show: false,\r\n update: false,\r\n }\r\n public fields: any[] = []\r\n public sectionHierarchy: any[] = []\r\n public sectionHierarchyDraggable: any = []\r\n public reportSections: any[] = outputFields\r\n public defaultOutputProfile: any = {\r\n landscape: true,\r\n hideZeroRows: false,\r\n hideEmptySections: false,\r\n showRef: false,\r\n showSection: {},\r\n sectionKey: {},\r\n sectionKeyV1: [],\r\n sectionKeyV2: [],\r\n sectionOrder: [],\r\n recharLayout: \"v1\",\r\n draft: \"no-draft\",\r\n pageBreak: true,\r\n sortACBAdjustmentsByEntryColumn: \"date\",\r\n isDescendingACBAdjustmentsByEntryColumn: false,\r\n showAcbOutput: {},\r\n }\r\n public outputProfile: any = { ...this.defaultOutputProfile }\r\n public profileType: ProfileType = \"CA\"\r\n public reportTabState: number = 0\r\n\r\n public drag: boolean = false\r\n public showDraggable: boolean = false\r\n public profileChangeType: string = \"none\"\r\n\r\n public tabIndex = 0\r\n public acbByEntrySortParam: any[] = []\r\n public movementLabels: { [key: string]: string } = {\r\n pre_acq_acb_adjustment: \"Pre-Acquisition Surplus Dividend Paid\",\r\n dividend_paid_rechar:\r\n \"Recharacterized Pre-Acquisition Surplus Dividend (90-day Rule)\",\r\n }\r\n\r\n public periodBatchLocal: ReportingPeriod[] = []\r\n public outputACBCalculator: any[] = outputACBCalculator\r\n public defaultShowACBOutput: { [key: string]: boolean } = {}\r\n\r\n public get dragOptions() {\r\n return {\r\n animation: 200,\r\n disabled: false,\r\n ghostClass: \"ghost\",\r\n }\r\n }\r\n\r\n public get periodBatches() {\r\n // Set up all the periods from here that will be displayed in the output\r\n const sortedPeriods = this.foreignAffiliate.reporting_periods\r\n .sort(sortPeriods)\r\n .filter((reportingPeriod: ReportingPeriod) =>\r\n this.fromReportingPeriod != \"\" && this.toReportingPeriod != \"\"\r\n ? reportingPeriod.start_date >= this.fromReportingPeriod.start_date &&\r\n reportingPeriod.start_date <= this.toReportingPeriod.start_date\r\n : true\r\n )\r\n\r\n // Chunk up the periods into batches that will be the separate reports\r\n let i\r\n let j\r\n\r\n const chunk = 6\r\n const periodBatches = []\r\n for (i = 0, j = sortedPeriods.length; i < j; i += chunk) {\r\n periodBatches.push(sortedPeriods.slice(i, i + chunk))\r\n }\r\n\r\n return periodBatches\r\n }\r\n\r\n public get periodBatchesNoChunks() {\r\n // Set up all the periods from here that will be displayed in the output\r\n return this.foreignAffiliate.reporting_periods\r\n .sort(sortPeriods)\r\n .filter((reportingPeriod: ReportingPeriod) =>\r\n this.fromReportingPeriod != \"\" && this.toReportingPeriod != \"\"\r\n ? reportingPeriod.start_date >= this.fromReportingPeriod.start_date &&\r\n reportingPeriod.start_date <= this.toReportingPeriod.start_date\r\n : true\r\n )\r\n }\r\n\r\n public get assembleSectionOrder() {\r\n // codes sectionHierarchyDraggable to .sectionOrder\r\n // Saves arrangement to Profile\r\n return this.sectionHierarchyDraggable.map((sec: any) => {\r\n const children = sec.children\r\n\r\n return {\r\n id: sec.id,\r\n children: children.map((secChildren: any) => {\r\n const returnObj = { id: secChildren.id }\r\n return returnObj\r\n }),\r\n }\r\n })\r\n }\r\n public get disassembleSectionOrderFromProfile() {\r\n // Extracts section order from saved Profile\r\n\r\n if (this.outputProfile.sectionOrder.length === 0) {\r\n return null\r\n }\r\n\r\n return this.disassembleSectionOrder(this.outputProfile.sectionOrder)\r\n }\r\n\r\n public disassembleSectionOrder(sectionOrdering: any) {\r\n // re-arranges sectionHierarchyDraggable from .sectionOrder\r\n\r\n return sectionOrdering.map((secSO: any) => {\r\n const sectionH = this.sectionHierarchyDraggable.find(\r\n (secH: any) => secSO.id === secH.id\r\n )\r\n\r\n const sectionHchildren = secSO.children.map((secChildrenSO: any) =>\r\n sectionH.children.find(\r\n (secChildrenH: any) => secChildrenSO.id === secChildrenH.id\r\n )\r\n )\r\n sectionH.children = sectionHchildren\r\n\r\n return sectionH\r\n })\r\n }\r\n\r\n public get reportSectionsDraggable() {\r\n this.outputProfile.sectionOrder = this.assembleSectionOrder\r\n\r\n return this.sectionHierarchyDraggable.map((sec: any) => {\r\n const reportSection = this.reportSections.find(\r\n (secR: any) => secR.printId === sec.id\r\n )\r\n\r\n // save the Children Nodes\r\n const sectionHierarchyDraggableChildren = sec.children\r\n const reportSectionSubSection = reportSection.subSections\r\n\r\n // re-arrange the nested children nodes\r\n reportSection.subSections = sectionHierarchyDraggableChildren.map(\r\n (secSection: any) => {\r\n return reportSectionSubSection.find(\r\n (secSubSectionR: any) => secSubSectionR.printId === secSection.id\r\n )\r\n }\r\n )\r\n\r\n return reportSection\r\n })\r\n }\r\n\r\n /**\r\n * These are the reporting sections that are chosen by the user.\r\n */\r\n public get displayedReportSections() {\r\n return this.reportSectionsDraggable\r\n .filter((sec: any) => this.outputProfile.showSection[sec.printId])\r\n .map((sec: any) => {\r\n const children = sec.subSections\r\n .filter(\r\n (subSec: any) => this.outputProfile.showSection[subSec.printId]\r\n )\r\n .map((subSec: any) => {\r\n const children = subSec.fields\r\n .filter((field: any) => {\r\n if (field.printId) {\r\n return this.outputProfile.showSection[field.printId]\r\n } else {\r\n // accounts for type:\"blanks\", because they do not have a printId field.\r\n // this doesn't affect the SEP chlidren node because a printId is generated, which negates this issue\r\n return true\r\n }\r\n })\r\n .map((field: any) => {\r\n if (field.type === \"sep_periods\") {\r\n const children = field.fields\r\n .filter((sepField: any) => {\r\n const sepFieldMetaId =\r\n field.printId + \"_\" + sepField.metaId\r\n return this.outputProfile.showSection[sepFieldMetaId]\r\n })\r\n .map((sepField: any) => {\r\n const sepFieldMetaId =\r\n field.printId + \"_\" + sepField.metaId\r\n return {\r\n ...sepField,\r\n printId: sepFieldMetaId,\r\n }\r\n })\r\n return {\r\n ...field,\r\n fields: children,\r\n }\r\n }\r\n return {\r\n ...field,\r\n }\r\n })\r\n return {\r\n ...subSec,\r\n fields: children,\r\n }\r\n })\r\n return {\r\n ...sec,\r\n subSections: children,\r\n }\r\n })\r\n }\r\n\r\n /**\r\n * Object containing the output content.\r\n */\r\n public get outputTables() {\r\n const content: any = {}\r\n // this invokes the getter displayedReportSections()\r\n\r\n this.displayedReportSections.forEach((reportSection: any) => {\r\n const config = {\r\n hideZeroRows: reportSection.hasOwnProperty(\"hideZeroRows\")\r\n ? reportSection.hideZeroRows\r\n : true,\r\n hideEmptySections: reportSection.hasOwnProperty(\"hideEmptySections\")\r\n ? reportSection.hideEmptySections\r\n : true,\r\n }\r\n const weakMap = new WeakMap()\r\n this.periodBatches.forEach((periodBatch: any) => {\r\n if (reportSection.subSections) {\r\n const subSectionContent: any = {}\r\n reportSection.subSections.forEach((subSection: any) => {\r\n const tableContent: any[] = this.createTableData(\r\n periodBatch,\r\n subSection.fields,\r\n config\r\n )\r\n if (tableContent.length > 0) {\r\n subSectionContent[subSection.id] = tableContent\r\n }\r\n })\r\n if (Object.keys(subSectionContent).length > 0) {\r\n weakMap.set(periodBatch, subSectionContent)\r\n }\r\n }\r\n })\r\n content[reportSection.id] = weakMap\r\n })\r\n return content\r\n }\r\n\r\n /**\r\n * These are the sections that have content.\r\n */\r\n public get shownSections() {\r\n return this.displayedReportSections.filter(\r\n (section: any) => this.sectionPeriodBatches(section).length > 0\r\n )\r\n }\r\n\r\n public get fromPeriodOptions() {\r\n const periods = this.reportingPeriods.slice()\r\n return periods\r\n .filter((reportingPeriod: ReportingPeriod) => {\r\n return this.toReportingPeriod != \"\"\r\n ? reportingPeriod.start_date <= this.toReportingPeriod.start_date\r\n : true\r\n })\r\n .map((item: ReportingPeriod) => ({\r\n value: item,\r\n text: `${item.start_date} to ${item.end_date}`,\r\n }))\r\n }\r\n\r\n public get toPeriodOptions() {\r\n const periods = this.reportingPeriods.slice()\r\n return periods\r\n .filter((reportingPeriod: ReportingPeriod) => {\r\n return this.fromReportingPeriod != \"\"\r\n ? reportingPeriod.start_date >= this.fromReportingPeriod.start_date\r\n : true\r\n })\r\n .map((item: ReportingPeriod) => ({\r\n value: item,\r\n text: `${item.start_date} to ${item.end_date}`,\r\n }))\r\n }\r\n\r\n public sectionPeriodBatches(section: any) {\r\n const content: WeakMap = this.outputTables[section.id]\r\n if (content) {\r\n return this.periodBatches.filter((periodBatch: any) =>\r\n content.has(periodBatch)\r\n )\r\n }\r\n return []\r\n }\r\n\r\n public periodBatchSubSections(\r\n section: any,\r\n periodBatch: any,\r\n subSections: any[]\r\n ) {\r\n const content: WeakMap = this.outputTables[section.id]\r\n if (content && content.has(periodBatch)) {\r\n const subsectionKeys = Object.keys(content.get(periodBatch))\r\n return subSections.filter((subsection: any) =>\r\n subsectionKeys.includes(subsection.id)\r\n )\r\n }\r\n return []\r\n }\r\n\r\n public subSectionsTableContent(\r\n section: any,\r\n periodBatch: any,\r\n subSection: any\r\n ) {\r\n const content: WeakMap = this.outputTables[section.id]\r\n if (content && content.has(periodBatch)) {\r\n const tableContents = content.get(periodBatch)\r\n return tableContents[subSection.id]\r\n }\r\n return []\r\n }\r\n\r\n public toggleChildren(section: any, value: boolean) {\r\n if (section.children && section.children.length > 0) {\r\n section.children.forEach((sec: any) => {\r\n // If this entry corresponds with the current layout or is undefined (meaning it can occur in layout v1 or v2), then toggle the id.\r\n if (\r\n sec.recharLayout === this.outputProfile.recharLayout ||\r\n sec.recharLayout === undefined\r\n ) {\r\n this.outputProfile.showSection[sec.id] = value\r\n this.toggleChildren(sec, value)\r\n }\r\n })\r\n }\r\n }\r\n\r\n public showSection(section: any) {\r\n return (\r\n section.children &&\r\n section.children.length > 0 &&\r\n this.outputProfile.showSection[section.id]\r\n )\r\n }\r\n\r\n public toggleAllSections(toggle: boolean) {\r\n Object.keys(this.outputProfile.showSection).forEach(\r\n (key: string) => (this.outputProfile.showSection[key] = toggle)\r\n )\r\n }\r\n\r\n public toggleRecharLayout(value: any) {\r\n let toggleV1: boolean\r\n let toggleV2: boolean\r\n\r\n if (value == \"v1\") {\r\n toggleV1 = true\r\n toggleV2 = !toggleV1\r\n } else {\r\n // \"v2\"\r\n toggleV1 = false\r\n toggleV2 = !toggleV1\r\n }\r\n\r\n this.outputProfile.sectionKeyV1.forEach(\r\n (key: string) => (this.outputProfile.showSection[key] = toggleV1)\r\n )\r\n this.outputProfile.sectionKeyV2.forEach(\r\n (key: string) => (this.outputProfile.showSection[key] = toggleV2)\r\n )\r\n }\r\n\r\n public mounted() {\r\n // Set the starting reporting periods\r\n this.fromReportingPeriod = this.reportingPeriods[0]\r\n this.toReportingPeriod = this.reportingPeriods[\r\n this.reportingPeriods.length - 1\r\n ]\r\n\r\n this.setupSectionHierarchy()\r\n\r\n // Populate default showACBOutput option.\r\n this.defaultOutputProfile.showAcbOutput = this.setupShowAcbOutput()\r\n this.outputProfile.showAcbOutput = _.clone(\r\n this.defaultOutputProfile.showAcbOutput\r\n )\r\n // Populate dropdown options for 'By Entry' sort.\r\n this.acbByEntrySortParam = this.ACBAdjustmentByEntrySortParams()\r\n }\r\n\r\n public setupSectionHierarchy() {\r\n const hiddenSections: string[] = []\r\n\r\n if (!this.isAcbEnabled) {\r\n hiddenSections.push(\"acb-balances\")\r\n }\r\n\r\n const filterHiddenSections = (section: any) =>\r\n !hiddenSections.includes(section.id)\r\n\r\n // Create the structure of sections tree\r\n this.sectionHierarchy = outputFields\r\n .filter(filterHiddenSections)\r\n .map((section: any, sectionIndex: any) => {\r\n const sectionId = section.printId\r\n\r\n this.addSection(sectionId, section)\r\n const children = section.subSections.map(\r\n (subSection: any, subsectionIndex: any) => {\r\n const subsectionId = subSection.printId\r\n\r\n this.addSection(subsectionId, subSection)\r\n const children = subSection.fields.map((field: any, index: any) => {\r\n const fieldId = field.printId\r\n\r\n this.addSection(fieldId, field)\r\n if (field.type === \"sep_periods\") {\r\n // Checks if it is a SEP\r\n\r\n const children = field.fields.map(\r\n (sepField: any, sepFieldId: any) => {\r\n const sepFieldMetaId = fieldId + \"_\" + sepField.metaId\r\n\r\n this.addSection(sepFieldMetaId, sepField)\r\n\r\n return {\r\n id: sepFieldMetaId,\r\n label: sepField.desc,\r\n }\r\n }\r\n )\r\n return {\r\n id: fieldId,\r\n children,\r\n label: \"SEP\",\r\n }\r\n }\r\n return {\r\n id: fieldId,\r\n label: field.desc,\r\n recharLayout: field.recharLayout,\r\n }\r\n })\r\n return {\r\n id: subsectionId,\r\n children,\r\n label: subSection.name,\r\n }\r\n }\r\n )\r\n return {\r\n id: sectionId,\r\n children,\r\n label: section.name,\r\n }\r\n })\r\n // note: sectionHierarchy is not modified, only sectionHierarchyDraggable is modified from this point on.\r\n // sectionHierarchy is the default order of the sections.\r\n // A deep copy of the variable is initiated.\r\n this.defaultSectionHierarchy()\r\n }\r\n\r\n public addSection(sectionId: string, section: any = null) {\r\n // Forces the creation of the showSection Array that controls the tick marks\r\n this.$set(this.outputProfile.showSection, sectionId, true)\r\n\r\n // creates an array to reference the sectionId's that corresponds with laytout v1 and v2\r\n // this is used for toggling between the 2 layouts. saving these values to an array avoids recursively searching through the hierarchy every time.\r\n if (section !== null) {\r\n if (section.recharLayout === \"v1\") {\r\n this.outputProfile.sectionKeyV1.push(sectionId)\r\n } else if (section.recharLayout === \"v2\") {\r\n // Force the sectionId that corresponds to v2 to be false\r\n this.$set(this.outputProfile.showSection, sectionId, false)\r\n this.outputProfile.sectionKeyV2.push(sectionId)\r\n } else {\r\n // pass. Do nothing when section.recharLayout is undefined.\r\n }\r\n }\r\n }\r\n\r\n public formatFieldDescription(field: any) {\r\n const { indent, desc, cellClass } = field\r\n let formattedDesc = desc\r\n\r\n if (cellClass) {\r\n formattedDesc = `
${formattedDesc}
`\r\n }\r\n\r\n return formattedDesc\r\n }\r\n\r\n public formatWPRow(value: any) {\r\n return `
${value}
`\r\n }\r\n\r\n public createTableData(\r\n periodBatch: ReportingPeriod[],\r\n fields: any[],\r\n config: any = {}\r\n ) {\r\n // For each line that needs to be added, also need to add the values for each reporting period\r\n let rows: any[] = []\r\n const hideZeroRows = this.outputProfile.hideZeroRows && config.hideZeroRows\r\n const hideEmptySections =\r\n this.outputProfile.hideEmptySections && config.hideEmptySections\r\n fields.forEach((field: any, index: number, arrFields: any[]) => {\r\n const {\r\n metaId,\r\n printId,\r\n type,\r\n desc,\r\n path,\r\n indent,\r\n cellClass,\r\n precision,\r\n cellStyle,\r\n fields,\r\n details,\r\n } = field\r\n const formattedDesc = this.formatFieldDescription(field)\r\n const newRow: any = {\r\n desc: formattedDesc || \" \",\r\n type,\r\n }\r\n\r\n // No need to add values for 'blank' rows\r\n if (type === \"blank\") {\r\n // ======= Dynamically removes the type=\"blank\" if certain criteras are met =======\r\n // only applicable to: { type=\"blank\" }\r\n\r\n if (arrFields.length - 1 === index) {\r\n // If last entry is blank, and they don't have desc, cellClass and (printId or metaID)\r\n if (\r\n desc == null &&\r\n cellClass == null &&\r\n (printId == null || metaId == null)\r\n ) {\r\n return\r\n }\r\n }\r\n\r\n if (index - 1 >= 0) {\r\n // when 2 type=\"blank\" stacks, and they don't have desc, cellClass and (printId or metaID)\r\n const {\r\n desc: descPrev,\r\n cellClass: cellClassPrev,\r\n printId: printIdPrev,\r\n metaId: metaIdPrev,\r\n } = arrFields[index - 1]\r\n\r\n if (\r\n desc == null &&\r\n cellClass == null &&\r\n (printId == null || metaId == null) &&\r\n descPrev == null &&\r\n cellClassPrev == null &&\r\n (printIdPrev == null || metaIdPrev == null)\r\n ) {\r\n return\r\n }\r\n } else {\r\n // If first entry is blank, and they don't have desc, cellClass and (printId or metaID)\r\n if (\r\n desc == null &&\r\n cellClass == null &&\r\n (printId == null || metaId == null)\r\n ) {\r\n return\r\n }\r\n }\r\n\r\n rows.push(newRow)\r\n return\r\n } else if (type === \"sep_periods\") {\r\n if (path && fields) {\r\n const sepRows = this.sepPeriodSections(\r\n periodBatch,\r\n path,\r\n fields,\r\n config\r\n )\r\n rows = rows.concat(sepRows)\r\n }\r\n return\r\n } else if (type === \"detailed_input\") {\r\n if (metaId) {\r\n const detailedRows = this.detailedInputSections(\r\n periodBatch,\r\n field,\r\n config\r\n )\r\n rows = rows.concat(detailedRows)\r\n }\r\n return\r\n } else if (type === \"acb_detailed_input\") {\r\n if (metaId) {\r\n const acbDetailedRows = this.acbAdjustmentOutput(\r\n periodBatch,\r\n field,\r\n config\r\n )\r\n rows = rows.concat(acbDetailedRows)\r\n }\r\n return\r\n } else if (\r\n type === \"input\" &&\r\n this.outputProfile.showRef &&\r\n CalculatorHelpers.scheduleFields.includes(metaId) &&\r\n (details != undefined ? details : true)\r\n ) {\r\n // details property is used to determine which schedule fields can be broken down\r\n if (metaId) {\r\n const detailedRows = this.detailedInputSections(\r\n periodBatch,\r\n field,\r\n config\r\n )\r\n rows = rows.concat(detailedRows)\r\n }\r\n return\r\n }\r\n // Iterate all the periods to add their values\r\n periodBatch.forEach((reportingPeriod: ReportingPeriod) => {\r\n const {\r\n openings,\r\n id,\r\n calculator,\r\n sepOpening,\r\n closings,\r\n localFields,\r\n } = reportingPeriod\r\n // Depending on the field type, we'll decide how/where to get the values from\r\n let value = 0\r\n switch (type) {\r\n case \"opening\":\r\n if (metaId === \"opening_sep\") {\r\n value = sepOpening || 0\r\n } else if (openings && openings[metaId] !== undefined) {\r\n const noRecharNeeded = [\"acbBalance\", \"openingReDeficit\"]\r\n if (noRecharNeeded.includes(metaId)) {\r\n value = openings[metaId]\r\n } else {\r\n value =\r\n openings[metaId] -\r\n (openings.recharacterizedAmounts\r\n ? openings.recharacterizedAmounts[metaId]\r\n : 0)\r\n }\r\n } else if (openings && metaId === \"netBalance\") {\r\n value =\r\n openings[\"exemptBalance\"] +\r\n openings[\"hybridBalance\"] +\r\n openings[\"taxableBalance\"] -\r\n (openings.recharacterizedAmounts\r\n ? openings.recharacterizedAmounts[\"exemptBalance\"]\r\n : 0) -\r\n (openings.recharacterizedAmounts\r\n ? openings.recharacterizedAmounts[\"hybridBalance\"]\r\n : 0) -\r\n (openings.recharacterizedAmounts\r\n ? openings.recharacterizedAmounts[\"taxableBalance\"]\r\n : 0)\r\n }\r\n break\r\n case \"closingAfterRechar\": // balance shows closing after recharacterized amount is applied\r\n if (closings && closings[metaId] !== undefined) {\r\n value = closings[metaId]\r\n } else if (closings && metaId === \"netBalance\") {\r\n value =\r\n closings[\"exemptBalance\"] +\r\n closings[\"hybridBalance\"] +\r\n closings[\"taxableBalance\"]\r\n }\r\n break\r\n case \"closing\": // balance shows closing before recharacterized amount is applied\r\n if (closings && closings[metaId] !== undefined) {\r\n value =\r\n closings[metaId] -\r\n (closings.recharacterizedAmounts\r\n ? closings.recharacterizedAmounts[metaId]\r\n : 0)\r\n } else if (closings && metaId === \"netBalance\") {\r\n value =\r\n closings[\"exemptBalance\"] +\r\n closings[\"hybridBalance\"] +\r\n closings[\"taxableBalance\"] -\r\n (closings.recharacterizedAmounts\r\n ? closings.recharacterizedAmounts[\"exemptBalance\"]\r\n : 0) -\r\n (closings.recharacterizedAmounts\r\n ? closings.recharacterizedAmounts[\"hybridBalance\"]\r\n : 0) -\r\n (closings.recharacterizedAmounts\r\n ? closings.recharacterizedAmounts[\"taxableBalance\"]\r\n : 0)\r\n }\r\n break\r\n case \"input\":\r\n const field = this.periodField(metaId, id)\r\n if (field) {\r\n value = this.periodFieldValue(metaId, id)\r\n } else {\r\n value = localFields[metaId]\r\n }\r\n break\r\n case \"calculated\":\r\n if (path && calculator) {\r\n value = getDeepProperty(\r\n path,\r\n (calculator as Calculator).generatedOutput // this invokes a getter\r\n )\r\n }\r\n break\r\n case \"calculatedMap\":\r\n // Since there are values that need to be calculated per period, need to use a function that accepts a reporting period\r\n const valueFunction = this.calculatedValuesMap[metaId]\r\n if (valueFunction) {\r\n value = valueFunction(reportingPeriod)\r\n }\r\n break\r\n }\r\n\r\n // Add value to the row\r\n newRow[`period_${id}`] = `${formatOutputMoney(value, precision || 0)}`\r\n })\r\n\r\n // Append row\r\n if (hideZeroRows) {\r\n if (!this.isZeroRow(newRow)) {\r\n rows.push(newRow)\r\n }\r\n } else {\r\n rows.push(newRow)\r\n }\r\n })\r\n\r\n if (hideZeroRows) {\r\n const isBlankRow = (row: any) =>\r\n row.desc === \" \" && row.type === \"blank\"\r\n const isHeadingRow = (row: any) =>\r\n row.desc && row.desc !== \" \" && row.type === \"blank\"\r\n const removeSequentialBlankRows = (rows: any[]) => {\r\n // Since we are hiding zero rows, also wanna make sure we dont have any hovering blank lines\r\n let i = rows.length\r\n while (i-- > 0) {\r\n const currentRow = rows[i]\r\n let nextRow = null\r\n if (i < rows.length - 1) {\r\n nextRow = rows[i + 1]\r\n }\r\n if (\r\n currentRow &&\r\n (isHeadingRow(currentRow) || isBlankRow(currentRow))\r\n ) {\r\n // if its a heading row and the last row, we can delete it\r\n if (!nextRow) {\r\n rows.splice(i, 1)\r\n } else if (isBlankRow(nextRow)) {\r\n rows.splice(i, 2)\r\n i--\r\n }\r\n } else if (currentRow && isBlankRow(currentRow) && !nextRow) {\r\n // if its a blank row and there is no next must be a trailing empty row\r\n rows.splice(i, 1)\r\n }\r\n }\r\n }\r\n removeSequentialBlankRows(rows)\r\n }\r\n\r\n // if wanna hide the empty sections, check that there is some row that isnt zero\r\n if (hideEmptySections) {\r\n if (rows.some((row: any) => !this.isZeroRow(row))) {\r\n return rows\r\n } else {\r\n return []\r\n }\r\n }\r\n\r\n return rows\r\n }\r\n\r\n public isZeroRow(row: any) {\r\n return Object.keys(row)\r\n .filter(key => key.includes(\"period\"))\r\n .every((key: string) => {\r\n const value = unformat(row[key])\r\n return value == 0\r\n })\r\n }\r\n\r\n public detailedInputSections(\r\n periodBatch: ReportingPeriod[],\r\n outputField: any,\r\n config: any = {}\r\n ) {\r\n const { desc, metaId, order, totalLineText, cellClass } = outputField\r\n const hideZeroRows = this.outputProfile.hideZeroRows && config.hideZeroRows\r\n // Figure out what indent to use for the items,\r\n let itemIndent = \"indent-4\"\r\n const indentMatches = cellClass ? cellClass.match(/^indent-([0-6])$/) : null\r\n if (indentMatches) {\r\n const indent = parseInt(indentMatches[1], 10) + 2\r\n itemIndent = `indent-${indent}`\r\n }\r\n const newRows: any[] = []\r\n const totals: any = {\r\n desc: this.formatFieldDescription({\r\n desc: totalLineText ? totalLineText : \"Total\",\r\n cellClass: cellClass ? cellClass : `font-weight-bold`,\r\n }),\r\n }\r\n\r\n // Need to find all the adjusments that are in common for this one field\r\n let userFields: any[] = []\r\n periodBatch.forEach((rp: ReportingPeriod) => {\r\n const periodId = `period_${rp.id}`\r\n totals[periodId] = `${formatOutputMoney(0)}`\r\n userFields = userFields.concat(\r\n getChildrenFields(metaId, rp).map((f: any) => {\r\n return {\r\n ...f,\r\n field_name: {\r\n ...f.field_name,\r\n metadata: f.field_name.metadata\r\n ? JSON.parse(f.field_name.metadata)\r\n : {},\r\n },\r\n }\r\n })\r\n )\r\n })\r\n // Group the fields by the description.\r\n const fieldsGroupedByDesc: any = _.groupBy(userFields, field =>\r\n _.snakeCase(\r\n field.field_name.metadata.description ||\r\n field.field_name.metadata.client_description\r\n )\r\n )\r\n\r\n let descFieldIds = Object.keys(fieldsGroupedByDesc)\r\n // Order the fields if needed\r\n if (order) {\r\n descFieldIds = _.sortBy(descFieldIds, field => {\r\n const index = _.indexOf(order, field)\r\n return index < 0 ? 999 : index\r\n })\r\n }\r\n\r\n // Set the header value\r\n newRows.push({\r\n desc: this.formatFieldDescription({\r\n desc,\r\n cellClass: cellClass ? cellClass : `font-weight-bold`,\r\n }),\r\n })\r\n\r\n if (userFields.length > 0) {\r\n let rowAdded = false\r\n descFieldIds.forEach((descFieldId: string) => {\r\n const descFields: any[] = fieldsGroupedByDesc[descFieldId]\r\n // Capture row desciption which will be used for every ref line\r\n let rowDescription: any = \"N/A\"\r\n if (descFields.length !== 0) {\r\n if (\"description\" in descFields[0].field_name.metadata) {\r\n rowDescription = descFields[0].field_name.metadata.description\r\n } else if (\r\n \"client_description\" in descFields[0].field_name.metadata\r\n ) {\r\n rowDescription =\r\n descFields[0].field_name.metadata.client_description\r\n }\r\n if (rowDescription === undefined) {\r\n rowDescription = \"N/A\"\r\n }\r\n }\r\n const newRow: any = {\r\n desc: this.formatFieldDescription({\r\n desc: rowDescription !== \"\" ? rowDescription : \"Other Adjustments\",\r\n cellClass: itemIndent,\r\n }),\r\n }\r\n const wprRow: any = {\r\n desc: this.formatFieldDescription({\r\n desc: \"Working Paper Reference\",\r\n cellClass: itemIndent + \" text-danger\",\r\n }),\r\n }\r\n\r\n periodBatch.forEach(({ id }) => {\r\n const periodHeaderId = `period_${id}`\r\n newRow[periodHeaderId] = `${formatOutputMoney(0)}`\r\n\r\n const periodFields = descFields.filter(\r\n (f: any) => f.reporting_period == id\r\n )\r\n\r\n // Add value to the row\r\n if (periodFields.length > 0) {\r\n // Concatenate all the refs into one\r\n const rowRefs: string[] = periodFields\r\n .map(\r\n f =>\r\n f.field_name.metadata.ref || f.field_name.metadata.client_ref\r\n )\r\n .filter(\r\n (ref, index, array) =>\r\n ref != null && array.indexOf(ref) === index\r\n )\r\n\r\n // Since a user could technically add multiple adjusments with the same description, we wanna sum them up PER reporting period.\r\n const value = periodFields.reduce(\r\n (acc: number, f: any) => (acc = acc + f.value),\r\n 0\r\n )\r\n\r\n totals[periodHeaderId] = formatOutputMoney(\r\n unformat(totals[periodHeaderId]) + value\r\n )\r\n newRow[periodHeaderId] = `${formatOutputMoney(value)}`\r\n\r\n wprRow[periodHeaderId] = this.formatWPRow(\r\n rowRefs.length > 0 ? rowRefs.join(\", \") : \"N/A\"\r\n )\r\n }\r\n })\r\n\r\n // Append desc row and its wpf row\r\n const addRows = () => {\r\n rowAdded = true\r\n newRows.push(newRow)\r\n if (this.outputProfile.showRef) {\r\n newRows.push(wprRow)\r\n }\r\n }\r\n\r\n if (hideZeroRows) {\r\n // If the row contains at least one number that isnt zero, push it\r\n if (!this.isZeroRow(newRow)) {\r\n addRows()\r\n }\r\n } else {\r\n addRows()\r\n }\r\n })\r\n\r\n // If no rows were added and want to hide zero rows, return empty array (leading to table not showing)\r\n if (!rowAdded && hideZeroRows) {\r\n return []\r\n }\r\n } else if (hideZeroRows) {\r\n // Since there are no fields, and dont wanna show empty rows, return empty array\r\n return []\r\n } else {\r\n // Add row specifying there are no items.\r\n newRows.push({\r\n desc: this.formatFieldDescription({\r\n desc: \"No Items\",\r\n cellClass: itemIndent,\r\n }),\r\n })\r\n }\r\n\r\n // Include the totals line\r\n newRows.push(totals)\r\n\r\n return newRows\r\n }\r\n\r\n public acbAdjustmentOutput(\r\n periodBatch: ReportingPeriod[],\r\n outputField: any,\r\n config: any = {}\r\n ) {\r\n const { desc, metaId, order, totalLineText, cellClass } = outputField\r\n const hideZeroRows = this.outputProfile.hideZeroRows && config.hideZeroRows\r\n // Figure out what indent to use for the items,\r\n let itemIndent = \"indent-4\"\r\n const indentMatches = cellClass ? cellClass.match(/^indent-([0-6])$/) : null\r\n if (indentMatches) {\r\n const indent = parseInt(indentMatches[1], 10) + 2\r\n itemIndent = `indent-${indent}`\r\n }\r\n const newRows: any[] = []\r\n const totals: any = {\r\n desc: this.formatFieldDescription({\r\n desc: totalLineText ? totalLineText : \"Total\",\r\n cellClass: cellClass ? cellClass : `font-weight-bold`,\r\n }),\r\n }\r\n\r\n // Need to find all the adjusments that are in common for this one field\r\n let acbFields: any[] = []\r\n periodBatch.forEach((rp: ReportingPeriod) => {\r\n const periodId = `period_${rp.id}`\r\n totals[periodId] = `${formatOutputMoney(0)}`\r\n if (rp.acb_adjustments) {\r\n acbFields = acbFields.concat([...rp.acb_adjustments])\r\n }\r\n })\r\n\r\n // Group the fields by the type.\r\n const fieldsGroupedByType: any = _.groupBy(acbFields, o => {\r\n return o.type\r\n })\r\n\r\n const descFieldIds = Object.keys(fieldsGroupedByType)\r\n\r\n // Set the header value\r\n // newRows.push({\r\n // desc: this.formatFieldDescription({\r\n // desc,\r\n // cellClass: cellClass ? cellClass : `font-weight-bold`,\r\n // }),\r\n // })\r\n\r\n if (acbFields.length > 0) {\r\n let rowAdded = false\r\n descFieldIds.forEach((descFieldId: string) => {\r\n const descFields: any[] = fieldsGroupedByType[descFieldId]\r\n // Capture row desciption which will be used for every ref line // from mixin\r\n const rowDescription = (this.acbAdjustmentTypes.find(\r\n option => option.id.toString() == descFieldId\r\n ) as ACBAdjustmentType).name\r\n const newRow: any = {\r\n desc: this.formatFieldDescription({\r\n desc: rowDescription,\r\n cellClass: itemIndent,\r\n }),\r\n }\r\n const wprRow: any = {\r\n desc: this.formatFieldDescription({\r\n desc: \"Working Paper Reference\",\r\n cellClass: itemIndent + \" text-danger\",\r\n }),\r\n }\r\n\r\n periodBatch.forEach(({ id }) => {\r\n const periodHeaderId = `period_${id}`\r\n newRow[periodHeaderId] = `${formatOutputMoney(0)}`\r\n\r\n const periodFields = descFields.filter(\r\n (f: any) => f.reporting_period == id\r\n )\r\n\r\n // Add value to the row\r\n if (periodFields.length > 0) {\r\n // Concatenate all the refs into one\r\n const rowRefs: string[] = periodFields\r\n .map(f => f.ref || f.client_ref)\r\n .filter(\r\n (ref, index, array) =>\r\n ref != null && array.indexOf(ref) === index\r\n )\r\n\r\n // Since a user could technically add multiple adjusments with the same description, we wanna sum them up PER reporting period.\r\n const value = periodFields.reduce(\r\n (acc: number, f: any) => (acc = acc + f.amount),\r\n 0\r\n )\r\n\r\n totals[periodHeaderId] = formatOutputMoney(\r\n unformat(totals[periodHeaderId]) + value\r\n )\r\n newRow[periodHeaderId] = `${formatOutputMoney(value)}`\r\n\r\n wprRow[periodHeaderId] = this.formatWPRow(\r\n rowRefs.length > 0 ? rowRefs.join(\", \") : \"N/A\"\r\n )\r\n }\r\n })\r\n\r\n // Append desc row and its wpf row\r\n const addRows = () => {\r\n rowAdded = true\r\n newRows.push(newRow)\r\n if (this.outputProfile.showRef) {\r\n newRows.push(wprRow)\r\n }\r\n }\r\n\r\n if (hideZeroRows) {\r\n // If the row contains at least one number that isnt zero, push it\r\n if (!this.isZeroRow(newRow)) {\r\n addRows()\r\n }\r\n } else {\r\n addRows()\r\n }\r\n })\r\n\r\n // If no rows were added and want to hide zero rows, return empty array (leading to table not showing)\r\n if (!rowAdded && hideZeroRows) {\r\n return []\r\n }\r\n } else if (hideZeroRows) {\r\n // Since there are no fields, and dont wanna show empty rows, return empty array\r\n return []\r\n } else {\r\n // Add row specifying there are no items.\r\n newRows.push({\r\n desc: this.formatFieldDescription({\r\n desc: \"No Items\",\r\n cellClass: itemIndent,\r\n }),\r\n })\r\n }\r\n\r\n // Include the totals line\r\n // newRows.push(totals)\r\n\r\n return newRows\r\n }\r\n\r\n public sepPeriodSections(\r\n periodBatch: ReportingPeriod[],\r\n path: any[],\r\n fields: any[],\r\n config: any = {}\r\n ) {\r\n const newRows: any[] = []\r\n const hideZeroRows = this.outputProfile.hideZeroRows && config.hideZeroRows\r\n // Need to iterate through all the SEPs of each period at\r\n // the same time to have the line up correctly\r\n let maxSEPs = 0\r\n\r\n periodBatch.forEach(({ calculator }) => {\r\n if (calculator) {\r\n const SEPs = calculator.getTransactions.filter(\r\n (t: Transaction) => t.getActionType === \"sepAdjustment\"\r\n ).length\r\n if (SEPs > maxSEPs) {\r\n maxSEPs = SEPs\r\n }\r\n }\r\n })\r\n // Go through all the SEPs\r\n for (let i = 0; i < maxSEPs + 1; i++) {\r\n let SEPTarget = \"\"\r\n let showLastClosing = true\r\n\r\n if (i < maxSEPs) {\r\n SEPTarget = `sep_${i}`\r\n } else {\r\n SEPTarget = `last`\r\n\r\n // Since we need to omit showing the last line for the last SEP on the following sections\r\n const omitLastLine = [\"calculated_hut\", \"calculated_hs\"]\r\n if (path && path.length > 0 && omitLastLine.includes(path[0])) {\r\n showLastClosing = false\r\n }\r\n }\r\n\r\n fields.forEach((field: any, index: number, arrFields: any[]) => {\r\n const { precision, type, metaId, desc } = field\r\n const fieldTemp: any = { ...field } // makes a copy of field, due to overwrite of desc\r\n\r\n if (metaId === \"sep_period_title\") {\r\n if (i < maxSEPs) {\r\n fieldTemp.desc = field.desc + \" \" + `${i + 1}`\r\n } else {\r\n fieldTemp.desc = \"Last\" + \" \" + field.desc\r\n }\r\n }\r\n\r\n if (metaId === \"closing_surplus\") {\r\n if (i < maxSEPs) {\r\n fieldTemp.desc = field.desc + \" for SEP Period \" + `${i + 1}`\r\n } else {\r\n let appendToEnd: string = \"\"\r\n switch (path[0]) {\r\n case \"calculated_es\":\r\n appendToEnd = \" before Exempt Earnings/(Loss)\"\r\n break\r\n case \"calculated_ts\":\r\n appendToEnd = \" before Taxable Earnings/(Loss)\"\r\n break\r\n case \"calculated_uft\":\r\n appendToEnd = \" Before Tax Applicable to Taxable Earnings\"\r\n break\r\n case \"calculated_hs\":\r\n // Note: \"calculated_hs\" is skipped as per omitLastLine\r\n break\r\n case \"calculated_hut\":\r\n // Note: \"calculated_hut\" is skipped as per omitLastLine\r\n break\r\n }\r\n\r\n fieldTemp.desc = field.desc + appendToEnd\r\n }\r\n }\r\n\r\n const formattedDesc = this.formatFieldDescription(fieldTemp)\r\n const newRow: any = {\r\n desc: formattedDesc || \" \",\r\n }\r\n\r\n if (metaId == \"closing_surplus\" && !showLastClosing) {\r\n return\r\n }\r\n\r\n if (\r\n path[0] === \"calculated_hut\" &&\r\n i === maxSEPs &&\r\n type === \"blank\" &&\r\n field.desc === undefined\r\n ) {\r\n // Removes an extra blank row when the last line is omitted for \"calculated_hut\" that separates \"Total adjustments\" and \"Closing Hut before adjustment\"\r\n return\r\n }\r\n\r\n // No need to add values for 'blank' rows\r\n if (type === \"blank\") {\r\n // ======= Dynamically removes the type=\"blank\" if certain criteras are met =======\r\n // only applicable to: { type=\"blank\" }\r\n\r\n if (index === 0 && desc === undefined) {\r\n // If in initial position of the array, and has a blank desc\r\n return\r\n } else if (arrFields.length - 1 === index && desc === undefined) {\r\n // If in final position of the array, and has a blank desc\r\n return\r\n }\r\n\r\n // ==============\r\n newRows.push(newRow)\r\n return\r\n }\r\n\r\n periodBatch.forEach(({ calculator, id }) => {\r\n if (calculator) {\r\n const SEPData = getDeepProperty(path, calculator.generatedOutput)\r\n if (SEPData && SEPData[SEPTarget]) {\r\n const value = SEPData[SEPTarget][metaId]\r\n // Add value to the row\r\n newRow[`period_${id}`] = `${formatOutputMoney(\r\n value,\r\n precision || 0\r\n )}`\r\n }\r\n }\r\n })\r\n\r\n // Append row\r\n if (hideZeroRows) {\r\n if (!this.isZeroRow(newRow)) {\r\n newRows.push(newRow)\r\n }\r\n } else {\r\n newRows.push(newRow)\r\n }\r\n })\r\n\r\n if (\r\n fields.length === 1 &&\r\n fields[0].type === \"blank\" &&\r\n fields[0].desc === undefined\r\n ) {\r\n // This isn't appropriate coding... but only for this specific case, blank row should not be shown\r\n } else {\r\n newRows.push({\r\n desc: \" \",\r\n })\r\n }\r\n }\r\n return newRows\r\n }\r\n\r\n public createTableStructure(\r\n periodBatch: ReportingPeriod[],\r\n tableName: string = \"\"\r\n ) {\r\n // Create the headers based on the periods\r\n const fields: any[] = [\r\n {\r\n key: \"desc\",\r\n label: \"\",\r\n thStyle: {\r\n width: \"30%\",\r\n },\r\n },\r\n ]\r\n\r\n periodBatch.forEach((rp: ReportingPeriod) =>\r\n fields.push({\r\n key: `period_${rp.id}`,\r\n label: `${rp.start_date} to ${rp.end_date}`,\r\n thClass: \"text-center\",\r\n tdClass: \"text-center\",\r\n })\r\n )\r\n\r\n return fields\r\n }\r\n\r\n public pdfStyleEditor(add: boolean = true) {\r\n const container = document\r\n const targetClass = \"desc-cell\"\r\n const targetedClasses: HTMLCollectionOf<\r\n Element\r\n > = container.getElementsByClassName(targetClass)\r\n for (const element of targetedClasses) {\r\n const parentCell = element.closest(\"td\") as HTMLElement\r\n for (const spanClass of element.classList) {\r\n if (spanClass !== targetClass) {\r\n if (add) {\r\n parentCell.classList.add(spanClass)\r\n } else {\r\n parentCell.classList.remove(spanClass)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n public getClassesFromCellData(data: any) {\r\n return data.cell.raw.getAttribute(\"class\")\r\n }\r\n\r\n public pageBreakToggle(sectionType: string) {\r\n const currentPDF: any = this.pdf\r\n const orientation = this.outputProfile.landscape ? \"landscape\" : \"portrait\"\r\n\r\n const pageBreakThresholdConfig: any = {\r\n landscape: {\r\n header: 0.65,\r\n section: 0.75,\r\n },\r\n portrait: {\r\n header: 0.7,\r\n section: 0.8,\r\n },\r\n }\r\n\r\n const minY =\r\n pageBreakThresholdConfig[orientation][sectionType] *\r\n currentPDF.internal.pageSize.getHeight()\r\n let pageBreakToggle: string\r\n\r\n if (\r\n currentPDF.lastAutoTable.finalY !== undefined &&\r\n currentPDF.lastAutoTable.finalY >= minY\r\n ) {\r\n // Ignores first pass because lastAutoTable.finalY is undefined\r\n pageBreakToggle = \"always\"\r\n } else {\r\n pageBreakToggle = \"auto\"\r\n }\r\n\r\n return pageBreakToggle\r\n }\r\n\r\n public exportPdf() {\r\n const descColWidth = this.outputProfile.landscape ? 70 : 50\r\n const font = \"helvetica\"\r\n this.pdf = this.createjsPdfInstance({\r\n orientation: this.outputProfile.landscape ? \"l\" : \"p\",\r\n format: \"a4\",\r\n unit: \"mm\",\r\n })\r\n let curPage = 0\r\n\r\n const tableConfig = {\r\n theme: \"plain\",\r\n useCss: false,\r\n styles: {\r\n font,\r\n cellPadding: 1,\r\n },\r\n headStyles: {\r\n fontSize: 7,\r\n cellPadding: 1,\r\n lineWidth: 0.2,\r\n halign: \"center\",\r\n },\r\n bodyStyles: {\r\n fontSize: 5,\r\n lineWidth: 0.2,\r\n overflow: \"visible\",\r\n halign: \"center\",\r\n },\r\n margin: {\r\n top: 40,\r\n },\r\n columnStyles: {\r\n 0: {\r\n cellWidth: descColWidth,\r\n halign: \"left\",\r\n },\r\n },\r\n }\r\n\r\n // Insert style into cells of table\r\n this.pdfStyleEditor()\r\n\r\n // Iterate through all sections and their respective subsections and add their tables\r\n this.periodBatches.forEach((rps: ReportingPeriod[], rpsIndex: number) => {\r\n // newRpsSection accounts for new page being inserted if chunk > 6\r\n // Therefore if it is a new reporting section it should ignore the pageBreakToggle() logic and go directly to \"auto\"\r\n let newRpsSection = true\r\n this.shownSections.forEach((section: any, reportIndex: number) => {\r\n const sectionId = `${section.id}-${reportIndex}`\r\n const header = document.getElementById(sectionId) as HTMLTableElement\r\n let headerAdded = false\r\n // Add the subsections as well\r\n section.subSections.forEach((subSection: any) => {\r\n const subSectionId = `${subSection.id}-${rpsIndex}`\r\n const source = document.getElementById(\r\n subSectionId\r\n ) as HTMLTableElement\r\n if (source) {\r\n // for some reason this is editing the source in place, so copying it fixes ref issues\r\n const newSource = source.cloneNode(true)\r\n // Since we only wanna add the header if we have subsections to show, then we gotta do the header check here\r\n if (!headerAdded && header) {\r\n // @ts-ignore\r\n this.pdf.autoTable({\r\n html: header,\r\n margin: {\r\n top: 40,\r\n },\r\n headStyles: {\r\n fontSize: 9,\r\n cellPadding: 1,\r\n halign: \"center\",\r\n fillColor: [0, 51, 141],\r\n },\r\n pageBreak:\r\n this.outputProfile.pageBreak && !newRpsSection\r\n ? this.pageBreakToggle(\"header\")\r\n : \"auto\",\r\n })\r\n headerAdded = true\r\n newRpsSection = false\r\n }\r\n // @ts-ignore\r\n this.pdf.autoTable({\r\n html: newSource,\r\n ...tableConfig,\r\n pageBreak: this.outputProfile.pageBreak\r\n ? this.pageBreakToggle(\"section\")\r\n : \"auto\",\r\n didParseCell: (data: any) => {\r\n // @todo should move all changes to data.cell into this function\r\n const classes = this.getClassesFromCellData(data)\r\n if (classes) {\r\n if (classes.includes(\"text-right\")) {\r\n data.cell.styles.halign = \"right\"\r\n }\r\n }\r\n },\r\n willDrawCell: (data: any) => {\r\n const classes = this.getClassesFromCellData(data)\r\n const tableWidth = data.table.width\r\n const tableColumnsLength = data.table.columns.length\r\n const text = data.cell.text[0]\r\n const indentLength = 0\r\n let indentContent = \"\"\r\n\r\n // Figure out how much indentation is necessary\r\n if (classes) {\r\n if (classes.includes(\"indent\")) {\r\n const regex = /indent-[1-6]/\r\n let found = classes.match(regex)\r\n if (found) {\r\n found = found[0].split(\"-\")\r\n indentContent = \" \".repeat(parseInt(found[1]))\r\n }\r\n }\r\n }\r\n\r\n // Split the description if neccessary\r\n if (data.column.index === \"0\" && data.section == \"body\") {\r\n const colWidth = data.column.width\r\n // If there is indent to be included then the max length needs to take into account\r\n const maxLength = colWidth - colWidth / 5 - indentLength\r\n\r\n // adjust row height to accept two lines if greater than a certain length\r\n if (data.cell.text[0].length > maxLength) {\r\n data.cell.text = this.pdf.splitTextToSize(\r\n data.cell.text,\r\n maxLength\r\n )\r\n const spacing = 1 * data.cell.text.length\r\n const newHeight = data.row.height + spacing\r\n data.row.height = newHeight\r\n data.row.maxCellHeight = newHeight\r\n }\r\n }\r\n\r\n // Match the row height for the cell\r\n data.cell.height = data.row.height\r\n data.cell.contentHeight = data.row.height\r\n\r\n if (classes) {\r\n if (classes.includes(\"bold\")) {\r\n this.pdf.setFontStyle(\"bold\")\r\n }\r\n if (classes.includes(\"primary\")) {\r\n this.pdf.setTextColor(0, 51, 141)\r\n }\r\n if (classes.includes(\"danger\")) {\r\n this.pdf.setTextColor(255, 0, 0)\r\n }\r\n if (classes.includes(\"indent\")) {\r\n data.cell.text.forEach(\r\n (line: string, i: number) =>\r\n (data.cell.text[i] = indentContent + line)\r\n )\r\n }\r\n }\r\n },\r\n didDrawPage: (data: any) => {\r\n // called every time page is drawn on, not when a new page is added\r\n // check if we've already added header/footer to this page\r\n if (\r\n this.pdf.internal.getCurrentPageInfo().pageNumber !== curPage\r\n ) {\r\n const leftMargin = data.settings.margin.left\r\n const rightMargin = data.settings.margin.right\r\n const faNameString = this.foreignAffiliate.name\r\n const taxpayerNameString =\r\n this.activeTaxpayer && this.activeTaxpayer.name\r\n const currencyString = `Calculating Currency: ${\r\n this.foreignAffiliate.reporting_surplus_currency\r\n }`\r\n // HEADER\r\n this.pdf.setFontSize(13)\r\n this.pdf.setFont(font)\r\n this.pdf.text(\r\n `Canadian Taxpayer: ${taxpayerNameString}`,\r\n leftMargin,\r\n 28\r\n )\r\n this.pdf.setFontSize(10)\r\n this.pdf.text(\r\n `Foreign Affiliate: ${faNameString}`,\r\n leftMargin,\r\n 32\r\n )\r\n this.pdf.setFontSize(10)\r\n this.pdf.text(currencyString, leftMargin, 36)\r\n this.addLogo(leftMargin - 1, 8)\r\n if (this.outputProfile.draft !== \"no-draft\") {\r\n this.addDraftBlurb(rightMargin, this.outputProfile.draft)\r\n }\r\n\r\n // FOOTER\r\n this.pdf.setFontSize(10)\r\n const pageString = `Page ${\r\n this.pdf.internal.getCurrentPageInfo().pageNumber\r\n }`\r\n const fontSize =\r\n this.pdf.internal.getFontSize() /\r\n this.pdf.internal.scaleFactor\r\n const footerMargin =\r\n this.pdf.internal.pageSize.width -\r\n data.settings.margin.right -\r\n fontSize * this.pdf.getStringUnitWidth(pageString)\r\n\r\n this.pdf.text(\r\n pageString,\r\n footerMargin,\r\n this.pdf.internal.pageSize.height - 8\r\n )\r\n\r\n // DISCLAIMER\r\n let wordBreak = 250\r\n this.pdf.setFontSize(6)\r\n\r\n if (!this.outputProfile.landscape) {\r\n this.pdf.setFontSize(5)\r\n wordBreak = 160\r\n }\r\n const disclaimerText = this.pdf.splitTextToSize(\r\n this.strings[\"OUTPUT_DISCLAIMER\"],\r\n wordBreak\r\n )\r\n this.pdf.text(\r\n disclaimerText,\r\n data.settings.margin.left,\r\n this.pdf.internal.pageSize.height - 12\r\n )\r\n curPage += 1\r\n }\r\n },\r\n })\r\n }\r\n })\r\n })\r\n // Start on new page\r\n if (\r\n this.periodBatches.length > 1 &&\r\n rpsIndex < this.periodBatches.length - 1\r\n ) {\r\n this.pdf.addPage()\r\n }\r\n })\r\n\r\n // Save PDF\r\n const pdfName = `${this.foreignAffiliate.name} - Report.pdf`\r\n this.pdf\r\n .save(pdfName, { returnPromise: true })\r\n .then((data: any) => {\r\n this.$bvToast.toast(`${pdfName} download succesful.`, {\r\n title: \"Export\",\r\n variant: \"success\",\r\n autoHideDelay: 5000,\r\n })\r\n })\r\n .catch((err: any) => {\r\n this.$bvToast.toast(`Something went wrong. Please try again.`, {\r\n title: \"Export\",\r\n variant: \"danger\",\r\n autoHideDelay: 5000,\r\n })\r\n })\r\n\r\n // remove style\r\n this.pdfStyleEditor(false)\r\n }\r\n\r\n public async resetOrdering() {\r\n const resetOutputOrdering = await this.confirmBox(\r\n `Are you sure you would like to reset ordering of output organization?`,\r\n this.deleteOptions\r\n )\r\n\r\n if (resetOutputOrdering) {\r\n this.defaultSectionHierarchy()\r\n }\r\n }\r\n\r\n public defaultSectionHierarchy() {\r\n // utilizes a deep clone copy\r\n this.sectionHierarchyDraggable = _.cloneDeep(this.sectionHierarchy)\r\n }\r\n\r\n // Below are for the ACB Calculator Tab\r\n\r\n public setupShowAcbOutput() {\r\n const dict: { [key: string]: boolean } = {}\r\n this.outputACBCalculator.forEach(\r\n ({ id }: { id: string }) => (dict[id] = true)\r\n )\r\n\r\n return dict\r\n }\r\n\r\n public get tableFieldsACBAdjustmentByDate() {\r\n const fields: any[] = [\r\n {\r\n key: \"date\",\r\n label: \"Date\",\r\n type: \"date\",\r\n },\r\n {\r\n key: \"type\",\r\n label: \"Type\",\r\n type: \"text\",\r\n },\r\n {\r\n key: \"amount\",\r\n label: \"Amount\",\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"acbBalance\",\r\n label: \"ACB\",\r\n type: \"number\",\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n ]\r\n return fields\r\n }\r\n\r\n public tableFieldsACBAdjustmentByEntry(sortable: boolean = false) {\r\n const fields: any[] = [\r\n {\r\n key: \"date\",\r\n label: \"Date\",\r\n type: \"date\",\r\n sortable,\r\n },\r\n {\r\n key: \"type\",\r\n label: \"Type\",\r\n type: \"select\",\r\n sortable,\r\n sortByFormatted: true,\r\n formatter: (value: number | string) => {\r\n if (value === \"Opening Balance\") {\r\n return value\r\n }\r\n return this.getOptionText(\r\n this.acbAdjustmentTypeOptions,\r\n value.toString()\r\n )\r\n },\r\n },\r\n {\r\n key: \"amount\",\r\n label: \"Amount\",\r\n type: \"number\",\r\n sortable,\r\n formatter: (value: string, evt: any) => {\r\n const formatted = formatMoney(value)\r\n return formatted\r\n },\r\n },\r\n {\r\n key: \"client_description\",\r\n label: \"Description\",\r\n type: \"textarea\",\r\n sortable,\r\n },\r\n {\r\n key: \"client_ref\",\r\n label: \"Working Paper Reference\",\r\n type: \"text\",\r\n sortable,\r\n },\r\n ]\r\n return fields\r\n }\r\n\r\n public ACBAdjustmentByEntrySortParams() {\r\n // Retrieves the columns of 'By Entry' table to populate the settings drop down.\r\n\r\n return this.tableFieldsACBAdjustmentByEntry().map(\r\n ({ key, label }: { key: string; label: string }) => {\r\n return {\r\n value: key,\r\n text: label,\r\n }\r\n }\r\n )\r\n }\r\n\r\n public ACBOpeningBalance(reportingPeriod: ReportingPeriod) {\r\n if (reportingPeriod && reportingPeriod.openings) {\r\n return {\r\n acbBalance: reportingPeriod.openings.acbBalance,\r\n amount: reportingPeriod.openings.acbBalance,\r\n date: reportingPeriod.start_date,\r\n }\r\n } else {\r\n return {\r\n acbBalance: 0,\r\n amount: 0,\r\n date: \"1900-01-01\",\r\n }\r\n }\r\n }\r\n\r\n public ACBAdjustments(reportingPeriod: ReportingPeriod) {\r\n if (reportingPeriod.acb_adjustments) {\r\n return reportingPeriod.acb_adjustments\r\n } else {\r\n return []\r\n }\r\n }\r\n\r\n public get getOpeningBalance() {\r\n const openingBalance = this.ACBOpeningBalance(this.periodBatchLocal[0])\r\n const newObj = {\r\n ...openingBalance,\r\n type: \"Opening Balance\",\r\n }\r\n\r\n return newObj\r\n }\r\n\r\n public get getAlternationEntries() {\r\n const output = this.periodBatchLocal\r\n .map((reportingPeriod: ReportingPeriod) => {\r\n return this.alterations(reportingPeriod)\r\n })\r\n .flat()\r\n\r\n output.unshift(this.getOpeningBalance)\r\n\r\n return output\r\n }\r\n\r\n public get getACBAdjustmentEntries() {\r\n // console.log(this.ACBOpeningBalance(this.periodBatchLocal[0]))\r\n const output = this.periodBatchLocal\r\n .map((reportingPeriod: ReportingPeriod) => {\r\n return this.ACBAdjustments(reportingPeriod)\r\n })\r\n .flat()\r\n\r\n return output\r\n }\r\n\r\n public alterations(reportingPeriod: ReportingPeriod) {\r\n // Modified version of the computed variable 'Alterations' from CalculatorBreakdown.vue\r\n // This only calculates the acbBalance.\r\n\r\n if (reportingPeriod && reportingPeriod.calculator) {\r\n return reportingPeriod.calculator.getAlterations\r\n .filter((alteration: Alteration) => {\r\n return alteration.getType === \"acb_adjustment\"\r\n })\r\n .map((alteration: Alteration) => {\r\n const { date, metadata, localOrder, movement } = alteration\r\n let { amount } = alteration\r\n const { from } = movement\r\n let type = \"N/A\"\r\n\r\n // Get the ACB adjustment type from the metadata\r\n if (metadata.acbAdjustment) {\r\n const acbType = this.acbAdjustmentTypes.find(\r\n option =>\r\n option.id == (metadata.acbAdjustment as ACBAdjustment).type\r\n )\r\n if (acbType) {\r\n type = acbType.name\r\n }\r\n } else if (from) {\r\n type = this.movementLabels[from.toString()]\r\n\r\n switch (from) {\r\n case \"pre_acq_acb_adjustment\":\r\n amount = Math.abs(amount) * -1\r\n break\r\n case \"dividend_paid_rechar\":\r\n amount = Math.abs(amount)\r\n break\r\n default:\r\n break\r\n }\r\n }\r\n\r\n let item: any = {\r\n date: dateFns.format(date, \"YYYY-MM-DD\"),\r\n amount,\r\n metadata,\r\n type,\r\n localOrder,\r\n movement,\r\n }\r\n\r\n if (metadata.runningBalances) {\r\n const balance: BalanceTypes = metadata.runningBalances\r\n const { acbBalance } = balance.surplusBalances\r\n\r\n item = {\r\n ...item,\r\n acbBalance,\r\n }\r\n }\r\n\r\n return item\r\n })\r\n }\r\n return []\r\n }\r\n\r\n public exportACBPdf(outputProfile: any) {\r\n const descColWidth = outputProfile.landscape ? 70 : 50\r\n const font = \"helvetica\"\r\n this.pdf = this.createjsPdfInstance({\r\n orientation: outputProfile.landscape ? \"l\" : \"p\",\r\n format: \"a4\",\r\n unit: \"mm\",\r\n })\r\n let curPage = 0\r\n\r\n const tableConfig = {\r\n theme: \"plain\",\r\n useCss: false,\r\n styles: {\r\n font,\r\n cellPadding: 1,\r\n },\r\n headStyles: {\r\n fontSize: 7,\r\n cellPadding: 1,\r\n lineWidth: 0.2,\r\n halign: \"center\",\r\n },\r\n bodyStyles: {\r\n fontSize: 5,\r\n lineWidth: 0.2,\r\n overflow: \"visible\",\r\n halign: \"left\",\r\n cellWidth: outputProfile.landscape ? 40 : 20,\r\n },\r\n margin: {\r\n top: 40,\r\n },\r\n alternateRowStyles: {\r\n fillColor: \"#f8f9fa\",\r\n },\r\n }\r\n\r\n // Insert style into cells of table\r\n this.pdfStyleEditor()\r\n\r\n this.outputACBCalculator.forEach((entries: any, entryIndex: number) => {\r\n if (!outputProfile.showAcbOutput[entries.id]) {\r\n return\r\n }\r\n\r\n // const header = document.getElementById(\"adjustments-by-date\") as HTMLTableElement\r\n const header = document.getElementById(\r\n `${entries.id}-title`\r\n ) as HTMLTableElement\r\n if (header) {\r\n // @ts-ignore\r\n this.pdf.autoTable({\r\n html: header,\r\n margin: {\r\n top: 40,\r\n },\r\n headStyles: {\r\n fontSize: 9,\r\n cellPadding: 1,\r\n halign: \"center\",\r\n fillColor: [0, 51, 141],\r\n },\r\n })\r\n }\r\n\r\n entries.tables.forEach((tableName: string, tableIndex: number) => {\r\n const targetId = `${entries.id}-${tableName}`\r\n const table = document.getElementById(targetId) as HTMLTableElement\r\n const newSource = table.cloneNode(true)\r\n // @ts-ignore\r\n this.pdf.autoTable({\r\n html: newSource,\r\n ...tableConfig,\r\n columnStyles: null,\r\n didParseCell: (data: any) => {\r\n // @todo should move all changes to data.cell into this function\r\n const classes = this.getClassesFromCellData(data)\r\n if (classes) {\r\n if (classes.includes(\"text-right\")) {\r\n data.cell.styles.halign = \"right\"\r\n }\r\n }\r\n },\r\n willDrawCell: (data: any) => {\r\n const classes = this.getClassesFromCellData(data)\r\n const tableWidth = data.table.width\r\n const tableColumnsLength = data.table.columns.length\r\n const text = data.cell.text[0]\r\n const indentLength = 0\r\n let indentContent = \"\"\r\n\r\n // Figure out how much indentation is necessary\r\n if (classes) {\r\n if (classes.includes(\"indent\")) {\r\n const regex = /indent-[1-6]/\r\n let found = classes.match(regex)\r\n if (found) {\r\n found = found[0].split(\"-\")\r\n indentContent = \" \".repeat(parseInt(found[1]))\r\n }\r\n }\r\n }\r\n\r\n // Split the description if neccessary\r\n if (data.column.index === \"0\" && data.section == \"body\") {\r\n const colWidth = data.column.width\r\n // If there is indent to be included then the max length needs to take into account\r\n const maxLength = colWidth - colWidth / 5 - indentLength\r\n\r\n // adjust row height to accept two lines if greater than a certain length\r\n if (data.cell.text[0].length > maxLength) {\r\n data.cell.text = this.pdf.splitTextToSize(\r\n data.cell.text,\r\n maxLength\r\n )\r\n const spacing = 1 * data.cell.text.length\r\n const newHeight = data.row.height + spacing\r\n data.row.height = newHeight\r\n data.row.maxCellHeight = newHeight\r\n }\r\n }\r\n\r\n // Match the row height for the cell\r\n data.cell.height = data.row.height\r\n data.cell.contentHeight = data.row.height\r\n\r\n if (classes) {\r\n if (classes.includes(\"bold\")) {\r\n this.pdf.setFontStyle(\"bold\")\r\n }\r\n if (classes.includes(\"primary\")) {\r\n this.pdf.setTextColor(0, 51, 141)\r\n }\r\n if (classes.includes(\"danger\")) {\r\n this.pdf.setTextColor(255, 0, 0)\r\n }\r\n if (classes.includes(\"indent\")) {\r\n data.cell.text.forEach(\r\n (line: string, i: number) =>\r\n (data.cell.text[i] = indentContent + line)\r\n )\r\n }\r\n }\r\n },\r\n didDrawPage: (data: any) => {\r\n // called every time page is drawn on, not when a new page is added\r\n // check if we've already added header/footer to this page\r\n\r\n if (this.pdf.internal.getCurrentPageInfo().pageNumber !== curPage) {\r\n const leftMargin = data.settings.margin.left\r\n const rightMargin = data.settings.margin.right\r\n const faNameString = this.foreignAffiliate.name\r\n const taxpayerNameString =\r\n this.activeTaxpayer && this.activeTaxpayer.name\r\n const currencyString = `Currency of Adjusted Cost Base Calculation: ${\r\n this.foreignAffiliate.reporting_surplus_currency\r\n }`\r\n\r\n // HEADER\r\n this.pdf.setFontSize(13)\r\n this.pdf.setFont(font)\r\n this.pdf.text(\r\n `Canadian Taxpayer: ${taxpayerNameString}`,\r\n leftMargin,\r\n 28\r\n )\r\n this.pdf.setFontSize(10)\r\n this.pdf.text(\r\n `Foreign Affiliate: ${faNameString}`,\r\n leftMargin,\r\n 32\r\n )\r\n this.pdf.setFontSize(10)\r\n this.pdf.text(currencyString, leftMargin, 36)\r\n this.addLogo(leftMargin - 1, 8)\r\n if (outputProfile.draft !== \"no-draft\") {\r\n this.addDraftBlurb(rightMargin, outputProfile.draft)\r\n }\r\n\r\n // FOOTER\r\n this.pdf.setFontSize(10)\r\n const pageString = `Page ${\r\n this.pdf.internal.getCurrentPageInfo().pageNumber\r\n }`\r\n const fontSize =\r\n this.pdf.internal.getFontSize() / this.pdf.internal.scaleFactor\r\n const footerMargin =\r\n this.pdf.internal.pageSize.width -\r\n data.settings.margin.right -\r\n fontSize * this.pdf.getStringUnitWidth(pageString)\r\n\r\n this.pdf.text(\r\n pageString,\r\n footerMargin,\r\n this.pdf.internal.pageSize.height - 8\r\n )\r\n\r\n // DISCLAIMER\r\n let wordBreak = 250\r\n this.pdf.setFontSize(6)\r\n\r\n if (!outputProfile.landscape) {\r\n this.pdf.setFontSize(5)\r\n wordBreak = 160\r\n }\r\n const disclaimerText = this.pdf.splitTextToSize(\r\n this.strings[\"OUTPUT_DISCLAIMER\"],\r\n wordBreak\r\n )\r\n this.pdf.text(\r\n disclaimerText,\r\n data.settings.margin.left,\r\n this.pdf.internal.pageSize.height - 12\r\n )\r\n curPage += 1\r\n }\r\n },\r\n })\r\n })\r\n\r\n // Add new page after every header\r\n this.pdf.addPage()\r\n })\r\n\r\n // Delete the last page which will be blank.\r\n this.pdf.deletePage(this.pdf.internal.getCurrentPageInfo().pageNumber)\r\n\r\n // Save PDF\r\n const pdfName = `${\r\n this.foreignAffiliate.name\r\n } - Adjusted Cost Base Report.pdf`\r\n this.pdf\r\n .save(pdfName, { returnPromise: true })\r\n .then((data: any) => {\r\n this.$bvToast.toast(`${pdfName} download succesful.`, {\r\n title: \"Export\",\r\n variant: \"success\",\r\n autoHideDelay: 5000,\r\n })\r\n })\r\n .catch((err: any) => {\r\n this.$bvToast.toast(`Something went wrong. Please try again.`, {\r\n title: \"Export\",\r\n variant: \"danger\",\r\n autoHideDelay: 5000,\r\n })\r\n })\r\n\r\n // remove style\r\n this.pdfStyleEditor(false)\r\n }\r\n\r\n @Watch(\"isAcbEnabled\")\r\n public isAcbEnabledChange(newVal: boolean, oldVal: boolean) {\r\n if (newVal != oldVal) {\r\n this.setupSectionHierarchy()\r\n }\r\n }\r\n\r\n @Watch(\"profileChangeType\")\r\n public updateHierarchyDraggable() {\r\n switch (this.profileChangeType) {\r\n case \"defaultSet\":\r\n // sectionHierarchy is the original mounted ordering\r\n // therefore when a user selects default, the ordering reverts back.\r\n this.defaultSectionHierarchy()\r\n break\r\n case \"profileSet\":\r\n // reorders the sectionHierarchyDraggable from the saved sectionOrder.\r\n this.sectionHierarchyDraggable = this.disassembleSectionOrderFromProfile\r\n\r\n // includes new entries, if it doesn't exist previously\r\n this.outputProfile.showAcbOutput = {\r\n ...this.defaultOutputProfile.showAcbOutput,\r\n ...this.outputProfile.showAcbOutput,\r\n }\r\n break\r\n }\r\n\r\n this.profileChangeType = \"none\"\r\n }\r\n\r\n @Watch(\"toReportingPeriod\")\r\n @Watch(\"fromReportingPeriod\")\r\n public updatePeriodBatchLocal() {\r\n // Allows to be used with b-table, or else there will be an infinity loop error.\r\n /// https://stackoverflow.com/questions/70269173/infinite-loop-when-trying-to-sort-array-in-v-for\r\n this.periodBatchLocal = this.periodBatchesNoChunks\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorOutput.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorOutput.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./CalculatorOutput.vue?vue&type=template&id=6da7604e&\"\nimport script from \"./CalculatorOutput.vue?vue&type=script&lang=ts&\"\nexport * from \"./CalculatorOutput.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./CalculatorOutput.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[_c('b-button',{directives:[{name:\"b-toggle\",rawName:\"v-b-toggle.sidebar-1\",modifiers:{\"sidebar-1\":true}}],class:_vm.buttonClass,style:(_vm.buttonStyle),attrs:{\"variant\":_vm.buttonVariant}},[_vm._t(\"button-content\",[_vm._v(\"Sidebar\")])],2),_c('b-sidebar',_vm._b({attrs:{\"id\":\"sidebar-1\"},scopedSlots:_vm._u([{key:\"default\",fn:function(ref){\nvar hide = ref.hide;\nreturn [_c('div',{staticClass:\"p-3\"},[_c('font-awesome-icon',{staticClass:\"pointer\",attrs:{\"icon\":\"chevron-right\"},on:{\"click\":hide}}),_c('div',{staticClass:\"px-3 pb-5\"},[_c('h4',{staticClass:\"pt-5 font-weight-bold\",attrs:{\"id\":\"sidebar-no-header-title\"}},[_vm._v(\"\\n Foreign Affiliates\\n \")]),_c('h6',[_vm._v(\"\\n Select a taxation year from the list below. On selection, you will\\n be redirected to the corresponding page.\\n \")]),_c('b-input-group',{staticClass:\"mt-3 search-border-radius search-shadow bg-white\"},[_c('b-input-group-prepend',[_c('span',{staticClass:\"input-group-text pr-0\"},[_c('font-awesome-icon',{attrs:{\"icon\":\"search\",\"size\":\"sm\",\"left\":\"\"}})],1)]),_c('b-form-input',{staticClass:\"border-0\",attrs:{\"placeholder\":\"Search...\"},model:{value:(_vm.searchFilter),callback:function ($$v) {_vm.searchFilter=(typeof $$v === 'string'? $$v.trim(): $$v)},expression:\"searchFilter\"}})],1)],1),(_vm.otherForeignAffiliates.length > 0)?_c('div',{staticClass:\"pb-4\"},_vm._l((_vm.otherForeignAffiliates),function(fa,faIndex){return _c('div',{key:faIndex,staticClass:\"pb-2 px-1\"},[_c('b-button',{directives:[{name:\"b-toggle\",rawName:\"v-b-toggle\",value:('sidebar-collapse-' + faIndex),expression:\"'sidebar-collapse-' + faIndex\"}],staticClass:\"text-secondary fa-link text-decoration-none\",attrs:{\"size\":\"md\",\"variant\":\"link\"}},[_vm._v(\"\\n \"+_vm._s(fa.name)+\"\\n \"),_c('span',{staticClass:\"when-opened\"},[_c('font-awesome-icon',{attrs:{\"icon\":\"chevron-down\",\"size\":\"sm\"}})],1),_c('span',{staticClass:\"when-closed\"},[_c('font-awesome-icon',{attrs:{\"icon\":\"chevron-right\",\"size\":\"sm\"}})],1)]),_c('b-collapse',{staticClass:\"pl-4\",attrs:{\"id\":'sidebar-collapse-' + faIndex}},[_vm._l((_vm.sortReportingPeriods(\n fa.reporting_periods\n )),function(period,rpIndex){return _c('b-button',{directives:[{name:\"b-toggle\",rawName:\"v-b-toggle\",value:('sidebar-collapse-' + faIndex),expression:\"'sidebar-collapse-' + faIndex\"}],key:rpIndex,staticClass:\"text-decoration-none date-link mt-1 mb-1\",attrs:{\"variant\":\"link\",\"to\":{\n name: 'foreign-affiliate',\n params: { id: fa.id },\n query: { period: period.id },\n }}},[_vm._v(\"\\n \"+_vm._s(period.start_date)+\" to\\n \"+_vm._s(period.end_date)+\"\\n \")])}),(!fa.reporting_periods.length)?_c('div',[_c('p',{staticClass:\"pl-4 text-muted\"},[_vm._v(\"\\n No taxation year available.\\n \"),_c('router-link',{attrs:{\"to\":{\n name: 'foreign-affiliate',\n params: { id: fa.id },\n }}},[_vm._v(\"Navigate to the foreign affiliate.\")])],1)]):_vm._e()],2)],1)}),0):_c('div',[_c('h4',{staticClass:\"font-weight-light px-3 pb-5\"},[_vm._v(\"No foreign affiliates\")])])],1),_c('b-button',{staticClass:\"text-secondary close-button\",attrs:{\"variant\":\"light\"},on:{\"click\":hide}},[_vm._v(\"Close\")])]}}])},'b-sidebar',_vm.$attrs,false))],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Vue, Prop, Watch, Mixins } from \"vue-property-decorator\"\r\nimport CalculatorMixin from \"@/mixins/CalculatorMixin\"\r\nimport { sortPeriods } from \"@/util/sortPeriods\"\r\nimport {\r\n ForeignAffiliate,\r\n ReportingPeriodLockStatus,\r\n ReportingPeriod,\r\n} from \"@/interfaces\"\r\n@Component({\r\n inheritAttrs: false,\r\n})\r\nexport default class FANavigationSidebar extends Mixins(CalculatorMixin) {\r\n // Button Props\r\n @Prop({ default: \"\" })\r\n public buttonClass!: object | string\r\n @Prop({ default: \"\" })\r\n public buttonStyle!: object | string\r\n @Prop({ default: \"primary\" })\r\n public buttonVariant!: string\r\n\r\n public searchFilter: string = \"\"\r\n\r\n public get otherForeignAffiliates(): ForeignAffiliate[] {\r\n return this.activeTaxpayerForeignAffiliates\r\n .filter(fa => {\r\n if (fa.id == this.activeForeignAffiliate!.id) {\r\n return false\r\n }\r\n return true\r\n })\r\n .filter((fa: ForeignAffiliate) =>\r\n fa.name.toLowerCase().includes(this.searchFilter.toLowerCase())\r\n )\r\n .sort((a: ForeignAffiliate, b: ForeignAffiliate) =>\r\n a.name.localeCompare(b.name)\r\n )\r\n }\r\n\r\n public sortReportingPeriods(reportingPeriods: ReportingPeriod[]) {\r\n return reportingPeriods\r\n .slice()\r\n .sort(sortPeriods)\r\n .reverse()\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FANavigationSidebar.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FANavigationSidebar.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./FANavigationSidebar.vue?vue&type=template&id=4a38bcae&scoped=true&\"\nimport script from \"./FANavigationSidebar.vue?vue&type=script&lang=ts&\"\nexport * from \"./FANavigationSidebar.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./FANavigationSidebar.vue?vue&type=style&index=0&id=4a38bcae&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"4a38bcae\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[_c('b-button',{directives:[{name:\"b-toggle\",rawName:\"v-b-toggle.sidebar-2\",modifiers:{\"sidebar-2\":true}}],class:_vm.buttonClass,style:(_vm.buttonStyle),attrs:{\"variant\":_vm.buttonVariant,\"size\":_vm.buttonSize}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"size\":\"sm\",\"icon\":\"comments\"}}),_vm._t(\"button-content\",[_vm._v(\"Sidebar\")])],2),_c('b-sidebar',_vm._b({attrs:{\"id\":\"sidebar-2\"},scopedSlots:_vm._u([{key:\"default\",fn:function(ref){\nvar hide = ref.hide;\nreturn [_c('div',{staticClass:\"p-3\"},[_c('font-awesome-icon',{staticClass:\"pointer\",attrs:{\"icon\":\"chevron-right\"},on:{\"click\":hide}}),_c('div',{staticClass:\"px-3 pb-5\"},[_c('h4',{staticClass:\"pt-4 font-weight-bold\",attrs:{\"id\":\"sidebar-no-header-title\"}},[_vm._v(\"\\n Recent Comments\\n \")]),(_vm.lastComments.length > 0)?_c('div',_vm._l((_vm.lastComments.slice(\n 0,\n _vm.commentsToShow\n )),function(comment,index){return _c('CommentActivityCard',{key:((comment.reporting_period) + \"-\" + (comment.id) + \"-\" + index),staticClass:\"mb-2\",attrs:{\"comment\":comment,\"reportingPeriodsData\":_vm.findRP(comment)}})}),1):_c('div',[_c('CommentActivityCard',{attrs:{\"comment\":undefined}})],1),(_vm.lastComments.length > _vm.commentsToShow)?_c('b-button',{attrs:{\"size\":\"sm\",\"variant\":\"outline-secondary\",\"block\":\"\"},on:{\"click\":function($event){_vm.commentsToShow += 4}}},[_vm._v(\"\\n View More Comments\\n \"),_c('font-awesome-icon',{attrs:{\"icon\":\"chevron-down\",\"size\":\"sm\"}})],1):_vm._e()],1)],1),_c('b-button',{staticClass:\"text-secondary close-button\",attrs:{\"variant\":\"light\"},on:{\"click\":hide}},[_vm._v(\"Close\")])]}}])},'b-sidebar',_vm.$attrs,false))],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.comment)?_c('b-card',{staticClass:\"mb-1 comment-return-exist\"},[_c('b-row',{staticClass:\"comment-top\"},[_c('div',{staticClass:\"comment-top-text\"},[_vm._v(\"\\n \"+_vm._s(_vm.comment.comment)+\"\\n \")]),(_vm.comment.resolved_by && !_vm.isClient)?_c('div',{staticClass:\"comment-top-resolved\"},[_c('b-badge',{attrs:{\"variant\":\"primary\"}},[_vm._v(\"Resolved\")])],1):_vm._e(),(!_vm.isClient)?_c('div',{staticClass:\"comment-top-resolved\"},[_c('b-badge',{attrs:{\"variant\":\"secondary\"}},[_vm._v(_vm._s(_vm.comment.type == \"K\" ? \"Internal\" : \"Client\"))])],1):_vm._e()]),_c('b-row',{staticClass:\"pt-1 comment-details text-muted\"},[_c('font-awesome-icon',{attrs:{\"icon\":\"user\",\"size\":\"sm\"}}),_vm._v(\" \\n \"+_vm._s(_vm.comment.user_details.username)+\" commented  \\n \"),_c('font-awesome-icon',{attrs:{\"icon\":\"clock\",\"size\":\"sm\"}}),_vm._v(\" \\n \"+_vm._s(_vm.formatDateDistanceToNow(_vm.comment.date_created))+\" at  \\n \"),_c('font-awesome-icon',{attrs:{\"icon\":\"map-marker-alt\",\"size\":\"sm\"}}),_vm._v(\" \\n \"+_vm._s(_vm.findNestedObj(_vm.fieldsFixture, _vm.comment.meta_id).name)+\"\\n \")],1),(_vm.reportingPeriodsData)?_c('b-row',{staticClass:\"comment-period\"},[_vm._v(\"\\n Taxation Year: \"+_vm._s(_vm.reportingPeriodsData.start_date)+\" to\\n \"+_vm._s(_vm.reportingPeriodsData.end_date)+\"\\n \")]):_vm._e()],1):_c('b-card',{staticClass:\"comment-return-is-none\"},[_vm._v(\"\\n No Recent Comments\\n\")])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\n\n\n\r\nimport { Component, Vue, Prop, Watch, Mixins } from \"vue-property-decorator\"\r\nimport CalculatorMixin from \"@/mixins/CalculatorMixin\"\r\nimport { Comment } from \"@/interfaces\"\r\nimport _ from \"lodash\"\r\nimport dateFns from \"date-fns\"\r\nimport fields from \"@/fixtures/fields\"\r\nimport UserMixin from \"@/mixins/UserMixin\"\r\n\r\n@Component({})\r\nexport default class CommentActivityCard extends Mixins(\r\n CalculatorMixin,\r\n UserMixin\r\n) {\r\n // Props\r\n @Prop({ required: true })\r\n public comment!: Comment\r\n @Prop({ default: undefined })\r\n public reportingPeriodsData: any[] | undefined\r\n\r\n public fieldsFixture: any = fields\r\n\r\n public formatDateDistanceToNow(date: any) {\r\n return dateFns.distanceInWordsToNow(date, {\r\n addSuffix: true,\r\n })\r\n }\r\n public findNestedObj(entireObj: any, keyToFind: any) {\r\n // modified stackoverflow entry\r\n // https://stackoverflow.com/a/56204398\r\n let foundObj\r\n JSON.stringify(entireObj, (_, nestedValue) => {\r\n if (nestedValue && Object.keys(nestedValue).includes(keyToFind)) {\r\n foundObj = nestedValue[keyToFind]\r\n }\r\n return nestedValue\r\n })\r\n return foundObj\r\n }\r\n}\r\n","import mod from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CommentActivityCard.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../../node_modules/thread-loader/dist/cjs.js!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/ts-loader/index.js??ref--13-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CommentActivityCard.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./CommentActivityCard.vue?vue&type=template&id=8347cd1a&scoped=true&\"\nimport script from \"./CommentActivityCard.vue?vue&type=script&lang=ts&\"\nexport * from \"./CommentActivityCard.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./CommentActivityCard.vue?vue&type=style&index=0&id=8347cd1a&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"8347cd1a\",\n null\n \n)\n\nexport default component.exports","\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\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\n\n\n\n\n\r\nimport { Component, Vue, Prop, Watch, Mixins } from \"vue-property-decorator\"\r\nimport CalculatorMixin from \"@/mixins/CalculatorMixin\"\r\nimport Table from \"@/components/utils/Table.vue\"\r\nimport CommentActivityCard from \"@/components/calculator/schedules/CommentActivityCard.vue\"\r\nimport fields from \"@/fixtures/fields\"\r\nimport { Comment, ReportingPeriod } from \"@/interfaces\"\r\nimport _ from \"lodash\"\r\nimport dateFns from \"date-fns\"\r\nimport UserMixin from \"../../mixins/UserMixin\"\r\n\r\n@Component({\r\n inheritAttrs: false,\r\n components: {\r\n Table,\r\n CommentActivityCard,\r\n },\r\n})\r\nexport default class CommentSidebar extends Mixins(CalculatorMixin, UserMixin) {\r\n // Button Props\r\n @Prop({ default: \"\" })\r\n public buttonClass!: object | string\r\n @Prop({ default: \"\" })\r\n public buttonStyle!: object | string\r\n @Prop({ default: \"primary\" })\r\n public buttonVariant!: string\r\n @Prop({ default: \"\" })\r\n public buttonSize!: string\r\n\r\n public searchFilter: string = \"\"\r\n public fieldsFixture: any = fields\r\n\r\n public reportingPeriodsData = []\r\n public commentsToShow: number = 10\r\n\r\n public get startEndRPs() {\r\n if (!this.reportingPeriods) {\r\n return []\r\n }\r\n return this.reportingPeriods.map((e: ReportingPeriod) => {\r\n const { id, start_date, end_date } = e\r\n return { id, start_date, end_date }\r\n })\r\n }\r\n\r\n public findRP(comment: Comment) {\r\n return this.startEndRPs.find((e: any) => e.id === comment.reporting_period)\r\n }\r\n\r\n public get lastComments() {\r\n if (!this.reportingPeriods) {\r\n return []\r\n }\r\n return (\r\n _.chain(\r\n this.reportingPeriods.map((e: ReportingPeriod) => e.comments).flat()\r\n )\r\n // @ts-ignore\r\n .orderBy([\"last_updated\"], [\"desc\"])\r\n .value()\r\n // Filter out the KPMG comments if user is client\r\n .filter((c: Comment) => (this.isClient ? c.type == \"C\" : true))\r\n )\r\n }\r\n\r\n public formatDateDistanceToNow(date: any) {\r\n return dateFns.distanceInWordsToNow(date, {\r\n addSuffix: true,\r\n })\r\n }\r\n\r\n public resolvedTrueFalse(value: any) {\r\n if (value) {\r\n return true\r\n } else {\r\n return false\r\n }\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CommentSidebar.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CommentSidebar.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./CommentSidebar.vue?vue&type=template&id=2f11083c&scoped=true&\"\nimport script from \"./CommentSidebar.vue?vue&type=script&lang=ts&\"\nexport * from \"./CommentSidebar.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./CommentSidebar.vue?vue&type=style&index=0&id=2f11083c&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"2f11083c\",\n null\n \n)\n\nexport default component.exports","\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\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\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\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\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\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Vue, Watch, Prop } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport _ from \"lodash\"\r\nimport dateFns from \"date-fns\"\r\nimport { State, Action, Getter } from \"vuex-class\"\r\n// Project Imports\r\nimport CalculatorSection from \"@/components/calculator/CalculatorSection.vue\"\r\nimport CalculatorBreakdown from \"@/components/calculator/CalculatorBreakdown.vue\"\r\nimport CalculatorPeriodNavigation from \"@/components/calculator/CalculatorPeriodNavigation.vue\"\r\nimport CalculatorOutput from \"@/components/calculator/CalculatorOutput.vue\"\r\nimport fields from \"@/fixtures/fields\"\r\nimport { ReportingPeriod, ForeignAffiliate } from \"../../interfaces\"\r\nimport CalculatorMixin from \"@/mixins/CalculatorMixin\"\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport UserMixin from \"../../mixins/UserMixin\"\r\nimport StringsMixin from \"../../mixins/StringsMixin\"\r\nimport EnvMixin from \"../../mixins/EnvMixin\"\r\nimport FANavigationSidebar from \"@/components/calculator/FANavigationSidebar.vue\"\r\nimport CommentSidebar from \"@/components/calculator/CommentSidebar.vue\"\r\nconst namespace: string = \"calculator\"\r\n\r\n@Component({\r\n components: {\r\n CalculatorSection,\r\n CalculatorBreakdown,\r\n CalculatorPeriodNavigation,\r\n CalculatorOutput,\r\n FANavigationSidebar,\r\n CommentSidebar,\r\n },\r\n})\r\nexport default class Calculator extends mixins(\r\n CalculatorMixin,\r\n LoadingMixin,\r\n UserMixin,\r\n StringsMixin,\r\n EnvMixin\r\n) {\r\n @Prop({ required: true })\r\n public foreignAffiliate!: ForeignAffiliate\r\n public sections: any = fields\r\n public collapseAll: boolean = false\r\n public expandAll: boolean = false\r\n public isHoveredFooter: boolean = false\r\n public observer: any = null\r\n public isStickyTop: boolean = false\r\n public visible: boolean = true\r\n public showModal: boolean = false\r\n\r\n @Watch(\"isClient\")\r\n public toggleFooterVisible() {\r\n // Force true whenever isClient is changed\r\n this.visible = true\r\n }\r\n\r\n public get clientLocked() {\r\n return this.isClient && this.foreignAffiliate.client_locked\r\n }\r\n\r\n public get clientHidden() {\r\n return this.isClient && this.foreignAffiliate.client_hidden\r\n }\r\n\r\n public get calculatorSections() {\r\n const letters = [\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\"]\r\n const hiddenSections: string[] = []\r\n\r\n if (!this.isAcbEnabled) {\r\n hiddenSections.push(\"ACB\")\r\n }\r\n\r\n const filterHiddenSections = (key: string) => !hiddenSections.includes(key)\r\n\r\n if (this.isClient) {\r\n return Object.keys(this.sections)\r\n .filter((key: any) => {\r\n const section = this.sections[key]\r\n return section.showClient != undefined ? section.showClient : true\r\n })\r\n .filter(filterHiddenSections)\r\n .map((key: string, index: number) => {\r\n const section = this.sections[key]\r\n return { ...section, section: letters[index] || \"\", key }\r\n })\r\n } else {\r\n return Object.keys(this.sections)\r\n .filter(filterHiddenSections)\r\n .map((key: any, index: any) => {\r\n const section = this.sections[key]\r\n return {\r\n ...section,\r\n section: section === \"OPENING BALANCES\" ? \"\" : letters[index - 1],\r\n key,\r\n }\r\n })\r\n }\r\n }\r\n\r\n public revertChangesClick() {\r\n this.revertFieldValues()\r\n this.calculateSurplus()\r\n this.saveFieldValues()\r\n }\r\n\r\n public mounted() {\r\n this.calculateSurplus()\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Calculator.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Calculator.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Calculator.vue?vue&type=template&id=60030170&scoped=true&\"\nimport script from \"./Calculator.vue?vue&type=script&lang=ts&\"\nexport * from \"./Calculator.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./Calculator.vue?vue&type=style&index=0&id=60030170&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"60030170\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('ErrorAlert',{attrs:{\"error\":_vm.error}}),_c('b-form',{on:{\"submit\":function($event){$event.preventDefault();return _vm.handleOnSubmit($event)}}},[_c('b-card',{attrs:{\"no-body\":\"\"}},[_c('b-tabs',{attrs:{\"id\":\"taxation-year-tabs\",\"pills\":\"\",\"card\":\"\",\"fill\":\"\"},model:{value:(_vm.taxationYearType),callback:function ($$v) {_vm.taxationYearType=$$v},expression:\"taxationYearType\"}},[(!_vm.initialData)?_c('b-tab',{key:\"before\",attrs:{\"title\":\"Before\",\"lazy\":\"\",\"disabled\":_vm.isFirstYearPeriod}},[_c('PeriodCallout',{attrs:{\"variant\":\"primary\",\"text\":\"Allows for the creation of a taxation year before the first year in the current calculation. \"}}),_c('PeriodDate',{key:\"prepend\",attrs:{\"periodType\":\"prepend\",\"startDate\":_vm.startDatePrepend,\"endDate\":_vm.endDatePrepend,\"minStartEndDate\":_vm.minEndDatePrepend,\"maxStartEndDate\":_vm.maxEndDatePrepend,\"edit\":_vm.edit,\"canDelete\":_vm.canDelete,\"isFirstYearPeriod\":_vm.isFirstYearPeriod,\"disabled\":_vm.submitDisabledFromDate,\"loading\":_vm.loading},on:{\"update:startDate\":function($event){_vm.startDatePrepend=$event},\"update:start-date\":function($event){_vm.startDatePrepend=$event},\"update:endDate\":function($event){_vm.endDatePrepend=$event},\"update:end-date\":function($event){_vm.endDatePrepend=$event},\"update:disabled\":function($event){_vm.submitDisabledFromDate=$event}}}),_vm._v(\"\\n Note: FA's first year begins will be modified\\n \")],1):_vm._e(),(!_vm.initialData)?_c('b-tab',{key:\"after\",attrs:{\"title\":\"After\",\"lazy\":\"\",\"active\":\"\"}},[_c('PeriodCallout',{attrs:{\"variant\":\"primary\",\"text\":\"Allows for the creation of a taxation year after the last year in the current calculation.\"}}),_c('PeriodDate',{key:\"append\",attrs:{\"periodType\":\"append\",\"startDate\":_vm.startDate,\"endDate\":_vm.endDate,\"minStartEndDate\":_vm.minEndDate,\"maxStartEndDate\":_vm.maxEndDate,\"edit\":_vm.edit,\"canDelete\":_vm.canDelete,\"isFirstYearPeriod\":_vm.isFirstYearPeriod,\"disabled\":_vm.submitDisabledFromDate,\"loading\":_vm.loading},on:{\"update:startDate\":function($event){_vm.startDate=$event},\"update:start-date\":function($event){_vm.startDate=$event},\"update:endDate\":function($event){_vm.endDate=$event},\"update:end-date\":function($event){_vm.endDate=$event},\"update:disabled\":function($event){_vm.submitDisabledFromDate=$event}}})],1):_vm._e(),(!_vm.initialData)?_c('b-tab',{key:\"insert\",attrs:{\"title\":\"Insert\",\"disabled\":_vm.periodOptions.length < 2,\"lazy\":\"\"}},[_c('PeriodCallout',{attrs:{\"variant\":\"primary\",\"text\":\"Allows for the creation of a taxation year in between two current taxation years in the calculation. \"}}),_vm._v(\"\\n Insert Taxation Year after the following:\\n \"),_c('b-form-select',{attrs:{\"options\":_vm.insertRPList,\"text-field\":\"text\",\"value-field\":\"value.id\",\"disabled\":_vm.loading},model:{value:(_vm.selectedRP),callback:function ($$v) {_vm.selectedRP=$$v},expression:\"selectedRP\"}}),(_vm.selectedRP)?_c('div',[_c('div',[_c('PeriodDate',{key:(\"insert-\" + _vm.selectedRP),attrs:{\"periodType\":\"insert\",\"startDate\":_vm.startDateInsert,\"endDate\":_vm.endDateInsert,\"minStartEndDate\":_vm.minEndDateInsert,\"maxStartEndDate\":_vm.maxEndDateInsert,\"edit\":_vm.edit,\"canDelete\":_vm.canDelete,\"isFirstYearPeriod\":_vm.isFirstYearPeriod,\"disabled\":_vm.submitDisabledFromDate,\"loading\":_vm.loading},on:{\"update:startDate\":function($event){_vm.startDateInsert=$event},\"update:start-date\":function($event){_vm.startDateInsert=$event},\"update:endDate\":function($event){_vm.endDateInsert=$event},\"update:end-date\":function($event){_vm.endDateInsert=$event},\"update:disabled\":function($event){_vm.submitDisabledFromDate=$event}}})],1),(!_vm.submitDisabledFromDate)?_c('PeriodEditPanel',{key:(\"insert-period-\" + (_vm.selectedRP.id) + \"-\" + _vm.startDateInsert + \"-\" + _vm.endDateInsert),attrs:{\"periodType\":\"insert\",\"startDate\":_vm.startDateInsert,\"endDate\":_vm.endDateInsert,\"initialStartDate\":_vm.initialStartDate,\"initialEndDate\":_vm.initialEndDate,\"editStatus\":_vm.getEditStatus,\"currentReportingPeriod\":{ id: _vm.selectedRP },\"periodList\":_vm.periodList,\"disabled\":_vm.loading},on:{\"shiftedRPList\":function($event){_vm.shiftedRPList = $event},\"stubRP\":function($event){_vm.stubRP = $event},\"submitDisabled\":function($event){_vm.submitDisabledFromEditPanel = $event},\"editPanelOptionChange\":function($event){_vm.editPanelOptionChange = $event}}}):_vm._e()],1):_vm._e()],1):_vm._e(),(_vm.initialData)?_c('b-tab',{key:\"edit\",attrs:{\"title\":\"Edit\",\"lazy\":\"\",\"active\":\"\"}},[_c('PeriodCallout',{attrs:{\"variant\":\"primary\",\"text\":\"Please note that although data inputs with a date associated (Dividends, SEP Adjustments, Hybrid Gains/Losses, Other Inclusions/Deductions) will be moved to the corresponding taxation year, any data inputs with no date associated will stay in the original taxation year being modified. Please check all inputs once taxation year edits have been made.\"}}),_c('PeriodDate',{key:\"edit\",attrs:{\"periodType\":\"edit\",\"startDate\":_vm.startDate,\"endDate\":_vm.endDate,\"minStartEndDate\":_vm.minEndDate,\"maxStartEndDate\":_vm.maxEndDate,\"edit\":_vm.edit,\"canDelete\":_vm.canDelete,\"isFirstYearPeriod\":_vm.isFirstYearPeriod,\"disabled\":_vm.submitDisabledFromDate,\"initialStartDate\":_vm.initialStartDate,\"initialEndDate\":_vm.initialEndDate,\"minStartDateEdit\":_vm.minStartDate,\"maxStartDateEdit\":_vm.maxStartDate,\"loading\":_vm.loading},on:{\"update:startDate\":function($event){_vm.startDate=$event},\"update:start-date\":function($event){_vm.startDate=$event},\"update:endDate\":function($event){_vm.endDate=$event},\"update:end-date\":function($event){_vm.endDate=$event},\"update:disabled\":function($event){_vm.submitDisabledFromDate=$event}}}),(_vm.getEditStatus && !_vm.submitDisabledFromDate)?_c('PeriodEditPanel',{key:(\"edit-period-\" + (_vm.initialData.id) + \"-\" + (_vm.getEditStatus.action) + \"-\" + _vm.startDate + \"-\" + _vm.endDate),attrs:{\"periodType\":\"edit\",\"startDate\":_vm.startDate,\"endDate\":_vm.endDate,\"initialStartDate\":_vm.initialStartDate,\"initialEndDate\":_vm.initialEndDate,\"editStatus\":_vm.getEditStatus,\"currentReportingPeriod\":_vm.initialData,\"periodList\":_vm.periodList,\"disabled\":_vm.loading},on:{\"shiftedRPList\":function($event){_vm.shiftedRPList = $event},\"stubRP\":function($event){_vm.stubRP = $event},\"submitDisabled\":function($event){_vm.submitDisabledFromEditPanel = $event},\"editPanelOptionChange\":function($event){_vm.editPanelOptionChange = $event}}}):_vm._e()],1):_vm._e()],1)],1),(_vm.displayPeriodOptionPanel)?_c('hr'):_vm._e(),(_vm.displayPeriodOptionPanel)?_c('PeriodOptionPanel',{key:(\"period-option-panel-\" + _vm.taxationYearType + \"-\" + _vm.selectedRP + \"-\" + _vm.startDate + \"-\" + _vm.endDate),attrs:{\"initialData\":_vm.initialData,\"foreignAffiliate\":_vm.foreignAffiliate,\"taxationYearType\":_vm.taxationYearType,\"selectedRP\":_vm.selectedRP,\"title\":_vm.periodOptionPanelTitle,\"edit\":_vm.edit,\"disabled\":_vm.loading},on:{\"faBusinessActivity\":function($event){_vm.faBusinessActivity = $event},\"faForeignTaxLawRequired\":function($event){_vm.faForeignTaxLawRequired = $event},\"faResidentDesignatedCountry\":function($event){_vm.faResidentDesignatedCountry = $event},\"faBusinessDesignatedCountry\":function($event){_vm.faBusinessDesignatedCountry = $event},\"depreciationElection\":function($event){_vm.depreciationElection = $event},\"dividendsTaxableSurplusFirst\":function($event){_vm.dividendsTaxableSurplusFirst = $event},\"dividendsAcb\":function($event){_vm.dividendsAcb = $event},\"sepChanges\":function($event){_vm.sepChanges = $event},\"recharacterizedPropertyIncome\":function($event){_vm.recharacterizedPropertyIncome = $event},\"fapi\":function($event){_vm.fapi = $event},\"dividendsFromFa\":function($event){_vm.dividendsFromFa = $event},\"dividendsPayTax\":function($event){_vm.dividendsPayTax = $event},\"dividendsPaid\":function($event){_vm.dividendsPaid = $event},\"dispositions\":function($event){_vm.dispositions = $event},\"consolidationOrGroupRelief\":function($event){_vm.consolidationOrGroupRelief = $event},\"fxRate\":function($event){_vm.fxRate = $event},\"fxCurrency\":function($event){_vm.fxCurrency = $event}}}):_vm._e(),(_vm.outOfRangeIssue.length > 0)?_c('hr'):_vm._e(),(_vm.outOfRangeIssue.length > 0)?_c('b-card',[_c('PeriodOutOfRangePanel',{key:(\"out-of-range-panel-\" + _vm.taxationYearType + \"-\" + _vm.selectedRP + \"-\" + _vm.startDate + \"-\" + _vm.endDate + \"-\" + (_vm.outOfRangeIssue.length)),attrs:{\"outOfRangeIssue\":_vm.outOfRangeIssue,\"disabled\":_vm.loading},on:{\"submitDisabled\":function($event){_vm.submitDisabledFromOutOfRangePanel = $event}}})],1):_vm._e(),(_vm.divTierIssue.length > 0)?_c('hr'):_vm._e(),(_vm.divTierIssue.length > 0)?_c('b-card',[_c('PeriodDividendTierCheckerPanel',{key:(\"dividend-tier-checker-panel-\" + _vm.taxationYearType + \"-\" + _vm.selectedRP + \"-\" + _vm.startDate + \"-\" + _vm.endDate + \"-\" + (_vm.divTierIssue.length)),attrs:{\"divTierIssue\":_vm.divTierIssue,\"newPeriodList\":_vm.newPeriodList,\"shiftedRPList\":_vm.shiftedRPList,\"disabled\":_vm.loading},on:{\"divTierIssueOverride\":function($event){_vm.divTierIssueOverride = $event},\"submitDisabled\":function($event){_vm.submitDisabledFromDTCheckerPanel = $event}}})],1):_vm._e(),_c('hr'),_c('LoadingButton',{attrs:{\"data-cy\":\"rp-submit-button\",\"loading\":_vm.loading,\"disabled\":_vm.disableSave,\"text\":\"Save Taxation Year\"}}),(_vm.refreshBalance)?_c('hr'):_vm._e(),(_vm.refreshBalance)?_c('b-card',[_c('PeriodBalanceRefreshPanel',{attrs:{\"taxpayer\":_vm.activeTaxpayer,\"periodId\":_vm.periodId},on:{\"refreshBalanceStatus\":function($event){_vm.refreshBalanceComplete = $event}}})],1):_vm._e()],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import dateFns from \"date-fns\"\r\n\r\nexport const dateDiff = (currentDate: string, initialDate: string) => {\r\n return dateFns.differenceInDays(currentDate, initialDate)\r\n}\r\n\r\nexport const isDateDiff = (currentDate: string, initialDate: string) => {\r\n return dateDiff(currentDate, initialDate) !== 0\r\n}\r\n\r\nexport const formatDate = (date: string | Date) => {\r\n return dateFns.format(date, \"YYYY-MM-DD\")\r\n}\r\n\r\nexport const formatDateSpace = (date: string | Date) => {\r\n return dateFns.format(date, \"YYYY MM DD\")\r\n}\r\n\r\nexport const periodShift = (date: string, diff: number) => {\r\n return formatDate(dateFns.addDays(dateFns.addYears(date, 1), diff))\r\n}\r\n\r\nexport const dayShift = (date: string, diff: number) => {\r\n return formatDate(dateFns.addDays(date, diff))\r\n}\r\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-row',[_c('b-col',[_c('b-form-group',{attrs:{\"label\":\"Start Date\",\"description\":_vm.descriptionForm('left'),\"invalid-feedback\":_vm.invalidFeedback,\"state\":_vm.stateDateValid('left')}},[_c('datepicker',{attrs:{\"value\":_vm.startDate,\"input-class\":\"form-control\",\"format\":\"yyyy MM dd\",\"name\":\"startDate\",\"typeable\":true,\"placeholder\":\"yyyy MM dd\",\"required\":\"\",\"disabledDates\":_vm.disabledDatesForm('left'),\"disabled\":_vm.disabledForm('left') || _vm.loading},on:{\"input\":function($event){return _vm.componentEmit($event, 'startDate')}}})],1)],1),(_vm.periodType === 'insertSplit')?_c('b-col',[_c('b-form-group',{attrs:{\"label\":\"Split Date\",\"description\":_vm.descriptionForm('center'),\"invalid-feedback\":_vm.invalidFeedback,\"state\":_vm.stateDateValid('center')}},[_c('datepicker',{attrs:{\"value\":_vm.splitDate,\"input-class\":\"form-control\",\"name\":\"endDate\",\"typeable\":true,\"format\":\"yyyy MM dd\",\"placeholder\":\"yyyy MM dd\",\"disabledDates\":_vm.disabledDatesForm('center'),\"disabled\":_vm.disabledForm('center') || _vm.loading},on:{\"input\":function($event){return _vm.componentEmit($event, 'splitDate')}}})],1)],1):_vm._e(),_c('b-col',[_c('b-form-group',{attrs:{\"label\":\"End Date\",\"description\":_vm.descriptionForm('right'),\"invalid-feedback\":_vm.invalidFeedback,\"state\":_vm.stateDateValid('right')}},[_c('datepicker',{attrs:{\"value\":_vm.endDate,\"input-class\":\"form-control\",\"name\":\"endDate\",\"typeable\":true,\"format\":\"yyyy MM dd\",\"placeholder\":\"yyyy MM dd\",\"disabledDates\":_vm.disabledDatesForm('right'),\"disabled\":_vm.disabledForm('right') || _vm.loading},on:{\"input\":function($event){return _vm.componentEmit($event, 'endDate')}}})],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\n\n\n\n\n\n\n\r\nimport { Component, Prop, Watch, Emit } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport * as _ from \"lodash\"\r\nimport Datepicker from \"vuejs-datepicker\"\r\n// Project Imports\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport LoadingButton from \"@/components/LoadingButton.vue\"\r\nimport { getDate } from \"@/util/getDate\"\r\nimport { dateDiff, isDateDiff } from \"@/util/periodDateHelper\"\r\nimport CalculatorMixin from \"../../mixins/CalculatorMixin\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport ConfirmBoxMixin from \"../../mixins/ConfirmBoxMixin\"\r\n\r\n@Component({\r\n components: {\r\n LoadingButton,\r\n Datepicker,\r\n ErrorAlert,\r\n },\r\n})\r\nclass PeriodDate extends mixins(\r\n LoadingMixin,\r\n CalculatorMixin,\r\n ConfirmBoxMixin\r\n) {\r\n @Prop()\r\n public periodType!: string\r\n\r\n @Prop()\r\n public startDate!: string\r\n\r\n @Prop()\r\n public endDate!: string\r\n\r\n @Prop({ default: \"\" })\r\n public splitDate!: string\r\n\r\n @Prop()\r\n public minStartEndDate!: string\r\n\r\n @Prop()\r\n public maxStartEndDate!: string\r\n\r\n @Prop({ default: false })\r\n public edit!: boolean\r\n\r\n @Prop({ default: false })\r\n public canDelete!: boolean\r\n\r\n @Prop({})\r\n public isFirstYearPeriod!: boolean\r\n\r\n @Prop({ default: false })\r\n public disabled!: boolean\r\n\r\n @Prop()\r\n public initialStartDate!: string\r\n\r\n @Prop()\r\n public initialEndDate!: string\r\n\r\n @Prop()\r\n public minStartDateEdit!: string\r\n\r\n @Prop()\r\n public maxStartDateEdit!: string\r\n @Prop({ default: false })\r\n public loading!: boolean\r\n\r\n private invalidFeedback: string = \"The date chosen is not within the Period.\"\r\n private mode: string = \"edit\"\r\n\r\n // Calculate startDate and endDate\r\n // This is dependent on the periodType\r\n\r\n // created() {\r\n // console.log(\"=====\")\r\n // console.log(\"start date: \", this.startDate)\r\n // console.log(\"end date: \",this.endDate)\r\n // console.log(\"split date: \",this.splitDate)\r\n // console.log(\"min date: \",this.minStartEndDate)\r\n // console.log(\"max date: \",this.maxStartEndDate)\r\n\r\n // console.log(\"min date: \",getDate(this.minStartEndDate))\r\n // console.log(\"max date: \",getDate(this.maxStartEndDate))\r\n\r\n // console.log(\"=====\")\r\n\r\n // }\r\n\r\n public componentEmit(event: string, type: string) {\r\n let emitEvent = \"\"\r\n switch (type) {\r\n case \"startDate\":\r\n emitEvent = \"update:startDate\"\r\n break\r\n case \"endDate\":\r\n emitEvent = \"update:endDate\"\r\n break\r\n case \"splitDate\":\r\n emitEvent = \"update:splitDate\"\r\n break\r\n }\r\n\r\n this.$emit(emitEvent, event)\r\n }\r\n\r\n public disabledDates(minDate: string, maxDate: string) {\r\n /*\r\n Returns an object that is compatible with vuejs-datepicker's disabledDates\r\n\r\n String format (yyyy MM dd) required for minDate/maxDate\r\n eg. 2020 12 20\r\n */\r\n return {\r\n to: new Date(minDate),\r\n from: new Date(maxDate),\r\n }\r\n }\r\n\r\n public disabledForm(position = \"left\") {\r\n /*\r\n This function determines if the date is selectable or not dependent on the position of the date input box.\r\n\r\n PeriodType:\r\n - prepend\r\n - Left date box is selectable\r\n - append\r\n - Right date box is selectable\r\n - insert\r\n - Right date box is selectable\r\n - innerSplit\r\n - Neither left or right is selectable\r\n - edit\r\n - If left date box is modified, only the left will be selectable\r\n - If right date box is modified, only the right will be selectable\r\n\r\n Position\r\n - left\r\n - the start date\r\n - right\r\n - the end date\r\n\r\n */\r\n switch (this.periodType) {\r\n case \"prepend\":\r\n if (position === \"left\") {\r\n return !this.canDelete && this.edit\r\n }\r\n break\r\n case \"append\":\r\n case \"insert\":\r\n if (position === \"right\") {\r\n return !this.canDelete && this.edit\r\n }\r\n break\r\n case \"insertSplit\":\r\n if (position === \"center\") {\r\n return !this.canDelete && this.edit\r\n }\r\n break\r\n case \"edit\":\r\n // If the other box is edited, disable the other side.\r\n if (position === \"right\") {\r\n return isDateDiff(this.startDate, this.initialStartDate)\r\n } else {\r\n return isDateDiff(this.endDate, this.initialEndDate)\r\n }\r\n\r\n return false\r\n }\r\n // Default return\r\n return true\r\n }\r\n\r\n public descriptionForm(position = \"left\") {\r\n /*\r\n Handles the description that appears the date boxes\r\n */\r\n switch (this.periodType) {\r\n case \"prepend\":\r\n if (position === \"right\") {\r\n return \"Immediately before initial taxation year.\"\r\n }\r\n break\r\n case \"append\":\r\n case \"insert\":\r\n if (position === \"left\") {\r\n return this.isFirstYearPeriod\r\n ? \"Default to first year period as there are no existing taxation years.\"\r\n : \"Continuation from previous taxation year.\"\r\n }\r\n break\r\n case \"insertSplit\":\r\n if (position === \"left\" || position === \"right\") {\r\n return \"\"\r\n }\r\n break\r\n case \"edit\":\r\n }\r\n // Default return\r\n return \"Note: Date format must include '/', or a space.\"\r\n }\r\n\r\n public disabledDatesForm(position = \"left\") {\r\n /*\r\n Returns the the disabledDates depending on the position of the date box.\r\n\r\n eg. Date boxes that are selectable will return an object { to: string, from: string}.\r\n Date boxes that are not selectable will return undefined\r\n\r\n */\r\n\r\n switch (this.periodType) {\r\n case \"prepend\":\r\n if (position === \"right\") {\r\n return undefined\r\n }\r\n break\r\n case \"append\":\r\n case \"insert\":\r\n if (position === \"left\") {\r\n return undefined\r\n }\r\n break\r\n case \"insertSplit\":\r\n if (position === \"left\" || position === \"right\") {\r\n return undefined\r\n }\r\n break\r\n case \"edit\":\r\n if (position === \"left\") {\r\n return this.disabledDates(\r\n this.minStartDateEdit,\r\n this.maxStartDateEdit\r\n )\r\n }\r\n break\r\n }\r\n return this.disabledDates(this.minStartEndDate, this.maxStartEndDate)\r\n }\r\n\r\n public dateWithinRange(date: string, minDate: string, maxDate: string) {\r\n return (\r\n getDate(minDate) <= getDate(date) && getDate(maxDate) >= getDate(date)\r\n )\r\n }\r\n\r\n public disabledEmitWrapper(event: boolean, override = false) {\r\n /*\r\n The function that handles emit to the parent for 'disable'\r\n */\r\n\r\n // console.log(\"disabled watcher: \", event)\r\n // Emit the status on whether the chosen date is within range.\r\n if (!override) {\r\n this.$emit(\"update:disabled\", !event)\r\n }\r\n return event\r\n }\r\n\r\n public suppressEmit(position: string) {\r\n /*\r\n This function checks whether the emit for 'disable' should be suppressed.\r\n\r\n Used when the periodType is 'edit', because the user can choose either to edit the start/end date.\r\n */\r\n if (this.periodType === \"edit\") {\r\n switch (position) {\r\n case \"left\":\r\n return isDateDiff(this.endDate, this.initialEndDate)\r\n case \"right\":\r\n return isDateDiff(this.startDate, this.initialStartDate)\r\n }\r\n }\r\n return false\r\n }\r\n\r\n public stateDateValid(position = \"left\") {\r\n /*\r\n This function handles whether the date selected is valid or not.\r\n If not, an emit for disable is sent to the parent.\r\n\r\n PeriodType:\r\n - prepend\r\n - Handles for the left date box\r\n - append\r\n - Handles for the right date box\r\n - insert\r\n - Handles for the right date box\r\n - innerSplit\r\n - Neither left or right date box\r\n - edit\r\n - If left date box is modified, only handles the left date box\r\n - If right date box is modified, only handles the right date box\r\n\r\n Position\r\n - left\r\n - the start date\r\n - right\r\n - the end date\r\n\r\n */\r\n switch (this.periodType) {\r\n case \"prepend\":\r\n if (position === \"right\") {\r\n return true\r\n } else {\r\n return this.disabledEmitWrapper(\r\n this.dateWithinRange(\r\n this.startDate,\r\n this.minStartEndDate,\r\n this.maxStartEndDate\r\n )\r\n )\r\n }\r\n case \"append\":\r\n case \"insert\":\r\n if (position === \"left\") {\r\n return true\r\n } else {\r\n return this.disabledEmitWrapper(\r\n this.dateWithinRange(\r\n this.endDate,\r\n this.minStartEndDate,\r\n this.maxStartEndDate\r\n )\r\n )\r\n }\r\n case \"insertSplit\":\r\n if (position === \"left\" || position === \"right\") {\r\n return true\r\n } else {\r\n return this.disabledEmitWrapper(\r\n this.dateWithinRange(\r\n this.splitDate,\r\n this.minStartEndDate,\r\n this.maxStartEndDate\r\n )\r\n )\r\n }\r\n case \"edit\":\r\n if (position === \"left\") {\r\n return this.disabledEmitWrapper(\r\n this.dateWithinRange(\r\n this.startDate,\r\n this.minStartDateEdit,\r\n this.maxStartDateEdit\r\n ),\r\n this.suppressEmit(position)\r\n )\r\n } else if (position === \"right\") {\r\n return this.disabledEmitWrapper(\r\n this.dateWithinRange(\r\n this.endDate,\r\n this.minStartEndDate,\r\n this.maxStartEndDate\r\n ),\r\n this.suppressEmit(position)\r\n )\r\n }\r\n }\r\n }\r\n}\r\nexport default PeriodDate\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PeriodDate.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PeriodDate.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./PeriodDate.vue?vue&type=template&id=57bacd95&\"\nimport script from \"./PeriodDate.vue?vue&type=script&lang=ts&\"\nexport * from \"./PeriodDate.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.periodType === 'insert')?_c('div',[_c('label',{staticClass:\"font-weight-bold\"},[_vm._v(\"\\n \"+_vm._s(\"Changes:\")+\"\\n \")]),_c('div',[_vm._v(\"\\n Inserted Taxation Year 🡺 \"+_vm._s(_vm.stubStartDateDisplay)+\" to\\n \"+_vm._s(_vm.stubEndDateDisplay)+\"\\n \")]),_vm._l((_vm.calculateNewPeriodList(\n _vm.action,\n _vm.position,\n _vm.stubOption,\n _vm.shiftOption,\n _vm.periodType\n )),function(period,index){return _c('div',{key:index},[_c('label',{staticClass:\"text-muted text-line-through mb-0\"},[_vm._v(_vm._s(period.before))]),_vm._v(\"\\n 🡺\\n \"),_c('label',{staticClass:\"mb-0\"},[_vm._v(_vm._s(period.after)+\"\\n\\n \"),(!period.valid)?_c('label',{directives:[{name:\"b-popover\",rawName:\"v-b-popover.hover.right\",value:('Taxation period is over 53 weeks!'),expression:\"'Taxation period is over 53 weeks!'\",modifiers:{\"hover\":true,\"right\":true}}],staticClass:\"mb-0\",staticStyle:{\"color\":\"red\"}},[_vm._v(\"⚠\\n \")]):_vm._e()])])})],2):_vm._e(),(_vm.periodType === 'edit')?_c('div',[(_vm.action === 'shorten')?_c('b-row',[_c('b-col',[_c('b-form-group',{attrs:{\"label\":_vm.stubOptionLabel}},[_c('b-form-radio-group',{attrs:{\"options\":_vm.stubOptionsList,\"disabled\":_vm.disabled},model:{value:(_vm.stubOption),callback:function ($$v) {_vm.stubOption=$$v},expression:\"stubOption\"}})],1)],1)],1):_vm._e(),(\n (_vm.action === 'expand' || _vm.stubOption === 'B') && !_vm.edgePeriod(_vm.position)\n )?_c('b-row',[_c('b-col',[_c('b-form-group',{attrs:{\"label\":\"Choose how to modify existing taxation year(s) to account for date changes:\",\"disabled\":_vm.disabled}},[_c('b-form-radio',{attrs:{\"value\":\"A\",\"disabled\":_vm.checkShiftOptionA},model:{value:(_vm.shiftOption),callback:function ($$v) {_vm.shiftOption=$$v},expression:\"shiftOption\"}},[_vm._v(\"\\n \"+_vm._s(_vm.shiftOptionAText)+\"\\n \"),(_vm.checkShiftOptionA)?_c('label',{directives:[{name:\"b-popover\",rawName:\"v-b-popover.hover.right\",value:('A Taxation period is over 53 weeks!'),expression:\"'A Taxation period is over 53 weeks!'\",modifiers:{\"hover\":true,\"right\":true}}],staticClass:\"mb-0\",staticStyle:{\"color\":\"red\"}},[_vm._v(\"⚠\\n \")]):_vm._e()]),_c('b-form-radio',{attrs:{\"value\":\"B\"},model:{value:(_vm.shiftOption),callback:function ($$v) {_vm.shiftOption=$$v},expression:\"shiftOption\"}},[_vm._v(\"\\n \"+_vm._s(_vm.shiftOptionBText)+\"\\n \")])],1)],1)],1):_vm._e(),(_vm.shiftOption === 'B' && _vm.action === 'shorten')?_c('b-row',[_c('b-col',[_c('b-form-group',{attrs:{\"label\":_vm.stubOption2Label}},[_c('b-form-radio-group',{attrs:{\"options\":_vm.stubOptionsList,\"disabled\":_vm.disabled},model:{value:(_vm.stubOption2),callback:function ($$v) {_vm.stubOption2=$$v},expression:\"stubOption2\"}})],1)],1)],1):_vm._e(),_c('b-row',[(_vm.displayPanel)?_c('b-col',[_c('label',{staticClass:\"font-weight-bold\"},[_vm._v(\"\\n \"+_vm._s(\"Changes:\")+\"\\n \")]),(\n (_vm.stubOption === 'A' && _vm.position === 'startDate') ||\n (_vm.stubOption2 === 'A' && _vm.position === 'startDate')\n )?_c('div',[_vm._v(\"\\n New Taxation Year 🡺 \"+_vm._s(_vm.stubStartDateDisplay)+\" to\\n \"+_vm._s(_vm.stubEndDateDisplay)+\"\\n \")]):_vm._e(),_vm._l((_vm.calculateNewPeriodList(\n _vm.action,\n _vm.position,\n _vm.stubOption,\n _vm.shiftOption,\n _vm.periodType\n )),function(period,index){return _c('div',{key:index},[_c('label',{staticClass:\"text-muted text-line-through mb-0\"},[_vm._v(_vm._s(period.before))]),_vm._v(\"\\n 🡺\\n \"),_c('label',{staticClass:\"mb-0\"},[_vm._v(_vm._s(period.after)+\"\\n\\n \"),(!period.valid)?_c('label',{directives:[{name:\"b-popover\",rawName:\"v-b-popover.hover.right\",value:('Taxation period is over 53 weeks!'),expression:\"'Taxation period is over 53 weeks!'\",modifiers:{\"hover\":true,\"right\":true}}],staticClass:\"mb-0\",staticStyle:{\"color\":\"red\"}},[_vm._v(\"⚠\\n \")]):_vm._e()])])}),(\n (_vm.stubOption === 'A' && _vm.position === 'endDate') ||\n (_vm.stubOption2 === 'A' && _vm.position === 'endDate')\n )?_c('div',[_vm._v(\"\\n New Taxation Year 🡺 \"+_vm._s(_vm.stubStartDateDisplay)+\" to\\n \"+_vm._s(_vm.stubEndDateDisplay)+\"\\n \")]):_vm._e()],2):_vm._e()],1)],1):_vm._e()])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\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\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\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\r\nimport { Component, Prop, Watch } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport * as _ from \"lodash\"\r\nimport dateFns from \"date-fns\"\r\nimport Datepicker from \"vuejs-datepicker\"\r\n// Project Imports\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport LoadingButton from \"@/components/LoadingButton.vue\"\r\nimport { getDate } from \"@/util/getDate\"\r\nimport {\r\n dateDiff,\r\n isDateDiff,\r\n dayShift,\r\n periodShift,\r\n formatDate,\r\n} from \"@/util/periodDateHelper\"\r\nimport CalculatorMixin from \"../../mixins/CalculatorMixin\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport ConfirmBoxMixin from \"../../mixins/ConfirmBoxMixin\"\r\nimport {\r\n ReportingPeriod,\r\n ReportingPeriodList,\r\n ReportingPeriodShifted,\r\n EditStatus,\r\n} from \"../../interfaces\"\r\n\r\n@Component({\r\n components: {\r\n LoadingButton,\r\n Datepicker,\r\n ErrorAlert,\r\n },\r\n})\r\nclass PeriodEditPanel extends mixins(\r\n LoadingMixin,\r\n CalculatorMixin,\r\n ConfirmBoxMixin\r\n) {\r\n @Prop()\r\n public periodType!: string\r\n @Prop()\r\n public startDate!: string\r\n @Prop()\r\n public endDate!: string\r\n @Prop()\r\n public initialStartDate!: string\r\n @Prop()\r\n public initialEndDate!: string\r\n @Prop()\r\n public editStatus!: EditStatus | undefined\r\n @Prop()\r\n public currentReportingPeriod!: ReportingPeriod\r\n @Prop()\r\n public periodList!: ReportingPeriodList[]\r\n @Prop({ default: false })\r\n public disabled!: boolean\r\n @Prop({ default: \"\" })\r\n public splitDate!: string\r\n\r\n public stubOption: string | null = null\r\n public stubOptionsList: Array<{ text: string; value: string }> = [\r\n { text: \"Yes\", value: \"A\" },\r\n { text: \"No\", value: \"B\" },\r\n ]\r\n\r\n public stubOption2: string | null = null\r\n\r\n public currentReportingPeriodId: string | number | undefined = this\r\n .currentReportingPeriod.id\r\n\r\n public shiftOption: string | null = null\r\n\r\n public position: string | undefined = undefined\r\n public action: string | undefined = undefined\r\n\r\n public stubStartDate: string = \"\"\r\n public stubEndDate: string = \"\"\r\n public stubStartDateDisplay: string = \"\"\r\n public stubEndDateDisplay: string = \"\"\r\n public optionChangeValue = 0\r\n\r\n public created() {\r\n // Forces stubRP to reset when the component is re-rendered\r\n this.$emit(\"stubRP\", null)\r\n\r\n // console.log(this.startDate)\r\n // console.log(this.endDate)\r\n // console.log(this.initialStartDate)\r\n // console.log(this.initialEndDate)\r\n // console.log(this.currentReportingPeriod)\r\n\r\n if (this.periodType === \"insert\") {\r\n this.stubStartDateDisplay = formatDate(this.startDate)\r\n this.stubEndDateDisplay = formatDate(this.endDate)\r\n\r\n this.stubStartDate = this.startDate\r\n this.stubEndDate = this.endDate\r\n\r\n this.$emit(\"stubRP\", {\r\n start_date: this.stubStartDateDisplay,\r\n end_date: this.stubEndDateDisplay,\r\n })\r\n }\r\n\r\n this.position = this.editStatus ? this.editStatus.position : undefined\r\n this.action = this.editStatus ? this.editStatus.action : undefined\r\n\r\n // console.log(this.periodType)\r\n // console.log(this.action)\r\n // console.log(this.position)\r\n // console.log(this.edgePeriod(this.position))\r\n\r\n if (\r\n this.periodType == \"edit\" &&\r\n this.position == \"startDate\" &&\r\n this.action == \"expand\" &&\r\n this.edgePeriod(this.position)\r\n ) {\r\n // No need to disable when changing the start date of the first period\r\n this.submitDisabled(false)\r\n } else {\r\n // Forces submit box to to be disabled when the component is re-rendered during the onset of shorten/expand\r\n this.submitDisabled()\r\n }\r\n }\r\n\r\n @Watch(\"shiftOption\")\r\n public shiftOptionChange(newValue: string, oldValue: string) {\r\n if (newValue === oldValue || newValue === null) {\r\n return\r\n }\r\n\r\n this.stubOption2 = null\r\n\r\n this.stubStartDate = \"\"\r\n this.stubEndDate = \"\"\r\n this.stubStartDateDisplay = \"\"\r\n this.stubEndDateDisplay = \"\"\r\n\r\n this.$emit(\"stubRP\", null)\r\n\r\n this.submitDisabled()\r\n }\r\n\r\n @Watch(\"stubOption\")\r\n public stubOptionChange(newValue: string, oldValue: string) {\r\n if (newValue === oldValue || newValue === null) {\r\n return\r\n } else if (newValue === \"B\") {\r\n this.stubStartDate = \"\"\r\n this.stubEndDate = \"\"\r\n this.stubStartDateDisplay = \"\"\r\n this.stubEndDateDisplay = \"\"\r\n\r\n this.$emit(\"stubRP\", null)\r\n this.submitDisabled()\r\n return\r\n }\r\n\r\n this.shiftOption = null\r\n this.stubOption2 = null\r\n\r\n let newStubStartDate: string = \"\"\r\n let newStubEndDate: string = \"\"\r\n\r\n switch (this.action) {\r\n case \"shorten\":\r\n switch (this.position) {\r\n case \"startDate\":\r\n newStubStartDate = this.initialStartDate\r\n newStubEndDate = dayShift(this.startDate, -1)\r\n break\r\n case \"endDate\":\r\n newStubStartDate = dayShift(this.endDate, 1)\r\n newStubEndDate = this.initialEndDate\r\n break\r\n }\r\n break\r\n case \"expand\":\r\n break\r\n }\r\n\r\n this.stubStartDateDisplay = formatDate(newStubStartDate)\r\n this.stubEndDateDisplay = formatDate(newStubEndDate)\r\n\r\n this.stubStartDate = newStubStartDate\r\n this.stubEndDate = newStubEndDate\r\n\r\n this.$emit(\"stubRP\", {\r\n start_date: this.stubStartDateDisplay,\r\n end_date: this.stubEndDateDisplay,\r\n })\r\n this.submitDisabled()\r\n }\r\n\r\n @Watch(\"stubOption2\")\r\n public stubOption2Change(newValue: string, oldValue: string) {\r\n if (newValue === oldValue || newValue === null) {\r\n return\r\n } else if (newValue === \"B\") {\r\n this.stubStartDate = \"\"\r\n this.stubEndDate = \"\"\r\n this.stubStartDateDisplay = \"\"\r\n this.stubEndDateDisplay = \"\"\r\n\r\n this.$emit(\"stubRP\", null)\r\n this.submitDisabled()\r\n return\r\n }\r\n\r\n let newStubStartDate: string = \"\"\r\n let newStubEndDate: string = \"\"\r\n\r\n const calculatedList = this.calculateNewPeriodList(\r\n this.action,\r\n this.position,\r\n this.shiftOption,\r\n this.stubOption,\r\n this.periodType\r\n )\r\n\r\n switch (this.action) {\r\n case \"shorten\":\r\n switch (this.position) {\r\n case \"startDate\":\r\n newStubEndDate = dayShift(calculatedList[0].value.start_date, -1)\r\n this.stubStartDateDisplay = calculatedList[0].valueBefore.start_date\r\n this.stubEndDateDisplay = formatDate(newStubEndDate)\r\n newStubStartDate = this.stubStartDateDisplay\r\n break\r\n case \"endDate\":\r\n newStubStartDate = dayShift(\r\n calculatedList[calculatedList.length - 1].value.end_date,\r\n 1\r\n )\r\n this.stubStartDateDisplay = formatDate(newStubStartDate)\r\n this.stubEndDateDisplay =\r\n calculatedList[calculatedList.length - 1].valueBefore.end_date\r\n newStubEndDate = this.stubEndDateDisplay\r\n break\r\n }\r\n break\r\n case \"expand\":\r\n break\r\n }\r\n\r\n this.stubStartDate = newStubStartDate\r\n this.stubEndDate = newStubEndDate\r\n\r\n this.$emit(\"stubRP\", {\r\n start_date: this.stubStartDateDisplay,\r\n end_date: this.stubEndDateDisplay,\r\n })\r\n this.submitDisabled()\r\n }\r\n\r\n public stubRPClear() {\r\n this.stubStartDate = \"\"\r\n this.stubEndDate = \"\"\r\n this.stubStartDateDisplay = \"\"\r\n this.stubEndDateDisplay = \"\"\r\n\r\n this.$emit(\"stubRP\", null)\r\n }\r\n\r\n public edgePeriod(position?: string) {\r\n /*\r\n Handles changes for periods at the beginning or end of JSON\r\n */\r\n\r\n const currentRPLoc = this.periodList.findIndex(\r\n (el: ReportingPeriodList) => el.value.id === this.currentReportingPeriodId\r\n )\r\n const lastIndex = this.periodList.length - 1\r\n const startIndex = 0\r\n\r\n switch (true) {\r\n case position === \"startDate\" && currentRPLoc === startIndex:\r\n case position === \"endDate\" && currentRPLoc === lastIndex:\r\n return true\r\n\r\n default:\r\n return false\r\n }\r\n }\r\n\r\n public submitDisabled(override: boolean = false) {\r\n /*\r\n Emits an event to disable the submit button in PeriodForm\r\n */\r\n let emitValue: boolean\r\n\r\n if (override) {\r\n emitValue = override\r\n } else {\r\n switch (true) {\r\n case this.periodType === \"edit\" &&\r\n this.stubOption === null &&\r\n this.shiftOption === null &&\r\n !this.edgePeriod(this.position):\r\n case this.periodType === \"edit\" &&\r\n this.stubOption === \"B\" &&\r\n this.shiftOption === null &&\r\n !this.edgePeriod(this.position): // excludes edge period when shortening\r\n case this.periodType === \"edit\" &&\r\n this.action === \"shorten\" &&\r\n this.stubOption === null &&\r\n this.shiftOption === null &&\r\n this.edgePeriod(this.position):\r\n case this.periodType === \"edit\" &&\r\n this.stubOption === \"B\" &&\r\n this.shiftOption === \"B\" &&\r\n this.action === \"shorten\" &&\r\n this.stubOption2 === null:\r\n emitValue = true\r\n break\r\n default:\r\n emitValue = false\r\n }\r\n }\r\n this.$emit(\"submitDisabled\", emitValue)\r\n }\r\n\r\n public get shiftOptionAText() {\r\n /*\r\n Shifting a RP has two options that the user can chose.\r\n - Option A Text refers to the first option, and there are a total of 4 different combinations that can occur\r\n */\r\n switch (true) {\r\n case this.action === \"shorten\" && this.position === \"startDate\":\r\n return `Move end date of previous taxation year only`\r\n case this.action === \"shorten\" && this.position === \"endDate\":\r\n return `Move start date of next taxation year only`\r\n case this.action === \"expand\" && this.position === \"startDate\":\r\n return `Shorten previous previous taxation year only`\r\n case this.action === \"expand\" && this.position === \"endDate\":\r\n return `Shorten next taxation year only`\r\n }\r\n }\r\n\r\n public get shiftOptionBText() {\r\n /*\r\n Shifting a RP has two options that the user can chose.\r\n - Option B Text refers to the second option, and there are a total of 4 different combinations that can occur. However, there are only 2 common occurance that will be displayed\r\n */\r\n switch (true) {\r\n case this.action === \"shorten\" && this.position === \"startDate\":\r\n case this.action === \"expand\" && this.position === \"startDate\":\r\n return `Move all previous taxation year(s)`\r\n case this.action === \"shorten\" && this.position === \"endDate\":\r\n case this.action === \"expand\" && this.position === \"endDate\":\r\n return `Move all future taxation year(s)`\r\n }\r\n }\r\n\r\n public get stubOptionLabel() {\r\n /*\r\n Changes the label for level 1 stubOption\r\n */\r\n switch (true) {\r\n case this.action === \"shorten\" && this.position === \"startDate\":\r\n return `Add new taxation year before shortened taxation year?`\r\n case this.action === \"shorten\" && this.position === \"endDate\":\r\n return `Add new taxation year after shortened taxation year?`\r\n }\r\n }\r\n\r\n public get stubOption2Label() {\r\n /*\r\n Changes the label for level 2 stubOption\r\n */\r\n switch (true) {\r\n case this.action === \"shorten\" && this.position === \"startDate\":\r\n return `Add new taxation year before first taxation year?`\r\n case this.action === \"shorten\" && this.position === \"endDate\":\r\n return `Add new taxation year after last taxation year?`\r\n }\r\n }\r\n\r\n // stubOption, shiftOption, stubOption2\r\n @Watch(\"stubOption\")\r\n @Watch(\"stubOption2\")\r\n @Watch(\"shiftOption\")\r\n public optionChangeTrigger() {\r\n this.optionChangeValue += 1\r\n\r\n this.$emit(\"editPanelOptionChange\", this.optionChangeValue)\r\n }\r\n\r\n public get followingReportingPeriodID() {\r\n /*\r\n Grabs the id of the next RP\r\n */\r\n const tempPeriodOptions = _.cloneDeep(this.periodOptions).reverse()\r\n const index =\r\n tempPeriodOptions.findIndex(\r\n (el: ReportingPeriodList) =>\r\n el.value.id === this.currentReportingPeriodId\r\n ) + 1\r\n\r\n return tempPeriodOptions[index].value.id\r\n }\r\n\r\n public get displayPanel() {\r\n /*\r\n This handles the combinations that will show/hide the user to see the panel that shows how the RP are shifted.\r\n Edge cases are included when the current RP is on either ends of a JSON array\r\n */\r\n switch (this.action) {\r\n case \"shorten\":\r\n switch (true) {\r\n case this.position === \"startDate\" && this.stubOption === \"A\":\r\n case this.position === \"startDate\" &&\r\n this.stubOption === \"B\" &&\r\n this.edgePeriod(this.position):\r\n case this.position === \"startDate\" &&\r\n this.stubOption === \"B\" &&\r\n !this.edgePeriod(this.position) &&\r\n this.shiftOption === \"A\":\r\n case this.position === \"startDate\" &&\r\n this.stubOption === \"B\" &&\r\n !this.edgePeriod(this.position) &&\r\n this.shiftOption === \"B\" &&\r\n this.stubOption2 !== null:\r\n case this.position === \"endDate\" && this.stubOption === \"A\":\r\n case this.position === \"endDate\" &&\r\n this.stubOption === \"B\" &&\r\n this.edgePeriod(this.position):\r\n case this.position === \"endDate\" &&\r\n this.stubOption === \"B\" &&\r\n !this.edgePeriod(this.position) &&\r\n this.shiftOption === \"A\":\r\n case this.position === \"endDate\" &&\r\n this.stubOption === \"B\" &&\r\n !this.edgePeriod(this.position) &&\r\n this.shiftOption === \"B\" &&\r\n this.stubOption2 !== null:\r\n return true\r\n default:\r\n return false\r\n }\r\n case \"expand\":\r\n switch (true) {\r\n case this.position === \"startDate\" && this.shiftOption !== null:\r\n case this.position === \"endDate\" && this.shiftOption !== null:\r\n case this.edgePeriod(this.position):\r\n return true\r\n default:\r\n return false\r\n }\r\n }\r\n }\r\n\r\n public periodValidity(start_date: string, end_date: string) {\r\n // Checks if the start date is within 53 weeks\r\n return getDate(end_date) <= dateFns.addWeeks(getDate(start_date), 53)\r\n }\r\n\r\n public getMinLoc(\r\n action?: string,\r\n position?: string,\r\n stubOption?: string | null,\r\n shiftOption?: string | null,\r\n periodType?: string\r\n ) {\r\n /*\r\n Used with calculateNewPeriodList to determine the minimum index of a JSON array\r\n */\r\n const currentRPLoc = this.periodList.findIndex(\r\n (el: ReportingPeriodList) => el.value.id === this.currentReportingPeriodId\r\n )\r\n\r\n switch (true) {\r\n case action === \"shorten\" && position === \"endDate\":\r\n case action === \"expand\" && position === \"endDate\":\r\n case action === \"shorten\" &&\r\n position === \"startDate\" &&\r\n this.edgePeriod(position):\r\n case action === \"expand\" &&\r\n position === \"startDate\" &&\r\n this.edgePeriod(position):\r\n case action === \"shorten\" &&\r\n position === \"startDate\" &&\r\n stubOption === \"A\":\r\n return currentRPLoc\r\n case action === \"shorten\" &&\r\n position === \"startDate\" &&\r\n stubOption === \"B\" &&\r\n shiftOption === \"A\":\r\n case action === \"expand\" &&\r\n position === \"startDate\" &&\r\n shiftOption === \"A\":\r\n return currentRPLoc - 1\r\n case action === \"shorten\" &&\r\n position === \"startDate\" &&\r\n stubOption === \"B\" &&\r\n shiftOption === \"B\":\r\n case action === \"expand\" &&\r\n position === \"startDate\" &&\r\n shiftOption === \"B\":\r\n return 0\r\n case periodType === \"insert\":\r\n return currentRPLoc + 1\r\n default:\r\n return\r\n }\r\n }\r\n\r\n public getMaxLoc(\r\n action?: string,\r\n position?: string,\r\n stubOption?: string | null,\r\n shiftOption?: string | null,\r\n periodType?: string\r\n ) {\r\n /*\r\n Used with calculateNewPeriodList to determine the maximum index of a JSON array\r\n */\r\n const currentRPLoc = this.periodList.findIndex(\r\n (el: ReportingPeriodList) => el.value.id === this.currentReportingPeriodId\r\n )\r\n\r\n switch (true) {\r\n case action === \"shorten\" && position === \"startDate\":\r\n case action === \"expand\" && position === \"startDate\":\r\n case action === \"shorten\" &&\r\n position === \"endDate\" &&\r\n this.edgePeriod(position):\r\n case action === \"expand\" &&\r\n position === \"endDate\" &&\r\n this.edgePeriod(position):\r\n case action === \"shorten\" && position === \"endDate\" && stubOption === \"A\":\r\n return currentRPLoc\r\n case action === \"shorten\" &&\r\n position === \"endDate\" &&\r\n stubOption === \"B\" &&\r\n shiftOption === \"A\":\r\n case action === \"expand\" && position === \"endDate\" && shiftOption === \"A\":\r\n return currentRPLoc + 1\r\n case action === \"shorten\" &&\r\n position === \"endDate\" &&\r\n stubOption === \"B\" &&\r\n shiftOption === \"B\":\r\n case action === \"expand\" && position === \"endDate\" && shiftOption === \"B\":\r\n case periodType === \"insert\":\r\n return this.periodList.length - 1\r\n default:\r\n return\r\n }\r\n }\r\n\r\n public calculateNewPeriodList(\r\n action?: string,\r\n position?: string,\r\n stubOption?: string | null,\r\n shiftOption?: string | null,\r\n periodType?: string,\r\n checkPeriodAllowed: boolean = false\r\n ) {\r\n /*\r\n This getter handles the calculation of the new list of RP dates\r\n\r\n The general flow is..\r\n 1) Grab the minimum and maximum index in a current list of RP\r\n 2) Determine the date difference in the intended date change\r\n 3) Dependent on the various combinations...\r\n - Action: shorten, expand\r\n - Position: startDate, endDate\r\n - Stub: A, B\r\n - Shift: A, B\r\n This will determine the outputs of start_date and end_dates for the shifted RP list.\r\n 4) The shifted RP list is then packaged so that it can be passed to the API in PeriodForm.vue\r\n */\r\n const minLoc = this.getMinLoc(\r\n action,\r\n position,\r\n stubOption,\r\n shiftOption,\r\n periodType\r\n )\r\n const maxLoc = this.getMaxLoc(\r\n action,\r\n position,\r\n stubOption,\r\n shiftOption,\r\n periodType\r\n )\r\n\r\n if (minLoc === undefined || maxLoc === undefined) {\r\n return []\r\n }\r\n\r\n let diffValue: number\r\n switch (position) {\r\n case \"startDate\":\r\n diffValue = dateDiff(this.startDate, this.initialStartDate)\r\n break\r\n case \"endDate\":\r\n diffValue = dateDiff(this.endDate, this.initialEndDate)\r\n break\r\n }\r\n if (periodType === \"insert\") {\r\n diffValue = dateFns.differenceInCalendarDays(\r\n this.endDate,\r\n this.initialEndDate\r\n )\r\n }\r\n\r\n const reducedPeriodList = _.cloneDeep(\r\n this.periodList.filter((el: ReportingPeriodList, index: number) => {\r\n return index <= maxLoc && index >= minLoc\r\n })\r\n )\r\n\r\n const arrLastIndex = reducedPeriodList.length - 1\r\n\r\n const overrideValue = (\r\n id: number | string | undefined,\r\n start_date: string,\r\n end_date: string,\r\n diffValue: number,\r\n index: number,\r\n action?: string,\r\n position?: string,\r\n stubOption?: string | null,\r\n shiftOption?: string | null,\r\n periodType?: string\r\n ) => {\r\n /*\r\n This large switch/case statement determines all the combinations that are allowed for:\r\n - shorten\r\n - expand\r\n - other\r\n */\r\n\r\n // For shorten\r\n switch (true) {\r\n case action === \"shorten\" &&\r\n position === \"startDate\" &&\r\n stubOption == \"A\":\r\n start_date = dayShift(start_date, diffValue)\r\n break\r\n case action === \"shorten\" &&\r\n position === \"startDate\" &&\r\n stubOption == \"B\":\r\n switch (true) {\r\n case this.edgePeriod(position):\r\n start_date = dayShift(start_date, diffValue)\r\n break\r\n case !this.edgePeriod(position) &&\r\n shiftOption === \"A\" &&\r\n index === 0:\r\n end_date = dayShift(end_date, diffValue)\r\n break\r\n case !this.edgePeriod(position) &&\r\n shiftOption === \"A\" &&\r\n index !== 0:\r\n start_date = dayShift(start_date, diffValue)\r\n break\r\n case !this.edgePeriod(position) &&\r\n shiftOption === \"B\" &&\r\n arrLastIndex !== index:\r\n start_date = dayShift(start_date, diffValue)\r\n end_date = dayShift(end_date, diffValue)\r\n break\r\n case !this.edgePeriod(position) &&\r\n shiftOption === \"B\" &&\r\n arrLastIndex === index:\r\n start_date = dayShift(start_date, diffValue)\r\n break\r\n }\r\n break\r\n case action === \"shorten\" &&\r\n position === \"endDate\" &&\r\n stubOption == \"A\":\r\n end_date = dayShift(end_date, diffValue)\r\n break\r\n case action === \"shorten\" &&\r\n position === \"endDate\" &&\r\n stubOption == \"B\":\r\n switch (true) {\r\n case this.edgePeriod(position):\r\n end_date = dayShift(end_date, diffValue)\r\n break\r\n case !this.edgePeriod(position) &&\r\n shiftOption === \"A\" &&\r\n index === 0:\r\n end_date = dayShift(end_date, diffValue)\r\n break\r\n case !this.edgePeriod(position) && shiftOption === \"A\" && index > 0:\r\n start_date = dayShift(start_date, diffValue)\r\n break\r\n case !this.edgePeriod(position) && shiftOption === \"B\" && index > 0:\r\n start_date = dayShift(start_date, diffValue)\r\n end_date = dayShift(end_date, diffValue)\r\n break\r\n case !this.edgePeriod(position) &&\r\n shiftOption === \"B\" &&\r\n index === 0:\r\n end_date = dayShift(end_date, diffValue)\r\n break\r\n }\r\n break\r\n }\r\n\r\n // For expand\r\n switch (true) {\r\n case action === \"expand\" &&\r\n position === \"startDate\" &&\r\n this.edgePeriod(position):\r\n start_date = dayShift(start_date, diffValue)\r\n break\r\n case action === \"expand\" &&\r\n position === \"endDate\" &&\r\n this.edgePeriod(position):\r\n end_date = dayShift(end_date, diffValue)\r\n break\r\n case action === \"expand\" &&\r\n position === \"startDate\" &&\r\n shiftOption === \"A\" &&\r\n index === 0:\r\n end_date = dayShift(end_date, diffValue)\r\n break\r\n case action === \"expand\" &&\r\n position === \"startDate\" &&\r\n shiftOption === \"A\" &&\r\n index > 0:\r\n start_date = dayShift(start_date, diffValue)\r\n break\r\n case action === \"expand\" &&\r\n position === \"startDate\" &&\r\n shiftOption === \"B\" &&\r\n arrLastIndex !== index:\r\n start_date = dayShift(start_date, diffValue)\r\n end_date = dayShift(end_date, diffValue)\r\n break\r\n case action === \"expand\" &&\r\n position === \"startDate\" &&\r\n shiftOption === \"B\" &&\r\n arrLastIndex === index:\r\n start_date = dayShift(start_date, diffValue)\r\n break\r\n case action === \"expand\" &&\r\n position === \"endDate\" &&\r\n shiftOption === \"A\" &&\r\n index === 0:\r\n end_date = dayShift(end_date, diffValue)\r\n break\r\n case action === \"expand\" &&\r\n position === \"endDate\" &&\r\n shiftOption === \"A\" &&\r\n index > 0:\r\n start_date = dayShift(start_date, diffValue)\r\n break\r\n case action === \"expand\" &&\r\n position === \"endDate\" &&\r\n shiftOption === \"B\" &&\r\n index === 0:\r\n end_date = dayShift(end_date, diffValue)\r\n break\r\n case action === \"expand\" &&\r\n position === \"endDate\" &&\r\n shiftOption === \"B\" &&\r\n index > 0:\r\n start_date = dayShift(start_date, diffValue)\r\n end_date = dayShift(end_date, diffValue)\r\n break\r\n }\r\n\r\n // Other\r\n switch (true) {\r\n case periodType === \"insert\":\r\n start_date = periodShift(start_date, diffValue)\r\n end_date = periodShift(end_date, diffValue)\r\n break\r\n }\r\n\r\n return { id, start_date, end_date }\r\n }\r\n\r\n const output = reducedPeriodList.map(\r\n (el: ReportingPeriodList, index: number) => {\r\n const { text } = el\r\n const { id, start_date, end_date } = el.value\r\n const value = overrideValue(\r\n id,\r\n start_date,\r\n end_date,\r\n diffValue,\r\n index,\r\n action,\r\n position,\r\n stubOption,\r\n shiftOption,\r\n periodType\r\n )\r\n return {\r\n before: text,\r\n after: `${value.start_date} to ${value.end_date}`,\r\n id,\r\n value: { start_date: value.start_date, end_date: value.end_date },\r\n valueBefore: { start_date, end_date },\r\n valid: this.periodValidity(value.start_date, value.end_date),\r\n }\r\n }\r\n )\r\n\r\n // If the taxation year is beyond 53 weeks, the submit button will be disabled\r\n if (output.filter((el: ReportingPeriodShifted) => !el.valid).length > 0) {\r\n if (!checkPeriodAllowed) {\r\n this.submitDisabled(true)\r\n }\r\n }\r\n\r\n if (!checkPeriodAllowed) {\r\n this.$emit(\"shiftedRPList\", output)\r\n }\r\n\r\n return output\r\n }\r\n\r\n public checkNewPeriodListValidity(\r\n action?: string,\r\n position?: string,\r\n stubOption?: string | null,\r\n shiftOption?: string | null,\r\n periodType?: string,\r\n checkPeriodAllowed: boolean = true\r\n ) {\r\n /*\r\n For the provided properties, checks if the returned period list is valid or not.\r\n */\r\n const calculatedList = this.calculateNewPeriodList(\r\n action,\r\n position,\r\n stubOption,\r\n shiftOption,\r\n periodType,\r\n checkPeriodAllowed\r\n )\r\n if (\r\n calculatedList.filter((el: ReportingPeriodShifted) => !el.valid).length >\r\n 0\r\n ) {\r\n return true\r\n }\r\n return false\r\n }\r\n\r\n public get checkShiftOptionA() {\r\n /*\r\n Use to check if shiftOption A is valid or not.\r\n */\r\n const isShiftOptionAValid = this.checkNewPeriodListValidity(\r\n this.action,\r\n this.position,\r\n this.stubOption,\r\n \"A\",\r\n this.periodType\r\n )\r\n if (isShiftOptionAValid) {\r\n this.shiftOption = \"B\"\r\n }\r\n return isShiftOptionAValid\r\n }\r\n}\r\nexport default PeriodEditPanel\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PeriodEditPanel.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PeriodEditPanel.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./PeriodEditPanel.vue?vue&type=template&id=e44084cc&\"\nimport script from \"./PeriodEditPanel.vue?vue&type=script&lang=ts&\"\nexport * from \"./PeriodEditPanel.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('h3',[_vm._v(\"Dividend Tier Issue\")]),_c('hr'),_c('PeriodCallout',{attrs:{\"variant\":\"danger\",\"text\":\"WARNING: There's a\\n conflict with the following sets of dividend tiers for the displayed\\n taxation years. All the following items will be changed to 'Other FA'.\",\"icon\":\"warning\",\"mb\":\"2\"}}),_c('PeriodCallout',{attrs:{\"variant\":\"primary\",\"text\":\"Only dividend tiers that are connected to the current Foreign Affiliate\\n are displayed.\",\"icon\":\"info\",\"mb\":\"2\"}}),_c('PeriodCallout',{attrs:{\"variant\":\"primary\",\"text\":\"If this issue panel re-appears again after confirmation, there are\\n potentially dividend tier issues connected between other Foreign\\n Affiliates instead.\",\"icon\":\"info\"}}),_vm._l((_vm.reportingPeriodsWithIssues),function(rp,index){return _c('div',{key:(\"rp-issues-\" + index)},[_c('label',{directives:[{name:\"b-toggle\",rawName:\"v-b-toggle\",value:((\"collapse-div-tier-checker-panel-\" + index)),expression:\"`collapse-div-tier-checker-panel-${index}`\"}],staticClass:\"issue-panel font-weight-bold\"},[_c('font-awesome-icon',{staticClass:\"when-closed float-left mr-2\",attrs:{\"icon\":\"plus-circle\"}}),_c('font-awesome-icon',{staticClass:\"when-opened float-left mr-2\",attrs:{\"icon\":\"minus-circle\"}}),_vm._v(\"\\n \"+_vm._s(rp.text)+\"\\n \")],1),_c('b-collapse',{attrs:{\"id\":(\"collapse-div-tier-checker-panel-\" + index)}},_vm._l((_vm.divTierIssueInRP(rp.id)),function(dt,index){return _c('div',{key:(\"div-tier-issues-\" + index)},[_c('b-card',{staticClass:\"mb-1\"},_vm._l((dt.dt_value),function(valEntry,valIndex){return _c('div',{key:(\"value-\" + (dt.dt_id) + \"-\" + valIndex)},[(valEntry !== null)?_c('span',[_c('label',{staticClass:\"mb-0 font-weight-bold text-capitalize\"},[_vm._v(\"\\n \"+_vm._s(valIndex.replaceAll(\"_\", \" \"))+\":\\n \")]),_vm._v(\"\\n \"+_vm._s()+\"\\n \"),_c('label',{staticClass:\"mb-0 text-capitalize\",class:valIndex == \"receiver_name\"\n ? \"text-muted text-line-through\"\n : null},[_vm._v(\"\\n \"+_vm._s(valEntry)+\"\\n \")]),(valIndex == \"receiver_name\")?_c('span',[_vm._v(\"\\n 🡺 Other FA\\n \")]):_vm._e(),_c('br')]):_vm._e()])}),0)],1)}),0),_c('b-form-checkbox',{staticClass:\"mt-3\",attrs:{\"disabled\":_vm.disabled},model:{value:(_vm.confirmation),callback:function ($$v) {_vm.confirmation=$$v},expression:\"confirmation\"}},[_vm._v(\"\\n I agree to the above modifications.\")]),(!_vm.confirmation)?_c('PeriodCallout',{attrs:{\"variant\":\"warning\",\"text\":\"If the box is not checked, changes cannot be made.\",\"icon\":\"warning\",\"size\":\"small\",\"mb\":\"0\"}}):_vm._e()],1)})],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\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\n\n\n\n\n\n\r\nimport { Component, Prop, Watch } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport * as _ from \"lodash\"\r\nimport Datepicker from \"vuejs-datepicker\"\r\n// Project Imports\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport LoadingButton from \"@/components/LoadingButton.vue\"\r\nimport CalculatorMixin from \"../../mixins/CalculatorMixin\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport ConfirmBoxMixin from \"../../mixins/ConfirmBoxMixin\"\r\nimport {\r\n DividendTierIssue,\r\n ReportingPeriodListFromBackend,\r\n} from \"../../interfaces\"\r\nimport PeriodCallout from \"@/components/periods/PeriodCallout.vue\"\r\n\r\n@Component({\r\n components: {\r\n LoadingButton,\r\n Datepicker,\r\n ErrorAlert,\r\n PeriodCallout,\r\n },\r\n})\r\nclass PeriodDividendTierCheckerPanel extends mixins(\r\n LoadingMixin,\r\n CalculatorMixin,\r\n ConfirmBoxMixin\r\n) {\r\n @Prop()\r\n public divTierIssue!: DividendTierIssue[]\r\n\r\n @Prop()\r\n public newPeriodList!: ReportingPeriodListFromBackend[]\r\n\r\n @Prop({ default: false })\r\n public disabled!: boolean\r\n\r\n public selected: number[] = []\r\n\r\n public confirmation: boolean = false\r\n\r\n public get reportingPeriodsWithIssues() {\r\n /*\r\n This getter filters the reporting period list so that it only displays the reporting periods where there is a corersponding Dividend Tier issues\r\n */\r\n return this.newPeriodList.filter((rp: ReportingPeriodListFromBackend) =>\r\n this.divTierIssueInRP(rp.id).length > 0 ? true : false\r\n )\r\n }\r\n\r\n public created() {\r\n // Populate this.selected with all the Divdiend Tiers\r\n this.divTierIssue.forEach((el: DividendTierIssue) =>\r\n this.selected.push(el.dt_id)\r\n )\r\n\r\n // When this component is created, the submit button will always be disabled\r\n this.$emit(\"submitDisabled\", true)\r\n }\r\n\r\n @Watch(\"confirmation\")\r\n public confirmationChange() {\r\n if (this.confirmation === true) {\r\n this.$emit(\"divTierIssueOverride\", this.selected)\r\n this.$emit(\"submitDisabled\", false)\r\n } else {\r\n this.$emit(\"divTierIssueOverride\", [])\r\n this.$emit(\"submitDisabled\", true)\r\n }\r\n }\r\n\r\n public divTierIssueInRP(rpID: number) {\r\n /* Returns an array of Dividend Tiers */\r\n return this.divTierIssue.filter(\r\n (el: DividendTierIssue) => el.rp_id === rpID\r\n )\r\n }\r\n}\r\nexport default PeriodDividendTierCheckerPanel\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PeriodDividendTierCheckerPanel.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PeriodDividendTierCheckerPanel.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./PeriodDividendTierCheckerPanel.vue?vue&type=template&id=ca6c2978&\"\nimport script from \"./PeriodDividendTierCheckerPanel.vue?vue&type=script&lang=ts&\"\nexport * from \"./PeriodDividendTierCheckerPanel.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('h3',[_vm._v(\"Outside of Period Data\")]),_c('hr'),_c('PeriodCallout',{attrs:{\"variant\":\"danger\",\"icon\":\"warning\",\"mb\":\"1\"},scopedSlots:_vm._u([{key:\"text-slot\",fn:function(){return [_vm._v(\"\\n WARNING: The following item(s) will have the\\n \"),_c('b-badge',{attrs:{\"variant\":\"danger\"}},[_vm._v(\"Delete\")]),_vm._v(\" or\\n \"),_c('b-badge',{attrs:{\"variant\":\"primary\"}},[_vm._v(\"Modify\")]),_vm._v(\" action applied in order to\\n proceed because their dates fall outside of any taxation year of the\\n Foreign Affiliate.\\n \")]},proxy:true}])}),_c('PeriodCallout',{attrs:{\"variant\":\"primary\",\"icon\":\"info\"},scopedSlots:_vm._u([{key:\"text-slot\",fn:function(){return [_vm._v(\"\\n For the \"),_c('b-badge',{attrs:{\"variant\":\"primary\"}},[_vm._v(\"Modify\")]),_vm._v(\" action, please see\\n the corresponding items for more details.\\n \")]},proxy:true}])}),_vm._l((_vm.outOfRangeIssue),function(entry,index){return _c('div',{key:(\"obj-out-of-range-issue-\" + index)},[_c('label',{directives:[{name:\"b-toggle\",rawName:\"v-b-toggle\",value:((\"collapse-out-of-range-panel-\" + index)),expression:\"`collapse-out-of-range-panel-${index}`\"}],staticClass:\"issue-panel\"},[_c('font-awesome-icon',{staticClass:\"when-closed float-left mr-1\",attrs:{\"icon\":\"plus-circle\"}}),_c('font-awesome-icon',{staticClass:\"when-opened float-left mr-1\",attrs:{\"icon\":\"minus-circle\"}}),_c('b-badge',{staticClass:\"mr-1 text-capitalize\",attrs:{\"variant\":entry.action === \"delete\" ? \"danger\" : \"primary\"}},[_vm._v(_vm._s(entry.action))]),_vm._v(\"\\n \"+_vm._s(_vm.modelNameDictionary[entry.model])+\"\\n \")],1),_c('b-collapse',{attrs:{\"id\":(\"collapse-out-of-range-panel-\" + index)}},[_c('b-card',{staticClass:\"mb-2\"},_vm._l((entry.value),function(valEntry,valIndex){return _c('div',{key:(\"value-\" + (entry.id) + \"-\" + valIndex)},[(valEntry !== null)?_c('span',[_c('label',{staticClass:\"mb-0 font-weight-bold text-capitalize\"},[_vm._v(\"\\n \"+_vm._s(valIndex.replaceAll(\"_\", \" \"))+\":\\n \")]),_vm._v(\"\\n \"+_vm._s()+\"\\n \"),_c('label',{staticClass:\"mb-0 text-capitalize\",class:_vm.isModifyChange(entry.action, entry.model, valIndex)\n ? \"text-muted text-line-through\"\n : null},[_vm._v(\"\\n \"+_vm._s(valEntry)+\"\\n \")]),(_vm.isModifyChange(entry.action, entry.model, valIndex))?_c('span',[_vm._v(\"\\n 🡺 Other FA\\n \")]):_vm._e(),_c('br')]):_vm._e()])}),0)],1)],1)}),_c('b-form-checkbox',{staticClass:\"mt-3\",attrs:{\"disabled\":_vm.disabled},model:{value:(_vm.confirmation),callback:function ($$v) {_vm.confirmation=$$v},expression:\"confirmation\"}},[_vm._v(\"\\n I agree to the above modifications.\")]),(!_vm.confirmation)?_c('PeriodCallout',{attrs:{\"variant\":\"warning\",\"text\":\"If the box is not checked, changes cannot be made.\",\"icon\":\"warning\",\"size\":\"small\",\"mb\":\"0\"}}):_vm._e()],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\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\n\r\nimport { Component, Prop, Watch, Emit } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport * as _ from \"lodash\"\r\nimport Datepicker from \"vuejs-datepicker\"\r\n// Project Imports\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport LoadingButton from \"@/components/LoadingButton.vue\"\r\nimport CalculatorMixin from \"../../mixins/CalculatorMixin\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport ConfirmBoxMixin from \"../../mixins/ConfirmBoxMixin\"\r\nimport \"@/style/app.scss\"\r\nimport { ModelObjectIssue } from \"../../interfaces\"\r\nimport PeriodCallout from \"@/components/periods/PeriodCallout.vue\"\r\n\r\n@Component({\r\n components: {\r\n LoadingButton,\r\n Datepicker,\r\n ErrorAlert,\r\n PeriodCallout,\r\n },\r\n})\r\nclass PeriodOutOfRangePanel extends mixins(\r\n LoadingMixin,\r\n CalculatorMixin,\r\n ConfirmBoxMixin\r\n) {\r\n @Prop()\r\n public outOfRangeIssue!: ModelObjectIssue[]\r\n @Prop({ default: false })\r\n public disabled!: boolean\r\n\r\n public confirmation: boolean = false\r\n\r\n public modelNameDictionary: { [key: string]: string } = {\r\n SEPAdjustmentPeriod: \"Surplus Entitlement Percentage (SEP) Adjustment\",\r\n DispositionAdjustment: \"Hybrid Surplus Adjustment\",\r\n Adjustment: \"Other Inclusion/(Deduction) Adjustment\",\r\n Dividend: \"Dividend\",\r\n DividendTier: \"Dividend Tier\",\r\n }\r\n\r\n public isModifyChange(\r\n actionName: string,\r\n modelName: string,\r\n indexName: string\r\n ) {\r\n /*\r\n In the backend, there are certain scenarios where there is the action 'modify' where the FA is changed to 'Other FA'\r\n Cases:\r\n - Dividend -> Payer\r\n - Occurs when the current FA is paying to another FA, but the current FA's reporting period doesn't exist anymore to faciliate paying out the Dividend.\r\n - Therefore, the paid dividend doesn't exist anymore. The dividend being received is modified to 'Other FA' and the DividendTier is also deleted.\r\n - DividendTier -> Receiver\r\n - Occurs when another FA is paying to the current FA, but the current FA's reporting period doesn't exist anymore to faciliate receiving the Divdiend.\r\n - Therefore the receiving dividend doesn't exist anymore. The dividend being received is deleted, and the DividendTier is modified to 'Other FA'.\r\n */\r\n return (\r\n actionName == `modify` &&\r\n ((indexName === `payer_name` && modelName === `Dividend`) ||\r\n (indexName === `receiver_name` && modelName === `DividendTier`))\r\n )\r\n }\r\n\r\n @Watch(\"confirmation\")\r\n public confirmationChange() {\r\n this.$emit(\"submitDisabled\", !this.confirmation)\r\n }\r\n\r\n public created() {\r\n this.$emit(\"submitDisabled\", true)\r\n }\r\n}\r\nexport default PeriodOutOfRangePanel\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PeriodOutOfRangePanel.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PeriodOutOfRangePanel.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./PeriodOutOfRangePanel.vue?vue&type=template&id=fcfb76b4&\"\nimport script from \"./PeriodOutOfRangePanel.vue?vue&type=script&lang=ts&\"\nexport * from \"./PeriodOutOfRangePanel.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('h3',[_vm._v(\"Balance Refresh\")]),_c('hr'),_c('div',{staticClass:\"text-center\"},[_c('b-spinner',{staticClass:\"mb-3\"}),(_vm.taxpayerCalculatorProgress.inProgress)?_c('div',[_c('p',{staticClass:\"text-center\"},[_vm._v(_vm._s(_vm.taxpayerCalculatorProgress.status))]),_c('b-progress',{attrs:{\"value\":_vm.taxpayerCalculatorProgress.progress}})],1):_vm._e()],1)])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Vue } from \"vue-property-decorator\"\r\n// Project Imports\r\nimport router from \"@/router\"\r\nimport TaxpayerCalculator from \"../../services/calculator/TaxpayerCalculator\"\r\nimport { Taxpayer } from \"@/interfaces\"\r\n\r\n@Component\r\nexport default class PeriodBalanceRefreshPanel extends Vue {\r\n @Prop()\r\n public taxpayer!: Taxpayer\r\n\r\n @Prop()\r\n public periodId!: string | undefined\r\n\r\n public taxpayerCalculatorProgress: any = {\r\n progress: 0,\r\n status: \"\",\r\n inProgress: false,\r\n }\r\n\r\n public mounted() {\r\n this.refreshBalances()\r\n }\r\n\r\n public async refreshBalances() {\r\n // Run TaxpayerCalulator and updat UI with progress\r\n if (this.taxpayer.id) {\r\n const taxpayerCalculator = new TaxpayerCalculator(this.taxpayer.id)\r\n // Reset progress values\r\n this.taxpayerCalculatorProgress.progress = 0\r\n this.taxpayerCalculatorProgress.status = \"\"\r\n // Subscibe to update/status events\r\n taxpayerCalculator.subscribe(\"progress-update\", progress => {\r\n this.taxpayerCalculatorProgress.progress = progress\r\n })\r\n taxpayerCalculator.subscribe(\"status-update\", status => {\r\n this.taxpayerCalculatorProgress.status = status\r\n })\r\n this.taxpayerCalculatorProgress.inProgress = true\r\n await taxpayerCalculator.calculate()\r\n }\r\n\r\n if (this.periodId) {\r\n router.push({\r\n name: \"foreign-affiliate\",\r\n params: { id: this.$route.params.id },\r\n query: { period: this.periodId },\r\n })\r\n } else {\r\n router.push({\r\n name: \"foreign-affiliate\",\r\n params: { id: this.$route.params.id },\r\n })\r\n }\r\n\r\n this.$router.go(0)\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PeriodBalanceRefreshPanel.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PeriodBalanceRefreshPanel.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./PeriodBalanceRefreshPanel.vue?vue&type=template&id=50355f45&\"\nimport script from \"./PeriodBalanceRefreshPanel.vue?vue&type=script&lang=ts&\"\nexport * from \"./PeriodBalanceRefreshPanel.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\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\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\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\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\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\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\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\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\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Watch, Emit } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport * as _ from \"lodash\"\r\nimport dateFns from \"date-fns\"\r\nimport Datepicker from \"vuejs-datepicker\"\r\n// Project Imports\r\nimport ValidatorMixin from \"@/mixins/ValidatorMixin\"\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport router from \"@/router\"\r\nimport LoadingButton from \"@/components/LoadingButton.vue\"\r\nimport {\r\n ReportingPeriod,\r\n ForeignAffiliate,\r\n EditPayload,\r\n DividendTierIssue,\r\n ModelObjectIssue,\r\n ReportingPeriodShifted,\r\n ReportingPeriodList,\r\n ReportingPeriodListFromBackend,\r\n} from \"@/interfaces\"\r\nimport { period } from \"@/services/api\"\r\nimport { getDate } from \"@/util/getDate\"\r\nimport {\r\n dateDiff,\r\n isDateDiff,\r\n formatDate,\r\n formatDateSpace,\r\n} from \"@/util/periodDateHelper\"\r\nimport CurrencyDropdown from \"@/components/CurrencyDropdown.vue\"\r\nimport PeriodDate from \"@/components/periods/PeriodDate.vue\"\r\nimport PeriodEditPanel from \"@/components/periods/PeriodEditPanel.vue\"\r\nimport PeriodOptionPanel from \"@/components/periods/PeriodOptionPanel.vue\"\r\nimport PeriodDividendTierCheckerPanel from \"@/components/periods/PeriodDividendTierCheckerPanel.vue\"\r\nimport PeriodOutOfRangePanel from \"@/components/periods/PeriodOutOfRangePanel.vue\"\r\nimport { formatMoney } from \"@/util/formatMoney\"\r\nimport CalculatorMixin from \"../../mixins/CalculatorMixin\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport ConfirmBoxMixin from \"../../mixins/ConfirmBoxMixin\"\r\nimport PeriodBalanceRefreshPanel from \"@/components/periods/PeriodBalanceRefreshPanel.vue\"\r\nimport PeriodCallout from \"@/components/periods/PeriodCallout.vue\"\r\n\r\n@Component({\r\n components: {\r\n LoadingButton,\r\n Datepicker,\r\n CurrencyDropdown,\r\n ErrorAlert,\r\n PeriodDate,\r\n PeriodEditPanel,\r\n PeriodOptionPanel,\r\n PeriodDividendTierCheckerPanel,\r\n PeriodOutOfRangePanel,\r\n PeriodBalanceRefreshPanel,\r\n PeriodCallout,\r\n },\r\n})\r\nclass PeriodForm extends mixins(\r\n LoadingMixin,\r\n CalculatorMixin,\r\n ConfirmBoxMixin,\r\n ValidatorMixin\r\n) {\r\n @Prop()\r\n public fetchDataProp!: any\r\n\r\n @Prop()\r\n public initialData!: ReportingPeriod\r\n\r\n @Prop({ required: true })\r\n public foreignAffiliate!: ForeignAffiliate\r\n\r\n @Prop({ default: false })\r\n public edit!: boolean\r\n\r\n @Prop({ default: false })\r\n public canDelete!: boolean\r\n\r\n public faResidentDesignatedCountry: boolean = false\r\n public faBusinessActivity: boolean = false\r\n public faBusinessDesignatedCountry: boolean = false\r\n public faForeignTaxLawRequired: boolean = false\r\n public depreciationElection: boolean = false\r\n public dividendsTaxableSurplusFirst: boolean = false\r\n public dividendsAcb: boolean = false\r\n public sepChanges: boolean = false\r\n public recharacterizedPropertyIncome: boolean = false\r\n public fapi: boolean = false\r\n public dividendsFromFa: boolean = false\r\n public dividendsPayTax: boolean = false\r\n public dividendsPaid: boolean = false\r\n public dispositions: boolean = false\r\n public consolidationOrGroupRelief: boolean = false\r\n public startDate: string = \"\"\r\n public endDate: string = \"\"\r\n public startDatePrepend: string = \"\"\r\n public endDatePrepend: string = \"\"\r\n public startDateInsert: string = \"\"\r\n public endDateInsert: string = \"\"\r\n\r\n public fxRate: string = \"\"\r\n public fxCurrency: string = \"\"\r\n\r\n public currencyChange: boolean = false\r\n\r\n public maxStartDate: string = \"\"\r\n public maxEndDate: string = \"\"\r\n public minStartDate: string = \"\"\r\n public minEndDate: string = \"\"\r\n\r\n public maxEndDatePrepend: string = \"\"\r\n public minEndDatePrepend: string = \"\"\r\n\r\n public maxEndDateInsert: string = \"\"\r\n public minEndDateInsert: string = \"\"\r\n\r\n public taxationYearType: number = 0\r\n public selectedRP: number | null = null\r\n public periodList: ReportingPeriodList[] = []\r\n\r\n public shortenStartDateInsert: string = \"\"\r\n public shortenEndDateInsert: string = \"\"\r\n public stubStartDateInsert: string = \"\"\r\n public stubEndDateInsert: string = \"\"\r\n\r\n public submitDisabledFromDate: boolean = false\r\n public submitDisabledFromEditPanel: boolean = false\r\n public submitDisabledFromOutOfRangePanel: boolean = false\r\n public submitDisabledFromDTCheckerPanel: boolean = false\r\n\r\n public initialStartDate: string = \"\"\r\n public initialEndDate: string = \"\"\r\n\r\n public shiftedRPList: ReportingPeriodShifted[] = []\r\n public stubRP: { start_date: string; end_date: string } | null = null\r\n\r\n public divTierIssue: DividendTierIssue[] = []\r\n public divTierIssueOverride: number[] = []\r\n public outOfRangeIssue: ModelObjectIssue[] = []\r\n public outofRangeIssueOverride: boolean = false\r\n public newPeriodList: ReportingPeriodListFromBackend[] | null = null\r\n\r\n public editPanelOptionChange: number = 0\r\n\r\n public refreshBalance: boolean = false\r\n public periodId: string | number | undefined = undefined\r\n\r\n @Emit(\"closeModal\")\r\n public closeModal(data: any) {\r\n return data\r\n }\r\n\r\n public get insertRPList() {\r\n /*\r\n Displays the list of RP's where a new taxation year can be inserted after it.\r\n */\r\n const output = _.cloneDeep(this.periodOptions)\r\n\r\n output.push({ text: \"Please select a Taxation Year\", value: { id: null } })\r\n\r\n output.reverse()\r\n output.pop()\r\n\r\n return output\r\n }\r\n\r\n @Watch(\"selectedRP\")\r\n public selectedRPChange() {\r\n if (!this.selectedRP) {\r\n // NULL\r\n this.startDateInsert = \"\"\r\n this.endDateInsert = \"\"\r\n\r\n this.initialStartDate = \"\"\r\n this.initialEndDate = \"\"\r\n\r\n this.submitDisabledFromDate = true\r\n } else {\r\n // Create the start/end dateInsert\r\n // retrieve originalPeriodList\r\n\r\n const { end_date } = this.periodOptions.find(\r\n (el: any) => el.value.id === this.selectedRP\r\n ).value\r\n this.initialStartDate = _.clone(\r\n getDate(dateFns.addDays(end_date, 1)).toString()\r\n )\r\n this.initialEndDate = _.clone(\r\n getDate(\r\n dateFns.addDays(dateFns.addYears(this.initialStartDate, 1), -1)\r\n ).toString()\r\n )\r\n\r\n this.startDateInsert = getDate(dateFns.addDays(end_date, 1)).toString()\r\n this.endDateInsert = getDate(\r\n dateFns.addDays(dateFns.addYears(this.startDateInsert, 1), -1)\r\n ).toString()\r\n }\r\n }\r\n\r\n @Watch(\"taxationYearType\")\r\n public taxationYearTypeChange(newValue: number, oldValue: number) {\r\n if (newValue === 2 && this.selectedRP == null) {\r\n this.submitDisabledFromDate = true\r\n }\r\n }\r\n\r\n @Watch(\"endDateInsert\")\r\n public endDateInsertChange(newValue: string, oldValue: string) {\r\n if (newValue === oldValue) {\r\n return\r\n }\r\n }\r\n\r\n public get displayPeriodOptionPanel() {\r\n /*\r\n This function determines if the Period Option Panel will be displayed. Appears in 2 cases:\r\n - Edit taxation year\r\n - Add taxation year\r\n */\r\n // console.log(\"====\")\r\n // console.log(this.initialData)\r\n // console.log(this.getEditStatus)\r\n // console.log(this.stubRP)\r\n // console.log(\"====\")\r\n switch (true) {\r\n case this.initialData === undefined: // 'Add taxation year' button\r\n case this.initialData !== undefined && this.getEditStatus === undefined: // Edit mode with no date box being modified\r\n case this.initialData !== undefined &&\r\n this.getEditStatus !== undefined &&\r\n this.stubRP !== null: // Edit mode when date box are modified and with an existing stubRP object\r\n return true\r\n }\r\n\r\n return false\r\n }\r\n\r\n public get periodOptionPanelTitle() {\r\n /*\r\n Handles the title of the Period Option Panel\r\n */\r\n switch (true) {\r\n case this.initialData !== undefined && this.getEditStatus === undefined: // Edit mode when date box are modified and with an existing stubRP object\r\n return \"Edit Taxation Year\"\r\n }\r\n return \"Add New Taxation Year\"\r\n }\r\n\r\n // public shiftDate(date: string, diff: number) {\r\n // return dateFns.addDays(date, diff)\r\n // }\r\n\r\n @Watch(\"currencyChange\")\r\n public currencyToggle() {\r\n if (!this.currencyChange) {\r\n this.fxRate = \"\"\r\n this.fxCurrency = \"\"\r\n }\r\n }\r\n\r\n @Watch(\"startDate\")\r\n public startDateChange(newValue: string, oldValue: string) {\r\n if (newValue === oldValue) {\r\n return\r\n }\r\n\r\n if (this.isSet(newValue)) {\r\n this.maxEndDate = formatDateSpace(dateFns.addWeeks(newValue, 53))\r\n this.minEndDate = formatDateSpace(newValue)\r\n\r\n if (this.initialData) {\r\n this.maxEndDate = formatDateSpace(\r\n dateFns.addWeeks(this.initialStartDate, 53)\r\n )\r\n this.minEndDate = formatDateSpace(this.initialStartDate)\r\n\r\n // Used for edit mode\r\n this.maxStartDate = formatDateSpace(\r\n dateFns.addDays(this.initialEndDate, -1)\r\n )\r\n this.minStartDate = formatDateSpace(\r\n dateFns.subWeeks(this.initialEndDate, 53)\r\n )\r\n }\r\n } else {\r\n this.maxEndDate = \"\"\r\n this.minEndDate = \"\"\r\n\r\n // Used for edit mode\r\n this.minStartDate = \"\"\r\n this.maxStartDate = \"\"\r\n }\r\n }\r\n\r\n @Watch(\"endDatePrepend\")\r\n public endDatePrependChange(newValue: string, oldValue: string) {\r\n if (newValue === oldValue) {\r\n return\r\n }\r\n if (this.isSet(newValue)) {\r\n this.minEndDatePrepend = formatDateSpace(dateFns.subWeeks(newValue, 53))\r\n this.maxEndDatePrepend = formatDateSpace(dateFns.addDays(newValue, -1))\r\n } else {\r\n this.maxEndDatePrepend = \"\"\r\n this.minEndDatePrepend = \"\"\r\n }\r\n }\r\n\r\n @Watch(\"startDateInsert\")\r\n public startDateInsertChange(newValue: string, oldValue: string) {\r\n if (newValue === oldValue) {\r\n return\r\n }\r\n\r\n if (this.isSet(newValue)) {\r\n this.maxEndDateInsert = formatDateSpace(dateFns.addWeeks(newValue, 53))\r\n this.minEndDateInsert = formatDateSpace(newValue)\r\n } else {\r\n this.maxEndDateInsert = \"\"\r\n this.minEndDateInsert = \"\"\r\n }\r\n }\r\n\r\n @Watch(\"startDate\")\r\n @Watch(\"endDate\")\r\n @Watch(\"editPanelOptionChange\")\r\n @Watch(\"taxationYearType\")\r\n @Watch(\"selectedRP\")\r\n @Watch(\"startDateInsert\")\r\n @Watch(\"endDateInsert\")\r\n public startDateEndDateClearVariables() {\r\n // When any of the Watch variables are modified, the following variables are reset to default\r\n this.divTierIssue = []\r\n this.divTierIssueOverride = []\r\n\r\n this.outOfRangeIssue = []\r\n this.submitDisabledFromOutOfRangePanel = false\r\n this.outofRangeIssueOverride = false\r\n\r\n this.submitDisabledFromDTCheckerPanel = false\r\n }\r\n\r\n @Watch(\"submitDisabledFromOutOfRangePanel\")\r\n public submitDisabledFromOutOfRangePanelChange() {\r\n // The override for the out of Range panel.\r\n if (this.outOfRangeIssue.length > 0) {\r\n this.outofRangeIssueOverride = !this.submitDisabledFromOutOfRangePanel\r\n }\r\n }\r\n\r\n public handleOnChange(val: string, e: any) {\r\n this.fxCurrency = val\r\n }\r\n\r\n public isSet(value: any) {\r\n return value && value !== \"\"\r\n }\r\n\r\n public get startDisabledDates() {\r\n return {\r\n from: new Date(this.maxStartDate),\r\n to: new Date(this.minStartDate),\r\n }\r\n }\r\n\r\n public get endDisabledDates() {\r\n return {\r\n from: new Date(this.maxEndDate),\r\n to: new Date(this.minEndDate),\r\n }\r\n }\r\n\r\n public disabledDates(minDate: string, maxDate: string) {\r\n return {\r\n to: new Date(minDate),\r\n from: new Date(maxDate),\r\n }\r\n }\r\n\r\n public get reportingPeriods() {\r\n return this.foreignAffiliate.reporting_periods\r\n }\r\n\r\n public get isFirstYearPeriod() {\r\n const allDates = _.flatMap(this.reportingPeriods, rp => {\r\n return [getDate(rp.start_date), getDate(rp.end_date)]\r\n })\r\n return allDates.length === 0\r\n }\r\n\r\n public get maxDate() {\r\n if (this.edit) {\r\n return undefined\r\n }\r\n\r\n const allDates = _.flatMap(this.reportingPeriods, rp => {\r\n return [getDate(rp.start_date), getDate(rp.end_date)]\r\n })\r\n const maxDate = _.max(allDates)\r\n if (maxDate) {\r\n return dateFns.addDays(maxDate, 1)\r\n } else {\r\n return undefined\r\n }\r\n }\r\n\r\n public get minDate() {\r\n if (this.edit) {\r\n return undefined\r\n }\r\n\r\n const allDates = _.flatMap(this.reportingPeriods, rp => {\r\n return [getDate(rp.start_date), getDate(rp.end_date)]\r\n })\r\n const minDate = _.min(allDates)\r\n if (minDate) {\r\n return dateFns.addDays(minDate, -1)\r\n } else {\r\n return undefined\r\n }\r\n }\r\n\r\n public get disableSave() {\r\n const {\r\n submitDisabledFromDate,\r\n submitDisabledFromEditPanel,\r\n submitDisabledFromOutOfRangePanel,\r\n submitDisabledFromDTCheckerPanel,\r\n } = this\r\n\r\n return (\r\n submitDisabledFromDate ||\r\n submitDisabledFromEditPanel ||\r\n submitDisabledFromOutOfRangePanel ||\r\n submitDisabledFromDTCheckerPanel\r\n )\r\n }\r\n\r\n public created() {\r\n if (this.edit && this.initialData) {\r\n const newStartDate = getDate(this.initialData.start_date).toString()\r\n const newEndDate = getDate(this.initialData.end_date).toString()\r\n\r\n this.initialStartDate = _.clone(newStartDate)\r\n this.initialEndDate = _.clone(newEndDate)\r\n this.startDate = newStartDate\r\n this.endDate = newEndDate\r\n } else {\r\n // Set the default dates if there is a maxDate being returned\r\n const maxDate = this.maxDate\r\n const minDate = this.minDate\r\n if (!this.isFirstYearPeriod && maxDate && minDate) {\r\n const newStartDate = maxDate.toString()\r\n const newEndDate = dateFns.addDays(dateFns.addYears(maxDate, 1), -1)\r\n this.startDate = newStartDate\r\n this.endDate = newEndDate.toString()\r\n\r\n this.startDatePrepend = dateFns\r\n .addDays(dateFns.subYears(minDate, 1), 1)\r\n .toString()\r\n this.endDatePrepend = minDate.toString()\r\n } else {\r\n // Else assume that the first year is being created and set the default start year\r\n this.startDate = getDate(\r\n this.foreignAffiliate.first_year_begins\r\n ).toString()\r\n const newEndDate = dateFns.addDays(\r\n dateFns.addYears(this.startDate, 1),\r\n -1\r\n )\r\n this.endDate = newEndDate.toString()\r\n }\r\n }\r\n this.periodList = _.cloneDeep(this.periodOptions.reverse())\r\n }\r\n\r\n public formatter(value: string, evt: any) {\r\n if (value === \"\") {\r\n return value\r\n }\r\n const formatted = formatMoney(value, 4)\r\n return formatted\r\n }\r\n\r\n public get getEditStatus() {\r\n /*\r\n This function returns an object containing the 'position' and 'action' that helps the edit panel in determining what is currently happening.\r\n If undefined, that means neither the start/end date are being edited.\r\n\r\n - position: startDate, endDate\r\n - action: shorten, expand\r\n */\r\n\r\n if (!this.initialData) {\r\n // When no current data exist\r\n return undefined\r\n }\r\n\r\n if (this.taxationYearType === 2) {\r\n // For the 'Insert' tab under 'Add taxation year' button.\r\n return undefined\r\n }\r\n\r\n const startDateDiff = isDateDiff(this.startDate, this.initialStartDate)\r\n const endDateDiff = isDateDiff(this.endDate, this.initialEndDate)\r\n\r\n /*\r\n Possible combinations of startDateDiff, endDateDiff:\r\n - No Change: False, False\r\n - startDate: True, False\r\n - endDate: False, True\r\n */\r\n\r\n const status = { position: \"none\", action: \"none\" }\r\n\r\n if (startDateDiff) {\r\n status.position = \"startDate\"\r\n if (dateDiff(this.startDate, this.initialStartDate) > 0) {\r\n status.action = \"shorten\"\r\n } else {\r\n status.action = \"expand\"\r\n }\r\n } else if (endDateDiff) {\r\n status.position = \"endDate\"\r\n if (dateDiff(this.endDate, this.initialEndDate) < 0) {\r\n status.action = \"shorten\"\r\n } else {\r\n status.action = \"expand\"\r\n }\r\n } else {\r\n return undefined\r\n }\r\n\r\n return status\r\n }\r\n\r\n public async handleOnSubmit() {\r\n const currentRPId = this.selectedReportingPeriod\r\n ? this.selectedReportingPeriod.id\r\n : undefined\r\n\r\n const values: any = {\r\n foreign_affiliate: this.$route.params.id,\r\n fa_business_activity: this.faBusinessActivity,\r\n fa_foreign_tax_law_required:\r\n this.faForeignTaxLawRequired &&\r\n this.faBusinessActivity &&\r\n this.faBusinessDesignatedCountry,\r\n fa_resident_designated_country: this.faResidentDesignatedCountry,\r\n fa_business_designated_country:\r\n this.faBusinessDesignatedCountry && this.faBusinessActivity,\r\n depreciation_election: this.depreciationElection,\r\n dividends_taxable_surplus_first:\r\n this.dividendsTaxableSurplusFirst && this.dividendsPaid,\r\n dividends_acb: this.dividendsAcb && this.dividendsPaid,\r\n sep_changes: this.sepChanges,\r\n recharacterized_property_income: this.recharacterizedPropertyIncome,\r\n fapi: this.fapi,\r\n dividends_from_fa: this.dividendsFromFa,\r\n dividends_pay_tax: this.dividendsPayTax && this.dividendsFromFa,\r\n dividends_paid: this.dividendsPaid,\r\n dispositions: this.dispositions,\r\n consolidation_or_group_relief: this.consolidationOrGroupRelief,\r\n start_date: formatDate(this.startDate),\r\n end_date: formatDate(this.endDate),\r\n fx_currency: this.fxCurrency !== \"\" ? this.fxCurrency : null,\r\n fx_rate: this.fxRate !== \"\" ? this.fxRate : null,\r\n type: \"prepend\",\r\n override: {\r\n div_tier_issue: this.divTierIssueOverride,\r\n out_of_range: this.outofRangeIssueOverride,\r\n },\r\n }\r\n\r\n if (this.edit && this.initialData.id) {\r\n // if (\r\n // getDate(this.initialData.end_date).getTime() >\r\n // getDate(values.end_date).getTime()\r\n // ) {\r\n // if (\r\n // !(await this.confirmBox(\r\n // `By changing the End date to an earlier date, all the dated adjustments(dividends, dispositions, SEP and other adjustments) will be removed. Change End date and delete adjustments after ${\r\n // values.end_date\r\n // }?`,\r\n // {\r\n // size: \"md\",\r\n // }\r\n // ))\r\n // ) {\r\n // return\r\n // }\r\n // }\r\n // Don't want to update the dates, so just use initial data\r\n // Unless you can delete this period (i.e. its the last period)\r\n this.loading = true\r\n\r\n if (this.getEditStatus === undefined) {\r\n // During 'edit' when there are no modifications to the date boxes\r\n period\r\n .update(\r\n {\r\n ...values,\r\n start_date: this.initialData.start_date,\r\n end_date: this.canDelete\r\n ? values.end_date\r\n : this.initialData.end_date,\r\n },\r\n this.initialData.id\r\n )\r\n .then((data: any) => {\r\n this.closeModal(data)\r\n })\r\n .catch((err: any) => {\r\n this.error = err\r\n })\r\n .finally(() => {\r\n this.loading = false\r\n })\r\n } else {\r\n // During 'edit' when there are modifications to start/end date boxes\r\n period\r\n .edit({\r\n ...values,\r\n stub_RP: this.stubRP,\r\n shifted_RP_list: this.shiftedRPList,\r\n })\r\n .then((data: EditPayload) => {\r\n this.divTierIssue = data.affected_DT\r\n this.outOfRangeIssue = data.affected_obj\r\n this.newPeriodList = data.periodList\r\n\r\n if (data.commit) {\r\n this.periodId = currentRPId\r\n this.refreshBalance = true\r\n // The Refresh Balance functionality is inside the PeriodBalanceRefreshPanel.vue\r\n } else {\r\n this.loading = false\r\n }\r\n })\r\n .catch((err: any) => {\r\n this.error = err\r\n this.loading = false\r\n })\r\n }\r\n } else if (this.taxationYearType == 0) {\r\n // 'Add taxation year' button:\r\n // - Prepend\r\n this.loading = true\r\n\r\n period\r\n .prepend({\r\n ...values,\r\n start_date: formatDate(new Date(this.startDatePrepend).toUTCString()),\r\n end_date: formatDate(new Date(this.endDatePrepend).toUTCString()),\r\n })\r\n .then((newReportingPeriod: ReportingPeriod) => {\r\n if (this.fetchDataProp) {\r\n this.fetchDataProp().then(() => {\r\n this.setSelectedReportingPeriod(newReportingPeriod)\r\n })\r\n }\r\n this.closeModal(newReportingPeriod)\r\n })\r\n .catch((err: any) => {\r\n this.error = err\r\n })\r\n .finally(() => {\r\n this.loading = false\r\n })\r\n } else if (this.taxationYearType == 1) {\r\n // 'Add taxation year' button:\r\n // - Append\r\n this.loading = true\r\n\r\n period\r\n .append(values)\r\n .then((newReportingPeriod: ReportingPeriod) => {\r\n if (this.fetchDataProp) {\r\n this.fetchDataProp().then(() => {\r\n this.setSelectedReportingPeriod(newReportingPeriod)\r\n })\r\n }\r\n this.closeModal(newReportingPeriod)\r\n })\r\n .catch((err: any) => {\r\n this.error = err\r\n })\r\n .finally(() => {\r\n this.loading = false\r\n })\r\n } else if (this.taxationYearType == 2) {\r\n // 'Add taxation year' button:\r\n // - Insert\r\n this.loading = true\r\n period\r\n .edit({\r\n ...values,\r\n stub_RP: this.stubRP,\r\n shifted_RP_list: this.shiftedRPList,\r\n })\r\n .then((data: EditPayload) => {\r\n this.divTierIssue = data.affected_DT\r\n this.outOfRangeIssue = data.affected_obj\r\n this.newPeriodList = data.periodList\r\n\r\n if (data.commit && data.stub_id !== null) {\r\n this.periodId = data.stub_id.toString()\r\n this.refreshBalance = true\r\n // The Refresh Balance functionality is inside the PeriodBalanceRefreshPanel.vue\r\n } else {\r\n this.loading = false\r\n }\r\n })\r\n .catch((err: any) => {\r\n this.error = err\r\n this.loading = false\r\n })\r\n }\r\n }\r\n}\r\n\r\nexport default PeriodForm\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PeriodForm.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PeriodForm.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./PeriodForm.vue?vue&type=template&id=6b3574d4&\"\nimport script from \"./PeriodForm.vue?vue&type=script&lang=ts&\"\nexport * from \"./PeriodForm.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('b-card',{attrs:{\"no-body\":\"\"}},[_c('b-tabs',{attrs:{\"card\":\"\"}},_vm._l((_vm.diagnosticsPerPeriod),function(periodItem,periodIndex){return _c('b-tab',{key:periodIndex,attrs:{\"title\":periodItem.label}},[_c('p',{staticClass:\"font-weight-light\"},[_vm._v(\"\\n The following are issues/concerns encountered during the import of\\n the taxation year.\\n \")]),_c('hr'),_vm._l((_vm.diagnosticItems(periodItem.diagnostics)),function(item,index){return _c('b-card',{key:index,staticClass:\"mb-3\",attrs:{\"no-body\":\"\"}},[_c('b-card-header',{directives:[{name:\"b-toggle\",rawName:\"v-b-toggle\",value:(((item.id) + \"_\" + periodIndex)),expression:\"`${item.id}_${periodIndex}`\"}],staticStyle:{\"cursor\":\"pointer\"},attrs:{\"header-tag\":\"header\",\"role\":\"tab\"}},[_c('div',{staticClass:\"font-weight-bold\"},[_vm._v(_vm._s(item.name))])]),_c('b-collapse',{attrs:{\"id\":((item.id) + \"_\" + periodIndex),\"visible\":\"\",\"role\":\"tabpanel\"}},[_c('b-card-body',[_c('b-row',{staticClass:\"mb-3\"},[(\n _vm.getDiagnostics(periodItem.diagnostics, item.id, 'warning')\n .length > 0\n )?_c('b-col',[_c('b-card',{attrs:{\"border-variant\":\"warning\",\"header-bg-variant\":\"warning\",\"header\":\"Warnings\",\"header-class\":\"text-center\"}},[_c('b-list-group',_vm._l((_vm.getDiagnostics(\n periodItem.diagnostics,\n item.id,\n 'warning'\n )),function(diagnostic,index){return _c('b-list-group-item',{key:index,staticClass:\"flex-column align-items-start\"},[_c('p',{staticClass:\"mb-1 font-weight-light\"},[_vm._v(\"\\n \"+_vm._s(diagnostic.message)+\"\\n \")]),(diagnostic.rows)?_c('small',[_vm._v(\"\\n Rows related:\\n \"),_vm._l((diagnostic.rows),function(row){return _c('b-badge',{key:row,staticClass:\"mr-1\",attrs:{\"variant\":\"dark\"}},[_vm._v(_vm._s(row))])})],2):_vm._e()])}),1)],1)],1):_vm._e()],1),_c('b-row',[(\n _vm.getDiagnostics(periodItem.diagnostics, item.id, 'error')\n .length > 0\n )?_c('b-col',[_c('b-card',{attrs:{\"border-variant\":\"danger\",\"header-bg-variant\":\"danger\",\"header-text-variant\":\"white\",\"header\":\"Errors\",\"header-class\":\"text-center\"}},[_c('b-list-group',_vm._l((_vm.getDiagnostics(\n periodItem.diagnostics,\n item.id,\n 'error'\n )),function(diagnostic,index){return _c('b-list-group-item',{key:index,staticClass:\"flex-column align-items-start\"},[_c('p',{staticClass:\"mb-1 font-weight-light\"},[_vm._v(\"\\n \"+_vm._s(diagnostic.message)+\"\\n \")]),(diagnostic.rows)?_c('small',[_vm._v(\"\\n Rows related:\\n \"),_vm._l((diagnostic.rows),function(row){return _c('b-badge',{key:row,staticClass:\"mr-1\",attrs:{\"variant\":\"dark\"}},[_vm._v(_vm._s(row))])})],2):_vm._e()])}),1)],1)],1):_vm._e()],1)],1)],1)],1)})],2)}),1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\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\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\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Watch, Emit } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport _ from \"lodash\"\r\n// Project Imports\r\nimport CalculatorMixin from \"../../mixins/CalculatorMixin\"\r\nimport { ReportingPeriod } from \"../../interfaces\"\r\nimport { sortPeriods } from \"@/util/sortPeriods\"\r\n\r\n@Component({ components: {} })\r\nexport default class ImportDiagnostics extends mixins(CalculatorMixin) {\r\n public get diagnosticsPerPeriod() {\r\n const reportingPeriods = [...this.reportingPeriods]\r\n return reportingPeriods\r\n .sort(sortPeriods)\r\n .filter(\r\n (rp: ReportingPeriod) =>\r\n rp.metadata &&\r\n JSON.parse(rp.metadata).hasOwnProperty(\"diagnostics\") &&\r\n JSON.parse(rp.metadata).diagnostics.length > 0\r\n )\r\n .map((rp: ReportingPeriod) => {\r\n const { start_date, end_date, metadata } = rp\r\n const diagnostics = JSON.parse(metadata).diagnostics\r\n const label = `${start_date} to ${end_date}`\r\n return {\r\n label,\r\n diagnostics,\r\n }\r\n })\r\n }\r\n\r\n public diagnosticItems(diagnostics: any[]) {\r\n if (diagnostics) {\r\n const groupedByField: any = _.groupBy(diagnostics, diag => diag.field)\r\n return Object.keys(groupedByField).map((key: string) => {\r\n const name = groupedByField[key][0][\"name\"] || this.periodFieldName(key)\r\n return {\r\n id: key,\r\n name,\r\n }\r\n })\r\n }\r\n return []\r\n }\r\n\r\n public getDiagnostics(diagnostics: any[], fieldId: string, type: string) {\r\n if (diagnostics) {\r\n return diagnostics\r\n .filter((diag: any) => diag.field === fieldId && diag.type === type)\r\n .map(({ message, rows }) => {\r\n return {\r\n message,\r\n rows,\r\n }\r\n })\r\n }\r\n return []\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ImportDiagnostics.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ImportDiagnostics.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./ImportDiagnostics.vue?vue&type=template&id=ced6772c&\"\nimport script from \"./ImportDiagnostics.vue?vue&type=script&lang=ts&\"\nexport * from \"./ImportDiagnostics.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',[_c('b-button',{staticClass:\"border-0 mr-2\",attrs:{\"size\":\"sm\",\"data-cy\":\"rp-edit-button\",\"variant\":\"outline-secondary\"},on:{\"click\":function () { return (_vm.showEditModal = true); }}},[_c('font-awesome-icon',{attrs:{\"size\":\"sm\",\"icon\":\"pen\"}}),_vm._v(\" Edit\")],1),(_vm.canDelete)?_c('b-button',{staticClass:\"border-0\",attrs:{\"size\":\"sm\",\"data-cy\":\"rp-delete-button\",\"variant\":\"outline-danger\"},on:{\"click\":_vm.deletePeriod}},[_c('font-awesome-icon',{attrs:{\"size\":\"sm\",\"icon\":\"trash\"}}),_vm._v(\" Delete\")],1):_vm._e(),_c('b-modal',{attrs:{\"size\":\"lg\",\"title\":\"Edit Taxation Year\",\"data-cy\":\"ty-edit-button\",\"hide-footer\":\"\",\"no-close-on-backdrop\":\"\"},model:{value:(_vm.showEditModal),callback:function ($$v) {_vm.showEditModal=$$v},expression:\"showEditModal\"}},[(_vm.showEditModal)?_c('PeriodForm',{attrs:{\"foreignAffiliate\":_vm.foreignAffiliate,\"initialData\":_vm.selectedReportingPeriod,\"edit\":true,\"canDelete\":_vm.canDelete},on:{\"closeModal\":_vm.closeModal}}):_vm._e()],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import api, { resolve } from \"./api\"\r\nimport { ReportingPeriod } from \"@/interfaces\"\r\n\r\nconst create = (values: ReportingPeriod): any =>\r\n api.post(\"reporting-periods/\", { ...values }).then(resolve)\r\n\r\nconst update = (values: ReportingPeriod | any, id: string | number): any =>\r\n api.patch(`/reporting-periods/${id}/`, { ...values }).then(resolve)\r\n\r\nconst updateBulk = (values: any[]): any =>\r\n api.patch(`/reporting-periods-bulk/`, values).then(resolve)\r\n\r\nconst destroy = (id: string | number): any =>\r\n api.delete(`/reporting-periods/${id}/`)\r\n\r\nconst prepend = (values: ReportingPeriod): any =>\r\n api.post(\"reporting-periods/prepend/\", { ...values }).then(resolve)\r\n\r\nconst append = (values: ReportingPeriod): any =>\r\n api.post(\"reporting-periods/append/\", { ...values }).then(resolve)\r\n\r\nconst edit = (values: ReportingPeriod): any =>\r\n api.post(\"reporting-periods/update/\", { ...values }).then(resolve)\r\n\r\nexport default {\r\n create,\r\n update,\r\n destroy,\r\n updateBulk,\r\n prepend,\r\n append,\r\n edit,\r\n}\r\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\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Watch, Emit } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\n// Project Imports\r\nimport CalculatorMixin from \"../../mixins/CalculatorMixin\"\r\nimport UserMixin from \"../../mixins/UserMixin\"\r\nimport ConfirmBoxMixin from \"../../mixins/ConfirmBoxMixin\"\r\nimport PeriodForm from \"@/components/periods/PeriodForm.vue\"\r\nimport { ForeignAffiliate, ReportingPeriod } from \"../../interfaces\"\r\nimport { sortPeriods } from \"../../util/sortPeriods\"\r\nimport period from \"@/services/api/period\"\r\nimport router from \"../../router\"\r\n\r\n@Component({ components: { PeriodForm } })\r\nexport default class EditPeriod extends mixins(\r\n CalculatorMixin,\r\n UserMixin,\r\n ConfirmBoxMixin\r\n) {\r\n @Prop({ required: true })\r\n public foreignAffiliate!: ForeignAffiliate\r\n public sortedPeriods: ReportingPeriod[] = this.foreignAffiliate.reporting_periods.sort(\r\n sortPeriods\r\n )\r\n\r\n public showEditModal: boolean = false\r\n\r\n public closeModal(data: ReportingPeriod) {\r\n if (data) {\r\n this.updateData()\r\n this.showEditModal = false\r\n }\r\n }\r\n\r\n public get canDelete() {\r\n return (\r\n this.selectedReportingPeriod &&\r\n this.selectedReportingPeriod.id ===\r\n this.sortedPeriods[this.sortedPeriods.length - 1].id\r\n )\r\n }\r\n\r\n public async deletePeriod() {\r\n const deletePeriod = await this.confirmBox(\r\n \"Are you sure you want to delete this period? THIS ACTION CANNOT BE UNDONE. Deleting a period will remove all values, related dividends, sep adjustments, and any data stored.\",\r\n { ...this.deleteOptions, size: \"md\" }\r\n )\r\n if (deletePeriod) {\r\n if (this.selectedReportingPeriod && this.selectedReportingPeriod.id) {\r\n period.destroy(this.selectedReportingPeriod.id).then(() => {\r\n router.go(0)\r\n })\r\n }\r\n } else {\r\n return\r\n }\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./EditPeriod.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./EditPeriod.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./EditPeriod.vue?vue&type=template&id=10ce5af6&\"\nimport script from \"./EditPeriod.vue?vue&type=script&lang=ts&\"\nexport * from \"./EditPeriod.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-row',{staticClass:\"pb-4\"},[_c('b-col',[_c('p',{staticClass:\"px-4\"},[_vm._v(\"\\n Lock and unlock editing for any taxation year. Taxation years' lock\\n status can be changed by KPMG internal users only. There are 3 types of\\n lock statuses:\\n \")]),_c('b-list-group',{staticClass:\"pl-4 pr-4\"},[_c('b-list-group-item',[_c('h6',[_vm._v(\"\\n Unlocked\\n \"),_c('font-awesome-icon',{staticClass:\"ml-1\",attrs:{\"id\":\"u-radio\",\"icon\":\"lock-open\"}})],1),_c('div',{staticClass:\"text-muted font-weight-light\"},[_vm._v(\"\\n Taxation year can be edited by any user.\\n \")])]),_c('b-list-group-item',[_c('h6',[_vm._v(\"\\n Client Locked\\n \"),_c('font-awesome-icon',{staticClass:\"ml-1\",attrs:{\"id\":\"u-radio\",\"icon\":\"user-lock\"}})],1),_c('div',{staticClass:\"text-muted font-weight-light\"},[_vm._v(\"\\n Taxation year cannot be edited by external client users. Can be\\n edited by any KPMG internal user.\\n \")])]),_c('b-list-group-item',[_c('h6',[_vm._v(\"\\n Locked\\n \"),_c('font-awesome-icon',{staticClass:\"ml-1\",attrs:{\"id\":\"u-radio\",\"icon\":\"lock\"}})],1),_c('div',{staticClass:\"text-muted font-weight-light\"},[_vm._v(\"\\n Taxation year cannot be edited by any user.\\n \")])])],1)],1),_c('b-col',[_c('b-overlay',{attrs:{\"show\":_vm.loading}},[_c('b-input-group',{staticClass:\"mb-3 search-border-radius search-shadow bg-white\"},[_c('b-input-group-prepend',[_c('span',{staticClass:\"input-group-text pr-0\"},[_c('font-awesome-icon',{attrs:{\"icon\":\"search\",\"size\":\"sm\",\"left\":\"\"}})],1)]),_c('b-form-input',{staticClass:\"border-0\",attrs:{\"placeholder\":\"Search...\"},model:{value:(_vm.searchFilter),callback:function ($$v) {_vm.searchFilter=(typeof $$v === 'string'? $$v.trim(): $$v)},expression:\"searchFilter\"}})],1),_c('div',{staticClass:\"d-flex align-items-center justify-content-start\"},[_vm._v(\"\\n Apply to all\\n \"),_c('b-radio-group',{staticClass:\"lock-radio-group ml-2\",attrs:{\"size\":\"sm\",\"buttons\":\"\",\"button-variant\":\"outline-secondary\",\"disabled\":_vm.searchFilter != ''},on:{\"change\":_vm.applyAllChange},model:{value:(_vm.allLockStatus),callback:function ($$v) {_vm.allLockStatus=$$v},expression:\"allLockStatus\"}},[_c('b-form-radio',{attrs:{\"value\":\"U\"}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"id\":\"u-radio\",\"icon\":\"lock-open\"}})],1),_c('b-form-radio',{attrs:{\"id\":\"cl-radio\",\"value\":\"CL\"}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"icon\":\"user-lock\"}})],1),_c('b-form-radio',{attrs:{\"id\":\"l-radio\",\"value\":\"L\"}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"icon\":\"lock\"}})],1)],1)],1),_c('hr'),_c('b-list-group',{staticClass:\"px-4 rp-list-group\"},_vm._l((_vm.filteredReportingPeriods),function(rp,index){return _c('b-list-group-item',{key:index,staticClass:\"d-flex align-items-center justify-content-between\"},[_c('span',[_vm._v(_vm._s(rp.start_date)+\" to \"+_vm._s(rp.end_date))]),_c('b-radio-group',{staticClass:\"lock-radio-group\",attrs:{\"size\":\"sm\",\"buttons\":\"\",\"button-variant\":\"outline-secondary\"},on:{\"change\":function (value) { return _vm.updateLockStatus(rp.id, value); }},model:{value:(_vm.reportingPeriodLockedState[rp.id]),callback:function ($$v) {_vm.$set(_vm.reportingPeriodLockedState, rp.id, $$v)},expression:\"reportingPeriodLockedState[rp.id]\"}},[_c('b-form-radio',{attrs:{\"value\":\"U\"}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"id\":\"u-radio\",\"icon\":\"lock-open\"}})],1),_c('b-form-radio',{attrs:{\"id\":\"cl-radio\",\"value\":\"CL\"}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"icon\":\"user-lock\"}})],1),_c('b-form-radio',{attrs:{\"id\":\"l-radio\",\"value\":\"L\"}},[_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"icon\":\"lock\"}})],1)],1)],1)}),1)],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Vue, Mixins, Watch } from \"vue-property-decorator\"\r\nimport CalculatorMixin from \"@/mixins/CalculatorMixin\"\r\nimport { ReportingPeriod, ReportingPeriodLockStatus } from \"../../interfaces\"\r\nimport LoadingMixin from \"../../mixins/LoadingMixin\"\r\nimport { sortPeriods } from \"../../util/sortPeriods\"\r\n\r\n@Component\r\nexport default class PeriodLockForm extends Mixins(\r\n CalculatorMixin,\r\n LoadingMixin\r\n) {\r\n private reportingPeriodLockedState: {\r\n [id: string]: ReportingPeriodLockStatus\r\n } = {}\r\n\r\n private readonly lockOptions = []\r\n private searchFilter: string = \"\"\r\n private allLockStatus: ReportingPeriodLockStatus | null = null\r\n\r\n public get filteredReportingPeriods() {\r\n const reportingPeriods = this.reportingPeriods\r\n .slice()\r\n .sort(sortPeriods)\r\n .reverse()\r\n if (this.searchFilter.length > 0) {\r\n return reportingPeriods.filter(\r\n (rp: ReportingPeriod) =>\r\n rp.start_date.includes(this.searchFilter) ||\r\n rp.end_date.includes(this.searchFilter)\r\n )\r\n }\r\n return reportingPeriods\r\n }\r\n\r\n public created() {\r\n // Capture state of reporting periods\r\n this.reportingPeriods.forEach((rp: ReportingPeriod) => {\r\n // this.reportingPeriodLockedState[rp.id as string] = rp.lock_status\r\n this.$set(\r\n this.reportingPeriodLockedState,\r\n rp.id as string,\r\n rp.lock_status\r\n )\r\n })\r\n }\r\n\r\n @Watch(\"reportingPeriodLockedState\", { deep: true })\r\n public statusLockChange() {\r\n // Get the overall status of the RPs\r\n const statuses = new Set(Object.values(this.reportingPeriodLockedState))\r\n if (statuses.size == 1) {\r\n this.allLockStatus = statuses.values().next().value\r\n } else {\r\n this.allLockStatus = null\r\n }\r\n }\r\n\r\n public async applyAllChange(newStatus: ReportingPeriodLockStatus) {\r\n if (newStatus) {\r\n const payload: any[] = []\r\n const fallbackValues = JSON.parse(\r\n JSON.stringify(this.reportingPeriodLockedState)\r\n )\r\n this.reportingPeriods.forEach((rp: ReportingPeriod) => {\r\n // Only update the value if it changed\r\n if (this.reportingPeriodLockedState[rp.id as string] != newStatus) {\r\n payload.push({ id: rp.id, lock_status: newStatus })\r\n this.$set(this.reportingPeriodLockedState, rp.id as string, newStatus)\r\n }\r\n })\r\n this.loading = true\r\n try {\r\n await this.updateReportingPeriods(payload)\r\n this.showSuccessUpdateToast()\r\n } catch (e) {\r\n this.error = e\r\n this.reportingPeriodLockedState = fallbackValues\r\n this.showErrorUpdateToast()\r\n }\r\n this.loading = false\r\n }\r\n }\r\n\r\n public async updateLockStatus(id: string, value: ReportingPeriodLockStatus) {\r\n this.loading = true\r\n try {\r\n await this.updateReportingPeriod({\r\n id,\r\n lock_status: value,\r\n })\r\n this.showSuccessUpdateToast()\r\n } catch (e) {\r\n this.error = e\r\n this.$set(\r\n this.reportingPeriodLockedState,\r\n id,\r\n this.reportingPeriodLockedState[id]\r\n )\r\n this.showErrorUpdateToast()\r\n }\r\n this.loading = false\r\n }\r\n\r\n public showSuccessUpdateToast() {\r\n this.$bvToast.toast(`Lock status updated.`, {\r\n title: \"Lock Status\",\r\n variant: \"success\",\r\n autoHideDelay: 5000,\r\n })\r\n }\r\n\r\n public showErrorUpdateToast() {\r\n this.$bvToast.toast(`Something went wrong. Try again.`, {\r\n title: \"Lock Status\",\r\n variant: \"danger\",\r\n autoHideDelay: 5000,\r\n })\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PeriodLockForm.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PeriodLockForm.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./PeriodLockForm.vue?vue&type=template&id=43d8f5ea&scoped=true&\"\nimport script from \"./PeriodLockForm.vue?vue&type=script&lang=ts&\"\nexport * from \"./PeriodLockForm.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./PeriodLockForm.vue?vue&type=style&index=0&id=43d8f5ea&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"43d8f5ea\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.prompt.show)?_c('prompt-window',{attrs:{\"title\":_vm.prompt.title,\"message\":_vm.prompt.message,\"showCancel\":true},on:{\"prompt-result\":_vm.onPromptCallback}},[_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"confirmButton\",\"variant\":\"danger\"},slot:\"confirmButton\"},[_vm._v(\"Delete\")]),_c('b-button',{staticClass:\"w-100\",attrs:{\"slot\":\"cancelButton\",\"variant\":\"success\"},slot:\"cancelButton\"},[_vm._v(\"Cancel\")])],1):_vm._e(),_c('b-modal',{attrs:{\"hide-footer\":\"\",\"no-close-on-backdrop\":\"\",\"size\":\"md\",\"title\":((_vm.isEdit ? 'Edit' : 'Add') + \" ACB Period\")},model:{value:(_vm.show),callback:function ($$v) {_vm.show=$$v},expression:\"show\"}},[(_vm.show)?_c('ACBSettingsForm',{attrs:{\"editPeriod\":_vm.acbPeriod,\"loading\":_vm.loading,\"disabledDates\":_vm.disabledDates},on:{\"update:loading\":function($event){_vm.loading=$event},\"close-modal\":_vm.closeModal}}):_vm._e()],1),_c('b-form-group',{attrs:{\"description\":\"By checking off the above, Section H will show on the KPMG and Client input screens. If your engagement does not include ACB calculations, please uncheck to remove Section H from the client input schedule.\"}},[_c('b-form-checkbox',{attrs:{\"value\":true,\"unchecked-value\":false,\"disabled\":_vm.loading},on:{\"change\":_vm.acbEnabledChange},model:{value:(_vm.acbEnabled),callback:function ($$v) {_vm.acbEnabled=$$v},expression:\"acbEnabled\"}},[_vm._v(\"Is the ACB of the FA shares being computed?\")])],1),_c('hr'),_c('h5',[_vm._v(\"Partnership Considerations\")]),_c('PeriodCallout',{attrs:{\"variant\":\"primary\",\"text\":\"Where the shares of the FA are held by a Partnership, the ACB should not be reduced where Pre-Acquisition Surplus dividends are paid by the FA to the Partnership.\"}}),_c('b-button-group',[_c('b-button',{attrs:{\"variant\":\"primary\"},on:{\"click\":_vm.showModal}},[_c('div',[_vm._v(\"\\n Add\\n \"),_c('font-awesome-icon',{staticClass:\"mr-1\",attrs:{\"icon\":\"plus-square\"}})],1)])],1),(_vm.loading)?_c('b-row',[_c('b-col',{staticClass:\"text-center mt-2\"},[_c('b-spinner')],1)],1):_c('Table',{attrs:{\"fields\":_vm.tableFields,\"items\":_vm.acbPeriodItems,\"slots\":[\n {\n name: 'actions',\n field: 'actions',\n } ]},scopedSlots:_vm._u([{key:\"actions\",fn:function(data){return [_c('b-button-group',{staticClass:\"float-right\"},[_c('b-button',{attrs:{\"variant\":\"secondary\",\"size\":\"sm\"},on:{\"click\":function($event){return _vm.editACBPeriodModal(data)}}},[_c('font-awesome-icon',{attrs:{\"icon\":\"cog\"}})],1),_c('b-button',{attrs:{\"variant\":\"danger\",\"size\":\"sm\"},on:{\"click\":function($event){return _vm.removeAcbPeriod(data)}}},[_c('font-awesome-icon',{attrs:{\"icon\":\"trash\"}})],1)],1)]}}])})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.switchVersion)?_c('PeriodCallout',{attrs:{\"variant\":\"warning\",\"text\":\"The date exists for an ACB Period entry. Please enter another date.\",\"icon\":\"warning\",\"mb\":\"1\"}}):_vm._e(),_c('b-form-group',{staticClass:\"mt-2\",attrs:{\"label\":\"Date of Ownership Update\"}},[_c('datepicker',{attrs:{\"input-class\":\"form-control\",\"typeable\":true,\"disabled\":_vm.loading,\"disabled-dates\":_vm.disabledDates,\"format\":\"yyyy MM dd\",\"placeholder\":\"yyyy mm dd\",\"required\":\"\"},model:{value:(_vm.partnershipDate),callback:function ($$v) {_vm.partnershipDate=$$v},expression:\"partnershipDate\"}})],1),_c('b-form-group',{staticClass:\"mt-2\",attrs:{\"label\":\"Type of Ownership Update\"}},[_c('b-form-select',{attrs:{\"options\":_vm.partnershipOptions},model:{value:(_vm.isPartnership),callback:function ($$v) {_vm.isPartnership=$$v},expression:\"isPartnership\"}})],1),_c('b-button',{staticClass:\"mt-3\",attrs:{\"disabled\":_vm.isDisabled,\"block\":\"\",\"variant\":\"primary\"},on:{\"click\":function($event){_vm.isEdit() ? _vm.updateAcbPeriod() : _vm.saveAcbPeriod()}}},[_c('b-col',{staticClass:\"text-center\"},[_vm._v(\"\\n \"+_vm._s(_vm.isEdit() ? \"Edit\" : \"Save\")+\"\\n \"),(_vm.loading)?_c('span',[_c('b-spinner',{attrs:{\"small\":\"\"}})],1):_vm._e()])],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Vue, Prop, Mixins, Watch } from \"vue-property-decorator\"\r\nimport Datepicker from \"vuejs-datepicker\"\r\nimport dateFns from \"date-fns\"\r\n// Project Imports\r\nimport { ACBPeriod } from \"@/interfaces\"\r\nimport CalculatorMixin from \"@/mixins/CalculatorMixin\"\r\nimport ScheduleMixin from \"@/mixins/ScheduleMixin\"\r\nimport PeriodCallout from \"@/components/periods/PeriodCallout.vue\"\r\n\r\n@Component({ components: { Datepicker } })\r\nexport default class ACBSettingsForm extends Mixins(\r\n ScheduleMixin,\r\n CalculatorMixin,\r\n PeriodCallout\r\n) {\r\n @Prop({ required: true })\r\n public editPeriod!: ACBPeriod\r\n @Prop({ required: true })\r\n public loading!: boolean\r\n @Prop({ required: true })\r\n public disabledDates!: { [key: string]: Date[] }\r\n\r\n public partnershipDate: Date | string = \"\"\r\n public isPartnership = false\r\n public acbPeriodId: string | number | undefined = undefined\r\n public editModified = false\r\n // public disabledDates: {[key: string]: Date[]} = { dates: [] }\r\n\r\n public partnershipOptions = [\r\n {\r\n text: \"FA Owned by Partnership\",\r\n value: true,\r\n },\r\n {\r\n text: \"FA not owned by Partnership\",\r\n value: false,\r\n },\r\n ]\r\n\r\n public async saveAcbPeriod() {\r\n this.$emit(\"update:loading\", true)\r\n\r\n try {\r\n await this.addAcbPeriod({\r\n date: dateFns.format(this.partnershipDate, \"YYYY-MM-DD\"),\r\n value: this.isPartnership,\r\n })\r\n } catch (error) {\r\n this.error = error\r\n }\r\n this.$emit(\"update:loading\", false)\r\n\r\n this.closeModalEmit()\r\n }\r\n\r\n public async updateAcbPeriod() {\r\n this.$emit(\"update:loading\", true)\r\n\r\n try {\r\n await this.editAcbPeriod({\r\n ...this.editPeriod,\r\n date: dateFns.format(this.partnershipDate, \"YYYY-MM-DD\"),\r\n value: this.isPartnership,\r\n })\r\n } catch (error) {\r\n this.error = error\r\n }\r\n this.$emit(\"update:loading\", false)\r\n\r\n this.closeModalEmit()\r\n }\r\n\r\n public isEdit() {\r\n return Object.keys(this.editPeriod).length !== 0\r\n }\r\n\r\n public get isModified() {\r\n if (this.editPeriod) {\r\n const { date, value } = this.editPeriod\r\n\r\n const isDateSame = dateFns.isEqual(\r\n new Date(dateFns.format(date, \"YYYY MM DD\")),\r\n this.partnershipDate\r\n )\r\n const isValueSame = value === this.isPartnership\r\n\r\n return !(isDateSame && isValueSame)\r\n }\r\n\r\n return false\r\n }\r\n\r\n public get isDisabled() {\r\n if (this.loading) {\r\n return true\r\n }\r\n\r\n if (!this.partnershipDate) {\r\n return true\r\n }\r\n\r\n if (this.isEdit()) {\r\n return !this.isModified\r\n }\r\n\r\n if (this.isDateDisabled) {\r\n return true\r\n }\r\n\r\n return false\r\n }\r\n\r\n public get isDateDisabled() {\r\n for (const d of this.disabledDates.dates) {\r\n if (dateFns.isEqual(d, this.partnershipDate)) {\r\n return true\r\n }\r\n }\r\n return false\r\n }\r\n\r\n public get switchVersion() {\r\n if (this.isEdit()) {\r\n // When editing, display warning callout.\r\n if (this.isModified) {\r\n // If not the same edit date.\r\n if (\r\n !dateFns.isEqual(\r\n new Date(dateFns.format(this.editPeriod.date, \"YYYY MM DD\")),\r\n this.partnershipDate\r\n )\r\n ) {\r\n return this.isDateDisabled\r\n }\r\n } else {\r\n return \"\"\r\n }\r\n } else {\r\n return this.isDateDisabled\r\n }\r\n }\r\n\r\n public closeModalEmit() {\r\n this.$emit(\"close-modal\", true)\r\n }\r\n\r\n public mounted() {\r\n if (this.isEdit()) {\r\n const { date, value, id } = this.editPeriod\r\n\r\n this.acbPeriodId = id\r\n this.partnershipDate = new Date(dateFns.format(date, \"YYYY MM DD\"))\r\n this.isPartnership = value\r\n } else {\r\n this.partnershipDate = \"\"\r\n this.isPartnership = false\r\n }\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ACBSettingsForm.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ACBSettingsForm.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./ACBSettingsForm.vue?vue&type=template&id=6d19f6a4&scoped=true&\"\nimport script from \"./ACBSettingsForm.vue?vue&type=script&lang=ts&\"\nexport * from \"./ACBSettingsForm.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"6d19f6a4\",\n null\n \n)\n\nexport default component.exports","\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\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\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\n\n\n\n\n\n\n\n\n\r\nimport { Component, Mixins, Watch } from \"vue-property-decorator\"\r\nimport { namespace } from \"vuex-class\"\r\nimport Datepicker from \"vuejs-datepicker\"\r\nimport dateFns from \"date-fns\"\r\n// Project Imports\r\nimport Table from \"../utils/Table.vue\"\r\nimport { ACBPeriod, Deferred } from \"@/interfaces\"\r\nimport { CalculatorState } from \"@/store/calculator/types\"\r\nimport PeriodCallout from \"@/components/periods/PeriodCallout.vue\"\r\nimport PromptWindow from \"@/components/utils/PromptWindow.vue\"\r\nimport ACBSettingsForm from \"@/components/calculator/ACBSettingsForm.vue\"\r\nimport ScheduleMixin from \"@/mixins/ScheduleMixin\"\r\n\r\nconst calculatorModule = namespace(\"calculator\")\r\n\r\n@Component({\r\n components: {\r\n Datepicker,\r\n Table,\r\n PeriodCallout,\r\n PromptWindow,\r\n ACBSettingsForm,\r\n },\r\n})\r\nexport default class ACBBreakdown extends Mixins(ScheduleMixin) {\r\n @calculatorModule.State((state: CalculatorState) =>\r\n state.foreignAffiliate ? state.foreignAffiliate.acb_periods : []\r\n )\r\n public acbPeriods!: ACBPeriod[]\r\n public acbPeriod: ACBPeriod | {} = {}\r\n public partnershipDate: string = \"\"\r\n public isPartnership: boolean = false\r\n\r\n public show = false\r\n\r\n public acbEnabled = false\r\n\r\n public tableFields = [\r\n {\r\n key: \"date\",\r\n label: \"Date of Ownership Update\",\r\n sortable: true,\r\n type: \"date\",\r\n },\r\n {\r\n key: \"valueLabel\",\r\n label: \"Type of Ownership Update\",\r\n sortable: true,\r\n type: \"text\",\r\n },\r\n { key: \"actions\", label: \"\" },\r\n ]\r\n\r\n public partnershipOptions = [\r\n {\r\n text: \"FA Owned by Partnership\",\r\n value: true,\r\n },\r\n {\r\n text: \"FA not owned by Partnership\",\r\n value: false,\r\n },\r\n ]\r\n\r\n // public disabledDates = {\r\n // to: dateFns.parse(\r\n // (this.activeForeignAffiliate as ForeignAffiliate).first_year_begins\r\n // ),\r\n // }\r\n\r\n public get acbPeriodItems() {\r\n return this.acbPeriods\r\n .sort((a, b) => {\r\n return new Date(a.date).getTime() - new Date(b.date).getTime()\r\n })\r\n .map(ap => ({\r\n ...ap,\r\n valueLabel: (this.partnershipOptions.find(\r\n opt => opt.value == ap.value\r\n ) as any).text,\r\n }))\r\n }\r\n\r\n public get disabledDates() {\r\n return {\r\n dates: this.acbPeriodItems.map(\r\n (el: ACBPeriod) => new Date(dateFns.format(el.date, \"YYYY MM DD\"))\r\n ),\r\n }\r\n }\r\n\r\n public get isEdit() {\r\n return Object.keys(this.acbPeriod).length !== 0\r\n }\r\n\r\n public created() {\r\n this.acbEnabled = this.isAcbEnabled\r\n // Set Prompt message\r\n this.prompt.message = \"Delete?\"\r\n }\r\n\r\n public async acbEnabledChange(checked: boolean) {\r\n this.loading = true\r\n try {\r\n await this.toggleACB(checked)\r\n } catch (error) {\r\n this.error = error\r\n }\r\n this.loading = false\r\n }\r\n\r\n public showModal() {\r\n this.show = true\r\n }\r\n public closeModal() {\r\n this.show = false\r\n }\r\n\r\n public editACBPeriodModal(row: any) {\r\n this.acbPeriod = row.item\r\n this.showModal()\r\n }\r\n\r\n public removeAcbPeriod(row: any) {\r\n this.prompt.show = true\r\n // Defer promise to be handled once resolved\r\n this.prompt.defer = new Deferred()\r\n this.prompt.defer.promise\r\n .then(() => {\r\n const acbPeriod = row.item\r\n this.loading = true\r\n this.deleteAcbPeriod(acbPeriod.id).finally(() => {\r\n this.loading = false\r\n })\r\n })\r\n .catch((error: any) => {\r\n if (error) {\r\n this.error = error\r\n }\r\n })\r\n }\r\n\r\n @Watch(\"show\")\r\n public onChange() {\r\n // Resets acbPeriod\r\n if (this.show == false) {\r\n this.acbPeriod = {}\r\n }\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ACBSettings.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ACBSettings.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./ACBSettings.vue?vue&type=template&id=75b29554&\"\nimport script from \"./ACBSettings.vue?vue&type=script&lang=ts&\"\nexport * from \"./ACBSettings.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\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\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\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\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\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\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\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\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\r\nimport { Component, Vue, Watch } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport _ from \"lodash\"\r\nimport dateFns from \"date-fns\"\r\nimport { State, Action, Getter } from \"vuex-class\"\r\n// Project Imports\r\nimport { Taxpayer, ReportingPeriod } from \"@/interfaces\"\r\nimport ConfirmBoxMixin from \"@/mixins/ConfirmBoxMixin\"\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport CalculatorMixin from \"@/mixins/CalculatorMixin\"\r\nimport UserMixin from \"@/mixins/UserMixin\"\r\nimport FAConsolidator from \"@/components/fa/FAConsolidator.vue\"\r\nimport Calculator from \"@/components/calculator/Calculator.vue\"\r\nimport PeriodForm from \"@/components/periods/PeriodForm.vue\"\r\nimport FAForm from \"@/components/fa/FAForm.vue\"\r\nimport { fa } from \"@/services/api\"\r\nimport ImportDiagnostics from \"@/components/periods/ImportDiagnostics.vue\"\r\nimport EditPeriod from \"@/components/periods/EditPeriod.vue\"\r\nimport PeriodLockForm from \"@/components/periods/PeriodLockForm.vue\"\r\nimport OptionsDropdown from \"@/components/utils/OptionsDropdown.vue\"\r\nimport CommentSidebar from \"@/components/calculator/CommentSidebar.vue\"\r\nimport ACBSettings from \"@/components/calculator/ACBSettings.vue\"\r\n\r\n@Component({\r\n components: {\r\n FAForm,\r\n PeriodForm,\r\n Calculator,\r\n EditPeriod,\r\n ImportDiagnostics,\r\n OptionsDropdown,\r\n PeriodLockForm,\r\n CommentSidebar,\r\n ACBSettings,\r\n },\r\n beforeRouteUpdate(to, from, next) {\r\n next()\r\n this.$router.go(0)\r\n },\r\n})\r\nexport default class ForeignAffiliate extends mixins(\r\n LoadingMixin,\r\n CalculatorMixin,\r\n UserMixin,\r\n ConfirmBoxMixin\r\n) {\r\n public selectedReportingPeriodModel: any = \"\"\r\n public taxpayer!: Taxpayer\r\n public faArr!: ForeignAffiliate | undefined\r\n\r\n // Object to keep track of opened modals\r\n public showModal: any = {\r\n foreignAffiliateForm: false,\r\n reportingPeriodForm: false,\r\n reportingPeriodLockForm: false,\r\n importDiagnostics: false,\r\n acbModuleSettings: false,\r\n }\r\n\r\n @Watch(\"selectedReportingPeriodModel\")\r\n public selectedReportingPeriodChange(newVal: ReportingPeriod | undefined) {\r\n if (newVal) {\r\n this.setSelectedReportingPeriod(newVal)\r\n }\r\n }\r\n\r\n public get clientLocked() {\r\n if (this.activeForeignAffiliate) {\r\n return this.isClient && this.activeForeignAffiliate.client_locked\r\n }\r\n return false\r\n }\r\n\r\n public get currency() {\r\n return this.usedCurrency(\r\n this.activeForeignAffiliate,\r\n this.selectedReportingPeriod\r\n )\r\n }\r\n\r\n public created() {\r\n this.fetchCalcData()\r\n }\r\n\r\n public closeModal(data: any) {\r\n _.forEach(this.showModal, (value: any, key: any) => {\r\n this.$set(this.showModal, key, false)\r\n })\r\n }\r\n\r\n public fetchCalcData() {\r\n this.loading = true\r\n return this.fetchData(parseInt(this.$route.params.id, 10))\r\n .then(() => {\r\n if (this.$route.query.period) {\r\n const paramReportingPeriod = this.reportingPeriods.find(\r\n rp => rp.id == this.$route.query.period\r\n )\r\n if (paramReportingPeriod) {\r\n this.selectedReportingPeriodModel = paramReportingPeriod\r\n }\r\n } else {\r\n this.selectedReportingPeriodModel = this.selectedReportingPeriod\r\n }\r\n\r\n this.taxpayer = this.activeTaxpayer as Taxpayer\r\n this.faArr = this.activeForeignAffiliate as ForeignAffiliate | undefined\r\n })\r\n .catch((err: any) => {\r\n this.$router.push({ name: \"404\" })\r\n })\r\n .finally(() => {\r\n this.loading = false\r\n })\r\n }\r\n\r\n public async deleteFA() {\r\n const deleteFA = await this.confirmBox(\r\n \"Are you sure you want to delete this foreign affiliate? THIS ACTION CANNOT BE UNDONE. Deleting a foreign affiliate will remove all reporting periods associated to it.\",\r\n { ...this.deleteOptions, size: \"md\" }\r\n )\r\n if (deleteFA && this.activeForeignAffiliate) {\r\n const taxpayer = this.activeForeignAffiliate.taxpayer\r\n fa.destroy(this.$route.params.id).then(() => {\r\n this.$router.push({ name: \"taxpayer\", params: { id: taxpayer } })\r\n })\r\n }\r\n }\r\n}\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ForeignAffiliate.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ForeignAffiliate.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./ForeignAffiliate.vue?vue&type=template&id=2c1a40ed&\"\nimport script from \"./ForeignAffiliate.vue?vue&type=script&lang=ts&\"\nexport * from \"./ForeignAffiliate.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./ForeignAffiliate.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-container',[_c('h1',{staticClass:\"kpmg\"},[_vm._v(_vm._s(_vm.name || \"User Profile\"))]),_c('hr'),_c('b-row',[_c('b-col'),_c('b-col',{attrs:{\"cols\":\"6\"}},[_c('b-card',[_c('h4',{attrs:{\"slot\":\"header\"},slot:\"header\"},[_vm._v(\"Change Password\")]),_c('transition',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[(_vm.loading)?_c('loader',{key:\"loader\"}):_c('b-form',{on:{\"submit\":function($event){$event.preventDefault();return _vm.validatePasswordChange($event)}}},[(_vm.error)?_c('ErrorAlert',{attrs:{\"error\":_vm.error}}):_vm._e(),_c('b-alert',{staticClass:\"text-center\",staticStyle:{\"font-size\":\"0.9rem\"},attrs:{\"fade\":\"\",\"variant\":\"success\",\"show\":Boolean(_vm.success)}},[_vm._v(\"Password Updated.\")]),_c('b-form-group',{attrs:{\"label-cols\":\"4\",\"label\":\"Current Password\",\"description\":_vm.validator.errors.first(\"Current Password\")}},[_c('b-form-input',{attrs:{\"required\":\"\",\"type\":\"password\"},model:{value:(_vm.oldPassword),callback:function ($$v) {_vm.oldPassword=$$v},expression:\"oldPassword\"}})],1),_c('hr'),_c('b-form-group',{attrs:{\"label-cols\":\"4\",\"label\":\"New Password\",\"description\":_vm.validator.errors.first(\"New Password\")}},[_c('b-form-input',{attrs:{\"required\":\"\",\"type\":\"password\"},model:{value:(_vm.newPassword),callback:function ($$v) {_vm.newPassword=$$v},expression:\"newPassword\"}})],1),_c('b-form-group',{attrs:{\"label-cols\":\"4\",\"label\":\"Confirm New Password\",\"description\":_vm.validator.errors.first(\"Confirm New Password\")}},[_c('b-form-input',{attrs:{\"required\":\"\",\"type\":\"password\"},model:{value:(_vm.confirmNewPassword),callback:function ($$v) {_vm.confirmNewPassword=$$v},expression:\"confirmNewPassword\"}})],1),_c('b-button',{staticClass:\"float-right\",attrs:{\"type\":\"submit\",\"variant\":\"primary\"}},[_vm._v(\"Change Password\")])],1)],1)],1)],1),_c('b-col')],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Vue, Mixins } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\n// Project Imports\r\nimport UserMixin from \"@/mixins/UserMixin\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport LoadingMixin from \"../mixins/LoadingMixin\"\r\nimport ValidatorMixin from \"../mixins/ValidatorMixin\"\r\n\r\n@Component({\r\n components: { ErrorAlert },\r\n})\r\nexport default class Profile extends mixins(\r\n UserMixin,\r\n LoadingMixin,\r\n ValidatorMixin\r\n) {\r\n public oldPassword: string = \"\"\r\n public newPassword: string = \"\"\r\n public confirmNewPassword: string = \"\"\r\n\r\n public created() {\r\n this.validator.attach({\r\n name: \"Current Password\",\r\n getter: () => this.oldPassword,\r\n })\r\n\r\n this.validator.attach({\r\n name: \"New Password\",\r\n rules: \"verify_password|min:8\",\r\n getter: () => this.newPassword,\r\n })\r\n\r\n this.validator.attach({\r\n name: \"Confirm New Password\",\r\n getter: () => this.confirmNewPassword,\r\n })\r\n }\r\n\r\n public validatePasswordChange() {\r\n this.error = \"\"\r\n this.validator.validate().then(result => {\r\n if (result) {\r\n if (this.newPassword != this.confirmNewPassword) {\r\n this.error = {\r\n message: \"New password doesn't match.\",\r\n }\r\n return\r\n }\r\n\r\n this.loading = true\r\n this.success = false\r\n return this.changePassword({\r\n oldPassword: this.oldPassword,\r\n newPassword: this.newPassword,\r\n confirmNewPassword: this.confirmNewPassword,\r\n })\r\n .then(() => {\r\n this.success = true\r\n\r\n this.oldPassword = \"\"\r\n this.newPassword = \"\"\r\n this.confirmNewPassword = \"\"\r\n })\r\n .catch((err: any) => (this.error = err))\r\n .finally(() => (this.loading = false))\r\n }\r\n })\r\n }\r\n}\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Profile.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Profile.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Profile.vue?vue&type=template&id=1e3e6de1&\"\nimport script from \"./Profile.vue?vue&type=script&lang=ts&\"\nexport * from \"./Profile.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _vm._m(0)}\nvar staticRenderFns = [function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"text-center\"},[_c('h1',[_vm._v(\"Oops! This page does not exist.\")])])}]\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\r\nimport { Component, Vue } from \"vue-property-decorator\"\r\n\r\n@Component\r\nexport default class PageNotFound extends Vue {}\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PageNotFound.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PageNotFound.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./PageNotFound.vue?vue&type=template&id=59132b0b&\"\nimport script from \"./PageNotFound.vue?vue&type=script&lang=ts&\"\nexport * from \"./PageNotFound.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-container',[_c('b-row',[_c('b-col',{attrs:{\"offset-lg\":\"3\",\"lg\":\"6\"}},[_c('ForgotPasswordForm',{attrs:{\"token\":_vm.$route.params.token}})],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[(_vm.loading)?_c('loader',{key:\"loader\"}):(!_vm.token)?_c('b-card',{key:\"resetRequest\"},[_c('b-form',{attrs:{\"action\":\"\"},on:{\"submit\":function($event){$event.preventDefault();return _vm.onResetRequestSubmit($event)}}},[_c('h1',{staticClass:\"kpmg text-center\"},[_vm._v(\"Surplus Calculator\")]),_c('h2',{staticClass:\"text-center\"},[_vm._v(\"Forgot Password\")]),_c('hr'),_c('ErrorAlert',{attrs:{\"error\":_vm.error}}),(!_vm.resetRequested)?_c('div',[_c('p',{staticClass:\"font-weight-light text-center\"},[_vm._v(\"\\n Enter your email to start the password recovery process.\\n \")]),_c('b-form-group',{attrs:{\"label\":\"Email\"}},[_c('b-form-input',{attrs:{\"type\":\"email\",\"required\":\"\",\"placeholder\":\"Email\"},model:{value:(_vm.email),callback:function ($$v) {_vm.email=$$v},expression:\"email\"}})],1),_c('hr'),_c('LoadingButton',{attrs:{\"loading\":_vm.loading,\"text\":\"Reset Password\"}}),_c('p',{staticClass:\"text-center mt-2\"},[_c('router-link',{attrs:{\"to\":{ name: 'login' }}},[_vm._v(\"Log in\")])],1)],1):_c('p',{staticClass:\"font-weight-light text-center\"},[_vm._v(\"\\n A password reset email has been sent.\\n \")])],1)],1):_c('b-card',{key:\"passwordReset\"},[_c('b-form',{attrs:{\"action\":\"\"},on:{\"submit\":function($event){$event.preventDefault();return _vm.onPasswordResetSubmit($event)}}},[_c('h1',{staticClass:\"kpmg text-center\"},[_vm._v(\"Surplus Calculator\")]),_c('h2',{staticClass:\"text-center\"},[_vm._v(\"Forgot Password\")]),_c('hr'),_c('ErrorAlert',{attrs:{\"error\":_vm.error}}),(!_vm.passwordResetSuccess)?_c('div',[_c('p',{staticClass:\"font-weight-light text-center\"},[_vm._v(\"\\n Enter and confirm your new password.\\n \")]),_c('b-form-group',{attrs:{\"label-cols\":\"6\",\"label\":\"New Password\",\"description\":_vm.validator.errors.first(\"New Password\")}},[_c('b-form-input',{attrs:{\"required\":\"\",\"type\":\"password\"},model:{value:(_vm.newPassword),callback:function ($$v) {_vm.newPassword=$$v},expression:\"newPassword\"}})],1),_c('b-form-group',{attrs:{\"label-cols\":\"6\",\"label\":\"Confirm New Password\",\"description\":_vm.validator.errors.first(\"Confirm New Password\")}},[_c('b-form-input',{attrs:{\"required\":\"\",\"type\":\"password\"},model:{value:(_vm.confirmNewPassword),callback:function ($$v) {_vm.confirmNewPassword=$$v},expression:\"confirmNewPassword\"}})],1),_c('hr'),_c('LoadingButton',{attrs:{\"loading\":_vm.loading,\"text\":\"Change Password\"}})],1):_c('p',{staticClass:\"font-weight-light text-center\"},[_vm._v(\"\\n Password has been changed. You may now\\n \"),_c('router-link',{attrs:{\"to\":{ name: 'login' }}},[_vm._v(\"login\")]),_vm._v(\" with\\n your new credentials\\n \")],1)],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Vue } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\n// Project Imports\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport UserMixin from \"@/mixins/UserMixin\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\n\r\nimport LoadingButton from \"@/components/LoadingButton.vue\"\r\nimport ValidatorMixin from \"../mixins/ValidatorMixin\"\r\n\r\n@Component({\r\n components: {\r\n LoadingButton,\r\n ErrorAlert,\r\n },\r\n})\r\nexport default class ForgotPasswordForm extends mixins(\r\n LoadingMixin,\r\n UserMixin,\r\n ValidatorMixin\r\n) {\r\n @Prop({ required: false, default: \"\" })\r\n public token!: string\r\n\r\n private resetRequested: boolean = false\r\n private passwordResetSuccess: boolean = false\r\n private email: string = \"\"\r\n private newPassword: string = \"\"\r\n private confirmNewPassword: string = \"\"\r\n\r\n public created() {\r\n this.validator.attach({\r\n name: \"New Password\",\r\n rules: \"verify_password|min:8\",\r\n getter: () => this.newPassword,\r\n })\r\n\r\n this.validator.attach({\r\n name: \"Confirm New Password\",\r\n getter: () => this.confirmNewPassword,\r\n })\r\n\r\n this.validateTokenExpiration()\r\n }\r\n\r\n private validateTokenExpiration() {\r\n if (this.token) {\r\n // 404 will be recieved if the token has expired\r\n this.validateToken(this.token).catch(() =>\r\n this.$router.push({ name: \"login\" })\r\n )\r\n }\r\n }\r\n\r\n private onResetRequestSubmit(): void {\r\n const { email } = this\r\n this.error = \"\"\r\n this.loading = true\r\n const promise = this.requestPasswordReset({ email }).finally(() => {\r\n this.resetRequested = true\r\n this.loading = false\r\n })\r\n }\r\n\r\n private onPasswordResetSubmit(): void {\r\n this.error = \"\"\r\n this.validator.validate().then(result => {\r\n if (result) {\r\n if (this.newPassword != this.confirmNewPassword) {\r\n this.error = {\r\n message: \"New password doesn't match.\",\r\n }\r\n return\r\n }\r\n\r\n this.passwordResetSuccess = false\r\n this.loading = true\r\n return this.resetPassword({\r\n token: this.token,\r\n newPassword: this.newPassword,\r\n confirmNewPassword: this.confirmNewPassword,\r\n })\r\n .then(() => {\r\n this.passwordResetSuccess = true\r\n })\r\n .catch((err: any) => (this.error = err))\r\n .finally(() => (this.loading = false))\r\n }\r\n })\r\n }\r\n}\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ForgotPasswordForm.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ForgotPasswordForm.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./ForgotPasswordForm.vue?vue&type=template&id=71bf53d7&\"\nimport script from \"./ForgotPasswordForm.vue?vue&type=script&lang=ts&\"\nexport * from \"./ForgotPasswordForm.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Vue } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\n// Project Imports\r\nimport LoadingMixin from \"@/mixins/LoadingMixin\"\r\nimport UserMixin from \"@/mixins/UserMixin\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\nimport LoadingButton from \"@/components/LoadingButton.vue\"\r\nimport ForgotPasswordForm from \"@/components/ForgotPasswordForm.vue\"\r\n\r\n@Component({\r\n components: {\r\n LoadingButton,\r\n ErrorAlert,\r\n ForgotPasswordForm,\r\n },\r\n})\r\nexport default class ForgotPassword extends mixins(LoadingMixin, UserMixin) {}\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ForgotPassword.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ForgotPassword.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./ForgotPassword.vue?vue&type=template&id=82d3313a&\"\nimport script from \"./ForgotPassword.vue?vue&type=script&lang=ts&\"\nexport * from \"./ForgotPassword.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{\"name\":\"fade\",\"mode\":\"out-in\"}},[_c('b-container',[_c('b-row',[_c('b-col',{attrs:{\"offset-md\":\"3\",\"md\":\"6\"}},[(_vm.loading)?_c('loader',{staticClass:\"text-center\"}):(_vm.taxpayer)?_c('b-card',[_c('h1',{staticClass:\"kpmg text-center\"},[_vm._v(\"Surplus Calculator\")]),_c('h2',{staticClass:\"text-center\"},[_vm._v(\"Client Access Extension\")]),_c('hr'),_c('ErrorAlert',{attrs:{\"error\":_vm.error}}),(!_vm.success)?_c('div',[_c('p',[_vm._v(\"\\n Client access of\\n \"),_c('strong',[_vm._v(_vm._s(_vm.taxpayer.name))]),_vm._v(\"\\n will expire on\\n \"),_c('strong',[_vm._v(_vm._s(_vm.taxpayer.client_access_expires))]),_vm._v(\". By extending access, the selected client users will have\\n access for an additional 6 months.\\n \")]),_c('b-form-group',{attrs:{\"label\":\"Please select the client users that require their access to be extended for an additional 6 months:\",\"description\":\"Note: Client users whose access is not extended will lose all access to the above noted taxpayer.\"}},[_c('b-form-checkbox-group',{staticClass:\"mb-3\",attrs:{\"options\":_vm.clients,\"stacked\":\"\",\"value-field\":\"id\",\"text-field\":\"name\"},model:{value:(_vm.selectedClients),callback:function ($$v) {_vm.selectedClients=$$v},expression:\"selectedClients\"}})],1),_c('b-button',{attrs:{\"disabled\":_vm.selectedClients.length == 0,\"variant\":\"primary\",\"block\":\"\"},on:{\"click\":_vm.extendAccess}},[_vm._v(\"Extend\")])],1):_c('div',{staticClass:\"text-center\"},[_c('font-awesome-icon',{staticClass:\"text-success m-3\",attrs:{\"size\":\"4x\",\"icon\":\"check-circle\"}}),_c('br'),_c('h5',[_c('p',{staticClass:\"font-weight-light\"},[_vm._v(\"\\n Client access to\\n \"),_c('strong',[_vm._v(_vm._s(_vm.taxpayer.name))]),_vm._v(\" has been extended until\\n \"),_c('strong',[_vm._v(_vm._s(_vm.taxpayer.client_access_expires))]),_vm._v(\" for the\\n following users:\\n \")]),_c('ul',{staticClass:\"my-4\",staticStyle:{\"list-style-type\":\"none\",\"padding\":\"0\"}},_vm._l((_vm.selectedClients),function(clientId,index){return _c('li',{key:index,staticClass:\"m-1\"},[_vm._v(\"\\n \"+_vm._s(_vm.clientName(clientId))+\"\\n \")])}),0)])],1)],1):_vm._e()],1)],1)],1)],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Prop, Vue, Watch, Mixins } from \"vue-property-decorator\"\r\n\r\nimport { taxpayer } from \"@/services/api\"\r\nimport { Taxpayer } from \"../interfaces\"\r\nimport LoadingMixin from \"../mixins/LoadingMixin\"\r\nimport ConfirmBoxMixin from \"../mixins/ConfirmBoxMixin\"\r\nimport ErrorAlert from \"@/components/utils/ErrorAlert.vue\"\r\n\r\n@Component({\r\n components: {\r\n ErrorAlert,\r\n },\r\n})\r\nexport default class Expiry extends Mixins(LoadingMixin, ConfirmBoxMixin) {\r\n public taxpayer: Taxpayer | null = null\r\n public selectedClients: any[] = []\r\n public token: string = \"\"\r\n public taxpayerId: string | number = \"\"\r\n public success: boolean = false\r\n\r\n public async created() {\r\n this.token = this.$route.params.token\r\n this.taxpayerId = this.$route.params.id\r\n if (this.token && this.taxpayerId) {\r\n try {\r\n this.error = \"\"\r\n this.loading = true\r\n this.taxpayer = await taxpayer.validateExpiry(\r\n this.token,\r\n this.taxpayerId\r\n )\r\n } catch (e) {\r\n this.error = e\r\n this.$router.push({ name: \"home\" })\r\n }\r\n this.loading = false\r\n } else {\r\n this.$router.push({ name: \"home\" })\r\n }\r\n }\r\n\r\n public async extendAccess() {\r\n const confirmed = await this.confirmBox(\r\n \"Are you sure you want to extend access to these client users?\",\r\n {\r\n title: \"Client Access Extension\",\r\n }\r\n )\r\n if (confirmed) {\r\n try {\r\n this.error = \"\"\r\n this.loading = true\r\n this.taxpayer = await taxpayer.extendExpiry(\r\n this.token,\r\n this.taxpayerId,\r\n this.selectedClients\r\n )\r\n this.success = true\r\n } catch (e) {\r\n this.error = e\r\n }\r\n this.loading = false\r\n }\r\n }\r\n\r\n public clientName(id: string | number) {\r\n return this.clients.find(o => o.id == id).name\r\n }\r\n\r\n public get clients() {\r\n return this.taxpayer && this.taxpayer.owners\r\n ? this.taxpayer.owners\r\n .filter(o => o.client)\r\n .map(o => {\r\n return {\r\n ...o,\r\n name:\r\n o.first_name && o.last_name\r\n ? `${o.last_name}, ${o.first_name}`\r\n : o.username,\r\n }\r\n })\r\n : []\r\n }\r\n}\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Expiry.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Expiry.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Expiry.vue?vue&type=template&id=71e2928d&\"\nimport script from \"./Expiry.vue?vue&type=script&lang=ts&\"\nexport * from \"./Expiry.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import Vue from \"vue\"\r\nimport Router from \"vue-router\"\r\nimport Home from \"./views/Home.vue\"\r\nimport Login from \"./views/Login.vue\"\r\nimport Taxpayer from \"./views/Taxpayer.vue\"\r\nimport ForeignAffiliate from \"./views/ForeignAffiliate.vue\"\r\nimport Profile from \"@/views/Profile.vue\"\r\nimport PageNotFound from \"@/views/PageNotFound.vue\"\r\nimport ForgotPassword from \"@/views/ForgotPassword.vue\"\r\nimport Expiry from \"@/views/Expiry.vue\"\r\n// Dynamic Routes\r\nconst TermsOfUse = () => import(\"@/views/TermsOfUse.vue\")\r\n\r\nimport store from \"./store\"\r\nVue.use(Router)\r\n\r\nconst router = new Router({\r\n mode: \"history\",\r\n base: process.env.BASE_URL,\r\n // Scroll to top when the route changes\r\n scrollBehavior(to, from, savedPosition) {\r\n return { x: 0, y: 0 }\r\n },\r\n routes: [\r\n {\r\n path: \"/\",\r\n name: \"home\",\r\n component: Home,\r\n meta: {\r\n auth: true,\r\n },\r\n },\r\n {\r\n path: \"/login\",\r\n name: \"login\",\r\n component: Login,\r\n },\r\n {\r\n path: \"/forgot-password/:token?\",\r\n name: \"forgotPassword\",\r\n component: ForgotPassword,\r\n },\r\n {\r\n path: \"/taxpayers/:id\",\r\n name: \"taxpayer\",\r\n component: Taxpayer,\r\n meta: {\r\n auth: true,\r\n },\r\n },\r\n {\r\n path: \"/taxpayers/:id/client-access/:token\",\r\n name: \"expiry\",\r\n component: Expiry,\r\n meta: {\r\n auth: true,\r\n },\r\n },\r\n {\r\n path: \"/profile\",\r\n name: \"profile\",\r\n component: Profile,\r\n meta: {\r\n auth: true,\r\n },\r\n },\r\n {\r\n path: \"/foreign-affiliates/:id\",\r\n name: \"foreign-affiliate\",\r\n component: ForeignAffiliate,\r\n meta: {\r\n auth: true,\r\n },\r\n },\r\n {\r\n path: \"/terms\",\r\n name: \"termsOfUse\",\r\n component: TermsOfUse,\r\n },\r\n {\r\n path: \"/404\",\r\n name: \"404\",\r\n component: PageNotFound,\r\n },\r\n {\r\n path: \"*\",\r\n redirect: { name: \"home\" },\r\n },\r\n ],\r\n})\r\n\r\nrouter.beforeEach((to, from, next) => {\r\n if (to.meta.auth) {\r\n if (!store.state.user.isAuthenticated) {\r\n // Check if user is can be authenticated\r\n store\r\n .dispatch(\"user/verify\")\r\n .then(() => {\r\n next()\r\n })\r\n .catch(() => {\r\n // No auth, redirect to login to get credentials, passing the path\r\n next({\r\n name: \"login\",\r\n query: {\r\n redirect: to.fullPath,\r\n },\r\n })\r\n })\r\n } else {\r\n next()\r\n }\r\n } else {\r\n next()\r\n }\r\n})\r\n\r\nrouter.onReady(() => {\r\n // @ts-ignore\r\n const currentRoute = router.history.current\r\n if (currentRoute.meta.auth) {\r\n if (!store.state.user.isAuthenticated) {\r\n store.dispatch(\"user/verify\")\r\n }\r\n }\r\n})\r\n\r\nexport default router\r\n","import { ActionTree } from \"vuex\"\r\nimport {\r\n UserState,\r\n SET_IS_AUTHENTICATED,\r\n SET_USER_DATA,\r\n TOGGLE_CLIENT,\r\n ADD_OUTPUT_PROFILE,\r\n EDIT_OUTPUT_PROFILE,\r\n DELETE_OUTPUT_PROFILE,\r\n} from \"./types\"\r\nimport { RootState } from \"../types\"\r\nimport { User, LoginResponseOk } from \"@/interfaces\"\r\nimport router from \"@/router\"\r\n\r\n// API\r\nimport { deleteToken, getToken, setToken } from \"@/services/token\"\r\nimport { auth, outputProfile, users } from \"@/services/api\"\r\n\r\nexport const actions: ActionTree = {\r\n setIsAuthenticated({ commit }: any, isAuthenticated: boolean) {\r\n commit(SET_IS_AUTHENTICATED, isAuthenticated)\r\n },\r\n setUserData({ commit }: any, user: User) {\r\n commit(SET_USER_DATA, user)\r\n },\r\n checkIsAuthenticated({ commit }: any) {\r\n const token = getToken()\r\n if (token) {\r\n auth\r\n .me()\r\n .then((data: any) => {\r\n commit(SET_IS_AUTHENTICATED, true)\r\n commit(SET_USER_DATA, data)\r\n router.push({ name: \"home\" })\r\n })\r\n .catch(err => {\r\n commit(SET_IS_AUTHENTICATED, false)\r\n deleteToken()\r\n router.push({ name: \"login\" })\r\n })\r\n } else {\r\n commit(SET_IS_AUTHENTICATED, false)\r\n }\r\n },\r\n\r\n logout({ commit }: any) {\r\n commit(SET_IS_AUTHENTICATED, false)\r\n commit(SET_USER_DATA, {})\r\n deleteToken()\r\n router.push({ name: \"login\" })\r\n },\r\n\r\n login({ commit }: any, payload: any) {\r\n const { username, password, otp } = payload\r\n\r\n const promise = auth.login({ username, password, otp })\r\n promise\r\n .then((res: LoginResponseOk) => {\r\n setToken(res.access)\r\n return auth.me().then((response: any) => {\r\n commit(SET_USER_DATA, response)\r\n commit(SET_IS_AUTHENTICATED, true)\r\n const redirect = router.currentRoute.query.redirect as string\r\n if (redirect != null) {\r\n router.push(redirect)\r\n } else {\r\n router.push({ name: \"home\" })\r\n }\r\n })\r\n })\r\n .catch((err: any) => {\r\n commit(SET_IS_AUTHENTICATED, false)\r\n return err\r\n })\r\n return promise\r\n },\r\n\r\n verify({ commit }: any) {\r\n const promise = new Promise((resolve: any, reject: any) => {\r\n const token = getToken()\r\n if (token) {\r\n resolve(\r\n auth\r\n .verify(token)\r\n .then(res => {\r\n return auth.me().then((response: any) => {\r\n commit(SET_USER_DATA, response)\r\n commit(SET_IS_AUTHENTICATED, true)\r\n // @ts-ignore\r\n if (router.history.current.name === \"login\") {\r\n router.push({ name: \"home\" })\r\n }\r\n })\r\n })\r\n .catch((err: any) => {\r\n deleteToken()\r\n reject(err)\r\n router.push({ name: \"login\" })\r\n })\r\n )\r\n } else {\r\n router.push({ name: \"login\" })\r\n reject(\"No token error\")\r\n }\r\n })\r\n return promise\r\n },\r\n\r\n changePassword({ commit }, payload: any) {\r\n const passwordChangePromise = auth.password(\r\n payload.oldPassword,\r\n payload.newPassword,\r\n payload.confirmNewPassword\r\n )\r\n return passwordChangePromise\r\n },\r\n\r\n toggleStaff({ commit }) {\r\n commit(TOGGLE_CLIENT)\r\n },\r\n addOutputProfile({ commit, state }, payload: any) {\r\n if (state.data) {\r\n const requestPromise = outputProfile.createUserProfile(\r\n state.data.id,\r\n payload\r\n )\r\n requestPromise.then((res: any) => {\r\n commit(ADD_OUTPUT_PROFILE, res)\r\n })\r\n return requestPromise\r\n }\r\n },\r\n editOutputProfile({ commit }, payload: any) {\r\n commit(EDIT_OUTPUT_PROFILE, payload)\r\n },\r\n deleteOutputProfile({ commit }, payload: any) {\r\n commit(DELETE_OUTPUT_PROFILE, payload)\r\n },\r\n getAllUsers() {\r\n return users.getAll()\r\n },\r\n requestPasswordReset({}, payload: any) {\r\n return auth.requestPasswordReset({ email: payload.email })\r\n },\r\n resetPassword({}, payload: any) {\r\n return auth.resetPassword(payload.token, {\r\n password: payload.newPassword,\r\n password_2: payload.confirmNewPassword,\r\n })\r\n },\r\n validateToken({}, payload: any) {\r\n return auth.validateToken(payload)\r\n },\r\n}\r\n","import { MutationTree } from \"vuex\"\r\nimport {\r\n UserState,\r\n SET_IS_AUTHENTICATED,\r\n SET_USER_DATA,\r\n TOGGLE_CLIENT,\r\n ADD_OUTPUT_PROFILE,\r\n EDIT_OUTPUT_PROFILE,\r\n DELETE_OUTPUT_PROFILE,\r\n} from \"./types\"\r\nimport { User } from \"@/interfaces\"\r\nimport Vue from \"vue\"\r\n\r\nexport const mutations: MutationTree = {\r\n [SET_IS_AUTHENTICATED](state: any, isAuthenticated: boolean) {\r\n Vue.set(state, \"isAuthenticated\", isAuthenticated)\r\n },\r\n [SET_USER_DATA](state: any, user: User) {\r\n Vue.set(state, \"isKIU\", !user.client)\r\n Vue.set(state, \"data\", user)\r\n\r\n // sessionStorage variables is \"client_persist_\" and the user ID generated by the application\r\n const client_persist = sessionStorage.getItem(\r\n \"client_persist_\" + state.data.id\r\n )\r\n\r\n if (client_persist) {\r\n // Note: sessionStorage can only store values as a string\r\n Vue.set(state.data, \"client_persist\", client_persist === \"true\")\r\n Vue.set(state.data, \"client\", client_persist === \"true\")\r\n } else {\r\n Vue.set(state.data, \"client_persist\", state.data.client)\r\n }\r\n },\r\n [TOGGLE_CLIENT](state: any) {\r\n const newClientState = !state.data.client\r\n Vue.set(state.data, \"client\", newClientState)\r\n\r\n Vue.set(state.data, \"client_persist\", newClientState)\r\n sessionStorage.setItem(\r\n \"client_persist_\" + state.data.id,\r\n newClientState.toString()\r\n )\r\n },\r\n [ADD_OUTPUT_PROFILE](state, newOutputProfile: any) {\r\n if (state.data && state.data.output_profiles) {\r\n const existingOutputProfile = state.data.output_profiles.find(\r\n (op: any) => {\r\n return op.id === newOutputProfile.id\r\n }\r\n )\r\n if (!existingOutputProfile) {\r\n state.data.output_profiles.push(newOutputProfile)\r\n }\r\n }\r\n },\r\n [EDIT_OUTPUT_PROFILE](state, editedProfile: any) {\r\n if (state.data && state.data.output_profiles) {\r\n let existingProfile = state.data.output_profiles.find((op: any) => {\r\n return op.id === editedProfile.id\r\n })\r\n if (existingProfile) {\r\n existingProfile = Object.assign(existingProfile, editedProfile)\r\n }\r\n }\r\n },\r\n [DELETE_OUTPUT_PROFILE](state, profileId: number | string) {\r\n if (state.data && state.data.output_profiles) {\r\n const existingProfile = state.data.output_profiles.findIndex(\r\n (op: any) => {\r\n return op.id === profileId\r\n }\r\n )\r\n if (existingProfile >= 0) {\r\n state.data.output_profiles.splice(existingProfile, 1)\r\n }\r\n }\r\n },\r\n}\r\n","import { Module } from \"vuex\"\r\nimport { getters } from \"./getters\"\r\nimport { actions } from \"./actions\"\r\nimport { mutations } from \"./mutations\"\r\nimport { UserState } from \"./types\"\r\nimport { RootState } from \"../types\"\r\n\r\nexport const state: UserState = {\r\n isAuthenticated: false,\r\n data: undefined,\r\n isKIU: false,\r\n error: false,\r\n}\r\n\r\nconst namespaced: boolean = true\r\n\r\nexport const user: Module = {\r\n namespaced,\r\n state,\r\n getters,\r\n actions,\r\n mutations,\r\n}\r\n","import Vue from \"vue\"\r\nimport Vuex from \"vuex\"\r\nimport { calculator } from \"./calculator/index\"\r\nimport { user } from \"./user/index\"\r\n\r\nVue.use(Vuex)\r\n\r\nexport default new Vuex.Store({\r\n modules: {\r\n user,\r\n calculator,\r\n },\r\n})\r\n","import { create, ApiResponse } from \"apisauce\"\r\nimport { AxiosRequestConfig } from \"axios\"\r\nimport { getToken } from \"../token\"\r\nimport store from \"@/store\"\r\nimport router from \"@/router\"\r\n\r\nexport const SERVER_ERROR_MESSAGE =\r\n \"Oops! Something went wrong. Try again later.\"\r\nexport const VALIDATION_ERROR_MESSAGE = \"There were validation errors.\"\r\n\r\nconst api = create({\r\n baseURL: process.env.VUE_APP_BASE_URL,\r\n headers: { \"content-type\": \"application/json\" },\r\n})\r\n\r\napi.addRequestTransform((request: AxiosRequestConfig) => {\r\n const token = getToken()\r\n if (token) {\r\n request.headers.Authorization = `Bearer ${token}`\r\n }\r\n if (process.env.NODE_ENV !== \"production\") {\r\n // tslint:disable-next-line\r\n console.log(\"REQUEST: \", request)\r\n }\r\n})\r\n\r\napi.addResponseTransform((response: ApiResponse) => {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n // tslint:disable-next-line\r\n console.log(\"RESPONSE: \", response)\r\n }\r\n if (response.status === 401) {\r\n store.state.user.isAuthenticated = false\r\n router.push({ name: \"login\" })\r\n }\r\n})\r\n\r\nexport const resolve = (response: any) => {\r\n if (response.ok) {\r\n return Promise.resolve(response.data)\r\n } else {\r\n const errors: any = {\r\n message: null,\r\n field: null,\r\n nonField: null,\r\n }\r\n switch (response.status) {\r\n case 500:\r\n case null:\r\n errors.message = SERVER_ERROR_MESSAGE\r\n break\r\n default:\r\n // Take the message sent from the backend.\r\n const { data }: any = response\r\n errors.message = VALIDATION_ERROR_MESSAGE\r\n if (data.message) {\r\n errors.message = data.message\r\n break\r\n }\r\n\r\n if (data.non_field_errors) {\r\n errors.nonField = data.non_field_errors\r\n break\r\n }\r\n if (data) {\r\n errors.field = data\r\n break\r\n }\r\n }\r\n return Promise.reject(errors)\r\n }\r\n}\r\n\r\nexport const resolveWithStatus = (response: any) => {\r\n const { data, status }: any = response\r\n if (response.ok) {\r\n return Promise.resolve(data)\r\n } else {\r\n const errors: any = {\r\n message: null,\r\n field: null,\r\n nonField: null,\r\n }\r\n switch (status) {\r\n case 500:\r\n case null:\r\n errors.message = SERVER_ERROR_MESSAGE\r\n break\r\n default:\r\n // Take the message sent from the backend.\r\n errors.message = VALIDATION_ERROR_MESSAGE\r\n if (data.message) {\r\n errors.message = data.message\r\n break\r\n }\r\n if (data.non_field_errors) {\r\n errors.nonField = data.non_field_errors\r\n break\r\n }\r\n if (data) {\r\n errors.field = data\r\n break\r\n }\r\n }\r\n return Promise.reject({ status, errors })\r\n }\r\n}\r\n\r\nexport default api\r\n","import { create, ApiResponse } from \"apisauce\"\r\nimport { AxiosRequestConfig } from \"axios\"\r\n\r\nconst bocApi = create({\r\n baseURL: \"https://www.bankofcanada.ca/valet/\",\r\n headers: { \"content-type\": \"application/json\" },\r\n})\r\n\r\nbocApi.addRequestTransform((request: AxiosRequestConfig) => {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n // tslint:disable-next-line\r\n console.log(\"REQUEST: \", request)\r\n }\r\n})\r\n\r\nbocApi.addResponseTransform((response: ApiResponse) => {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n // tslint:disable-next-line\r\n console.log(\"RESPONSE: \", response)\r\n }\r\n})\r\n\r\nexport const resolve = (response: any) => {\r\n if (response.ok) {\r\n return Promise.resolve(response.data)\r\n } else {\r\n if (response.data) {\r\n const { data }: any = response\r\n return Promise.reject(data)\r\n }\r\n return Promise.reject(\"Server application error, please try again later\")\r\n }\r\n}\r\n\r\nexport default bocApi\r\n","import api, { resolve, resolveWithStatus } from \"./api\"\r\nimport { LoginDetails } from \"@/interfaces\"\r\n\r\nconst login = (values: LoginDetails): any =>\r\n api.post(\"auth/\", { ...values }).then(resolveWithStatus)\r\n\r\nconst verify = (token: string) => {\r\n return api.post(\"auth/verify/\", { token }).then(resolve)\r\n}\r\n\r\nconst requestPasswordReset = (values: any): any =>\r\n api.post(\"/password/reset/\", { ...values }).then(resolve)\r\n\r\nconst resetPassword = (token: string, values: any): any =>\r\n api.post(`/password/reset/${token}/`, { ...values }).then(resolve)\r\n\r\nconst validateToken = (token: string): any =>\r\n api.get(`/password/reset/${token}/`).then(resolve)\r\n\r\nconst me = () => api.get(\"me\").then(resolve)\r\n\r\nconst password = (\r\n oldPassword: string,\r\n newPassword: string,\r\n confirmNewPassword: string\r\n) =>\r\n api\r\n .patch(\"me/password/\", {\r\n old_password: oldPassword,\r\n new_password: newPassword,\r\n new_password_2: confirmNewPassword,\r\n })\r\n .then(resolve)\r\n\r\nexport default {\r\n login,\r\n verify,\r\n me,\r\n password,\r\n requestPasswordReset,\r\n resetPassword,\r\n validateToken,\r\n}\r\n","import api, { resolve } from \"./api\"\r\nimport { Params } from \"@/interfaces\"\r\n\r\nconst reportingPeriodConsolidatorParams = {\r\n includes: \"fa,reporting_period\",\r\n \"fields[reporting_period]\":\r\n \"id,calculated_value,start_date,end_date,closing_sep,fx_rate,fx_currency,metadata,foreign_affiliate,fa_business_activity,fa_foreign_tax_law_required,fa_resident_designated_country,fa_business_designated_country,depreciation_election,dividends_taxable_surplus_first,dividends_acb,sep_changes,recharacterized_property_income,fapi,dividends_from_fa,dividends_pay_tax,dividends_paid,dispositions,consolidation_or_group_relief\",\r\n}\r\n\r\n// // Old version of reportingPeriodConsolidatorParams\r\n// const reportingPeriodConsolidatorParams = {\r\n// includes: \"fa,reporting_period\",\r\n// \"fields[reporting_period]\":\r\n// \"id,calculated_value,start_date,end_date,closing_sep,fx_rate,fx_currency,metadata,foreign_affiliate\",\r\n// }\r\n\r\nconst reportingPeriodCalculatorParams = {\r\n includes: \"fa,reporting_period\",\r\n \"fields[reporting_period]\":\r\n \"id,start_date,end_date,closing_sep,fx_rate,fx_currency,metadata,foreign_affiliate\",\r\n}\r\n\r\nconst get = (id?: number | string, params?: Params): any => {\r\n if (id) {\r\n return api\r\n .get(`taxpayers/${id}/`, params || { includes: \"fa\" })\r\n .then(response => resolve(response))\r\n }\r\n return api.get(\"taxpayers/\", params).then(resolve)\r\n}\r\n\r\nconst update = (id: number, values: any): any =>\r\n api.patch(`taxpayers/${id}/`, { ...values }).then(resolve)\r\n\r\nconst create = (values: any): any =>\r\n api.post(\"taxpayers/\", { ...values }).then(resolve)\r\n\r\nconst destroy = (id: string): any =>\r\n api.delete(`/taxpayers/${id}`).then(resolve)\r\n\r\nconst owners = (id: string | number, values: any): any =>\r\n api.put(`/taxpayers/${id}/owners/`, { ...values }).then(resolve)\r\n\r\nconst lockdown = (id: string | number, values: any): any =>\r\n api.put(`/taxpayers/${id}/lockdown/`, { ...values }).then(resolve)\r\n\r\nconst tiering = (id: string | number): any =>\r\n api.get(`/taxpayers/${id}/tiering/`).then(resolve)\r\n\r\nconst profile = (id: string | number, values: any): any =>\r\n api.post(`/taxpayers/${id}/profile/`, { values }).then(resolve)\r\n\r\nconst validateExpiry = (token: string, id: string | number): any =>\r\n api.get(`/taxpayers/${id}/client-access/${token}/`).then(resolve)\r\n\r\nconst extendExpiry = (token: string, id: string | number, owners: any[]): any =>\r\n api.put(`/taxpayers/${id}/client-access/${token}/`, { owners }).then(resolve)\r\n\r\nconst copy = (id: string | number, values: any): any =>\r\n api.post(`taxpayers/${id}/copy/`, { ...values }).then(resolve)\r\n\r\nexport default {\r\n get,\r\n create,\r\n update,\r\n destroy,\r\n owners,\r\n reportingPeriodConsolidatorParams,\r\n reportingPeriodCalculatorParams,\r\n lockdown,\r\n tiering,\r\n profile,\r\n validateExpiry,\r\n extendExpiry,\r\n copy,\r\n}\r\n","import api, { resolve } from \"./api\"\r\nimport { ForeignAffiliate } from \"@/interfaces\"\r\nimport { Params } from \"@/interfaces\"\r\n\r\nconst create = (values: ForeignAffiliate): any =>\r\n api.post(\"foreign-affiliates/\", { ...values }).then(resolve)\r\n\r\nconst upload = (taxpayer: number | string, files: FormData): any => {\r\n return api\r\n .post(`upload/${taxpayer}/`, files, {\r\n headers: {\r\n \"Content-Type\": \"multipart/form-data\",\r\n },\r\n })\r\n .then(resolve)\r\n}\r\n\r\nconst get = (id?: number | string, params?: Params) => {\r\n if (id) {\r\n return api\r\n .get(`foreign-affiliates/${id}/`, { includes: \"reporting_period\" })\r\n .then(resolve)\r\n }\r\n return api.get(`foreign-affiliates/`).then(resolve)\r\n}\r\n\r\nconst update = (values: ForeignAffiliate | any, id: string): any =>\r\n api.patch(`/foreign-affiliates/${id}/`, { ...values }).then(resolve)\r\n\r\nconst destroy = (id: string): any =>\r\n api.delete(`/foreign-affiliates/${id}`).then(resolve)\r\n\r\nconst allowedTiers = (id: string, date: string): any =>\r\n api\r\n .get(`/foreign-affiliates/${id}/allowed-tiers`, {\r\n date,\r\n })\r\n .then(resolve)\r\n\r\nconst copy = (id: string | number, values: any): any =>\r\n api.post(`foreign-affiliates/${id}/copy/`, { ...values }).then(resolve)\r\n\r\nexport default {\r\n update,\r\n create,\r\n get,\r\n destroy,\r\n upload,\r\n allowedTiers,\r\n copy,\r\n}\r\n","import api, { resolve } from \"./api\"\r\n\r\nconst update = (id: string | number, values: any): any =>\r\n api.put(`reporting-periods/${id}/fields/`, values).then(resolve)\r\n\r\nconst saveClosingValues = (id: string | number, values: any): any =>\r\n api.post(`reporting-periods/${id}/calculated-values/`, values).then(resolve)\r\n\r\nconst getClosingValues = (id: string | number): any =>\r\n api.get(`reporting-periods/${id}/calculated-values/`).then(resolve)\r\n\r\nconst saveBulkValues = (id: string | number, values: any) =>\r\n api\r\n .put(`reporting-periods/${id}/calculated-values/bulk/`, values)\r\n .then(resolve)\r\n\r\nexport default {\r\n update,\r\n saveClosingValues,\r\n getClosingValues,\r\n saveBulkValues,\r\n}\r\n","import api, { resolve } from \"./api\"\r\n\r\nconst create = (id: string | number, values: any): any =>\r\n api.post(`reporting-periods/${id}/sep-adjustments/`, values).then(resolve)\r\n\r\nconst remove = (id: string | number, SEPAdjusmentID: string | number): any =>\r\n api\r\n .delete(`reporting-periods/${id}/sep-adjustments/${SEPAdjusmentID}/`)\r\n .then(resolve)\r\n\r\nconst edit = (id: string | number, sep: any): any =>\r\n api\r\n .put(`reporting-periods/${id}/sep-adjustments/${sep.id}/`, sep)\r\n .then(resolve)\r\n\r\nexport default {\r\n create,\r\n remove,\r\n edit,\r\n}\r\n","import api, { resolve } from \"./api\"\r\n\r\nconst get = (id: string | number): any =>\r\n api.get(`reporting-periods/${id}/dividends/`).then(resolve)\r\n\r\nconst create = (id: string | number, values: any): any =>\r\n api.post(`reporting-periods/${id}/dividends/`, values).then(resolve)\r\n\r\nconst remove = (id: string | number, dividendID: string | number): any =>\r\n api.delete(`reporting-periods/${id}/dividends/${dividendID}/`).then(resolve)\r\n\r\nconst edit = (id: string | number, dividend: any): any =>\r\n api\r\n .put(`reporting-periods/${id}/dividends/${dividend.id}/`, dividend)\r\n .then(resolve)\r\n\r\nexport default {\r\n create,\r\n remove,\r\n edit,\r\n get,\r\n}\r\n","import api, { resolve } from \"./api\"\r\n\r\nconst create = (id: string | number, values: any): any =>\r\n api.post(`reporting-periods/${id}/adjustments/`, values).then(resolve)\r\n\r\nconst remove = (id: string | number, adjustmentID: string | number): any =>\r\n api\r\n .delete(`reporting-periods/${id}/adjustments/${adjustmentID}/`)\r\n .then(resolve)\r\n\r\nconst edit = (id: string | number, adj: any): any =>\r\n api.put(`reporting-periods/${id}/adjustments/${adj.id}/`, adj).then(resolve)\r\n\r\nexport default {\r\n create,\r\n remove,\r\n edit,\r\n}\r\n","import api, { resolve } from \"./api\"\r\n\r\nconst create = (id: string | number, values: any): any =>\r\n api.post(`reporting-periods/${id}/fields/`, values).then(resolve)\r\n\r\nconst createBulk = (id: string | number, values: any[]): any =>\r\n api\r\n .post(`reporting-periods/${id}/fields/bulk/`, { fields: values })\r\n .then(resolve)\r\n\r\nconst duplicate = (id: string | number, values: any): any =>\r\n api.post(`reporting-periods/${id}/fields/duplicate/`, values).then(resolve)\r\n\r\nconst remove = (id: string | number, fieldId: string | number): any =>\r\n api.delete(`reporting-periods/${id}/fields/${fieldId}/`).then(resolve)\r\n\r\nconst removeBulk = (id: string | number, fieldIds: string | number): any =>\r\n api\r\n .delete(\r\n `reporting-periods/${id}/fields/bulk/`,\r\n {},\r\n {\r\n data: {\r\n fields: fieldIds,\r\n },\r\n }\r\n )\r\n .then(resolve)\r\n\r\nconst edit = (id: string | number, field: any): any =>\r\n api.put(`reporting-periods/${id}/fields/${field.id}/`, field).then(resolve)\r\n\r\nexport default {\r\n create,\r\n remove,\r\n createBulk,\r\n removeBulk,\r\n edit,\r\n duplicate,\r\n}\r\n","import api, { resolve } from \"./api\"\r\n\r\nconst create = (id: string | number, values: any): any =>\r\n api\r\n .post(`reporting-periods/${id}/disposition-adjustments/`, values)\r\n .then(resolve)\r\n\r\nconst remove = (id: string | number, adjustmentID: string | number): any =>\r\n api\r\n .delete(`reporting-periods/${id}/disposition-adjustments/${adjustmentID}/`)\r\n .then(resolve)\r\n\r\nconst edit = (id: string | number, adj: any): any =>\r\n api\r\n .put(`reporting-periods/${id}/disposition-adjustments/${adj.id}/`, adj)\r\n .then(resolve)\r\n\r\nexport default {\r\n create,\r\n remove,\r\n edit,\r\n}\r\n","import api, { resolve } from \"./api\"\r\n\r\nconst update = (profileId: string | number, values: any): any =>\r\n api.put(`output-profiles/${profileId}/`, { ...values }).then(resolve)\r\n\r\nconst destroy = (profileId: string | number): any =>\r\n api.delete(`output-profiles/${profileId}/`).then(resolve)\r\n\r\nconst createUserProfile = (userId: string | number, values: any): any =>\r\n api.post(`output-profiles/user/${userId}/`, { ...values }).then(resolve)\r\n\r\nconst createTaxpayerProfile = (taxpayerId: any, values: any): any =>\r\n api\r\n .post(`output-profiles/taxpayer/${taxpayerId}/`, { ...values })\r\n .then(resolve)\r\n\r\nexport default {\r\n update,\r\n destroy,\r\n createUserProfile,\r\n createTaxpayerProfile,\r\n}\r\n","import api, { resolve } from \"./api\"\r\n\r\nconst getAll = (): any => api.get(\"/users/\").then(resolve)\r\n\r\nexport default {\r\n getAll,\r\n}\r\n","import bocApi, { resolve } from \"./bocApi\"\r\n\r\nconst get = (values: any): any => {\r\n const { conversions, startDate, endDate } = values\r\n let fxQuery = \"\"\r\n conversions.forEach((conversion: any) => {\r\n let { from, to } = conversion\r\n from = (from as string).toUpperCase()\r\n to = (to as string).toUpperCase()\r\n // Skip from, to is the same\r\n if (from == to) {\r\n return\r\n }\r\n // Comma separate if more than one\r\n if (fxQuery !== \"\") {\r\n fxQuery += \",\"\r\n }\r\n fxQuery += `FX${from}${to}`\r\n })\r\n if (fxQuery) {\r\n return bocApi\r\n .get(`observations/${fxQuery}`, {\r\n start_date: startDate,\r\n end_date: endDate,\r\n })\r\n .then(resolve)\r\n }\r\n\r\n return Promise.reject()\r\n}\r\n\r\nexport default {\r\n get,\r\n}\r\n","import api, { resolve } from \"./api\"\r\n\r\nconst get = (id: string | number): any =>\r\n api.get(`/reporting-periods/${id}/comment/`).then(resolve)\r\n\r\nconst post = (id: string | number, payload: any): any =>\r\n api.post(`/reporting-periods/${id}/comment/`, payload).then(resolve)\r\n\r\nconst remove = (id: string | number, comment_id: any): any =>\r\n api.delete(`/reporting-periods/${id}/comment/${comment_id}/`).then(resolve)\r\n\r\nconst putResolve = (\r\n id: string | number,\r\n comment_id: any,\r\n resolved: boolean\r\n): any =>\r\n api\r\n .put(`/reporting-periods/${id}/comment/${comment_id}/resolve/`, {\r\n resolved,\r\n })\r\n .then(resolve)\r\n\r\nexport default {\r\n get,\r\n post,\r\n remove,\r\n putResolve,\r\n}\r\n","import api, { resolve } from \"./api\"\r\n\r\nconst post = (model_name: string, id: number | string): any =>\r\n api.post(`/review/${model_name}/${id}/`).then(resolve)\r\n\r\nconst remove = (model_name: string, id: number | string): any =>\r\n api.delete(`/review/${model_name}/${id}/`).then(resolve)\r\n\r\nexport default {\r\n post,\r\n remove,\r\n}\r\n","\n\n\n\n\n\n\n\n\r\nimport { Vue, Component, Watch, Prop } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport _ from \"lodash\"\r\n// Project Imports\r\nimport UserMixin from \"../mixins/UserMixin\"\r\nimport { Taxpayer, ForeignAffiliate } from \"../interfaces\"\r\nimport { taxpayer } from \"../services/api\"\r\n\r\n@Component\r\nexport default class Breadcrumbs extends mixins(UserMixin) {\r\n @Prop()\r\n public activeTaxpayer!: Taxpayer\r\n @Prop()\r\n public activeForeignAffiliate!: ForeignAffiliate\r\n\r\n public order: any = {\r\n taxpayer: {\r\n text: \"Tax Payer\",\r\n to: { name: \"taxpayer\" },\r\n order: 2,\r\n },\r\n \"foreign-affiliate\": {\r\n text: \"Foreign Affiliate\",\r\n to: { name: \"foreign-affiliate\" },\r\n order: 3,\r\n },\r\n }\r\n\r\n public items: any[] = []\r\n\r\n @Watch(\"$route\", { deep: true })\r\n public setBreadcrumbs() {\r\n const { name, params } = this.$route\r\n const orderItem = name && this.order[name]\r\n if (orderItem) {\r\n // Change the name of the breadcrumbs based on the route\r\n switch (name) {\r\n case \"foreign-affiliate\":\r\n if (this.activeForeignAffiliate) {\r\n const id = this.activeForeignAffiliate.taxpayer\r\n\r\n this.order[name].text = this.activeForeignAffiliate.name\r\n this.order[\"taxpayer\"].to.params = {\r\n id,\r\n }\r\n\r\n // Since taxpayer not available, need to make API call to get its info\r\n taxpayer.get(id, { includes: \"\" }).then((res: any) => {\r\n this.order[\"taxpayer\"].text = res.name\r\n })\r\n }\r\n break\r\n case \"taxpayer\":\r\n if (this.activeTaxpayer) {\r\n this.order[name].text = this.activeTaxpayer.name\r\n }\r\n break\r\n }\r\n\r\n orderItem.to = { ...orderItem.to, params }\r\n const newItems = _.chain(this.order)\r\n .filter(o => {\r\n return o.order <= orderItem.order\r\n })\r\n // @ts-ignore\r\n .orderBy([\"order\"], [\"asc\"])\r\n .value()\r\n\r\n this.items = newItems\r\n }\r\n }\r\n\r\n public mounted() {\r\n this.setBreadcrumbs()\r\n }\r\n}\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Breadcrumbs.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Breadcrumbs.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Breadcrumbs.vue?vue&type=template&id=5f426fd8&\"\nimport script from \"./Breadcrumbs.vue?vue&type=script&lang=ts&\"\nexport * from \"./Breadcrumbs.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-container',{staticClass:\"mt-4 text-muted text-center\"},[_c('p',{staticClass:\"disclaimer\"},[_vm._v(\"\\n Please use Google Chrome to access the Surplus Calculator.\\n \")]),_vm._l((_vm.strings[\n _vm.getEnv('VUE_APP_CLIENT_APP') == 'true'\n ? 'CLIENT_DISCLAIMER'\n : 'INTERNAL_DISCLAIMER'\n ]),function(text,index){return _c('p',{key:index,staticClass:\"disclaimer\",domProps:{\"innerHTML\":_vm._s(text)}})}),(_vm.getEnv('VUE_APP_CLIENT_APP') == 'true')?_c('p',{staticClass:\"disclaimer\"},[_c('router-link',{attrs:{\"to\":{ name: 'termsOfUse' }}},[_vm._v(\"Terms of Use – Surplus Calculator (Client Module)\")])],1):_vm._e(),(_vm.getEnv('VUE_APP_VERSION'))?_c('small',[_vm._v(\"Version: \"+_vm._s(_vm.getEnv(\"VUE_APP_VERSION\")))]):_vm._e()],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\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\r\nimport { Component } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport StringsMixin from \"../mixins/StringsMixin\"\r\nimport EnvMixin from \"../mixins/EnvMixin\"\r\n\r\n@Component\r\nexport default class Disclaimer extends mixins(EnvMixin, StringsMixin) {}\r\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Disclaimer.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/ts-loader/index.js??ref--13-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Disclaimer.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Disclaimer.vue?vue&type=template&id=98796d06&scoped=true&\"\nimport script from \"./Disclaimer.vue?vue&type=script&lang=ts&\"\nexport * from \"./Disclaimer.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./Disclaimer.vue?vue&type=style&index=0&id=98796d06&scoped=true&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"98796d06\",\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-alert',{staticClass:\"mt-3\",attrs:{\"variant\":\"warning\",\"show\":_vm.isAppIdle && _vm.isAuthenticated}},[_vm._v(\"You have been inactive for \"+_vm._s(_vm.idleMinutes)+\" minutes. Logging out in\\n \"+_vm._s(_vm.logoutTimeoutSeconds)+\" seconds.\")])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\r\nimport { Component, Prop, Watch, Emit, Vue } from \"vue-property-decorator\"\r\nimport { mixins } from \"vue-class-component\"\r\nimport UserMixin from \"../../mixins/UserMixin\"\r\nimport EnvMixin from \"../../mixins/EnvMixin\"\r\n\r\n@Component\r\nexport default class IdleAlert extends mixins(UserMixin, EnvMixin) {\r\n public timeout!: any\r\n public isAppIdle!: boolean\r\n public logoutTimeoutSeconds: number = 10\r\n public idleMinutes: number = this.getEnv(\"VUE_APP_IDLE_MINS\") || 15\r\n\r\n @Watch(\"isAppIdle\")\r\n public idleChange() {\r\n if (this.isAuthenticated) {\r\n if (this.isAppIdle) {\r\n const timeoutLogout = () => {\r\n this.logout()\r\n }\r\n this.timeout = setTimeout(\r\n timeoutLogout,\r\n this.logoutTimeoutSeconds * 1000\r\n )\r\n } else {\r\n clearTimeout(this.timeout)\r\n }\r\n }\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./IdleAlert.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--13-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./IdleAlert.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./IdleAlert.vue?vue&type=template&id=530c2cea&\"\nimport script from \"./IdleAlert.vue?vue&type=script&lang=ts&\"\nexport * from \"./IdleAlert.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport { Component, Vue } from \"vue-property-decorator\"\r\n// Project Imports\r\nimport Navigation from \"@/components/Navigation.vue\"\r\nimport Breadcrumbs from \"@/components/Breadcrumbs.vue\"\r\nimport Disclaimer from \"@/components/Disclaimer.vue\"\r\nimport IdleAlert from \"@/components/utils/IdleAlert.vue\"\r\n\r\n@Component({\r\n components: { Navigation, Breadcrumbs, Disclaimer, IdleAlert },\r\n})\r\nexport default class App extends Vue {}\r\n","import mod from \"-!../node_modules/cache-loader/dist/cjs.js??ref--13-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js!../node_modules/ts-loader/index.js??ref--13-3!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../node_modules/cache-loader/dist/cjs.js??ref--13-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js!../node_modules/ts-loader/index.js??ref--13-3!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./App.vue?vue&type=template&id=4064df60&\"\nimport script from \"./App.vue?vue&type=script&lang=ts&\"\nexport * from \"./App.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./App.vue?vue&type=style&index=0&lang=scss&\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import Vue from \"vue\"\r\nimport App from \"./App.vue\"\r\nimport router from \"./router\"\r\nimport store from \"./store\"\r\nimport BootstrapVue from \"bootstrap-vue\"\r\nimport IdleVue from \"idle-vue\"\r\n// Style Import (Includes Bootstrap CSS imports)\r\nimport \"@/style/app.scss\"\r\nimport \"vue-search-select/dist/VueSearchSelect.css\"\r\n// Font Awesome Icon Imports\r\nimport { library } from \"@fortawesome/fontawesome-svg-core\"\r\nimport {\r\n faChevronUp,\r\n faChevronRight,\r\n faChevronCircleRight,\r\n faChevronLeft,\r\n faInfoCircle,\r\n faCog,\r\n faPlusSquare,\r\n faTrash,\r\n faSearch,\r\n faEdit,\r\n faExclamationTriangle,\r\n faChevronCircleDown,\r\n faExchangeAlt,\r\n faBars,\r\n faMinusCircle,\r\n faPlusCircle,\r\n faLock,\r\n faLockOpen,\r\n faEllipsisH,\r\n faPlus,\r\n faSave,\r\n faChevronDown,\r\n faSortAmountDown,\r\n faSortAmountUp,\r\n faColumns,\r\n faPen,\r\n faFileMedicalAlt,\r\n faUserLock,\r\n faEye,\r\n faEyeSlash,\r\n faCheckCircle,\r\n faSyncAlt,\r\n faTrashAlt,\r\n faPaperPlane,\r\n faComments,\r\n faUserCheck,\r\n faUserSlash,\r\n faCheck,\r\n faCopy,\r\n faClock,\r\n faMapMarkerAlt,\r\n faUser,\r\n faListAlt,\r\n faCircle,\r\n faDotCircle,\r\n faFileAlt,\r\n faCalendar,\r\n faExpand,\r\n faCompress,\r\n} from \"@fortawesome/free-solid-svg-icons\"\r\nimport { FontAwesomeIcon } from \"@fortawesome/vue-fontawesome\"\r\nimport Loader from \"@/components/utils/Loader.vue\"\r\n\r\nlibrary.add(\r\n faPlusSquare,\r\n faChevronUp,\r\n faChevronRight,\r\n faChevronLeft,\r\n faChevronDown,\r\n faInfoCircle,\r\n faCog,\r\n faTrash,\r\n faSearch,\r\n faEdit,\r\n faExclamationTriangle,\r\n faChevronCircleDown,\r\n faChevronCircleRight,\r\n faExchangeAlt,\r\n faBars,\r\n faMinusCircle,\r\n faPlusCircle,\r\n faLock,\r\n faLockOpen,\r\n faEllipsisH,\r\n faPlus,\r\n faSave,\r\n faColumns,\r\n faPen,\r\n faFileMedicalAlt,\r\n faSortAmountDown,\r\n faSortAmountUp,\r\n faUserLock,\r\n faEye,\r\n faEyeSlash,\r\n faCheckCircle,\r\n faSyncAlt,\r\n faTrashAlt,\r\n faPaperPlane,\r\n faComments,\r\n faUserCheck,\r\n faUserSlash,\r\n faCheck,\r\n faCopy,\r\n faClock,\r\n faMapMarkerAlt,\r\n faUser,\r\n faListAlt,\r\n faCircle,\r\n faDotCircle,\r\n faFileAlt,\r\n faCalendar,\r\n faExpand,\r\n faCompress\r\n)\r\n\r\nVue.use(BootstrapVue)\r\nVue.use(IdleVue, {\r\n store,\r\n moduleName: \"idle\",\r\n startAtIdle: false,\r\n idleTime: (process.env.VUE_APP_IDLE_MINS || 15) * 60000,\r\n})\r\nVue.component(\"font-awesome-icon\", FontAwesomeIcon)\r\nVue.component(\"loader\", Loader)\r\nVue.config.productionTip = false\r\n\r\nnew Vue({\r\n router,\r\n store,\r\n render: h => h(App),\r\n}).$mount(\"#app\")\r\n","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CommentRow.vue?vue&type=style&index=0&id=16e2e2fc&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CommentRow.vue?vue&type=style&index=0&id=16e2e2fc&lang=scss&scoped=true&\"","module.exports = __webpack_public_path__ + \"img/logo.9fe5762b.png\";","import mod from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ForeignAffiliate.vue?vue&type=style&index=0&lang=scss&\"; export default mod; export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ForeignAffiliate.vue?vue&type=style&index=0&lang=scss&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FAConsolidatorSettings.vue?vue&type=style&index=0&id=6297223d&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FAConsolidatorSettings.vue?vue&type=style&index=0&id=6297223d&lang=scss&scoped=true&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorInput.vue?vue&type=style&index=0&id=27ec1a51&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./CalculatorInput.vue?vue&type=style&index=0&id=27ec1a51&lang=scss&scoped=true&\"","import mod from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PeriodCallout.vue?vue&type=style&index=0&id=332ccc93&scoped=true&lang=scss&\"; export default mod; export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/index.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/lib/loader.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PeriodCallout.vue?vue&type=style&index=0&id=332ccc93&scoped=true&lang=scss&\""],"sourceRoot":""}