TimeTrex/interface/html5/dist/payroll-remittance_wizard-PayrollRemittanceAgencyEventWizardController.bundle.js

1 line
72 KiB
JavaScript

"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["payroll-remittance_wizard-PayrollRemittanceAgencyEventWizardController","payroll-remittance_wizard-PayrollRemittanceAgencyEventWizard","wizard-Wizard"],{3207:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Wizard\": () => (/* binding */ Wizard)\n/* harmony export */ });\n/* harmony import */ var _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6739);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n/**\n * For an example of implementation see: interface/html5/views/payroll/remittance_wizard/PayrollRemittanceAgencyEventWizard.js\n *\n * CRITICAL: ALL WIZARDS MUST HAVE A HOME STEP SO THAT THEY HAVE SOMEWHERE TO START.\n **/\n\n\n\nclass Wizard extends _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__.TTBackboneView {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tcurrent_step: false,\n\t\t\twizard_id: 'generic_wizard',\n\t\t\twizard_name: $.i18n._( 'Wizard' ),\n\t\t\tstep_history: {},\n\t\t\tstep_objects: {},\n\t\t\tel: $( '.wizard' ),\n\t\t\tprevious_wizard: null,\n\t\t\t_step_map: null,\n\t\t\tdo_not_initialize_onload: false, //when this flag is set, initialize will not be run automagically.\n\t\t\texternal_data: null,\n\t\t\tevents: {\n\t\t\t\t'click .close-btn': 'onCloseClick',\n\t\t\t\t'click .close-icon': 'onCloseClick',\n\t\t\t\t'click .wizard-overlay.onclick-close': 'onCloseClick',\n\t\t\t\t'click .forward-btn': 'onNextClick',\n\t\t\t\t'click .back-btn': 'onPrevClick',\n\t\t\t\t'click .done-btn': 'onDone'\n\t\t\t}\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinitialize( options ) {\n\t\tsuper.initialize( options );\n\n\t\tif ( options && options.external_data ) {\n\t\t\tthis.setExternalData( options.external_data );\n\t\t}\n\n\t\tif ( !this.do_not_initialize_onload ) {\n\t\t\tthis.step_history = {};\n\t\t\tthis.step_objects = {};\n\t\t\tvar $this = this;\n\n\t\t\tthis.initStepObject( ( this.getCurrentStepName() ? this.getCurrentStepName() : 'home' ), function( obj ) {\n\t\t\t\t$this.init();\n\t\t\t\t$this.render();\n\t\t\t\t$this.enableButtons();\n\n\n\t\t\t\tif ( $this.wizard_id === null ) {\n\t\t\t\t\t$this.wizard_id = $this.constructor.name;\n\t\t\t\t}\n\n\t\t\t\tif ( LocalCacheData.current_open_wizard_controllers.some( wizard => wizard.wizard_id === $this.wizard_id ) ) {\n\t\t\t\t\t$this.previous_wizard = LocalCacheData.current_open_wizard_controllers.find( wizard => wizard.wizard_id === $this.wizard_id );\n\t\t\t\t} else {\n\t\t\t\t\t$this.previous_wizard = false;\n\t\t\t\t}\n\n\t\t\t\tLocalCacheData.current_open_wizard_controllers.push( $this );\n\t\t\t} );\n\t\t}\n\t}\n\n\t//always override\n\tinit() {\n\t\treturn;\n\t}\n\n\tsetExternalData( data ) {\n\t\tthis.external_data = data;\n\t}\n\n\tgetExternalData() {\n\t\treturn this.external_data;\n\t}\n\n\tonNextClick( e ) {\n\t\tif ( this.button_click_procesing == true ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( this.getStepObject().isRequiredButtonsClicked() == false ) { //On last step.\n\t\t\tvar $this = this;\n\t\t\tTAlertManager.showConfirmAlert( $.i18n._( '<strong>WARNING</strong>: You are about to proceed to the next step without performing all required actions! <br><br><strong>This may result in payments or reports not being submitted to this agency.</strong> <br><br>Are you sure you wish to continue?<br><br>' ), null, function( flag ) {\n\t\t\t\tif ( flag === true ) {\n\t\t\t\t\t//Log the fact that the user skipped a step.\n\t\t\t\t\tvar api_payroll_remittance_agency_event = TTAPI.APIPayrollRemittanceAgencyEvent;\n\t\t\t\t\tapi_payroll_remittance_agency_event.doLogWizardEvent( $this.getStepObject().getWizardObject().selected_remittance_agency_event_id, 'step', $this.getStepObject().current_step, 'skip', false, true, {\n\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t\t$this.onNextClickComplete( e );\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\tif ( this.getStepObject().current_step == 'home' ) {\n\t\t\t\tvar api_payroll_remittance_agency_event = TTAPI.APIPayrollRemittanceAgencyEvent;\n\t\t\t\tapi_payroll_remittance_agency_event.doLogWizardEvent( this.getStepObject().getWizardObject().selected_remittance_agency_event_id, 'wizard', this.getStepObject().current_step, 'start', false, true, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tvar api_payroll_remittance_agency_event = TTAPI.APIPayrollRemittanceAgencyEvent;\n\t\t\t\tapi_payroll_remittance_agency_event.doLogWizardEvent( this.getStepObject().getWizardObject().selected_remittance_agency_event_id, 'step', this.getStepObject().current_step, 'complete', false, true, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tthis.onNextClickComplete( e );\n\t\t}\n\t}\n\n\tonNextClickComplete( e ) {\n\t\tif ( $( e.target ).hasClass( 'disable-image' ) == false ) {\n\t\t\tthis.disableButtons();\n\n\t\t\tvar name = this.getStepObject().getNextStepName();\n\t\t\tvar $this = this;\n\t\t\tthis.initStepObject( name, function( step_obj ) {\n\t\t\t\tstep_obj.setPreviousStepName( $this.getCurrentStepName() );\n\t\t\t\t$this.setCurrentStepName( name );\n\t\t\t\t//$this.enableButtons(); //This should be done at the end of each _render() function to avoid race conditions and hammer clicking right arrow causing JS exceptions.\n\t\t\t} );\n\t\t}\n\t}\n\n\tonPrevClick( e ) {\n\t\tif ( this.button_click_procesing == true ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( e === true || $( e.target ).hasClass( 'disable-image' ) == false ) {\n\t\t\tthis.disableButtons();\n\n\t\t\tvar name = this.getStepObject().getPreviousStepName();\n\t\t\tvar $this = this;\n\n\t\t\t//Needs to be initialized in the event that we came back from the min_tab.\n\t\t\tthis.initStepObject( name, function( step_obj ) {\n\t\t\t\t//step_obj.setPreviousStepName($this.getCurrentStepName());\n\t\t\t\t$this.setCurrentStepName( name );\n\t\t\t\t//$this.enableButtons(); //This should be done at the end of each _render() function to avoid race conditions and hammer clicking right arrow causing JS exceptions.\n\t\t\t} );\n\t\t}\n\t}\n\n\tonCloseClick( e ) {\n\t\tif ( !e || $( e.target ).hasClass( 'disable-image' ) == false ) {\n\t\t\tvar $this = this;\n\n\t\t\tif ( this.getStepObject().getPreviousStepName() !== false && this.getStepObject().getNextStepName() !== false ) { //Not on first step, and not last step\n\t\t\t\tTAlertManager.showConfirmAlert( $.i18n._( 'Are you sure you wish to cancel without completing all steps for this event?' ), null, function( flag ) {\n\t\t\t\t\tif ( flag === true ) {\n\t\t\t\t\t\tvar api_payroll_remittance_agency_event = TTAPI.APIPayrollRemittanceAgencyEvent;\n\t\t\t\t\t\tapi_payroll_remittance_agency_event.doLogWizardEvent( $this.getStepObject().getWizardObject().selected_remittance_agency_event_id, 'wizard', $this.getStepObject().current_step, 'cancel', false, true, {\n\t\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t$this.cleanUp();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} else if ( this.getStepObject().getNextStepName() == false ) { //On last step.\n\t\t\t\tif ( this.getStepObject().isRequiredButtonsClicked() == false ) { //Required actions are not performed.\n\t\t\t\t\tTAlertManager.showConfirmAlert( $.i18n._( '<strong>WARNING</strong>: You are about to cancel without performing all required actions on this step! <br><br><strong>This may result in payments or reports not being submitted to this agency.</strong> <br><br>Are you sure you wish to continue?<br><br>' ), null, function( flag ) {\n\t\t\t\t\t\tif ( flag === true ) {\n\t\t\t\t\t\t\tvar api_payroll_remittance_agency_event = TTAPI.APIPayrollRemittanceAgencyEvent;\n\t\t\t\t\t\t\tapi_payroll_remittance_agency_event.doLogWizardEvent( $this.getStepObject().getWizardObject().selected_remittance_agency_event_id, 'wizard', $this.getStepObject().current_step, 'cancel', false, true, {\n\t\t\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t$this.cleanUp();\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t} else { //Required actions ARE performed.\n\t\t\t\t\tTAlertManager.showConfirmAlert( $.i18n._( 'Are you sure you wish to cancel without marking this event as completed?' ), null, function( flag ) {\n\t\t\t\t\t\tif ( flag === true ) {\n\t\t\t\t\t\t\tvar api_payroll_remittance_agency_event = TTAPI.APIPayrollRemittanceAgencyEvent;\n\t\t\t\t\t\t\tapi_payroll_remittance_agency_event.doLogWizardEvent( $this.getStepObject().getWizardObject().selected_remittance_agency_event_id, 'wizard', $this.getStepObject().current_step, 'cancel', false, true, {\n\t\t\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t$this.cleanUp();\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar api_payroll_remittance_agency_event = TTAPI.APIPayrollRemittanceAgencyEvent;\n\t\t\t\tapi_payroll_remittance_agency_event.doLogWizardEvent( this.getStepObject().getWizardObject().selected_remittance_agency_event_id, 'wizard', this.getStepObject().current_step, 'complete', false, true, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\t$this.cleanUp();\n\t\t\t}\n\t\t}\n\t}\n\n\tonDone( e ) {\n\t\tif ( !e || $( e.target ).hasClass( 'disable-image' ) == false ) {\n\t\t\tvar $this = this;\n\n\t\t\tif ( this.getStepObject().getNextStepName() == false && this.getStepObject().isRequiredButtonsClicked() == false ) { //On last step.\n\t\t\t\tTAlertManager.showConfirmAlert( $.i18n._( '<strong>WARNING</strong>: You are about to mark this event as completed without performing all required actions on this step! <br><br><strong>This may result in payments or reports not being submitted to this agency.</strong> <br><br>Are you sure you wish to continue?<br><br>' ), null, function( flag ) {\n\t\t\t\t\tif ( flag === true ) {\n\t\t\t\t\t\tvar api_payroll_remittance_agency_event = TTAPI.APIPayrollRemittanceAgencyEvent;\n\t\t\t\t\t\tapi_payroll_remittance_agency_event.doLogWizardEvent( $this.getStepObject().getWizardObject().selected_remittance_agency_event_id, 'step', $this.getStepObject().current_step, 'skip', false, true, {\n\t\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t\t\tvar api_payroll_remittance_agency_event = TTAPI.APIPayrollRemittanceAgencyEvent;\n\t\t\t\t\t\t\t\tapi_payroll_remittance_agency_event.doLogWizardEvent( $this.getStepObject().getWizardObject().selected_remittance_agency_event_id, 'wizard', $this.getStepObject().current_step, 'complete', false, true, {\n\t\t\t\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t$this.onDoneComplete();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tvar api_payroll_remittance_agency_event = TTAPI.APIPayrollRemittanceAgencyEvent;\n\t\t\t\tapi_payroll_remittance_agency_event.doLogWizardEvent( this.getStepObject().getWizardObject().selected_remittance_agency_event_id, 'wizard', this.getStepObject().current_step, 'complete', false, true, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\t$this.onDoneComplete();\n\t\t\t}\n\t\t}\n\t}\n\n\t//Override this function to perform other actions when the user clicks the green checkmark to complete the wizard.\n\tonDoneComplete( e ) {\n\t\t$this.cleanUp();\n\t}\n\n\taddStepObject( name, obj ) {\n\t\t//always override.\n\t\tthis.step_objects[name] = obj;\n\t\treturn this.step_objects[name]; //returned for chaining.\n\t}\n\n\tgetStepObject( name ) {\n\t\tif ( typeof name == 'undefined' ) {\n\t\t\tname = this.getCurrentStepName();\n\t\t}\n\n\t\tif ( typeof this.step_objects[name] == 'object' ) {\n\t\t\treturn this.step_objects[name];\n\t\t}\n\t\treturn this.step_objects['home'];\n\t}\n\n\tgetCurrentStepName() {\n\t\treturn this.current_step;\n\t}\n\n\tsetCurrentStepName( val ) {\n\t\tthis.current_step = val;\n\t}\n\n\t//Stub to stop backbone from complaining that it's missing, Wizard really doesn't render itself as such, it just displays its template.\n\trender() {\n\t}\n\n\t/*\n\t * Clean up the markup.\n\t */\n\tcleanUp() {\n\t\t$( this.el ).remove();\n\t\tfor ( var n in this.step_objects ) {\n\t\t\tif ( this.step_objects[n] ) {\n\t\t\t\tthis.step_objects[n].reload = true;\n\t\t\t}\n\t\t}\n\n\t\tLocalCacheData.current_open_wizard_controllers = LocalCacheData.current_open_wizard_controllers.filter( wizard => wizard.wizard_id !== this.wizard_id );\n\n\t\t$().TFeedback( {\n\t\t\tsource: this.wizard_id\n\t\t} );\n\t}\n\n\t/**\n\t * setup a step object\n\t *\n\t * @param name\n\t * @param callback\n\t */\n\tinitStepObject( name, callback ) {\n\t\tif ( this._step_map.hasOwnProperty( name ) ) {\n\t\t\tif ( this.step_objects[name] == null || typeof this.step_objects[name] != 'object' ) {\n\t\t\t\tvar $this = this;\n\t\t\t\tGlobal.loadScript( this._step_map[name].script_path, function() {\n\t\t\t\t\t$this.setCurrentStepName( name );\n\t\t\t\t\t$( $this.el ).find( '.content' ).html( '' );\n\n\t\t\t\t\t//var obj = new window[$this._step_map[name].object_name]( $this );\n\t\t\t\t\tvar obj = eval( 'new ' + $this._step_map[name].object_name + '( $this );' );\n\t\t\t\t\tobj.reload = false;\n\t\t\t\t\t$this.addStepObject( name, obj );\n\n\t\t\t\t\tif ( typeof callback == 'function' ) {\n\t\t\t\t\t\tcallback( obj );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\t//reopening a step\n\t\t\t\tthis.setCurrentStepName( name );\n\t\t\t\tif ( typeof callback == 'function' ) {\n\t\t\t\t\tvar obj = this.step_objects[name];\n\n\t\t\t\t\t$( this.el ).find( '.content' ).html( '' );\n\t\t\t\t\t//obj = new window[this._step_map[name].object_name]( this );\n\t\t\t\t\tvar obj = eval( 'new ' + this._step_map[name].object_name + '( this );' );\n\n\t\t\t\t\t//reopening a step that has been opened in a previously closed wizard.\n\t\t\t\t\tif ( this.step_objects[name].reload == true ) {\n\t\t\t\t\t\tobj.clicked_buttons = {};\n\t\t\t\t\t\tobj.reload = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.addStepObject( name, obj );\n\n\t\t\t\t\tcallback( obj );\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n\n\tdisableButtons() {\n\t\tthis.button_click_procesing = true;\n\n\t\t//Changing the button images causes flashing and isn't required for just disabling the buttons while the view loads.\n\t\t// $( this.el ).find( '.forward-btn' ).addClass( 'disable-image' );\n\t\t// $( this.el ).find( '.back-btn' ).addClass( 'disable-image' );\n\t}\n\n\t/**\n\t * Enables the next/prev buttons\n\t * the step object for the first step should return false instead fo a previous step name to disable the previous button\n\t * the step object for the last step should return false instead of a next step name to disable the next button and enable the done button.\n\t */\n\tenableButtons() {\n\t\tvar step = this.getStepObject();\n\n\t\tif ( typeof step.getNextStepName() != 'string' ) {\n\t\t\t$( this.el ).find( '.forward-btn' ).addClass( 'disable-image' );\n\t\t\t$( this.el ).find( '.done-btn' ).removeClass( 'disable-image' ); //When right arrow is disabled, assume last step and enable done button.\n\t\t} else {\n\t\t\t$( this.el ).find( '.forward-btn' ).removeClass( 'disable-image' );\n\t\t\t$( this.el ).find( '.done-btn' ).addClass( 'disable-image' ); //When right arrow is enabled, assume *not* last step, disable done button.\n\t\t}\n\n\t\tif ( typeof step.getPreviousStepName() != 'string' ) {\n\t\t\t$( this.el ).find( '.back-btn' ).addClass( 'disable-image' );\n\t\t} else {\n\t\t\t$( this.el ).find( '.back-btn' ).removeClass( 'disable-image' );\n\t\t}\n\n\t\tthis._enableButtons();\n\n\t\tthis.button_click_procesing = false;\n\t}\n\n\t//override me.\n\t_enableButtons() {\n\t}\n\n\t/**\n\t * minimize the wiazrd to a min_tab\n\t */\n\tminimize() {\n\t\tLocalCacheData.PayrollRemittanceAgencyEventWizardController = this;\n\t\t//Remove from current_open_wizard_controllers so that when opening a new wizard the user does not get\n\t\t//a message asking them to close the previous (minimized) wizard that is not viewable.\n\t\tLocalCacheData.current_open_wizard_controllers = LocalCacheData.current_open_wizard_controllers.filter( wizard => wizard.wizard_id !== this.wizard_id );\n\t\tGlobal.addViewTab( this.wizard_id, this.wizard_name, window.location.href );\n\t\tthis.delegateEvents();\n\t\t$( this.el ).remove();\n\t}\n\n\treload() {\n\t\tfor ( var i in this.step_objects ) {\n\t\t\tthis.step_objects[i].reload = true;\n\t\t}\n\t}\n\n\tdisableForCommunity( callback ) {\n\t\tif ( Global.getProductEdition() <= 10 ) {\n\t\t\tTAlertManager.showAlert( Global.getUpgradeMessage(), $.i18n._( 'Denied' ) );\n\t\t} else {\n\t\t\tif ( typeof callback == 'function' ) {\n\t\t\t\tcallback();\n\t\t\t}\n\t\t}\n\n\t}\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzIwNy5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFd0Q7O0FBRWpELHFCQUFxQixpRUFBYztBQUMxQywyQkFBMkI7QUFDM0IsRUFBRSxDQUFDO0FBQ0g7QUFDQTtBQUNBLGdCQUFnQixDQUFDO0F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xvYWQoKSB7XG5cdFx0Zm9yICggdmFyIGkgaW4gdGhpcy5zdGVwX29iamVjdHMgKSB7XG5cdFx0XHR0aGlzLnN0ZXBfb2JqZWN0c1tpXS5yZWxvYWQgPSB0cnVlO1xuXHRcdH1cblx0fVxuXG5cdGRpc2FibGVGb3JDb21tdW5pdHkoIGNhbGxiYWNrICkge1xuXHRcdGlmICggR2xvYmFsLmdldFByb2R1Y3RFZGl0aW9uKCkgPD0gMTAgKSB7XG5cdFx0XHRUQWxlcnRNYW5hZ2VyLnNob3dBbGVydCggR2xvYmFsLmdldFVwZ3JhZGVNZXNzYWdlKCksICQuaTE4bi5fKCAnRGVuaWVkJyApICk7XG5cdFx0fSBlbHNlIHtcblx0XHRcdGlmICggdHlwZW9mIGNhbGxiYWNrID09ICdmdW5jdGlvbicgKSB7XG5cdFx0XHRcdGNhbGxiYWNrKCk7XG5cdFx0XHR9XG5cdFx0fVxuXG5cdH1cblxufSJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///3207\n")},7591:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"PayrollRemittanceAgencyEventWizard\": () => (/* binding */ PayrollRemittanceAgencyEventWizard)\n/* harmony export */ });\n/* harmony import */ var _global_widgets_wizard_Wizard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3207);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\nclass PayrollRemittanceAgencyEventWizard extends _global_widgets_wizard_Wizard__WEBPACK_IMPORTED_MODULE_0__.Wizard {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tcurrent_step: false,\n\t\t\twizard_name: $.i18n._( 'Tax Wizard' ),\n\n\t\t\tselected_remittance_agency_event: null,\n\t\t\tselected_remittance_agency_event_id: null,\n\t\t\tpayroll_remittance_agency_event_block: null,\n\n\t\t\twizard_id: 'PayrollRemittanceAgencyEventWizardController',\n\t\t\t_step_map: {\n\t\t\t\t'home': { // TODO: Webpack: Investigate how this works/does not work with Webpack\n\t\t\t\t\tscript_path: 'views/payroll/remittance_wizard/PayrollRemittanceAgencyEventWizardStepHome.js',\n\t\t\t\t\tobject_name: 'PayrollRemittanceAgencyEventWizardStepHome'\n\t\t\t\t},\n\t\t\t\t'review': {\n\t\t\t\t\tscript_path: 'views/payroll/remittance_wizard/PayrollRemittanceAgencyEventWizardStepReview.js',\n\t\t\t\t\tobject_name: 'PayrollRemittanceAgencyEventWizardStepReview'\n\t\t\t\t},\n\t\t\t\t'submit': {\n\t\t\t\t\tscript_path: 'views/payroll/remittance_wizard/PayrollRemittanceAgencyEventWizardStepSubmit.js',\n\t\t\t\t\tobject_name: 'PayrollRemittanceAgencyEventWizardStepSubmit'\n\t\t\t\t},\n\t\t\t\t'publish': {\n\t\t\t\t\tscript_path: 'views/payroll/remittance_wizard/PayrollRemittanceAgencyEventWizardStepPublish.js',\n\t\t\t\t\tobject_name: 'PayrollRemittanceAgencyEventWizardStepPublish'\n\t\t\t\t}\n\t\t\t}\n\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit() {\n\t\tvar $this = this;\n\t}\n\n\trender() {\n\t\t//do render stuff\n\t}\n\n\tonNextClick( e ) {\n\t\t//Get selected row data so we can determine the time period.\n\t\tif ( this.getStepObject().grid ) {\n\t\t\tvar row_data = this.getStepObject().grid.getRowData( this.getStepObject().grid.getSelectedRow() );\n\n\t\t\tif ( row_data['in_time_period'] && row_data['in_time_period'] == true ) {\n\t\t\t\tTAlertManager.showConfirmAlert( $.i18n._( 'Time period for this event has not ended yet, are you sure you want to process this event early?' ), null, ( flag ) => {\n\t\t\t\t\tif ( flag === true ) {\n\t\t\t\t\t\tsuper.onNextClick( e );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tsuper.onNextClick( e );\n\t\t\t}\n\t\t} else {\n\t\t\tsuper.onNextClick( e );\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * builds the event data block used on several steps in this wizard.\n\t * @param container_id\n\t * @param data\n\t */\n\tbuildEventDataBlock( container_id, data ) {\n\t\t$( '#' + container_id ).remove(); //never allow this to duplicate on the wizard.\n\t\tvar div = $( '<div id=\\'' + container_id + '\\' class=\\'payroll_remittance_agency_event_wizard_event_details\\'><table></table></div>' );\n\t\tvar step_obj = this.getStepObject( this.getCurrentStepName() );\n\t\tstep_obj.append( div );\n\n\t\tvar even = false;\n\t\tvar td_label, td_value;\n\n\t\tif ( this.payroll_remittance_agency_event_block == null ) {\n\n\t\t\tvar column_one_keys = [\n\t\t\t\t{ key: 'legal_entity_legal_name', title: $.i18n._( 'Legal Entity' ) },\n\t\t\t\t{ key: 'payroll_remittance_agency_name', title: $.i18n._( 'Agency' ) },\n\t\t\t\t{ key: 'type', title: $.i18n._( 'Event' ) }\n\t\t\t];\n\n\t\t\tvar column_two_keys = [\n\t\t\t\t{ key: 'frequency', title: $.i18n._( 'Frequency' ) },\n\t\t\t\t{ key: 'time_period', title: $.i18n._( 'Time Period' ) },\n\t\t\t\t{ key: 'due_date_display', title: $.i18n._( 'Due Date' ) }\n\t\t\t];\n\n\t\t\tvar upper_bound = ( column_one_keys.length > column_two_keys.length ) ? column_one_keys.length : column_two_keys.length;\n\n\t\t\tfor ( var i = 0; i < upper_bound; i++ ) {\n\t\t\t\tvar tr = $( '<tr></tr>' );\n\n\t\t\t\tif ( column_one_keys.length > i ) {\n\t\t\t\t\tvar label = $( '<td class=\"label col1\"></td>' );\n\t\t\t\t\tlabel.text( column_one_keys[i].title );\n\n\t\t\t\t\tvar value = $( '<td class=\"value\"></td>' );\n\t\t\t\t\tvalue.text( data[column_one_keys[i].key] );\n\n\t\t\t\t\ttr.append( label );\n\t\t\t\t\ttr.append( value );\n\t\t\t\t} else {\n\t\t\t\t\ttr.append( $( '<td></td>' ) );\n\t\t\t\t\ttr.append( $( '<td></td>' ) );\n\t\t\t\t}\n\n\t\t\t\tif ( column_two_keys.length > i ) {\n\t\t\t\t\tvar label = $( '<td class=\"label col2\"></td>' );\n\t\t\t\t\tlabel.text( column_two_keys[i].title );\n\n\t\t\t\t\tvar value = $( '<td class=\"value\"></td>' );\n\t\t\t\t\tif ( column_two_keys[i].key == 'time_period' ) {\n\t\t\t\t\t\tvalue.text( data.start_date_display + ' - ' + data.end_date_display );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalue.text( data[column_two_keys[i].key] );\n\t\t\t\t\t}\n\n\t\t\t\t\ttr.append( label );\n\t\t\t\t\ttr.append( value );\n\t\t\t\t} else {\n\n\t\t\t\t\ttr.append( $( '<td></td>' ) );\n\t\t\t\t\ttr.append( $( '<td></td>' ) );\n\t\t\t\t}\n\n\t\t\t\t$( '#' + container_id + ' table' ).append( tr );\n\t\t\t}\n\n\t\t\t//Show warning if still inside time period.\n\t\t\tif ( data['in_time_period'] && data['in_time_period'] == true ) {\n\t\t\t\tvar tr = $( '<tr></tr>' );\n\n\t\t\t\tvar row_contents = $( '<td align=\"center\" style=\"font-weight: bold; color: red;\" colspan=\"4\"></td>' );\n\t\t\t\trow_contents.html( $.i18n._( 'WARNING: Time period has not ended yet, you may be processing early.' ) );\n\n\t\t\t\ttr.append( row_contents );\n\n\t\t\t\t$( '#' + container_id + ' table' ).append( tr );\n\t\t\t}\n\n\t\t\t//Show warning if still inside time period.\n\t\t\tif ( data['is_split_time_period'] && data['is_split_time_period'] == true ) {\n\t\t\t\tvar tr = $( '<tr></tr>' );\n\n\t\t\t\tvar row_contents = $( '<td align=\"center\" style=\"font-weight: bold; color: red;\" colspan=\"4\"></td>' );\n\t\t\t\trow_contents.html( $.i18n._( 'NOTICE: Time Period has been split into two, due to crossing into a new quarter.<br>This event will now need to be processed twice, once for each part of the time period.' ) );\n\n\t\t\t\ttr.append( row_contents );\n\n\t\t\t\t$( '#' + container_id + ' table' ).append( tr );\n\t\t\t}\n\n\t\t\tthis.payroll_remittance_agency_event_block = $( '#' + container_id + ' table' ).html();\n\t\t} else {\n\t\t\t$( '#' + container_id + ' table' ).html( this.payroll_remittance_agency_event_block );\n\t\t}\n\t}\n\n\t/**\n\t * both args required.\n\t * @param id\n\t * @param callback\n\t */\n\tgetPayrollRemittanceAgencyEventById( id, columns, callback ) {\n\t\t//Stright to the callback if nothing has changed. if ( this.selected_remittance_agency_event.id != id) {\n\t\tif ( typeof callback == 'function' && this.selected_remittance_agency_event && this.selected_remittance_agency_event.id == id ) {\n\t\t\tcallback( this.selected_remittance_agency_event );\n\t\t} else {\n\t\t\tvar filter = {\n\t\t\t\tfilter_data: {\n\t\t\t\t\tid: this.selected_remittance_agency_event_id\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tif ( columns == null || typeof columns == 'undefined' ) {\n\t\t\t\tfilter.filter_columns = {\n\t\t\t\t\t'payroll_remittance_agency_id': true,\n\t\t\t\t\t'legal_entity_legal_name': true,\n\t\t\t\t\t'payroll_remittance_agency_name': true,\n\t\t\t\t\t'user_report_data_id': true,\n\t\t\t\t\t'status': true,\n\t\t\t\t\t'status_id': true,\n\t\t\t\t\t'type': true,\n\t\t\t\t\t'type_id': true,\n\t\t\t\t\t'frequency': true,\n\t\t\t\t\t'start_date_display': true,\n\t\t\t\t\t'end_date_display': true,\n\t\t\t\t\t'due_date_display': true,\n\t\t\t\t\t'in_time_period': true,\n\t\t\t\t\t'is_split_time_period': true,\n\t\t\t\t\t'event_data': true,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tfilter.columns = columns;\n\t\t\t}\n\t\t\tvar $this = this;\n\t\t\tvar api_payroll_remittance_agency_event = TTAPI.APIPayrollRemittanceAgencyEvent;\n\t\t\tapi_payroll_remittance_agency_event.getPayrollRemittanceAgencyEvent( filter, {\n\t\t\t\tonResult: function( event_result ) {\n\t\t\t\t\tvar event_result = event_result.getResult()[0];\n\n\t\t\t\t\tvar api_payroll_remittance_agency = TTAPI.APIPayrollRemittanceAgency;\n\t\t\t\t\tapi_payroll_remittance_agency.getPayrollRemittanceAgency( { filter_data: { id: event_result.payroll_remittance_agency_id } }, {\n\t\t\t\t\t\t\tonResult: function( agency_result ) {\n\t\t\t\t\t\t\t\tevent_result.payroll_remittance_agency_obj = agency_result.getResult()[0]; //Merge Event and Agency data together.\n\n\t\t\t\t\t\t\t\tif ( typeof callback == 'function' ) {\n\t\t\t\t\t\t\t\t\tcallback( event_result );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\t/**\n\t * Allows us to open reports to give us access to their context menu code from within wizards.\n\t *\n\t * @param report_type\n\t * @param report_obj\n\t * @param callback\n\t */\n\tgetReport( render_type, post_data ) {\n\t\tif ( !post_data ) {\n\t\t\tpost_data = {\n\t\t\t\t0: this.selected_remittance_agency_event_id,\n\t\t\t\t1: render_type\n\t\t\t};\n\t\t}\n\t\tGlobal.APIFileDownload( 'APIPayrollRemittanceAgencyEvent', 'getReportData', post_data );\n\t}\n\n\t/**\n\t * Displays html report. Does not close wizard, but leaves it up in the background.\n\t * @param report_name\n\t * @param post_data\n\t */\n\tshowHTMLReport( report_name, new_window ) {\n\t\tProgressBar.showOverlay();\n\t\tvar api = TTAPI.APIPayrollRemittanceAgencyEvent;\n\t\tapi['getReportData']( this.selected_remittance_agency_event_id, 'html', {\n\t\t\tonResult: function( res ) {\n\t\t\t\tProgressBar.closeOverlay();\n\n\t\t\t\tif ( res.isValid() ) {\n\t\t\t\t\tvar result = res.getResult();\n\t\t\t\t\tif ( new_window ) {\n\t\t\t\t\t\tvar w = window.open();\n\t\t\t\t\t\tw.document.writeln( result.api_retval );\n\t\t\t\t\t\tw.document.close();\n\t\t\t\t\t} else if ( result ) {\n\t\t\t\t\t\tIndexViewController.openWizard( 'ReportViewWizard', result.api_retval );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tTAlertManager.showErrorAlert( res );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t/**\n\t * @param e\n\t */\n\tonDoneComplete( e ) {\n\t\tvar $this = this;\n\t\tthis.getPayrollRemittanceAgencyEventById( this.selected_remittance_agency_event_id, {}, function( result ) {\n\t\t\tif ( result ) {\n\t\t\t\tresult.enable_recalculate_dates = 1;\n\t\t\t\tresult.last_due_date = result.due_date;\n\n\t\t\t\tvar api_payroll_remittance_agency_event = TTAPI.APIPayrollRemittanceAgencyEvent;\n\t\t\t\tapi_payroll_remittance_agency_event.setPayrollRemittanceAgencyEvent( result, false, true, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t$this.cleanUp();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t}\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzU5MS5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQXdEOztBQUVqRCxpREFBaUQsaUVBQU07QUFDOUQsMkJBQTJCO0FBQzNCLEVBQUUsQ0FBQztBQUNIO0FBQ0EsZ0JBQWdCLENBQUM7O0FBRWpCO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0EsY0FBYztBQUNkO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBO0FBQ0EsS0FBSztBQUNMO0FBQ0E7QUFDQTtBQUNBLEtBQUs7QUFDTDtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBLElBQUk7O0FBRUo7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0Esb0NBQW9DLENBQUM7QUFDckM7QUFDQTtBQUNBO0FBQ0EsTUFBTTtBQUNOLEtBQUs7QUFDTDtBQUNBO0FBQ0E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ZSwge1xuXHRcdFx0XHRcdG9uUmVzdWx0OiBmdW5jdGlvbiggcmVzdWx0ICkge1xuXHRcdFx0XHRcdFx0JHRoaXMuY2xlYW5VcCgpO1xuXHRcdFx0XHRcdH1cblx0XHRcdFx0fSApO1xuXHRcdFx0fVxuXHRcdH0gKTtcblx0fVxufSJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///7591\n")},5095:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"PayrollRemittanceAgencyEventWizardController\": () => (/* binding */ PayrollRemittanceAgencyEventWizardController)\n/* harmony export */ });\n/* harmony import */ var _PayrollRemittanceAgencyEventWizard__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7591);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\nclass PayrollRemittanceAgencyEventWizardController extends BaseWindowController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '.wizard-bg',\n\n\t\t\twizard_obj: null\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit() {\n\t\tvar wizard_id = 'PayrollRemittanceAgencyEventWizardController';\n\t\t//LocalCacheData[this.wizard_id] is set when the wizard is minimized due to external navigation\n\t\tif ( !this.wizard_obj && LocalCacheData[wizard_id] ) {\n\t\t\tthis.wizard_obj = LocalCacheData[wizard_id];\n\t\t\tthis.wizard_obj.remove();\n\t\t\tthis.wizard_obj.getStepObject().initialize( this.wizard_obj );\n\t\t\tthis.wizard_obj.init();\n\t\t\tthis.wizard_obj.setElement( $( '.tax_wizard' ) );\n\t\t\tdelete LocalCacheData[wizard_id];\n\t\t} else {\n\t\t\t//this.wizard_obj = new ( window[wizard_id] )( { el: $( '.tax_wizard' ) } );\n\t\t\tthis.wizard_obj = new _PayrollRemittanceAgencyEventWizard__WEBPACK_IMPORTED_MODULE_0__.PayrollRemittanceAgencyEventWizard( { el: $( '.tax_wizard' ) } );\n\t\t}\n\t}\n\n\t// getRequiredFiles() {\n\t// \treturn ['Wizard', 'WizardStep', 'views/payroll/remittance_wizard/PayrollRemittanceAgencyEventWizard.js'];\n\t// }\n\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTA5NS5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQTBGOztBQUVuRjtBQUNQLDJCQUEyQjtBQUMzQixFQUFFLENBQUM7QUFDSDs7QUFFQTtBQUNBLElBQUk7O0FBRUo7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsK0JBQStCLENBQUM7QUFDaEM7QUFDQSxJQUFJO0FBQ0osb0RBQW9ELHlCQUF5QjtBQUM3RSx5QkFBeUIsbUdBQWtDLElBQUksSUFBSSxDQUFDLG9CQUFvQjtBQUN4RjtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQSIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2ludGVyZmFjZS9odG1sNS92aWV3cy9wYXlyb2xsL3JlbWl0dGFuY2Vfd2l6YXJkL1BheXJvbGxSZW1pdHRhbmNlQWdlbmN5RXZlbnRXaXphcmRDb250cm9sbGVyLmpzPzBjMDQiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgUGF5cm9sbFJlbWl0dGFuY2VBZ2VuY3lFdmVudFdpemFyZCB9IGZyb20gJy4vUGF5cm9sbFJlbWl0dGFuY2VBZ2VuY3lFdmVudFdpemFyZCc7XG5cbmV4cG9ydCBjbGFzcyBQYXlyb2xsUmVtaXR0YW5jZUFnZW5jeUV2ZW50V2l6YXJkQ29udHJvbGxlciBleHRlbmRzIEJhc2VXaW5kb3dDb250cm9sbGVyIHtcblx0Y29uc3RydWN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