1 line
121 KiB
JavaScript
1 line
121 KiB
JavaScript
|
"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 = $( '<div class=\\'wizard-acombobox-div\\'></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 = $( '<div class=\\'grid-div wizard-grid-div\\'> <table id=\\'' + grid_id + '\\'></table></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.getRibbonIconRea
|