TimeTrex/interface/html5/dist/wizard-generate_pay_stub-GeneratePayStubWizardController.bundle.js

1 line
37 KiB
JavaScript

"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["wizard-generate_pay_stub-GeneratePayStubWizardController"],{7534:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"GeneratePayStubWizardController\": () => (/* binding */ GeneratePayStubWizardController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass GeneratePayStubWizardController extends BaseWizardController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '.wizard-bg'\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._( 'Generate Pay Stub 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\tbuildCurrentStepUI() {\n\t\tvar $this = this;\n\t\tthis.content_div.empty();\n\n\t\tthis.stepsWidgetDic[this.current_step] = {};\n\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._( 'Generate pay stubs for individual employees when manual modifications or a termination occurs. Use Payroll -> Process Payroll if you wish to generate pay stubs for all employees instead.' ) );\n\n\t\t\t\tthis.content_div.append( label );\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\n\t\t\t\tlabel = this.getLabel();\n\t\t\t\tlabel.text( $.i18n._( 'Select one or more pay periods and choose a payroll run type' ) );\n\t\t\t\tthis.content_div.append( label );\n\t\t\t\t// Pay period\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\t\t\t\tvar a_combobox = this.getAComboBox( TTAPI.APIPayPeriod, true, 'global_Pay_period', 'pay_period_id' );\n\t\t\t\ta_combobox.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t\t$this.saveCurrentStep();\n\t\t\t\t\t$this.onPayPeriodChange( true );\n\t\t\t\t\t$this.setPayRun( target.getValue() );\n\t\t\t\t} );\n\t\t\t\tform_item_label.text( $.i18n._( 'Pay Period' ) );\n\t\t\t\tform_item_input_div.append( a_combobox );\n\t\t\t\tthis.content_div.append( form_item );\n\t\t\t\tthis.stepsWidgetDic[this.current_step][a_combobox.getField()] = a_combobox;\n\n\t\t\t\t// Payroll Run Type\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\t\t\t\tvar combobox = this.getComboBox( 'type_id', false );\n\t\t\t\tform_item_label.text( $.i18n._( 'Payroll Run Type' ) );\n\t\t\t\tform_item_input_div.append( combobox );\n\t\t\t\tthis.content_div.append( form_item );\n\t\t\t\tthis.stepsWidgetDic[this.current_step][combobox.getField()] = combobox;\n\n\t\t\t\tcombobox.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t\t$this.saveCurrentStep();\n\t\t\t\t\t$this.onPayrollTypeChange( true );\n\t\t\t\t} );\n\n\t\t\t\t//Carry Forward to Date\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\t\t\t\tvar date_picker = this.getDatePicker( 'carry_forward_to_date' );\n\t\t\t\tform_item_label.text( $.i18n._( 'Carry Forward Adjustments to' ) );\n\t\t\t\tform_item_input_div.append( date_picker );\n\t\t\t\tthis.content_div.append( form_item );\n\t\t\t\tthis.stepsWidgetDic[this.current_step][date_picker.getField()] = date_picker;\n\t\t\t\tthis.stepsWidgetDic[this.current_step][date_picker.getField() + '_row'] = form_item;\n\n\t\t\t\tform_item.hide();\n\n\t\t\t\t//Transaction Date\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\t\t\t\tdate_picker = this.getDatePicker( 'transaction_date' );\n\t\t\t\tform_item_label.text( $.i18n._( 'Transaction Date' ) );\n\t\t\t\tform_item_input_div.append( date_picker );\n\t\t\t\tthis.content_div.append( form_item );\n\t\t\t\tthis.stepsWidgetDic[this.current_step][date_picker.getField()] = date_picker;\n\t\t\t\tthis.stepsWidgetDic[this.current_step][date_picker.getField() + '_row'] = form_item;\n\n\t\t\t\tform_item.hide();\n\n\t\t\t\t//Payroll Run #\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\t\t\t\tvar textInput = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\t\t\ttextInput = textInput.TTextInput( {\n\t\t\t\t\tfield: 'run_id',\n\t\t\t\t\twidth: 20\n\t\t\t\t} );\n\t\t\t\tform_item_label.text( $.i18n._( 'Payroll Run' ) );\n\t\t\t\tform_item_input_div.append( textInput );\n\t\t\t\tthis.content_div.append( form_item );\n\t\t\t\tthis.stepsWidgetDic[this.current_step][textInput.getField()] = textInput;\n\t\t\t\tthis.stepsWidgetDic[this.current_step][textInput.getField() + '_row'] = form_item;\n\n\t\t\t\tform_item.hide();\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\tvar div = $( '<div class=\\'wizard-acombobox-div\\'></div>' );\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\tsetPayRun( pay_period_id ) {\n\t\tvar api = TTAPI.APIPayStub;\n\t\tvar step_2_ui = this.stepsWidgetDic[2];\n\t\tapi.getCurrentPayRun( pay_period_id, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tvar data = result.getResult();\n\t\t\t\tstep_2_ui.run_id.setValue( data );\n\t\t\t}\n\t\t} );\n\t}\n\n\tbuildCurrentStepData() {\n\t\tvar $this = this;\n\n\t\tvar current_step_data = this.stepsDataDic[this.current_step];\n\t\tvar current_step_ui = this.stepsWidgetDic[this.current_step];\n\n\t\tif ( current_step_data && current_step_ui ) {\n\t\t\tswitch ( this.current_step ) {\n\t\t\t\tcase 2:\n\t\t\t\t\tif ( current_step_data.pay_period_id ) {\n\t\t\t\t\t\tvar pay_period_ids = current_step_data.pay_period_id;\n\t\t\t\t\t\tpay_period_ids = Global.array_unique( pay_period_ids );\n\n\t\t\t\t\t\tif ( current_step_data ) {\n\t\t\t\t\t\t\tcurrent_step_ui.pay_period_id.setValue( pay_period_ids );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this.setPayRun( pay_period_ids );\n\t\t\t\t\t}\n\t\t\t\t\tthis.onPayPeriodChange();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tif ( current_step_data.user_id ) {\n\t\t\t\t\t\tvar user_ids = current_step_data.user_id;\n\t\t\t\t\t\tuser_ids = Global.array_unique( user_ids );\n\t\t\t\t\t\tcurrent_step_ui.user_id.setValue( user_ids );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tonDoneClick() {\n\t\tvar $this = this;\n\t\tsuper.onDoneClick();\n\t\tthis.saveCurrentStep();\n\n\t\t// Function called stacks: TypeError: Cannot read property 'pay_period_id' of undefined\n\t\tif ( !this.stepsDataDic || !this.stepsDataDic[2] || !this.stepsDataDic[3] ) {\n\t\t\tTAlertManager.showAlert( $.i18n._( 'Wizard data is not correct on step 2 or step 3, please open wizard and try again' ) );\n\t\t\t$this.onCloseClick();\n\t\t}\n\n\t\tvar api = TTAPI.APIPayStub;\n\t\tvar pay_period_ids = this.stepsDataDic[2].pay_period_id;\n\t\tvar user_ids = this.stepsDataDic[3].user_id;\n\t\tvar type_id = this.stepsDataDic[2].type_id;\n\t\tvar run_id = this.stepsDataDic[2].run_id;\n\t\tvar transaction_date = null;\n\t\tvar cal_pay_stub_amendment = false;\n\t\tif ( type_id == 5 ) {\n\t\t\ttransaction_date = this.stepsDataDic[2].carry_forward_to_date;\n\t\t\tcal_pay_stub_amendment = true;\n\t\t} else {\n\t\t\ttransaction_date = this.stepsDataDic[2].transaction_date;\n\t\t}\n\n\t\tapi.setIsIdempotent( true ); //Force to idempotent API call to avoid duplicate network requests from causing errors displayed to the user.\n\t\tapi.generatePayStubs( pay_period_ids, user_ids, cal_pay_stub_amendment, run_id, type_id, transaction_date, { onResult: onDoneResult } );\n\n\t\tfunction onDoneResult( result ) {\n\t\t\tif ( result.isValid() ) {\n\t\t\t\tvar user_generic_status_batch_id = result.getAttributeInAPIDetails( 'user_generic_status_batch_id' );\n\n\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\tUserGenericStatusWindowController.open( user_generic_status_batch_id, user_ids, function() {\n\t\t\t\t\t\tif ( cal_pay_stub_amendment ) {\n\t\t\t\t\t\t\tvar filter = { filter_data: {} };\n\t\t\t\t\t\t\tvar users = { value: user_ids };\n\t\t\t\t\t\t\tfilter.filter_data.user_id = users;\n\t\t\t\t\t\t\tfilter.filter_data.status_id = 50; //active\n\t\t\t\t\t\t\tIndexViewController.goToView( 'PayStubAmendment', filter );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this.onCloseClick();\n\n\t\t\tif ( $this.call_back ) {\n\t\t\t\t$this.call_back();\n\t\t\t}\n\t\t}\n\n\t\t$this.onCloseClick();\n\t}\n\n\tonPayrollTypeChange( refresh ) {\n\t\tvar current_step_ui = this.stepsWidgetDic[this.current_step];\n\t\tvar current_step_data = this.stepsDataDic[this.current_step];\n\t\t//Error: Uncaught TypeError: Cannot read property 'hide' of undefined in /interface/html5/index.php#!m=PayStub line 221\n\t\tif ( !current_step_ui ||\n\t\t\t!current_step_ui['run_id_row'] ||\n\t\t\t!current_step_ui['carry_forward_to_date_row'] ||\n\t\t\t!current_step_ui['transaction_date_row'] ) {\n\t\t\treturn;\n\t\t}\n\t\tcurrent_step_ui['run_id_row'].hide();\n\t\tcurrent_step_ui['carry_forward_to_date_row'].hide();\n\t\tcurrent_step_ui['transaction_date_row'].hide();\n\t\tvar newest_pay_period = this.getNewestPayPeriod( this.selected_pay_periods );\n\t\tif ( current_step_data.type_id == 20 ) {\n\t\t\tcurrent_step_ui['run_id_row'].show();\n\t\t}\n\n\t\tif ( current_step_data.type_id != 5 ) {\n\t\t\tcurrent_step_ui['transaction_date_row'].show();\n\t\t\tif ( !refresh ) {\n\t\t\t\tif ( current_step_data.transaction_date ) {\n\t\t\t\t\tcurrent_step_ui['transaction_date'].setValue( Global.strToDateTime( current_step_data.transaction_date ).format() );\n\t\t\t\t} else {\n\t\t\t\t\tcurrent_step_ui['transaction_date'].setValue( newest_pay_period ? Global.strToDateTime( newest_pay_period.transaction_date ).format() : null );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcurrent_step_ui['transaction_date'].setValue( newest_pay_period ? Global.strToDateTime( newest_pay_period.transaction_date ).format() : null );\n\t\t\t}\n\t\t}\n\n\t\tif ( current_step_data.type_id == 5 ) {\n\t\t\tcurrent_step_ui['carry_forward_to_date_row'].show();\n\t\t\tif ( !refresh ) {\n\t\t\t\tcurrent_step_ui['carry_forward_to_date'].setValue( current_step_data.carry_forward_to_date || new Date().format() );\n\t\t\t} else {\n\t\t\t\tcurrent_step_ui['carry_forward_to_date'].setValue( new Date().format() );\n\t\t\t}\n\t\t}\n\t}\n\n\tbuildPayPeriodStatusIdArray( pay_periods ) {\n\t\tvar result = [];\n\t\tfor ( var i = 0; i < pay_periods.length; i++ ) {\n\t\t\tvar item = pay_periods[i];\n\t\t\tresult.push( item.status_id );\n\t\t}\n\t\treturn result;\n\t}\n\n\tgetNewestPayPeriod( pay_periods ) {\n\t\tvar result;\n\t\tfor ( var i = 0; i < pay_periods.length; i++ ) {\n\t\t\tvar item = pay_periods[i];\n\t\t\tvar date = Global.strToDateTime( item.transaction_date ).getTime();\n\t\t\tif ( !result || date > result ) {\n\t\t\t\tresult = item;\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tonPayPeriodChange( refresh ) {\n\t\tvar $this = this;\n\t\tvar current_step_ui = this.stepsWidgetDic[this.current_step];\n\t\tvar current_step_data = this.stepsDataDic[this.current_step];\n\t\tvar api = TTAPI.APIPayStub;\n\t\tvar api_pay_period = TTAPI.APIPayPeriod;\n\t\tvar args = {};\n\t\targs.filter_data = {};\n\t\targs.filter_data.id = current_step_data.pay_period_id;\n\t\tif ( !current_step_data.pay_period_id || current_step_data.pay_period_id.length === 0 ) {\n\t\t\targs.filter_data.id = [0];\n\t\t}\n\t\tapi_pay_period.getPayPeriod( args, {\n\t\t\tonResult: function( result ) {\n\t\t\t\t$this.selected_pay_periods = result.getResult();\n\t\t\t\tvar status_id_array = $this.buildPayPeriodStatusIdArray( $this.selected_pay_periods );\n\t\t\t\tapi.getOptions( 'payroll_run_type', status_id_array, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\tvar result_data = result.getResult();\n\t\t\t\t\t\tvar type_array = Global.buildRecordArray( result_data );\n\t\t\t\t\t\tcurrent_step_ui['type_id'].setSourceData( type_array );\n\t\t\t\t\t\tif ( !refresh ) {\n\t\t\t\t\t\t\tif ( !current_step_data.type_id ) {\n\t\t\t\t\t\t\t\tcurrent_step_data.type_id = type_array && type_array[0].value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcurrent_step_ui['type_id'].setValue( current_step_data.type_id );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcurrent_step_data.type_id = type_array && type_array[0].value;\n\t\t\t\t\t\t\tcurrent_step_ui['type_id'].setValue( current_step_data.type_id );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this.onPayrollTypeChange( refresh );\n\t\t\t\t\t}\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\tswitch ( this.current_step ) {\n\t\t\tcase 1:\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tcurrent_step_data.pay_period_id = current_step_ui.pay_period_id.getValue();\n\t\t\t\tcurrent_step_data.transaction_date = current_step_ui.transaction_date.getValue();\n\t\t\t\tcurrent_step_data.carry_forward_to_date = current_step_ui.carry_forward_to_date.getValue();\n\t\t\t\tcurrent_step_data.type_id = current_step_ui.type_id.getValue();\n\t\t\t\tcurrent_step_data.run_id = current_step_ui.run_id.getValue();\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[2] = {};\n\t\tthis.stepsDataDic[3] = {};\n\n\t\tif ( this.getDefaultData( 'user_id' ) ) {\n\t\t\tthis.stepsDataDic[3].user_id = this.getDefaultData( 'user_id' );\n\t\t}\n\n\t\tif ( this.getDefaultData( 'pay_period_id' ) ) {\n\t\t\tthis.stepsDataDic[2].pay_period_id = this.getDefaultData( 'pay_period_id' );\n\t\t}\n\t}\n\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzUzNC5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7QUFBTztBQUNQLDJCQUEyQjtBQUMzQixFQUFFLENBQUM7QUFDSDtBQUNBLElBQUk7O0FBRUo7QUFDQTs7QUFFQTtBQUNBOztBQUVBLGVBQWUsQ0FBQztBQUNoQjtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxnQkFBZ0IsQ0FBQzs7QUFFakI7QUFDQTtBQUNBOztBQUVBO0FBQ0EsZ0JBQWdCLENBQUM7QUFDakI7QUFDQTtBQUNBLG9CQUFvQixDQUFDO0FBQ3JCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsTUFBTTtBQUNOLDBCQUEwQixDQUFDO0FBQzNCO0FBQ0E7QUFDQTs7QUFFQTtBQUNBLGdCQUFnQixDQUFDO0FBQ2pCO0FBQ0E7QUFDQTtBQUNBLDBCQUEwQixDQUFDO0FBQzNCO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxNQUFNOztBQUVOO0FBQ0EsZ0JBQWdCLENBQUM7QUFDakI7QUFDQTtBQUNB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