"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["wizard-process_payroll-ProcessPayrollWizardController"],{5630:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ProcessPayrollWizardController\": () => (/* binding */ ProcessPayrollWizardController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass ProcessPayrollWizardController extends BaseWizardController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '.wizard-bg',\n\n\t\t\tall_columns: null,\n\t\t\tpay_stub_transaction_columns: null,\n\n\t\t\tapi_pay_period: null,\n\t\t\tapi_pay_stub: null,\n\n\t\t\tapi_pay_stub_transaction: null,\n\n\t\t\talert_message: $.i18n._( 'Please select one or more pay periods in the list above to enable icons.' ),\n\n\t\t\ttransaction_source_data: null\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\t\t//this._super('initialize', options );\n\n\t\tthis.title = $.i18n._( 'Payroll Processing Wizard' );\n\t\tthis.steps = 9;\n\t\tthis.current_step = 1;\n\t\tthis.script_name = 'wizard_process_payroll';\n\t\tthis.wizard_id = 'ProcessPayrollWizard';\n\t\tthis.api_pay_period = TTAPI.APIPayPeriod;\n\t\tthis.api_pay_stub = TTAPI.APIPayStub;\n\t\tthis.api_pay_stub_transaction = TTAPI.APIPayStubTransaction;\n\n\t\tthis.render();\n\t}\n\n\trender() {\n\t\tsuper.render();\n\n\t\tthis.initUserGenericData();\n\t}\n\n\tsetButtonsStatus() {\n\n\t\tGlobal.setWidgetEnabled( this.done_btn, false );\n\t\tGlobal.setWidgetEnabled( this.close_btn, true );\n\n\t\tif ( this.current_step === 1 ) {\n\t\t\tGlobal.setWidgetEnabled( this.back_btn, false );\n\t\t} else {\n\t\t\tGlobal.setWidgetEnabled( this.back_btn, true );\n\t\t}\n\n\t\tif ( this.current_step !== this.steps ) {\n\t\t\tGlobal.setWidgetEnabled( this.done_btn, false );\n\t\t\tGlobal.setWidgetEnabled( this.next_btn, true );\n\t\t\t//Error: TypeError: this.stepsWidgetDic[1] is undefined in interface/html5/framework/jquery.min.js?v=9.0.0-20150918-155419 line 2 > eval line 45\n\t\t\tif ( this.stepsWidgetDic[1] && ( !this.stepsWidgetDic[1].pay_period_id.getValue() || this.stepsWidgetDic[1].pay_period_id.getValue().length < 1 ) ) {\n\t\t\t\tGlobal.setWidgetEnabled( this.next_btn, false );\n\t\t\t}\n\t\t} else {\n\t\t\tGlobal.setWidgetEnabled( this.done_btn, true );\n\t\t\tGlobal.setWidgetEnabled( this.next_btn, false );\n\t\t}\n\t}\n\n\t//Create each page UI\n\tbuildCurrentStepUI() {\n\n\t\tvar $this = this;\n\t\tthis.content_div.empty();\n\t\tswitch ( this.current_step ) {\n\t\t\tcase 1:\n\n\t\t\t\tvar label = this.getLabel();\n\t\t\t\tlabel.text( $.i18n._( 'Select one or more pay periods to process payroll for' ) );\n\t\t\t\tvar a_combobox = this.getAComboBox( TTAPI.APIPayPeriod, true, 'global_Pay_period', 'pay_period_id' );\n\t\t\t\tvar div = $( '
' );\n\t\t\t\tdiv.append( a_combobox );\n\n\t\t\t\ta_combobox.unbind( 'formItemChange' ).bind( 'formItemChange', function() {\n\t\t\t\t\t$this.setButtonsStatus();\n\t\t\t\t} );\n\n\t\t\t\tthis.stepsWidgetDic[this.current_step] = {};\n\t\t\t\tthis.stepsWidgetDic[this.current_step][a_combobox.getField()] = a_combobox;\n\n\t\t\t\tthis.content_div.append( label );\n\t\t\t\tthis.content_div.append( div );\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tlabel = this.getLabel();\n\t\t\t\tlabel.text( $.i18n._( 'Confirm all requests are authorized' ) );\n\n\t\t\t\tthis.content_div.append( label );\n\t\t\t\tthis.stepsWidgetDic[this.current_step] = {};\n\n\t\t\t\tvar grid_id = 'pending_request';\n\t\t\t\tvar grid_div = $( '' );\n\t\t\t\tthis.setGrid( grid_id, grid_div, true );\n\n\t\t\t\tvar ribbon_button_box = this.getRibbonButtonBox();\n\t\t\t\tvar request_button = this.getRibbonButton( 'request', Global.getRibbonIconRealPath( 'requests-35x35.png' ), $.i18n._( 'Requests' ) );\n\n\t\t\t\trequest_button.unbind( 'click' ).bind( 'click', function() {\n\n\t\t\t\t\t$this.onNavigationClick( 'request' );\n\t\t\t\t} );\n\n\t\t\t\tribbon_button_box.children().eq( 0 ).append( request_button );\n\t\t\t\tthis.content_div.append( ribbon_button_box );\n\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tlabel = this.getLabel();\n\t\t\t\tlabel.text( $.i18n._( 'Confirm that no critical exceptions exist' ) );\n\n\t\t\t\tthis.content_div.append( label );\n\t\t\t\tthis.stepsWidgetDic[this.current_step] = {};\n\n\t\t\t\tgrid_id = 'exceptions';\n\t\t\t\tgrid_div = $( '' );\n\t\t\t\tthis.setGrid( grid_id, grid_div, true );\n\n\t\t\t\tthis.removeResizableGrids();\n\n\t\t\t\tribbon_button_box = this.getRibbonButtonBox();\n\t\t\t\tvar ribbon_btn = this.getRibbonButton( 'exceptions', Global.getRibbonIconRealPath( 'exceptions-35x35.png' ), $.i18n._( 'Exceptions' ) );\n\n\t\t\t\tribbon_btn.unbind( 'click' ).bind( 'click', function() {\n\t\t\t\t\t$this.onNavigationClick( 'exceptions' );\n\t\t\t\t} );\n\n\t\t\t\tribbon_button_box.children().eq( 0 ).append( ribbon_btn );\n\t\t\t\tthis.content_div.append( ribbon_button_box );\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tlabel = this.getLabel();\n\t\t\t\tlabel.text( $.i18n._( 'Confirm timesheets are verified' ) );\n\n\t\t\t\tthis.content_div.append( label );\n\t\t\t\tthis.stepsWidgetDic[this.current_step] = {};\n\n\t\t\t\tgrid_id = 'timesheet';\n\t\t\t\tgrid_div = $( '' );\n\t\t\t\tthis.setGrid( grid_id, grid_div, true );\n\n\t\t\t\tthis.removeResizableGrids();\n\n\t\t\t\tribbon_button_box = this.getRibbonButtonBox();\n\t\t\t\tribbon_btn = this.getRibbonButton( 'timesheet_reports', Global.getRibbonIconRealPath( 'timesheet_reports-35x35.png' ), $.i18n._( 'TimeSheet
Summary' ) );\n\t\t\t\tvar ribbon_btn2 = this.getRibbonButton( 'authorization_timesheet', Global.getRibbonIconRealPath( 'authorize_timesheet-35x35.png' ), $.i18n._( 'TimeSheet
Authorizations' ) );\n\n\t\t\t\tribbon_btn.unbind( 'click' ).bind( 'click', function() {\n\t\t\t\t\t$this.onNavigationClick( 'timesheet_reports' );\n\t\t\t\t} );\n\n\t\t\t\tribbon_btn2.unbind( 'click' ).bind( 'click', function() {\n\t\t\t\t\t$this.onNavigationClick( 'authorization_timesheet' );\n\t\t\t\t} );\n\n\t\t\t\tribbon_button_box.children().eq( 0 ).append( ribbon_btn );\n\t\t\t\tribbon_button_box.children().eq( 0 ).append( ribbon_btn2 );\n\t\t\t\tthis.content_div.append( ribbon_button_box );\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tlabel = this.getLabel();\n\t\t\t\tlabel.text( $.i18n._( 'Lock pay periods to prevent changes' ) );\n\n\t\t\t\tthis.content_div.append( label );\n\t\t\t\tthis.stepsWidgetDic[this.current_step] = {};\n\n\t\t\t\tgrid_id = 'lock_pay_period';\n\t\t\t\tgrid_div = $( '' );\n\t\t\t\tthis.setGrid( grid_id, grid_div, true );\n\n\t\t\t\tribbon_button_box = this.getRibbonButtonBox();\n\t\t\t\tribbon_btn = this.getRibbonButton( 'lock', Global.getRibbonIconRealPath( 'lock-35x35.png' ), $.i18n._( 'Lock' ) );\n\t\t\t\tribbon_btn2 = this.getRibbonButton( 'unlock', Global.getRibbonIconRealPath( 'unlock-35x35.png' ), $.i18n._( 'UnLock' ) );\n\n\t\t\t\tribbon_btn.unbind( 'click' ).bind( 'click', function() {\n\t\t\t\t\tif ( $( this ).hasClass( 'disable-image' ) ) {\n\t\t\t\t\t\tTAlertManager.showAlert( $this.alert_message );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t$this.onNavigationClick( 'lock' );\n\t\t\t\t} );\n\n\t\t\t\tribbon_btn2.unbind( 'click' ).bind( 'click', function() {\n\t\t\t\t\tif ( $( this ).hasClass( 'disable-image' ) ) {\n\t\t\t\t\t\tTAlertManager.showAlert( $this.alert_message );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t$this.onNavigationClick( 'unlock' );\n\t\t\t\t} );\n\n\t\t\t\tthis.stepsWidgetDic[this.current_step].lock = ribbon_btn;\n\t\t\t\tthis.stepsWidgetDic[this.current_step].unlock = ribbon_btn2;\n\n\t\t\t\tribbon_button_box.children().eq( 0 ).append( ribbon_btn );\n\t\t\t\tribbon_button_box.children().eq( 0 ).append( ribbon_btn2 );\n\t\t\t\tthis.content_div.append( ribbon_button_box );\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\tlabel = this.getLabel();\n\t\t\t\tlabel.text( $.i18n._( 'Create any necessary pay stub amendments' ) );\n\n\t\t\t\tthis.content_div.append( label );\n\t\t\t\tthis.stepsWidgetDic[this.current_step] = {};\n\n\t\t\t\tgrid_id = 'pay_stub_amendments';\n\t\t\t\tgrid_div = $( '' );\n\t\t\t\tthis.setGrid( grid_id, grid_div, true );\n\n\t\t\t\tribbon_button_box = this.getRibbonButtonBox();\n\t\t\t\tribbon_btn = this.getRibbonButton( 'pay_stub_amendment', Global.getRibbonIconRealPath( 'pay_stub_amendments-35x35.png' ), $.i18n._( 'Pay Stub
Amendments' ) );\n\n\t\t\t\tribbon_btn.unbind( 'click' ).bind( 'click', function() {\n\t\t\t\t\t$this.onNavigationClick( 'pay_stub_amendment' );\n\t\t\t\t} );\n\n\t\t\t\tribbon_button_box.children().eq( 0 ).append( ribbon_btn );\n\t\t\t\tthis.content_div.append( ribbon_button_box );\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\tlabel = this.getLabel();\n\t\t\t\tlabel.text( $.i18n._( 'Generate pay stubs' ) );\n\n\t\t\t\tthis.content_div.append( label );\n\t\t\t\tthis.stepsWidgetDic[this.current_step] = {};\n\n\t\t\t\tgrid_id = 'pay_stub_generate';\n\t\t\t\tgrid_div = $( '' );\n\t\t\t\tthis.setGrid( grid_id, grid_div, true );\n\n\t\t\t\tribbon_button_box = this.getRibbonButtonBox();\n\t\t\t\tribbon_btn = this.getRibbonButton( 'generate_pay_stub', Global.getRibbonIconRealPath( 'calculate_paystubs-35x35.png' ), $.i18n._( 'Generate
Pay Stubs' ) );\n\t\t\t\tribbon_btn2 = this.getRibbonButton( 'pay_stub', Global.getRibbonIconRealPath( 'pay_stubs-35x35.png' ), $.i18n._( 'Pay
Stubs' ) );\n\t\t\t\tvar ribbon_btn3 = this.getRibbonButton( 'pay_stub_summary', Global.getRibbonIconRealPath( 'pay_stubs_accounts-35x35.png' ), $.i18n._( 'Pay Stub
Summary' ) );\n\n\t\t\t\tribbon_btn.unbind( 'click' ).bind( 'click', function() {\n\t\t\t\t\tif ( $( this ).hasClass( 'disable-image' ) ) {\n\t\t\t\t\t\tTAlertManager.showAlert( $this.alert_message );\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t$this.onNavigationClick( 'generate_pay_stub' );\n\t\t\t\t} );\n\n\t\t\t\tribbon_btn2.unbind( 'click' ).bind( 'click', function() {\n\t\t\t\t\t$this.onNavigationClick( 'pay_stub' );\n\t\t\t\t} );\n\n\t\t\t\tribbon_btn3.unbind( 'click' ).bind( 'click', function() {\n\t\t\t\t\t$this.onNavigationClick( 'pay_stub_summary' );\n\t\t\t\t} );\n\n\t\t\t\tthis.stepsWidgetDic[this.current_step].generate_pay_stub = ribbon_btn;\n\n\t\t\t\tribbon_button_box.children().eq( 0 ).append( ribbon_btn );\n\t\t\t\tribbon_button_box.children().eq( 0 ).append( ribbon_btn2 );\n\t\t\t\tribbon_button_box.children().eq( 0 ).append( ribbon_btn3 );\n\n\t\t\t\tthis.content_div.append( ribbon_button_box );\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\tlabel = this.getLabel();\n\t\t\t\tlabel.text( $.i18n._( 'Process transactions' ) );\n\n\t\t\t\tthis.content_div.append( label );\n\t\t\t\tthis.stepsWidgetDic[this.current_step] = {};\n\n\t\t\t\t$( '.wizard .content' ).css( 'opacity', 0 );\n\t\t\t\tTTPromise.add( 'wizard', 'step8' );\n\t\t\t\tTTPromise.wait( 'wizard', 'step8', function() {\n\t\t\t\t\t$( '.wizard .content' ).css( 'opacity', 1 );\n\t\t\t\t} );\n\n\t\t\t\tgrid_id = 'pay_stub_transfer';\n\t\t\t\tgrid_div = $( '
' );\n\t\t\t\tthis.setGrid( grid_id, grid_div, true );\n\n\t\t\t\tgrid_id = 'pay_stub_transaction';\n\t\t\t\tgrid_div = $( '' );\n\t\t\t\tthis.setGrid( grid_id, grid_div, false ).setGridHeight( Math.floor( ( this.content_div.height() - 150 ) / 2 ) );\n\n\t\t\t\tribbon_button_box = this.getRibbonButtonBox();\n\t\t\t\tvar ribbon_btn1 = this.getRibbonButton( 'direct_deposit', Global.getRibbonIconRealPath( 'direct_deposit-35x35.png' ), $.i18n._( 'Process
Transactions' ) );\n\t\t\t\tribbon_btn2 = this.getRibbonButton( 'pay_stub_transaction_summary', Global.getRibbonIconRealPath( 'payroll_reports-35x35.png' ), $.i18n._( 'Pay Stub
Transaction Summary' ) );\n\t\t\t\tribbon_btn3 = this.getRibbonButton( 'payroll_export_report', Global.getRibbonIconRealPath( 'payroll_reports-35x35.png' ), $.i18n._( 'Payroll Export' ) );\n\n\t\t\t\tribbon_btn1.unbind( 'click' ).bind( 'click', function() {\n\t\t\t\t\t$this.onNavigationClick( 'direct_deposit' );\n\t\t\t\t} );\n\n\t\t\t\tribbon_btn2.unbind( 'click' ).bind( 'click', function() {\n\t\t\t\t\t$this.onNavigationClick( 'pay_stub_transaction_summary' );\n\t\t\t\t} );\n\t\t\t\tribbon_btn3.unbind( 'click' ).bind( 'click', function() {\n\t\t\t\t\t$this.onNavigationClick( 'payroll_export_report' );\n\t\t\t\t} );\n\n\t\t\t\t//this is the display order for buttons on step 8\n\t\t\t\tribbon_button_box.children().eq( 0 ).append( ribbon_btn1 );\n\t\t\t\tribbon_button_box.children().eq( 0 ).append( ribbon_btn2 );\n\t\t\t\tribbon_button_box.children().eq( 0 ).append( ribbon_btn3 );\n\n\t\t\t\tthis.content_div.append( ribbon_button_box );\n\t\t\t\tbreak;\n\t\t\tcase 9:\n\t\t\t\tlabel = this.getLabel();\n\t\t\t\tlabel.text( $.i18n._( 'Close pay period' ) );\n\n\t\t\t\tthis.content_div.append( label );\n\t\t\t\tthis.stepsWidgetDic[this.current_step] = {};\n\n\t\t\t\tgrid_id = 'pay_stub_close';\n\t\t\t\tgrid_div = $( '' );\n\t\t\t\tthis.setGrid( grid_id, grid_div, true );\n\n\t\t\t\tribbon_button_box = this.getRibbonButtonBox();\n\t\t\t\tribbon_btn = this.getRibbonButton( 'close_pay_period', Global.getRibbonIconRealPath( 'close_pay_period-35x35.png' ), $.i18n._( 'Close' ) );\n\n\t\t\t\tribbon_btn.unbind( 'click' ).bind( 'click', function() {\n\t\t\t\t\tif ( $( this ).hasClass( 'disable-image' ) ) {\n\t\t\t\t\t\tTAlertManager.showAlert( $this.alert_message );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t$this.onNavigationClick( 'close_pay_period' );\n\t\t\t\t} );\n\n\t\t\t\tthis.stepsWidgetDic[this.current_step].close = ribbon_btn;\n\n\t\t\t\tribbon_button_box.children().eq( 0 ).append( ribbon_btn );\n\n\t\t\t\tthis.content_div.append( ribbon_button_box );\n\t\t\t\tbreak;\n\n\t\t}\n\t}\n\n\tonNextClick() {\n\t\tthis.saveCurrentStep();\n\n\t\tif ( this.current_step === 1 ) {\n\t\t\tvar current_step_ui = this.stepsWidgetDic[this.current_step];\n\t\t\tvar pay_period_id = current_step_ui.pay_period_id.getValue();\n\t\t\tif ( !pay_period_id || pay_period_id.length == 0 || ( pay_period_id == TTUUID.zero_id ) || ( pay_period_id.length == 1 && pay_period_id[0] == TTUUID.zero_id ) ) {\n\t\t\t\tTAlertManager.showAlert( $.i18n._( 'Please choose a Pay Period' ) );\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tthis.current_step = this.current_step + 1;\n\t\tthis.initCurrentStep();\n\t}\n\n\tonDoneClick() {\n\t\tthis.cleanStepsData();\n\t\tLocalCacheData.current_open_wizard_controllers = LocalCacheData.current_open_wizard_controllers.filter( wizard => wizard.wizard_id !== this.wizard_id );\n\t\tthis.saveAllStepsToUserGenericData( function() {\n\n\t\t} );\n\n\t\tif ( this.call_back ) {\n\t\t\tthis.call_back();\n\t\t}\n\n\t\t$( this.el ).remove();\n\n\t\t$().TFeedback( {\n\t\t\tsource: this.wizard_id\n\t\t} );\n\t}\n\n\tgetGridColumns( gridId, callBack ) {\n\n\t\tvar $this = this;\n\n\t\tif ( gridId == 'pay_stub_transaction' ) {\n\t\t\tvar result = this.api_pay_stub_transaction.getOptions( 'columns', { 'payroll_wizard': true }, { async: false } );\n\n\t\t\tvar column_info_array = [];\n\t\t\tvar result_data = result.getResult();\n\t\t\t$this.pay_stub_transaction_columns = Global.buildColumnArray( result_data );\n\n\t\t\tfor ( var x in $this.pay_stub_transaction_columns ) {\n\n\t\t\t\tvar column_data = $this.pay_stub_transaction_columns[x];\n\n\t\t\t\tif ( column_data.value == 'remittance_source_account' ||\n\t\t\t\t\tcolumn_data.value == 'remittance_source_account_type' ||\n\t\t\t\t\tcolumn_data.value == 'currency' ||\n\t\t\t\t\tcolumn_data.value == 'total_transactions' ||\n\t\t\t\t\tcolumn_data.value == 'total_amount' ) {\n\t\t\t\t\tvar column_info = {\n\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\tname: column_data.value,\n\t\t\t\t\t\tindex: column_data.value,\n\t\t\t\t\t\tlabel: column_data.label,\n\t\t\t\t\t\twidth: 100,\n\t\t\t\t\t\tsortable: false,\n\t\t\t\t\t\ttitle: false\n\t\t\t\t\t};\n\t\t\t\t\tcolumn_info_array.push( column_info );\n\t\t\t\t}\n\t\t\t}\n\t\t\tcallBack( column_info_array );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.all_columns ) {\n\t\t\tdoNext();\n\t\t} else {\n\t\t\tvar result = this.api_pay_period.getOptions( 'columns', { async: false } );\n\t\t\tvar result_data = result.getResult();\n\t\t\t$this.all_columns = Global.buildColumnArray( result_data );\n\t\t\tdoNext();\n\t\t}\n\n\t\tfunction doNext() {\n\n\t\t\tvar len = $this.all_columns.length;\n\t\t\tvar column_info_array = [];\n\n\t\t\tswitch ( gridId ) {\n\t\t\t\tcase 'pending_request':\n\n\t\t\t\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\t\t\t\tvar column_data = $this.all_columns[i];\n\n\t\t\t\t\t\tif ( column_data.value == 'start_date' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'end_date' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'transaction_date' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'pending_requests' ) {\n\t\t\t\t\t\t\tvar column_info = {\n\t\t\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\t\t\tname: column_data.value,\n\t\t\t\t\t\t\t\tindex: column_data.value,\n\t\t\t\t\t\t\t\tlabel: column_data.label,\n\t\t\t\t\t\t\t\twidth: 100,\n\t\t\t\t\t\t\t\tsortable: false,\n\t\t\t\t\t\t\t\ttitle: false\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tcolumn_info_array.push( column_info );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'exceptions':\n\n\t\t\t\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\t\t\t\tcolumn_data = $this.all_columns[i];\n\n\t\t\t\t\t\tif ( column_data.value == 'start_date' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'end_date' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'transaction_date' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'exceptions_high' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'exceptions_medium' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'exceptions_low' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'exceptions_critical'\n\t\t\t\t\t\t) {\n\n\t\t\t\t\t\t\tif ( column_data.value == 'exceptions_high' ||\n\t\t\t\t\t\t\t\tcolumn_data.value == 'exceptions_medium' ||\n\t\t\t\t\t\t\t\tcolumn_data.value == 'exceptions_low' ||\n\t\t\t\t\t\t\t\tcolumn_data.value == 'exceptions_critical' ) {\n\n\t\t\t\t\t\t\t\tcolumn_info = {\n\t\t\t\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\t\t\t\tname: column_data.value,\n\t\t\t\t\t\t\t\t\tindex: column_data.value,\n\t\t\t\t\t\t\t\t\tlabel: column_data.label,\n\t\t\t\t\t\t\t\t\twidth: 50,\n\t\t\t\t\t\t\t\t\tsortable: false,\n\t\t\t\t\t\t\t\t\ttitle: false\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tcolumn_info_array.push( column_info );\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcolumn_info = {\n\t\t\t\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\t\t\t\tname: column_data.value,\n\t\t\t\t\t\t\t\t\tindex: column_data.value,\n\t\t\t\t\t\t\t\t\tlabel: column_data.label,\n\t\t\t\t\t\t\t\t\twidth: 100,\n\t\t\t\t\t\t\t\t\tsortable: false,\n\t\t\t\t\t\t\t\t\ttitle: false\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tcolumn_info_array.push( column_info );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'timesheet':\n\n\t\t\t\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\t\t\t\tcolumn_data = $this.all_columns[i];\n\n\t\t\t\t\t\tif ( column_data.value == 'start_date' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'end_date' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'transaction_date' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'verified_timesheets' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'pending_timesheets' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'total_timesheets'\n\t\t\t\t\t\t) {\n\n\t\t\t\t\t\t\tif ( column_data.value == 'verified_timesheets' ||\n\t\t\t\t\t\t\t\tcolumn_data.value == 'pending_timesheets' ||\n\t\t\t\t\t\t\t\tcolumn_data.value == 'total_timesheets' ) {\n\n\t\t\t\t\t\t\t\tcolumn_info = {\n\t\t\t\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\t\t\t\tname: column_data.value,\n\t\t\t\t\t\t\t\t\tindex: column_data.value,\n\t\t\t\t\t\t\t\t\tlabel: column_data.label,\n\t\t\t\t\t\t\t\t\twidth: 50,\n\t\t\t\t\t\t\t\t\tsortable: false,\n\t\t\t\t\t\t\t\t\ttitle: false\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tcolumn_info_array.push( column_info );\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcolumn_info = {\n\t\t\t\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\t\t\t\tname: column_data.value,\n\t\t\t\t\t\t\t\t\tindex: column_data.value,\n\t\t\t\t\t\t\t\t\tlabel: column_data.label,\n\t\t\t\t\t\t\t\t\twidth: 100,\n\t\t\t\t\t\t\t\t\tsortable: false,\n\t\t\t\t\t\t\t\t\ttitle: false\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tcolumn_info_array.push( column_info );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'lock_pay_period':\n\t\t\t\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\t\t\t\tcolumn_data = $this.all_columns[i];\n\n\t\t\t\t\t\tif ( column_data.value == 'start_date' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'end_date' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'transaction_date' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'status'\n\t\t\t\t\t\t) {\n\n\t\t\t\t\t\t\tcolumn_info = {\n\t\t\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\t\t\tname: column_data.value,\n\t\t\t\t\t\t\t\tindex: column_data.value,\n\t\t\t\t\t\t\t\tlabel: column_data.label,\n\t\t\t\t\t\t\t\twidth: 100,\n\t\t\t\t\t\t\t\tsortable: false,\n\t\t\t\t\t\t\t\ttitle: false\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tcolumn_info_array.push( column_info );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'pay_stub_amendments':\n\t\t\t\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\t\t\t\tcolumn_data = $this.all_columns[i];\n\n\t\t\t\t\t\tif ( column_data.value == 'start_date' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'end_date' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'transaction_date' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'ps_amendments'\n\t\t\t\t\t\t) {\n\n\t\t\t\t\t\t\tcolumn_info = {\n\t\t\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\t\t\tname: column_data.value,\n\t\t\t\t\t\t\t\tindex: column_data.value,\n\t\t\t\t\t\t\t\tlabel: column_data.label,\n\t\t\t\t\t\t\t\twidth: 100,\n\t\t\t\t\t\t\t\tsortable: false,\n\t\t\t\t\t\t\t\ttitle: false\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tcolumn_info_array.push( column_info );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'pay_stub_generate':\n\t\t\t\tcase 'pay_stub_transfer':\n\t\t\t\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\t\t\t\tcolumn_data = $this.all_columns[i];\n\n\t\t\t\t\t\tif ( column_data.value == 'start_date' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'end_date' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'transaction_date' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'pay_stubs_open'\n\t\t\t\t\t\t) {\n\n\t\t\t\t\t\t\tcolumn_info = {\n\t\t\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\t\t\tname: column_data.value,\n\t\t\t\t\t\t\t\tindex: column_data.value,\n\t\t\t\t\t\t\t\tlabel: column_data.label,\n\t\t\t\t\t\t\t\twidth: 100,\n\t\t\t\t\t\t\t\tsortable: false,\n\t\t\t\t\t\t\t\ttitle: false\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tcolumn_info_array.push( column_info );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'pay_stub_close':\n\t\t\t\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\t\t\t\tcolumn_data = $this.all_columns[i];\n\n\t\t\t\t\t\tif ( column_data.value == 'status' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'start_date' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'end_date' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'transaction_date' ||\n\t\t\t\t\t\t\tcolumn_data.value == 'pay_stubs_open'\n\t\t\t\t\t\t) {\n\n\t\t\t\t\t\t\tcolumn_info = {\n\t\t\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\t\t\tname: column_data.value,\n\t\t\t\t\t\t\t\tindex: column_data.value,\n\t\t\t\t\t\t\t\tlabel: column_data.label,\n\t\t\t\t\t\t\t\twidth: 100,\n\t\t\t\t\t\t\t\tsortable: false,\n\t\t\t\t\t\t\t\ttitle: false\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tcolumn_info_array.push( column_info );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tcallBack( column_info_array );\n\t\t}\n\t}\n\n\tremoveResizableGrids() {\n\t\t//Issue #3214 - Exception triggered when page is resized while on Exception or TimeSheet wizard steps\n\t\t//This is a related to a previous fix found in this.setGridGroupColumns().\n\t\t//To avoid this we now remove the two error causing grids from the resizeable grid list.\n\t\t//This solution was chosen as the exception is deep within TTGrid and not easily avoidable.\n\t\t//Resizing is not requires for normal use and only causes display issues with very small resolutions <1024px.\n\t\t//In addition, only happens in the specific case where the end user resizes their browser on those two wizard steps.\n\n\t\tif ( Array.isArray( LocalCacheData.resizeable_grids ) ) {\n\t\t\tLocalCacheData.resizeable_grids = LocalCacheData.resizeable_grids.filter( function( grid ) {\n\t\t\t\treturn grid !== null && grid.ui_id !== 'exceptions' && grid.ui_id !== 'timesheet';\n\t\t\t} );\n\t\t}\n\t}\n\n\tsetGridGroupColumns( gridId ) {\n\t\t//Short circuit this function if we aren't creating any spanning cells for exceptions/timesheets.\n\t\t// As having \"group-column-tr\" without anything in it causes jqGrid to trigger JS exception: Uncaught TypeError: Cannot read property 'style' of undefined\n\t\t// when running: $( '#contentContainer' ).trigger( 'resize' ) from the console.\n\t\tif ( gridId !== 'exceptions' && gridId !== 'timesheet' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar table = $( $( this.el ).find( 'table[aria-labelledby=gbox_' + gridId + ']' )[0] );\n\t\tvar table_width_target = $( $( this.el ).find( 'table[id=' + gridId + ']' )[0] );\n\n\t\tvar new_tr = $( '' + '
' );\n\n\t\tvar new_th = $( '' +\n\t\t\t'' +\n\t\t\t' | ' );\n\n\t\tswitch ( gridId ) {\n\t\t\tcase 'exceptions':\n\t\t\t\tvar ths = table_width_target.children( 0 ).children( 0 ).children();\n\n\t\t\t\tvar default_th = new_th.clone();\n\t\t\t\tdefault_th.attr( 'colspan', '1' );\n\t\t\t\tdefault_th.width( ths.eq( 0 ).width() );\n\t\t\t\tnew_tr.append( default_th );\n\n\t\t\t\tdefault_th = new_th.clone();\n\t\t\t\tdefault_th.attr( 'colspan', '3' );\n\t\t\t\tdefault_th.width( ths.eq( 1 ).width() * 3 );\n\t\t\t\tnew_tr.append( default_th );\n\n\t\t\t\tdefault_th = new_th.clone();\n\t\t\t\tdefault_th.attr( 'colspan', '4' );\n\t\t\t\tdefault_th.width( ths.eq( 4 ).width() * 4 );\n\n\t\t\t\tdefault_th.children( 0 ).text( $.i18n._( 'Exceptions' ) );\n\n\t\t\t\tbreak;\n\t\t\tcase 'timesheet':\n\t\t\t\tths = table_width_target.children( 0 ).children( 0 ).children();\n\n\t\t\t\tdefault_th = new_th.clone();\n\t\t\t\tdefault_th.attr( 'colspan', '1' );\n\t\t\t\tdefault_th.width( ths.eq( 0 ).width() );\n\t\t\t\tnew_tr.append( default_th );\n\n\t\t\t\tdefault_th = new_th.clone();\n\t\t\t\tdefault_th.attr( 'colspan', '3' );\n\t\t\t\tdefault_th.width( ths.eq( 1 ).width() * 3 );\n\t\t\t\tnew_tr.append( default_th );\n\n\t\t\t\tdefault_th = new_th.clone();\n\n\t\t\t\tdefault_th.attr( 'colspan', '3' );\n\t\t\t\tdefault_th.width( ths.eq( 4 ).width() * 3 );\n\n\t\t\t\tdefault_th.children( 0 ).text( $.i18n._( 'Timesheets' ) );\n\t\t\t\tbreak;\n\t\t}\n\n\t\tnew_tr.append( default_th );\n\t\ttable.find( 'thead' ).prepend( new_tr );\n\t}\n\n\tonNavigationClick( iconName ) {\n\t\tvar $this = this;\n\t\tvar current_step_ui = this.stepsWidgetDic[this.current_step];\n\t\tvar grid;\n\t\tvar ids;\n\t\tvar data_array;\n\t\tvar filter;\n\t\tswitch ( iconName ) {\n\t\t\tcase 'exceptions':\n\t\t\t\tfilter = { filter_data: {} };\n\t\t\t\tgrid = current_step_ui.exceptions;\n\t\t\t\tids = grid.grid.jqGrid( 'getGridParam', 'selarrrow' );\n\n\t\t\t\tvar pay_period_ids = { value: ids };\n\t\t\t\tfilter.filter_data.pay_period_id = pay_period_ids;\n\n\t\t\t\tGlobal.addViewTab( this.wizard_id, $.i18n._( 'Process Payroll' ), window.location.href );\n\t\t\t\tthis.onCloseClick();\n\t\t\t\tIndexViewController.goToView( 'Exception', filter );\n\n\t\t\t\tbreak;\n\t\t\tcase 'request':\n\t\t\t\tGlobal.addViewTab( this.wizard_id, $.i18n._( 'Process Payroll' ), window.location.href );\n\n\t\t\t\tIndexViewController.goToView( 'Request' );\n\n\t\t\t\tthis.onCloseClick();\n\t\t\t\tbreak;\n\t\t\tcase 'timesheet_reports':\n\t\t\t\tGlobal.addViewTab( this.wizard_id, $.i18n._( 'Process Payroll' ), window.location.href );\n\t\t\t\tthis.onCloseClick();\n\n\t\t\t\tLocalCacheData.default_filter_for_next_open_view = { template: 'by_pay_period_by_employee+verified_time_sheet' };\n\n\t\t\t\tIndexViewController.openReport( LocalCacheData.current_open_primary_controller, 'TimesheetSummaryReport' );\n\n\t\t\t\tbreak;\n\t\t\tcase 'lock':\n\t\t\t\tgrid = current_step_ui.lock_pay_period;\n\t\t\t\tids = grid.grid.jqGrid( 'getGridParam', 'selarrrow' );\n\t\t\t\tdata_array = [];\n\t\t\t\tfor ( var i = 0; i < ids.length; i++ ) {\n\t\t\t\t\tvar data = {};\n\t\t\t\t\tdata.id = ids[i];\n\t\t\t\t\tdata.status_id = 12;\n\t\t\t\t\tdata_array.push( data );\n\t\t\t\t}\n\t\t\t\tProgressBar.showOverlay();\n\t\t\t\tthis.api_pay_period.setPayPeriod( data_array, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\tif ( result.isValid() ) {\n\t\t\t\t\t\t\t$this.buildCurrentStepData();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tTAlertManager.showErrorAlert( result );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\tcase 'unlock':\n\t\t\t\tgrid = current_step_ui.lock_pay_period;\n\t\t\t\tids = grid.grid.jqGrid( 'getGridParam', 'selarrrow' );\n\t\t\t\tdata_array = [];\n\t\t\t\tfor ( var i = 0; i < ids.length; i++ ) {\n\t\t\t\t\tdata = {};\n\t\t\t\t\tdata.id = ids[i];\n\t\t\t\t\tdata.status_id = 10;\n\t\t\t\t\tdata_array.push( data );\n\t\t\t\t}\n\t\t\t\tProgressBar.showOverlay();\n\t\t\t\tthis.api_pay_period.setPayPeriod( data_array, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\tif ( result.isValid() ) {\n\t\t\t\t\t\t\t$this.buildCurrentStepData();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tTAlertManager.showErrorAlert( result );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\tcase 'pay_stub_amendment':\n\n\t\t\t\tGlobal.addViewTab( this.wizard_id, $.i18n._( 'Process Payroll' ), window.location.href );\n\t\t\t\tthis.onCloseClick();\n\n\t\t\t\tgrid = current_step_ui.pay_stub_amendments;\n\t\t\t\tids = grid.grid.jqGrid( 'getGridParam', 'selarrrow' );\n\t\t\t\tfilter = { filter_data: { pay_period_id: { value: ids } } };\n\t\t\t\tIndexViewController.goToView( 'PayStubAmendment', filter );\n\t\t\t\tbreak;\n\t\t\tcase 'generate_pay_stub':\n\n\t\t\t\tgrid = current_step_ui.pay_stub_generate;\n\t\t\t\tids = grid.grid.jqGrid( 'getGridParam', 'selarrrow' );\n\t\t\t\tProgressBar.showOverlay();\n\n\t\t\t\tTTAPI.APIPayStub.setIsIdempotent( true ); //Force to idempotent API call to avoid duplicate network requests from causing errors displayed to the user.\n\t\t\t\tTTAPI.APIPayStub.generatePayStubs( ids, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\tif ( result.isValid() ) {\n\t\t\t\t\t\t\tvar user_generic_status_batch_id = result.getAttributeInAPIDetails( 'user_generic_status_batch_id' );\n\n\t\t\t\t\t\t\tif ( user_generic_status_batch_id && TTUUID.isUUID( user_generic_status_batch_id ) && user_generic_status_batch_id != TTUUID.zero_id && user_generic_status_batch_id != TTUUID.not_exist_id ) {\n\t\t\t\t\t\t\t\tUserGenericStatusWindowController.open( user_generic_status_batch_id, [], function() {\n\t\t\t\t\t\t\t\t\t$this.buildCurrentStepData();\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tTAlertManager.showErrorAlert( result );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\tbreak;\n\t\t\tcase 'pay_stub':\n\n\t\t\t\tGlobal.addViewTab( this.wizard_id, $.i18n._( 'Process Payroll' ), window.location.href );\n\t\t\t\tthis.onCloseClick();\n\n\t\t\t\tif ( this.current_step === 7 ) {\n\t\t\t\t\tgrid = current_step_ui.pay_stub_generate;\n\t\t\t\t} else {\n\t\t\t\t\tgrid = current_step_ui.pay_stub_transfer;\n\t\t\t\t}\n\t\t\t\tids = grid.grid.jqGrid( 'getGridParam', 'selarrrow' );\n\t\t\t\tfilter = { filter_data: { pay_period_id: { value: ids } } };\n\t\t\t\tIndexViewController.goToView( 'PayStub', filter );\n\t\t\t\tbreak;\n\t\t\tcase 'pay_stub_summary':\n\t\t\t\tGlobal.addViewTab( this.wizard_id, $.i18n._( 'Process Payroll' ), window.location.href );\n\t\t\t\tthis.onCloseClick();\n\t\t\t\tIndexViewController.openReport( LocalCacheData.current_open_primary_controller, 'PayStubSummaryReport' );\n\n\t\t\t\tbreak;\n\t\t\tcase 'pay_stub_transaction_summary':\n\t\t\t\tGlobal.addViewTab( this.wizard_id, $.i18n._( 'Process Payroll' ), window.location.href );\n\t\t\t\tthis.onCloseClick();\n\t\t\t\tIndexViewController.openReport( LocalCacheData.current_open_primary_controller, 'PayStubTransactionSummaryReport' );\n\n\t\t\t\tbreak;\n\t\t\tcase 'payroll_export_report':\n\t\t\t\tGlobal.addViewTab( this.wizard_id, $.i18n._( 'Process Payroll' ), window.location.href );\n\t\t\t\tthis.onCloseClick();\n\t\t\t\tIndexViewController.openReport( LocalCacheData.current_open_primary_controller, 'PayrollExportReport' );\n\n\t\t\t\tbreak;\n\t\t\tcase 'close_pay_period':\n\t\t\t\tgrid = current_step_ui.pay_stub_close;\n\t\t\t\tids = grid.grid.jqGrid( 'getGridParam', 'selarrrow' );\n\t\t\t\tdata_array = [];\n\t\t\t\tfor ( var i = 0; i < ids.length; i++ ) {\n\t\t\t\t\tdata = {};\n\t\t\t\t\tdata.id = ids[i];\n\t\t\t\t\tdata.status_id = 20;\n\t\t\t\t\tdata_array.push( data );\n\t\t\t\t}\n\t\t\t\tProgressBar.showOverlay();\n\t\t\t\tthis.api_pay_period.setPayPeriod( data_array, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\tif ( result.isValid() ) {\n\t\t\t\t\t\t\t$this.buildCurrentStepData();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tTAlertManager.showErrorAlert( result );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\tcase 'authorization_timesheet':\n\t\t\t\tGlobal.addViewTab( this.wizard_id, $.i18n._( 'Process Payroll' ), window.location.href );\n\t\t\t\tIndexViewController.goToView( 'TimeSheetAuthorization' );\n\t\t\t\tthis.onCloseClick();\n\t\t\t\tbreak;\n\n\t\t\t//Process Payments Button Click\n\t\t\tcase 'direct_deposit':\n\t\t\t\tGlobal.addViewTab( this.wizard_id, $.i18n._( 'Process Payroll' ), window.location.href );\n\n\t\t\t\tvar pay_stub_transfer_grid = current_step_ui.pay_stub_transfer;\n\t\t\t\tvar data = {\n\t\t\t\t\ttransaction_source_data: $this.transaction_source_data,\n\t\t\t\t\tfilter_data: {\n\t\t\t\t\t\tpay_period_id: pay_stub_transfer_grid.grid.jqGrid( 'getGridParam', 'selarrrow' )\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tIndexViewController.openWizardController( 'ProcessTransactionsWizardController', data );\n\t\t\t\tthis.onCloseClick();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tonGridSelectRow( e ) {\n\t\tvar current_step_data = this.stepsDataDic[this.current_step];\n\t\tvar current_step_ui = this.stepsWidgetDic[this.current_step];\n\t\tvar grid;\n\t\tvar ids;\n\n\t\tif ( this.current_step === 5 ) {\n\t\t\tgrid = current_step_ui.lock_pay_period;\n\t\t\tids = grid.grid.jqGrid( 'getGridParam', 'selarrrow' );\n\n\t\t\tif ( ids.length < 1 ) {\n\t\t\t\tcurrent_step_ui.lock.addClass( 'disable-image' );\n\t\t\t\tcurrent_step_ui.unlock.addClass( 'disable-image' );\n\t\t\t} else {\n\t\t\t\tcurrent_step_ui.lock.removeClass( 'disable-image' );\n\t\t\t\tcurrent_step_ui.unlock.removeClass( 'disable-image' );\n\t\t\t}\n\n\t\t} else if ( this.current_step === 7 ) {\n\t\t\tgrid = current_step_ui.pay_stub_generate;\n\t\t\tids = grid.grid.jqGrid( 'getGridParam', 'selarrrow' );\n\t\t\tif ( ids.length < 1 ) {\n\t\t\t\tcurrent_step_ui.generate_pay_stub.addClass( 'disable-image' );\n\t\t\t} else {\n\t\t\t\tcurrent_step_ui.generate_pay_stub.removeClass( 'disable-image' );\n\t\t\t}\n\t\t} else if ( this.current_step === 8 ) {\n\t\t\tvar pay_stub_transfer_grid = current_step_ui.pay_stub_transfer;\n\t\t\tvar pay_stub_transaction_grid = current_step_ui.pay_stub_transaction;\n\n\t\t\tvar pay_period_ids = pay_stub_transfer_grid.grid.jqGrid( 'getGridParam', 'selarrrow' );\n\t\t\tif ( pay_period_ids.length < 1 ) {\n\t\t\t\tthis.content_div.find( '#directDepositIcon' ).addClass( 'disable-image' );\n\n\t\t\t\tvar grid = current_step_ui.pay_stub_transaction;\n\t\t\t\tgrid.grid.trigger( 'reloadGrid' );\n\t\t\t\tthis.setGridAutoHeight( grid, this.transaction_source_data.length );\n\t\t\t\tthis.showNoResultCover( grid.grid.parents( '.grid-div' ) );\n\t\t\t\tpay_stub_transaction_grid.grid.show();\n\n\t\t\t} else {\n\t\t\t\tthis.content_div.find( '#directDepositIcon' ).removeClass( 'disable-image' );\n\t\t\t\tvar $this = this;\n\t\t\t\tvar grid = current_step_ui.pay_stub_transaction;\n\n\t\t\t\t// A similar call to this api function is in the Process Transactions Popup\n\t\t\t\tthis.api_pay_stub_transaction.getPayPeriodTransactionSummary( { pay_period_id: pay_period_ids }, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t$this.transaction_source_data = result.getResult();\n\t\t\t\t\t\tif ( $this.transaction_source_data.length > 0 ) {\n\t\t\t\t\t\t\t$this.removeNoResultCover( grid.grid.parents( '.grid-div' ) );\n\n\t\t\t\t\t\t\tgrid.setData( $this.transaction_source_data );\n\t\t\t\t\t\t\t$this.setGridAutoHeight( grid, $this.transaction_source_data.length );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this.showNoResultCover( grid );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpay_stub_transaction_grid.grid.show();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\n\t\t} else if ( this.current_step === 9 ) {\n\t\t\tgrid = current_step_ui.pay_stub_close;\n\t\t\tids = grid.grid.jqGrid( 'getGridParam', 'selarrrow' );\n\t\t\tif ( ids.length < 1 ) {\n\t\t\t\tcurrent_step_ui.close.addClass( 'disable-image' );\n\t\t\t} else {\n\t\t\t\tcurrent_step_ui.close.removeClass( 'disable-image' );\n\t\t\t}\n\n\t\t}\n\t}\n\n\tsetGridAutoHeight( grid, length ) {\n\t\tif ( length > 0 && length < 10 ) {\n\t\t\tgrid.grid.setGridHeight( length * 23 );\n\t\t} else if ( length > 10 ) {\n\t\t\tgrid.grid.setGridHeight( 230 );\n\t\t}\n\t}\n\n\tbuildCurrentStepData() {\n\n\t\tif ( !this.stepsDataDic[1] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar pay_period_id = this.stepsDataDic[1].pay_period_id;\n\n\t\tif ( !pay_period_id || pay_period_id.length == 0 ) {\n\t\t\tpay_period_id = [0];\n\t\t}\n\t\tvar args = {};\n\t\tvar grid;\n\t\tvar $this = this;\n\t\tvar source_data;\n\n\t\tvar current_step_ui = this.stepsWidgetDic[this.current_step];\n\n\t\tswitch ( this.current_step ) {\n\t\t\tcase 2:\n\t\t\t\targs.filter_columns = {};\n\t\t\t\targs.filter_columns.id = true;\n\t\t\t\targs.filter_columns.start_date = true;\n\t\t\t\targs.filter_columns.end_date = true;\n\t\t\t\targs.filter_columns.transaction_date = true;\n\t\t\t\targs.filter_columns.pending_requests = true;\n\t\t\t\targs.filter_data = {};\n\t\t\t\targs.filter_data.id = pay_period_id;\n\n\t\t\t\tthis.api_pay_period.getPayPeriod( args, true, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\tsource_data = result.getResult();\n\t\t\t\t\t\tgrid = current_step_ui.pending_request;\n\t\t\t\t\t\tgrid.setData( source_data );\n\n\t\t\t\t\t\t$this.setGridSelection( grid, source_data );\n\n\t\t\t\t\t\t$this.setGridAutoHeight( grid, source_data.length );\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\targs.filter_columns = {};\n\t\t\t\targs.filter_columns.id = true;\n\t\t\t\targs.filter_columns.start_date = true;\n\t\t\t\targs.filter_columns.end_date = true;\n\t\t\t\targs.filter_columns.transaction_date = true;\n\t\t\t\targs.filter_columns.exceptions_high = true;\n\t\t\t\targs.filter_columns.exceptions_medium = true;\n\t\t\t\targs.filter_columns.exceptions_low = true;\n\t\t\t\targs.filter_columns.exceptions_critical = true;\n\t\t\t\targs.filter_data = {};\n\t\t\t\targs.filter_data.id = pay_period_id;\n\n\t\t\t\tthis.api_pay_period.getPayPeriod( args, true, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\tsource_data = result.getResult();\n\t\t\t\t\t\tgrid = current_step_ui.exceptions;\n\t\t\t\t\t\tgrid.setData( source_data );\n\n\t\t\t\t\t\t$this.setGridSelection( grid, source_data );\n\t\t\t\t\t\t$this.setGridAutoHeight( grid, source_data.length );\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\targs.filter_columns = {};\n\t\t\t\targs.filter_columns.id = true;\n\t\t\t\targs.filter_columns.start_date = true;\n\t\t\t\targs.filter_columns.end_date = true;\n\t\t\t\targs.filter_columns.transaction_date = true;\n\t\t\t\targs.filter_columns.verified_timesheets = true;\n\t\t\t\targs.filter_columns.pending_timesheets = true;\n\t\t\t\targs.filter_columns.total_timesheets = true;\n\t\t\t\targs.filter_data = {};\n\t\t\t\targs.filter_data.id = pay_period_id;\n\n\t\t\t\tthis.api_pay_period.getPayPeriod( args, true, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\tsource_data = result.getResult();\n\t\t\t\t\t\tgrid = current_step_ui.timesheet;\n\t\t\t\t\t\tgrid.setData( source_data );\n\n\t\t\t\t\t\t$this.setGridSelection( grid, source_data );\n\n\t\t\t\t\t\t$this.setGridAutoHeight( grid, source_data.length );\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\targs.filter_columns = {};\n\t\t\t\targs.filter_columns.id = true;\n\t\t\t\targs.filter_columns.start_date = true;\n\t\t\t\targs.filter_columns.end_date = true;\n\t\t\t\targs.filter_columns.transaction_date = true;\n\t\t\t\targs.filter_columns.status = true;\n\t\t\t\targs.filter_data = {};\n\t\t\t\targs.filter_data.id = pay_period_id;\n\n\t\t\t\tthis.api_pay_period.getPayPeriod( args, true, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\tsource_data = result.getResult();\n\t\t\t\t\t\tgrid = current_step_ui.lock_pay_period;\n\t\t\t\t\t\tgrid.setData( source_data );\n\t\t\t\t\t\t$this.setGridSelection( grid, source_data );\n\n\t\t\t\t\t\t$this.setGridAutoHeight( grid, source_data.length );\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\targs.filter_columns = {};\n\t\t\t\targs.filter_columns.id = true;\n\t\t\t\targs.filter_columns.start_date = true;\n\t\t\t\targs.filter_columns.end_date = true;\n\t\t\t\targs.filter_columns.transaction_date = true;\n\t\t\t\targs.filter_columns.ps_amendments = true;\n\t\t\t\targs.filter_data = {};\n\t\t\t\targs.filter_data.id = pay_period_id;\n\n\t\t\t\tthis.api_pay_period.getPayPeriod( args, true, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\tsource_data = result.getResult();\n\t\t\t\t\t\tgrid = current_step_ui.pay_stub_amendments;\n\t\t\t\t\t\tgrid.setData( source_data );\n\n\t\t\t\t\t\t$this.setGridSelection( grid, source_data );\n\t\t\t\t\t\t$this.setGridAutoHeight( grid, source_data.length );\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\targs.filter_columns = {};\n\t\t\t\targs.filter_columns.id = true;\n\t\t\t\targs.filter_columns.start_date = true;\n\t\t\t\targs.filter_columns.end_date = true;\n\t\t\t\targs.filter_columns.transaction_date = true;\n\t\t\t\targs.filter_columns.pay_stubs_open = true;\n\t\t\t\targs.filter_data = {};\n\t\t\t\targs.filter_data.id = pay_period_id;\n\n\t\t\t\tthis.api_pay_period.getPayPeriod( args, true, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\tsource_data = result.getResult();\n\t\t\t\t\t\tgrid = current_step_ui.pay_stub_generate;\n\t\t\t\t\t\tgrid.setData( source_data );\n\n\t\t\t\t\t\t$this.setGridSelection( grid, source_data );\n\t\t\t\t\t\t$this.setGridAutoHeight( grid, source_data.length );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\targs.filter_columns = {};\n\t\t\t\targs.filter_columns.id = true;\n\t\t\t\targs.filter_columns.start_date = true;\n\t\t\t\targs.filter_columns.end_date = true;\n\t\t\t\targs.filter_columns.transaction_date = true;\n\t\t\t\targs.filter_columns.pay_stubs_open = true;\n\t\t\t\targs.filter_data = {};\n\t\t\t\targs.filter_data.id = pay_period_id;\n\n\t\t\t\t//this if statement is only used for step 8 to prevent populating the transactions grid\n\t\t\t\tif ( TTUUID.isUUID( pay_period_id ) && pay_period_id != TTUUID.zero_id ) {\n\t\t\t\t\tthis.api_pay_period.getPayPeriod( args, true, {\n\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t\tsource_data = result.getResult();\n\t\t\t\t\t\t\tgrid = current_step_ui.pay_stub_transfer;\n\t\t\t\t\t\t\tgrid.setData( source_data );\n\n\t\t\t\t\t\t\t$this.setGridSelection( grid, source_data );\n\t\t\t\t\t\t\t$this.setGridAutoHeight( grid, source_data.length );\n\n\t\t\t\t\t\t\tvar pay_period_ids = [];\n\t\t\t\t\t\t\tfor ( var i in source_data ) {\n\t\t\t\t\t\t\t\tpay_period_ids.push( source_data[i].id );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$this.api_pay_stub_transaction.getPayPeriodTransactionSummary( { pay_period_id: pay_period_ids }, {\n\t\t\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t\t\t\t$this.transaction_source_data = result.getResult();\n\t\t\t\t\t\t\t\t\tgrid = current_step_ui.pay_stub_transaction;\n\t\t\t\t\t\t\t\t\tif ( typeof $this.transaction_source_data == 'object' && $this.transaction_source_data.length > 0 ) {\n\t\t\t\t\t\t\t\t\t\tgrid.setData( $this.transaction_source_data );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tgrid.setData( [] );\n\t\t\t\t\t\t\t\t\t\t$this.showNoResultCover( grid.grid.parents( '.grid-div' ) );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$this.setGridAutoHeight( grid, $this.transaction_source_data.length );\n\t\t\t\t\t\t\t\t\tgrid.grid.find( '.cbox' ).prop( 'checked', true );\n\n\t\t\t\t\t\t\t\t\tTTPromise.resolve( 'wizard', 'step8' );\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}\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 9:\n\t\t\t\targs.filter_columns = {};\n\t\t\t\targs.filter_columns.id = true;\n\t\t\t\targs.filter_columns.status = true;\n\t\t\t\targs.filter_columns.start_date = true;\n\t\t\t\targs.filter_columns.end_date = true;\n\t\t\t\targs.filter_columns.transaction_date = true;\n\t\t\t\targs.filter_columns.pay_stubs_open = true;\n\t\t\t\targs.filter_data = {};\n\t\t\t\targs.filter_data.id = pay_period_id;\n\n\t\t\t\tthis.api_pay_period.getPayPeriod( args, true, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\tsource_data = result.getResult();\n\t\t\t\t\t\tgrid = current_step_ui.pay_stub_close;\n\t\t\t\t\t\tgrid.setData( source_data );\n\n\t\t\t\t\t\t$this.setGridSelection( grid, source_data );\n\t\t\t\t\t\t$this.setGridAutoHeight( grid, source_data.length );\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\n\t\t}\n\t}\n\n\tsetCurrentStepValues() {\n\n\t\tif ( !this.stepsDataDic[this.current_step] ) {\n\t\t\tif ( this.current_step === 1 ) {\n\t\t\t\tthis.setLastPayPeriod();\n\t\t\t}\n\t\t\treturn;\n\t\t} else {\n\t\t\tvar current_step_data = this.stepsDataDic[this.current_step];\n\t\t\tvar current_step_ui = this.stepsWidgetDic[this.current_step];\n\t\t}\n\n\t\tswitch ( this.current_step ) {\n\t\t\tcase 1:\n\t\t\t\tif ( current_step_data.pay_period_id ) {\n\t\t\t\t\tif ( current_step_data.pay_period_id === TTUUID.zero_id || current_step_data.pay_period_id[0] === TTUUID.zero_id ) {\n\t\t\t\t\t\tthis.setLastPayPeriod();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurrent_step_ui.pay_period_id.setValue( current_step_data.pay_period_id );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetGridSelection( grid, source_data ) {\n\t\tif ( source_data ) {\n\t\t\tfor ( var i = 0; i < source_data.length; i++ ) {\n\t\t\t\tvar content = source_data[i];\n\t\t\t\tgrid.grid.jqGrid( 'setSelection', content['id'], false );\n\t\t\t}\n\t\t}\n\t}\n\n\tsetLastPayPeriod() {\n\t\tvar $this = this;\n\t\tthis.api_pay_period.getLastPayPeriod( {\n\t\t\tonResult: function( result ) {\n\t\t\t\tvar result_data = result.getResult();\n\n\t\t\t\tif ( result_data && result_data[0] && result_data[0].id ) {\n\t\t\t\t\t$this.stepsWidgetDic[1].pay_period_id.setValue( result_data );\n\t\t\t\t} else {\n\t\t\t\t\t$this.stepsWidgetDic[1].pay_period_id.setValue( TTUUID.zero_id );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\tsaveCurrentStep() {\n\t\tthis.stepsDataDic[this.current_step] = {};\n\t\tvar current_step_data = this.stepsDataDic[this.current_step];\n\t\tvar current_step_ui = this.stepsWidgetDic[this.current_step];\n\t\t//Error: TypeError: current_step_ui is undefined in /interface/html5/framework/jquery.min.js?v=8.0.0-20150126-115958 line 2 > eval line 989\n\t\tif ( !current_step_ui ) {\n\t\t\treturn;\n\t\t}\n\t\tswitch ( this.current_step ) {\n\t\t\tcase 1:\n\t\t\t\tcurrent_step_data.pay_period_id = current_step_ui.pay_period_id.getValue();\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetDefaultDataToSteps() {\n\n\t\tif ( !this.default_data ) {\n\t\t\treturn null;\n\t\t}\n\n//\t\t this.stepsDataDic[2] = {};\n//\t\t this.stepsDataDic[3] = {};\n//\n//\t\t if ( this.getDefaultData( 'user_id' ) ) {\n//\t\t\t this.stepsDataDic[3].user_id = this.getDefaultData( 'user_id' );\n//\t\t }\n//\n//\t\t if ( this.getDefaultData( 'pay_period_id' ) ) {\n//\t\t\t this.stepsDataDic[2].pay_period_id = this.getDefaultData( 'pay_period_id' );\n//\t\t }\n\t}\n\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTYzMC5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7QUFBTztBQUNQLDJCQUEyQjtBQUMzQixFQUFFLENBQUM7QUFDSDs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7O0FBRUEsa0JBQWtCLENBQUM7O0FBRW5CO0FBQ0EsSUFBSTs7QUFFSjtBQUNBOztBQUVBO0FBQ0E7O0FBRUEsZUFBZSxDQUFDO0FBQ2hCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBLElBQUk7QUFDSjtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsSUFBSTtBQUNKO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQSxnQkFBZ0IsQ0FBQztBQUNqQjtBQUNBLGNBQWMsQ0FBQztBQUNmOztBQUVBO0FBQ0E7QUFDQSxNQUFNOztBQUVOO0FBQ0E7O0F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