"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["wizard-re_calculate_accrual-ReCalculateAccrualWizardController"],{1490:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ReCalculateAccrualWizardController\": () => (/* binding */ ReCalculateAccrualWizardController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass ReCalculateAccrualWizardController extends BaseWizardController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '.wizard-bg',\n\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._( 'Accrual ReCalculation Wizard' );\n\t\tthis.steps = 3;\n\t\tthis.current_step = 1;\n\n\t\tthis.render();\n\t}\n\n\trender() {\n\t\tsuper.render();\n\n\t\tthis.initCurrentStep();\n\t}\n\n\t//Create each page UI\n\tbuildCurrentStepUI() {\n\n\t\tthis.content_div.empty();\n\t\tvar $this = this;\n\t\tthis.stepsWidgetDic[this.current_step] = {};\n\t\tswitch ( this.current_step ) {\n\t\t\tcase 1:\n\t\t\t\tvar label = this.getLabel();\n\t\t\t\tlabel.text( $.i18n._( 'Select one or more accrual policies' ) );\n\n\t\t\t\tvar a_combobox = this.getAComboBox( TTAPI.APIAccrualPolicy, true, 'global_accrual', 'accrual_policy_id' );\n\t\t\t\tvar div = $( '
' );\n\t\t\t\tdiv.append( a_combobox );\n\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._( 'Select the date range' ) );\n\n\t\t\t\tthis.content_div.append( label );\n\n\t\t\t\tvar form_item = $( Global.loadWidget( 'global/widgets/wizard_form_item/WizardFormItem.html' ) );\n\t\t\t\tvar form_item_label = form_item.find( '.form-item-label' );\n\t\t\t\tvar form_item_input_div = form_item.find( '.form-item-input-div' );\n\n\t\t\t\tvar combobox = this.getComboBox( 'time_period', true );\n\n\t\t\t\tform_item_label.text( $.i18n._( 'Time Period' ) );\n\t\t\t\tform_item_input_div.append( combobox );\n\n\t\t\t\tthis.content_div.append( form_item );\n\n\t\t\t\tform_item = $( Global.loadWidget( 'global/widgets/wizard_form_item/WizardFormItem.html' ) );\n\t\t\t\tform_item_label = form_item.find( '.form-item-label' );\n\t\t\t\tform_item_input_div = form_item.find( '.form-item-input-div' );\n\n\t\t\t\tvar start_picker = this.getDatePicker( 'start_date' );\n\n\t\t\t\tform_item_label.text( $.i18n._( 'Start Date' ) );\n\t\t\t\tform_item_input_div.append( start_picker );\n\n\t\t\t\tthis.content_div.append( form_item );\n\n\t\t\t\tform_item = $( Global.loadWidget( 'global/widgets/wizard_form_item/WizardFormItem.html' ) );\n\t\t\t\tform_item_label = form_item.find( '.form-item-label' );\n\t\t\t\tform_item_input_div = form_item.find( '.form-item-input-div' );\n\n\t\t\t\tvar end_picker = this.getDatePicker( 'end_date' );\n\n\t\t\t\tform_item_label.text( $.i18n._( 'End Date' ) );\n\t\t\t\tform_item_input_div.append( end_picker );\n\n\t\t\t\tthis.content_div.append( form_item );\n\n\t\t\t\tform_item = $( Global.loadWidget( 'global/widgets/wizard_form_item/WizardFormItem.html' ) );\n\t\t\t\tform_item_label = form_item.find( '.form-item-label' );\n\t\t\t\tform_item_input_div = form_item.find( '.form-item-input-div' );\n\n\t\t\t\tvar pay_period = this.getAComboBox( TTAPI.APIPayPeriod, true, 'global_Pay_period', 'pay_period_id' );\n\n\t\t\t\tform_item_label.text( $.i18n._( 'Pay Period' ) );\n\t\t\t\tform_item_input_div.append( pay_period );\n\n\t\t\t\tthis.content_div.append( form_item );\n\n\t\t\t\tform_item = $( Global.loadWidget( 'global/widgets/wizard_form_item/WizardFormItem.html' ) );\n\t\t\t\tform_item_label = form_item.find( '.form-item-label' );\n\t\t\t\tform_item_input_div = form_item.find( '.form-item-input-div' );\n\n\t\t\t\tvar pay_period_schedule = this.getAComboBox( TTAPI.APIPayPeriodSchedule, true, 'global_pay_period_schedule', 'pay_period_schedule_id' );\n\n\t\t\t\tform_item_label.text( $.i18n._( 'Pay Period Schedule' ) );\n\t\t\t\tform_item_input_div.append( pay_period_schedule );\n\n\t\t\t\tthis.content_div.append( form_item );\n\n\t\t\t\tcombobox.bind( 'formItemChange', function( e, target ) {\n\t\t\t\t\t$this.onTimePeriodChange( target );\n\t\t\t\t} );\n\n\t\t\t\tthis.stepsWidgetDic[this.current_step][combobox.getField()] = combobox;\n\n\t\t\t\tthis.stepsWidgetDic[this.current_step][start_picker.getField()] = start_picker;\n\t\t\t\tthis.stepsWidgetDic[this.current_step][end_picker.getField()] = end_picker;\n\t\t\t\tthis.stepsWidgetDic[this.current_step][pay_period.getField()] = pay_period;\n\t\t\t\tthis.stepsWidgetDic[this.current_step][pay_period_schedule.getField()] = pay_period_schedule;\n\n\t\t\t\t$this.onTimePeriodChange( combobox );\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._( 'Select one or more employees' ) );\n\n\t\t\t\ta_combobox = this.getAComboBox( TTAPI.APIUser, true, 'global_user', 'user_id', true );\n\t\t\t\tdiv = $( '
' );\n\t\t\t\tdiv.append( a_combobox );\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}\n\t}\n\n\tonTimePeriodChange( target ) {\n\t\tvar value = target.getValue();\n\n\t\tvar start_date_div = this.stepsWidgetDic[this.current_step]['start_date'].parent().parent();\n\t\tvar end_date_div = this.stepsWidgetDic[this.current_step]['end_date'].parent().parent();\n\t\tvar pay_period_div = this.stepsWidgetDic[this.current_step]['pay_period_id'].parent().parent();\n\t\tvar pay_period_schedule_div = this.stepsWidgetDic[this.current_step]['pay_period_schedule_id'].parent().parent();\n\n\t\tif ( value === 'custom_date' ) {\n\t\t\tstart_date_div.css( 'display', 'block' );\n\t\t\tend_date_div.css( 'display', 'block' );\n\t\t\tpay_period_div.css( 'display', 'none' );\n\t\t\tpay_period_schedule_div.css( 'display', 'none' );\n\t\t} else if ( value === 'custom_pay_period' ) {\n\t\t\tstart_date_div.css( 'display', 'none' );\n\t\t\tend_date_div.css( 'display', 'none' );\n\t\t\tpay_period_div.css( 'display', 'block' );\n\t\t\tpay_period_schedule_div.css( 'display', 'none' );\n\t\t} else if ( value === 'this_pay_period' || value === 'last_pay_period' || value === 'to_last_pay_period' || value === 'to_this_pay_period' ) {\n\t\t\tstart_date_div.css( 'display', 'none' );\n\t\t\tend_date_div.css( 'display', 'none' );\n\t\t\tpay_period_div.css( 'display', 'none' );\n\t\t\tpay_period_schedule_div.css( 'display', 'block' );\n\t\t} else {\n\t\t\tstart_date_div.css( 'display', 'none' );\n\t\t\tend_date_div.css( 'display', 'none' );\n\t\t\tpay_period_div.css( 'display', 'none' );\n\t\t\tpay_period_schedule_div.css( 'display', 'none' );\n\t\t}\n\t}\n\n\tonDoneClick() {\n\t\tvar $this = this;\n\t\tsuper.onDoneClick();\n\t\tthis.saveCurrentStep();\n\t\tvar accrual_policy_id = this.stepsDataDic[1].accrual_policy_id;\n\t\tvar user_ids = this.stepsDataDic[3].user_id;\n\n\t\tvar time_period = {};\n\t\ttime_period.time_period = this.stepsDataDic[2].time_period;\n\n\t\tfor ( var key in this.stepsDataDic[2] ) {\n\t\t\tif ( !this.stepsDataDic[2].hasOwnProperty( [key] ) || key === 'time_period' || key === 'effective_date' ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\ttime_period[key] = this.stepsDataDic[2][key];\n\n\t\t}\n\n\t\tvar accrual_policy_api = TTAPI.APIAccrualPolicy;\n\n\t\taccrual_policy_api.recalculateAccrual( accrual_policy_id, time_period, user_ids, {\n\t\t\tonResult: function( result ) {\n\t\t\t\t$this.onCloseClick();\n\n\t\t\t\tif ( $this.call_back ) {\n\t\t\t\t\t$this.call_back();\n\t\t\t\t}\n\n\t\t\t}\n\t\t} );\n\t}\n\n\tbuildCurrentStepData() {\n\t\tvar $this = this;\n\t\tvar current_step_data = this.stepsDataDic[this.current_step];\n\t\tvar current_step_ui = this.stepsWidgetDic[this.current_step];\n\t\tswitch ( this.current_step ) {\n\t\t\tcase 1:\n\t\t\t\tif ( current_step_data ) {\n\t\t\t\t\tfor ( var key in current_step_data ) {\n\t\t\t\t\t\tif ( !current_step_data.hasOwnProperty( key ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurrent_step_ui[key].setValue( current_step_data[key] );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tTTAPI.APITimesheetSummaryReport.getOptions( 'time_period', {\n\t\t\t\t\tonResult: function( result ) {\n\n\t\t\t\t\t\tcurrent_step_ui['time_period'].setSourceData( Global.buildRecordArray( result.getResult() ) );\n\n\t\t\t\t\t\tif ( !current_step_data ) {\n\t\t\t\t\t\t\tvar date = new Date();\n\t\t\t\t\t\t\tcurrent_step_ui.time_period.setValue( 'last_month' );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfor ( var key in current_step_data ) {\n\t\t\t\t\t\t\t\tif ( !current_step_data.hasOwnProperty( key ) ) {\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tcurrent_step_ui[key].setValue( current_step_data[key] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this.onTimePeriodChange( current_step_ui['time_period'] );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\n\t\t\t\tif ( !current_step_data ) {\n\t\t\t\t\tcurrent_step_ui['user_id'].setValue( TTUUID.not_exist_id );\n\t\t\t\t} else {\n\t\t\t\t\tfor ( var key in current_step_data ) {\n\t\t\t\t\t\tif ( !current_step_data.hasOwnProperty( key ) ) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurrent_step_ui[key].setValue( current_step_data[key] );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tfor ( var key in current_step_data ) {\n\t\t\t\t\tif ( !current_step_data.hasOwnProperty( key ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent_step_ui[key].setValue( current_step_data[key] );\n\t\t\t\t}\n\t\t\t\tbreak;\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\tswitch ( this.current_step ) {\n\t\t\tcase 1:\n\t\t\t\tcurrent_step_data.accrual_policy_id = current_step_ui.accrual_policy_id.getValue();\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tfor ( var key in current_step_ui ) {\n\t\t\t\t\tif ( !current_step_ui.hasOwnProperty( key ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( current_step_ui[key].is( ':visible' ) ) {\n\t\t\t\t\t\tcurrent_step_data[key] = current_step_ui[key].getValue();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tcurrent_step_data.user_id = current_step_ui.user_id.getValue();\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\tthis.stepsDataDic[1] = {};\n\n\t\tif ( this.getDefaultData( 'accrual_policy_id' ) ) {\n\t\t\tthis.stepsDataDic[1].accrual_policy_id = this.getDefaultData( 'accrual_policy_id' );\n\t\t}\n\t}\n\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ5MC5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7QUFBTztBQUNQLDJCQUEyQjtBQUMzQixFQUFFLENBQUM7QUFDSDs7QUFFQSxJQUFJOztBQUVKO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQSxlQUFlLENBQUM7QUFDaEI7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGdCQUFnQixDQUFDOztBQUVqQjtBQUNBLGNBQWMsQ0FBQztBQUNmOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxnQkFBZ0IsQ0FBQzs7QUFFakI7O0FBRUEsb0JBQW9CLENBQUM7QUFDckI7QUFDQTs7QUFFQTs7QUFFQSwwQkFBMEIsQ0FBQztBQUMzQjs7QUFFQTs7QUFFQSxnQkFBZ0IsQ0FBQztBQUNqQjtBQUNBOztBQUVBOztBQUVBLDBCQUEwQixDQUFDO0FBQzNCOztBQUVBOztBQUVBLGdCQUFnQixDQUFDO0FBQ2pCO0FBQ0E7O0FBRUE7O0FBRUEsMEJBQTBCLENBQUM7QUFDM0I7O0FBRUE7O0FBRUEsZ0JBQWdCLENBQUM7QUFDakI7QUFDQTs7QUFFQTs7QUFFQSwwQkFBMEIsQ0FBQztBQUMzQjs7QUFFQTs7QUFFQSxnQkFBZ0IsQ0FBQztBQUNqQjtBQUNB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