TimeTrex/interface/html5/dist/wizard-pay_stub_account-PayStubAccountWizardController.bundle.js

1 line
14 KiB
JavaScript
Raw Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["wizard-pay_stub_account-PayStubAccountWizardController"],{6701:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"PayStubAccountWizardController\": () => (/* binding */ PayStubAccountWizardController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass PayStubAccountWizardController 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\t\tthis.title = $.i18n._( 'Migrate PS Accounts' );\n\t\tthis.steps = 2;\n\t\tthis.current_step = 1;\n\t\t$( this.el ).width( 1010 );\n\t\tthis.render();\n\t}\n\n\trender() {\n\t\tsuper.render();\n\t\tthis.initCurrentStep();\n\t}\n\n\t//Create each page UI\n\tbuildCurrentStepUI() {\n\t\tthis.content_div.empty();\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.html( $.i18n._( 'This wizard will automatically create Pay Stub Amendments to migrate Year-To-Date amounts from one Pay Stub Account to another as of a specific effective date.' ) + '<br><br>' );\n\t\t\t\tthis.content_div.append( label );\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t//Source Pay Stub Account\n\t\t\t\tvar form_item = $( Global.loadWidget( 'global/widgets/wizard_form_item/WizardFormItem.html' ) );\n\t\t\t\tform_item.css( 'margin-top', '15px' );\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.APIPayStubEntryAccount, true, 'global_PayStubAccount', 'src_ids' );\n\t\t\t\tform_item_label.text( $.i18n._( 'Source Pay Stub Account(s)' ) );\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// Destination Pay Stub Account\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\ta_combobox = this.getAComboBox( TTAPI.APIPayStubEntryAccount, false, 'global_PayStubAccount', 'dst_id' );\n\t\t\t\tform_item_label.text( $.i18n._( 'Destination Pay Stub Account' ) );\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//Effective 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 effective_date = this.getDatePicker( 'effective_date' );\n\t\t\t\tform_item_label.text( $.i18n._( 'Effective Date' ) );\n\t\t\t\tform_item_input_div.append( effective_date );\n\t\t\t\tthis.content_div.append( form_item );\n\t\t\t\tthis.stepsWidgetDic[this.current_step][effective_date.getField()] = effective_date;\n\n\t\t\t\tbreak;\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\n\t\tswitch ( this.current_step ) {\n\t\t\tcase 2:\n\t\t\t\tif ( !current_step_data ) {\n\t\t\t\t\tvar date = new Date();\n\t\t\t\t\tcurrent_step_ui.effective_date.setValue( date.format() );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tonDoneClick() {\n\t\tvar $this = this;\n\t\tsuper.onDoneClick();\n\t\tthis.saveCurr