1 line
114 KiB
JavaScript
1 line
114 KiB
JavaScript
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["policy-accrual_policy-AccrualPolicyViewController"],{5594:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"AccrualPolicyViewController\": () => (/* binding */ AccrualPolicyViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass AccrualPolicyViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#accrual_policy_view_container',\n\n\t\t\ttype_array: null,\n\t\t\tapply_frequency_array: null,\n\t\t\tmonth_of_year_array: null,\n\t\t\tday_of_month_array: null,\n\t\t\tday_of_week_array: null,\n\t\t\tmonth_of_quarter_array: null,\n\t\t\tlength_of_service_unit_array: null,\n\t\t\toriginal_milestone_data: [],\n\t\t\tdate_api: null,\n\t\t\taccrual_policy_milestone_api: null,\n\t\t\taccrual_policy_user_modifier_api: null,\n\n\t\t\tsub_accrual_policy_user_modifier_view_controller: null\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\t\t//this._super('initialize', options );\n\t\tthis.edit_view_tpl = 'AccrualPolicyEditView.html';\n\t\tthis.permission_id = 'accrual_policy';\n\t\tthis.viewId = 'AccrualPolicy';\n\t\tthis.script_name = 'AccrualPolicyView';\n\t\tthis.table_name_key = 'accrual_policy';\n\t\tthis.context_menu_name = $.i18n._( 'Accrual Policy' );\n\t\tthis.navigation_label = $.i18n._( 'Accrual Policy' );\n\t\tthis.api = TTAPI.APIAccrualPolicy;\n\t\tthis.date_api = TTAPI.APITTDate;\n\t\tthis.accrual_policy_milestone_api = TTAPI.APIAccrualPolicyMilestone;\n\t\tthis.accrual_policy_user_modifier_api = TTAPI.APIAccrualPolicyUserModifier;\n\t\tthis.month_of_quarter_array = Global.buildRecordArray( { 1: 1, 2: 2, 3: 3 } );\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\n\t\tthis.initData();\n\t}\n\n\tonCustomContextClick( id ) {\n\t\tswitch ( id ) {\n\t\t\tcase 're_calculate_accrual':\n\t\t\t\tthis.onReCalAccrualClick();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tonReCalAccrualClick() {\n\t\tvar default_data = {};\n\t\tvar $this = this;\n\n\t\tif ( this.edit_view ) {\n\t\t\tdefault_data.accrual_policy_id = [this.current_edit_record.id];\n\t\t} else {\n\t\t\tdefault_data.accrual_policy_id = this.getGridSelectIdArray();\n\t\t}\n\n\t\tIndexViewController.openWizard( 'ReCalculateAccrualWizard', default_data, function() {\n\t\t\t$this.search();\n\t\t} );\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\texclude: [],\n\t\t\tinclude: [\n\t\t\t\t{\n\t\t\t\t\tlabel: '', //Empty label. vue_icon is displayed instead of text.\n\t\t\t\t\tid: 'other_header',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\taction_group: 'other',\n\t\t\t\t\taction_group_header: true,\n\t\t\t\t\tvue_icon: 'tticon tticon-more_vert_black_24dp',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'ReCalculate Accrual' ),\n\t\t\t\t\tid: 're_calculate_accrual',\n\t\t\t\t\tpermission_result: true,\n\t\t\t\t\tpermission: null,\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\taction_group: 'other'\n\t\t\t\t}\n\t\t\t]\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\n\n\t\tvar options = [\n\t\t\t{ option_name: 'type', api: this.api },\n\t\t\t{ option_name: 'apply_frequency', api: this.api },\n\t\t\t{ option_name: 'length_of_service_unit', field_name: 'length_of_service_unit_id', api: this.accrual_policy_milestone_api },\n\t\t];\n\n\t\tthis.initDropDownOptions( options );\n\n\t\tthis.date_api.getMonthOfYearArray( {\n\t\t\tonResult: function( res ) {\n\t\t\t\tres = res.getResult();\n\t\t\t\t$this.month_of_year_array = res;\n\t\t\t}\n\t\t} );\n\t\tthis.date_api.getDayOfMonthArray( {\n\t\t\tonResult: function( res ) {\n\t\t\t\tres = res.getResult();\n\t\t\t\t$this.day_of_month_array = res;\n\t\t\t}\n\t\t} );\n\t\tthis.date_api.getDayOfWeekArray( {\n\t\t\tonResult: function( res ) {\n\t\t\t\tres = res.getResult();\n\t\t\t\t$this.day_of_week_array = res;\n\t\t\t}\n\t\t} );\n\t}\n\n\tsetCustomDefaultMenuIcon( id, context_btn, grid_selected_length ) {\n\t\tswitch ( id ) {\n\t\t\tcase 're_calculate_accrual':\n\t\t\t\tthis.setDefaultMenuReCalAccrualWizardIcon( context_btn, grid_selected_length );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetCustomEditMenuIcon( id, context_btn ) {\n\t\tswitch ( id ) {\n\t\t\tcase 're_calculate_accrual':\n\t\t\t\tthis.setEditMenuReCalAccrualWizardIcon( context_btn );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetEditMenuReCalAccrualWizardIcon( context_btn ) {\n\t\tif ( PermissionManager.validate( 'accrual_policy', 'enabled' ) &&\n\t\t\t( PermissionManager.validate( 'accrual_policy', 'edit' ) || PermissionManager.validate( 'accrual_policy', 'edit_child' ) || PermissionManager.validate( 'accrual_policy', 'edit_own' ) )\n\t\t) {\n\t\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\n\t\t} else {\n\t\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false )\n\t\t}\n\n\t\tif ( this.current_edit_record && this.current_edit_record.id ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\t\t} else {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\t}\n\n\tsetDefaultMenuReCalAccrualWizardIcon( context_btn, grid_selected_length ) {\n\t\tif ( PermissionManager.validate( 'accrual_policy', 'enabled' ) &&\n\t\t\t( PermissionManager.validate( 'accrual_policy', 'edit' ) || PermissionManager.validate( 'accrual_policy', 'edit_child' ) || PermissionManager.validate( 'accrual_policy', 'edit_own' ) )\n\t\t) {\n\t\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\n\t\t} else {\n\t\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false )\n\t\t}\n\n\t\tif ( grid_selected_length >= 1 ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\t\t} else {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\t}\n\n\tbuildEditViewUI() {\n\n\t\tsuper.buildEditViewUI();\n\n\t\tvar $this = this;\n\n\t\tvar tab_model = {\n\t\t\t'tab_accrual_policy': { 'label': $.i18n._( 'Accrual Policy' ), 'is_multi_column': true },\n\t\t\t'tab_length_of_service_milestones': {\n\t\t\t\t'label': $.i18n._( 'Length Of Service Milestones' ),\n\t\t\t\t'html_template': this.getAccrualPolicyLengthOfServiceMilestonesTabHtml()\n\t\t\t},\n\t\t\t'tab_employee_settings': {\n\t\t\t\t'label': $.i18n._( 'Employee Settings' ),\n\t\t\t\t'init_callback': 'initSubAccrualPolicyUserModifier',\n\t\t\t\t'display_on_mass_edit': false,\n\t\t\t\t'show_permission_div': true\n\t\t\t},\n\t\t\t'tab_audit': true,\n\t\t};\n\t\tthis.setTabModel( tab_model );\n\n\t\tthis.navigation.AComboBox( {\n\t\t\tapi_class: TTAPI.APIAccrualPolicy,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_accrual',\n\t\t\tnavigation_mode: true,\n\t\t\tshow_search_inputs: true\n\t\t} );\n\n\t\tthis.setNavigation();\n\n\t\t//Tab 0 start\n\n\t\tvar tab_accrual_policy = this.edit_view_tab.find( '#tab_accrual_policy' );\n\t\tvar tab_length_of_service_milestones = this.edit_view_tab.find( '#tab_length_of_service_milestones' );\n\n\t\tvar tab_accrual_policy_column1 = tab_accrual_policy.find( '.first-column' );\n\t\tvar tab_length_of_service_milestones_column1 = tab_length_of_service_milestones.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_accrual_policy_column1 );\n\n\t\tvar form_item_input;\n\t\tvar widgetContainer;\n\t\tvar label;\n\n\t\t//Name\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'name', width: '100%' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Name' ), form_item_input, tab_accrual_policy_column1, '' );\n\n\t\tform_item_input.parent().width( '45%' );\n\n\t\t// Description\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_AREA );\n\t\tform_item_input.TTextArea( { field: 'description', width: '100%' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Description' ), form_item_input, tab_accrual_policy_column1, '', null, null, true );\n\n\t\tform_item_input.parent().width( '45%' );\n\n\t\t//Type\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\n\t\tform_item_input.TComboBox( { field: 'type_id', set_empty: false } );\n\t\tform_item_input.setSourceData( $this.type_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Type' ), form_item_input, tab_accrual_policy_column1 );\n\n\t\t// Contributing Shift\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIContributingShiftPolicy,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_contributing_shift_policy',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tset_default: true,\n\t\t\tfield: 'contributing_shift_policy_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Contributing Shift Policy' ), form_item_input, tab_accrual_policy_column1, '', null, true );\n\n\t\t// Accrual Account\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIAccrualPolicyAccount,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_accrual_policy_account',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tset_default: true,\n\t\t\tfield: 'accrual_policy_account_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Accrual Account' ), form_item_input, tab_accrual_policy_column1 );\n\n\t\t//Length of Service contributing pay codes.\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIContributingPayCodePolicy,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_contributing_pay_code_policy',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tset_default: true,\n\t\t\tfield: 'length_of_service_contributing_pay_code_policy_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Length Of Service Hours Based On' ), form_item_input, tab_length_of_service_milestones_column1, '', null, true );\n\n\t\t//Milestone Rollover Based On\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.SEPARATED_BOX );\n\t\tform_item_input.SeparatedBox( { label: $.i18n._( 'Milestone Rollover Based On' ) } );\n\t\tthis.addEditFieldToColumn( null, form_item_input, tab_accrual_policy_column1, '', null, true, false, 'separated_2' );\n\n\t\t//Employee's Hire Date\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'milestone_rollover_hire_date' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Employee\\'s Hire Date' ), form_item_input, tab_accrual_policy_column1, '', null, true );\n\n\t\t//Month\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'milestone_rollover_month' } );\n\t\tform_item_input.setSourceData( $this.month_of_year_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Month' ), form_item_input, tab_accrual_policy_column1, '', null, true );\n\n\t\t//Day Of Month\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\n\t\tform_item_input.TComboBox( { field: 'milestone_rollover_day_of_month' } );\n\t\tform_item_input.setSourceData( $this.day_of_month_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Day of Month' ), form_item_input, tab_accrual_policy_column1, '', null, true );\n\n\t\tvar tab_accrual_policy_column2 = tab_accrual_policy.find( '.second-column' );\n\t\tthis.edit_view_tabs[0].push( tab_accrual_policy_column2 );\n\n\t\t// Excess Rollover Accrual Account\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIAccrualPolicyAccount,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_accrual_policy_account',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tset_default: true,\n\t\t\tfield: 'excess_rollover_accrual_policy_account_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Move Excess Rollover Time To' ), form_item_input, tab_accrual_policy_column1 );\n\n\n\t\t//Frequency In Which To Apply Time to Employee Records\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.SEPARATED_BOX );\n\t\tform_item_input.SeparatedBox( { label: $.i18n._( 'Frequency In Which To Apply Time to Employee Records' ) } );\n\t\tthis.addEditFieldToColumn( null, form_item_input, tab_accrual_policy_column2, '', null, true, false, 'separated_1' );\n\n\t\t//Frequency\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'apply_frequency_id', set_empty: false } );\n\t\tform_item_input.setSourceData( $this.apply_frequency_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Frequency' ), form_item_input, tab_accrual_policy_column2, '', null, true );\n\n\t\t//Employee's Hire Date\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'apply_frequency_hire_date' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Employee\\'s Hire Date' ), form_item_input, tab_accrual_policy_column2, '', null, true );\n\n\t\t//Month\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'apply_frequency_month' } );\n\t\tform_item_input.setSourceData( $this.month_of_year_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Month' ), form_item_input, tab_accrual_policy_column2, '', null, true );\n\n\t\t//Day Of Month\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'apply_frequency_day_of_month' } );\n\t\tform_item_input.setSourceData( $this.day_of_month_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Day of Month' ), form_item_input, tab_accrual_policy_column2, '', null, true );\n\n\t\t//Day Of Week\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'apply_frequency_day_of_week' } );\n\t\tform_item_input.setSourceData( $.extend( {}, $this.day_of_week_array ) );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Day Of Week' ), form_item_input, tab_accrual_policy_column2, '', null, true );\n\n\t\t// Month of Quarter\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\n\t\tform_item_input.TComboBox( { field: 'apply_frequency_quarter_month', set_empty: false } );\n\t\tform_item_input.setSourceData( $this.month_of_quarter_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Month of Quarter' ), form_item_input, tab_accrual_policy_column2, '', null, true );\n\n\t\t// After Minimum Employed Days\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'minimum_employed_days', width: 30 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'After Minimum Employed Days' ), form_item_input, tab_accrual_policy_column2, '', null, true );\n\n\t\t//Enable Opening Balance\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'enable_opening_balance' } );\n\t\twidgetContainer = $( '<div class=\\'widget-h-box\\'></div>' );\n\t\tlabel = $( '<span class=\\'widget-right-label\\'> ' + $.i18n._( '(Applies Initial Accrual Amount on Hire Date)' ) + '</span>' );\n\t\twidgetContainer.append( form_item_input );\n\t\twidgetContainer.append( label );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Enable Opening Balance' ), form_item_input, tab_accrual_policy_column2, '', widgetContainer, true );\n\n\t\t//Enable Pro-Rate Initial Period\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'enable_pro_rate_initial_period' } );\n\t\twidgetContainer = $( '<div class=\\'widget-h-box\\'></div>' );\n\t\tlabel = $( '<span class=\\'widget-right-label\\'> ' + $.i18n._( '(Based on Hire Date)' ) + '</span>' );\n\t\twidgetContainer.append( form_item_input );\n\t\twidgetContainer.append( label );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Prorate Initial Accrual Amount' ), form_item_input, tab_accrual_policy_column2, '', widgetContainer, true );\n\n\t\tvar tab_length_of_service_milestones = this.edit_view_tab.find( '#tab_length_of_service_milestones' );\n\n\t\t//\n\t\t//Inside editor\n\t\t//\n\t\tvar inside_editor_div = tab_length_of_service_milestones.find( '.inside-editor-div' );\n\t\tvar args = {\n\t\t\tlength_of_service: $.i18n._( 'Length Of Service' ),\n\t\t\taccrual_rate: $.i18n._( 'Accrual Rate/Year' ),\n\t\t\taccrual_total_maximum: $.i18n._( 'Accrual Maximum Balance' ),\n\t\t\tannual_maximum_rollover: $.i18n._( 'Annual Maximum Rollover' ),\n\t\t\tannual_maximum_time: $.i18n._( 'Annual Accrual Maximum' )\n\t\t};\n\n\t\tthis.editor = Global.loadWidgetByName( FormItemType.INSIDE_EDITOR );\n\n\t\tthis.editor.InsideEditor( {\n\t\t\taddRow: this.insideEditorAddRow,\n\t\t\tremoveRow: this.insideEditorRemoveRow,\n\t\t\tgetValue: this.insideEditorGetValue,\n\t\t\tsetValue: this.insideEditorSetValue,\n\t\t\trender: getRender(),\n\t\t\trender_args: args,\n\t\t\trender_inline_html: true,\n\t\t\trow_render: getRowRender(),\n\t\t\tparent_controller: this\n\t\t} );\n\n\t\tfunction getRender() {\n\t\t\treturn `\n\t\t\t<table class=\"inside-editor-render\">\n\t\t\t\t<tr class=\"title\">\n\t\t\t\t\t<td style=\"width: 200px\"><%= length_of_service %></td>\n\t\t\t\t\t<td style=\"width: 200px\"><%= accrual_rate %></td>\n\t\t\t\t\t<td class=\"annual-maximum-time-td\" style=\"width: 200px\"><%= annual_maximum_time %></td>\n\t\t\t\t\t<td style=\"width: 200px\"><%= accrual_total_maximum %></td>\n\t\t\t\t\t<td style=\"width: 200px\"><%= annual_maximum_rollover %></td>\n\t\t\t\t\t<td style=\"width: 25px\"></td>\n\t\t\t\t\t<td style=\"width: 25px\"></td>\n\t\t\t\t</tr>\n\t\t\t</table>`;\n\t\t}\n\n\t\tfunction getRowRender() {\n\t\t\treturn `\n\t\t\t<tr class=\"inside-editor-row data-row\">\n\t\t\t\t<td class=\"length_of_service cell\"></td>\n\t\t\t\t<td class=\"accrual_rate cell\"></td>\n\t\t\t\t<td class=\"annual_maximum_time annual-maximum-time-td cell\"></td>\n\t\t\t\t<td class=\"accrual_total_maximum cell\"></td>\n\t\t\t\t<td class=\"annual_maximum_rollover cell\"></td>\n\t\t\t\t<td class=\"cell control-icon\">\n\t\t\t\t\t<button class=\"plus-icon\" onclick=\"\"></button>\n\t\t\t\t</td>\n\t\t\t\t<td class=\"cell control-icon\">\n\t\t\t\t\t<button class=\"minus-icon \" onclick=\"\"></button>\n\t\t\t\t</td>\n\t\t\t</tr>`;\n\t\t}\n\n\t\tinside_editor_div.append( this.editor );\n\t}\n\n\tonMilestoneRolloverHireDate() {\n\t\tif ( this.current_edit_record['milestone_rollover_hire_date'] === true ) {\n\t\t\tthis.detachElement( 'milestone_rollover_month' );\n\t\t\tthis.detachElement( 'milestone_rollover_day_of_month' );\n\t\t} else if ( this.current_edit_record['milestone_rollover_hire_date'] === false ) {\n\t\t\tthis.attachElement( 'milestone_rollover_month' );\n\t\t\tthis.attachElement( 'milestone_rollover_day_of_month' );\n\t\t}\n\n\t\tthis.editFieldResize();\n\t}\n\n\tonApplyFrequencyHireDate() {\n\t\tif ( this.current_edit_record['apply_frequency_id'] == 20 ) {\n\t\t\tthis.attachElement( 'apply_frequency_hire_date' );\n\t\t\tif ( this.current_edit_record['apply_frequency_hire_date'] === true ) {\n\t\t\t\tthis.detachElement( 'apply_frequency_month' );\n\t\t\t\tthis.detachElement( 'apply_frequency_day_of_month' );\n\t\t\t} else {\n\t\t\t\tthis.attachElement( 'apply_frequency_month' );\n\t\t\t\tthis.attachElement( 'apply_frequency_day_of_month' );\n\t\t\t}\n\n\t\t\tthis.editFieldResize();\n\t\t}\n\t}\n\n\tonApplyFrequencyChange( arg ) {\n\n\t\tif ( !Global.isSet( arg ) ) {\n\n\t\t\tif ( !Global.isSet( this.current_edit_record['apply_frequency_id'] ) ) {\n\t\t\t\tthis.current_edit_record['apply_frequency_id'] = 10;\n\t\t\t}\n\n\t\t\targ = this.current_edit_record['apply_frequency_id'];\n\t\t}\n\t\tthis.detachElement( 'apply_frequency_hire_date' );\n\t\tthis.detachElement( 'apply_frequency_month' );\n\t\tthis.detachElement( 'apply_frequency_day_of_month' );\n\t\tthis.detachElement( 'apply_frequency_day_of_week' );\n\t\tthis.detachElement( 'apply_frequency_quarter_month' );\n\n\t\tif ( arg == 20 ) {\n\t\t\tthis.onApplyFrequencyHireDate();\n\n\t\t} else if ( arg == 30 ) {\n\t\t\tthis.attachElement( 'apply_frequency_day_of_month' );\n\n\t\t} else if ( arg == 40 ) {\n\t\t\tthis.attachElement( 'apply_frequency_day_of_week' );\n\t\t} else if ( arg == 25 ) {\n\t\t\tthis.attachElement( 'apply_frequency_day_of_month' );\n\t\t\tthis.attachElement( 'apply_frequency_quarter_month' );\n\t\t}\n\n\t\tthis.editFieldResize();\n\t}\n\n\tonTypeChange() {\n\t\tif ( !Global.isSet( this.current_edit_record['type_id'] ) ) {\n\t\t\tthis.current_edit_record['type_id'] = 20;\n\t\t}\n\n\t\tif ( this.current_edit_record['type_id'] == 20 ) {\n\t\t\tif ( !this.is_mass_editing ) {\n\t\t\t\t$( this.edit_view_tab.find( 'ul li' )[1] ).show();\n\t\t\t\t$( this.edit_view_tab.find( 'ul li' )[2] ).show();\n\t\t\t}\n\t\t\tthis.edit_view_tab.find( '#tab_accrual_policy' ).find( '.second-column' ).css( 'display', 'block' );\n\t\t\tthis.edit_view_tab.find( '#tab_accrual_policy' ).find( '.first-column' ).removeClass( 'full-width-column' );\n\t\t\tthis.attachElement( 'separated_1' );\n\t\t\tthis.attachElement( 'apply_frequency_id' );\n\t\t\tthis.attachElement( 'minimum_employed_days' );\n\t\t\tthis.detachElement( 'contributing_shift_policy_id' );\n\t\t\tthis.attachElement( 'enable_opening_balance' );\n\t\t\tthis.attachElement( 'enable_pro_rate_initial_period' );\n\n\t\t\tthis.onApplyFrequencyChange();\n\t\t\tthis.onApplyFrequencyHireDate();\n\t\t} else if ( this.current_edit_record['type_id'] == 30 ) {\n\t\t\tif ( !this.is_mass_editing ) {\n\t\t\t\t$( this.edit_view_tab.find( 'ul li' )[1] ).show();\n\t\t\t\t$( this.edit_view_tab.find( 'ul li' )[2] ).show();\n\t\t\t}\n\t\t\tthis.edit_view_tab.find( '#tab_accrual_policy' ).find( '.second-column' ).css( 'display', 'block' );\n\t\t\tthis.edit_view_tab.find( '#tab_accrual_policy' ).find( '.first-column' ).removeClass( 'full-width-column' );\n\t\t\tthis.attachElement( 'contributing_shift_policy_id' );\n\t\t\tthis.attachElement( 'separated_1' );\n\t\t\tthis.attachElement( 'minimum_employed_days' );\n\t\t\tthis.detachElement( 'enable_opening_balance' );\n\t\t\tthis.detachElement( 'enable_pro_rate_initial_period' );\n\t\t\tthis.detachElement( 'apply_frequency_id' );\n\n\t\t\tthis.onApplyFrequencyChange( false );\n\t\t}\n\n\t\tthis.editFieldResize();\n\t\tthis.setAccrualRageFormat();\n\t}\n\n\tsetAccrualRageFormat( type ) {\n\n\t\tvar len = this.editor.rows_widgets_array.length;\n\n\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\tvar row = this.editor.rows_widgets_array[i];\n\n\t\t\tif ( this.current_edit_record['type_id'] == 30 ) {\n\t\t\t\trow.accrual_rate_hourly.show();\n\t\t\t\trow.accrual_rate_yearly.hide();\n\t\t\t} else {\n\t\t\t\trow.accrual_rate_yearly.show();\n\t\t\t\trow.accrual_rate_hourly.hide();\n\t\t\t}\n\t\t}\n\n\t\tvar td = $( '.inside-editor-render' ).children().eq( 0 ).children().eq( 0 ).children().eq( 1 );\n\t\tif ( this.current_edit_record['type_id'] == 30 ) {\n\t\t\ttd.text( $.i18n._( 'Accrual Rate/Hour' ) );\n\t\t\t$( '.annual-maximum-time-td' ).show();\n\t\t} else {\n\t\t\ttd.text( $.i18n._( 'Accrual Rate/Year' ) );\n\t\t\t$( '.annual-maximum-time-td' ).hide();\n\t\t}\n\t}\n\n\tonFormItemChange( target, doNotValidate ) {\n\t\tthis.setIsChanged( target );\n\t\tthis.setMassEditingFieldsWhenFormChange( target );\n\t\tvar key = target.getField();\n\t\tvar c_value = target.getValue();\n\n\t\tthis.current_edit_record[key] = c_value;\n\t\tif ( key === 'type_id' ) {\n\n\t\t\tthis.onTypeChange();\n\t\t}\n\n\t\tif ( key === 'apply_frequency_id' ) {\n\t\t\tthis.onApplyFrequencyChange();\n\t\t}\n\n\t\tif ( key === 'apply_frequency_hire_date' ) {\n\t\t\tthis.onApplyFrequencyHireDate();\n\t\t}\n\n\t\tif ( key === 'milestone_rollover_hire_date' ) {\n\t\t\tthis.onMilestoneRolloverHireDate();\n\t\t}\n\n\t\tif ( !doNotValidate ) {\n\t\t\tthis.validate();\n\t\t}\n\t}\n\n\tisDisplayLengthOfServiceHoursBasedOn() {\n\t\tvar len = this.editor.rows_widgets_array.length;\n\n\t\tvar count = 0;\n\n\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\tvar row = this.editor.rows_widgets_array[i];\n\t\t\tif ( row['length_of_service_unit_id'].getValue() == 50 ) {\n\t\t\t\tcount++;\n\t\t\t}\n\n\t\t}\n\n\t\tif ( count === 0 ) {\n\t\t\tthis.detachElement( 'length_of_service_contributing_pay_code_policy_id' );\n\t\t\tthis.edit_view_tab.find( '#tab_length_of_service_milestones' ).find( '.first-column' ).css( 'border', 'none' );\n\t\t} else {\n\t\t\tthis.attachElement( 'length_of_service_contributing_pay_code_policy_id' );\n\t\t\tthis.edit_view_tab.find( '#tab_length_of_service_milestones' ).find( '.first-column' ).css( 'border', '1px solid #c7c7c7' );\n\t\t}\n\t}\n\n\tinsideEditorSetValue( val ) {\n\t\tvar len = val.length;\n\n\t\tthis.removeAllRows();\n\t\tfor ( var i = 0; i < val.length; i++ ) {\n\t\t\tif ( Global.isSet( val[i] ) ) {\n\t\t\t\tvar row = val[i];\n\t\t\t\tif ( Global.isSet( this.parent_id ) ) {\n\t\t\t\t\trow['id'] = '';\n\t\t\t\t}\n\t\t\t\tthis.addRow( row );\n\t\t\t}\n\n\t\t}\n\t}\n\n\tinsideEditorAddRow( data, index ) {\n\n\t\tif ( !data ) {\n\t\t\tdata = {};\n\t\t}\n\n\t\tvar row_id = ( data.id && this.parent_controller.current_edit_record.id ) ? data.id : TTUUID.generateUUID();\n\n\t\tvar $this = this;\n\t\tvar row = this.getRowRender(); //Get Row render\n\t\tvar render = this.getRender(); //get render, should be a table\n\t\tvar widgets = {}; //Save each row's widgets\n\n\t\t//Build row widgets\n\n\t\tvar form_item_input;\n\t\tvar widgetContainer;\n\n\t\t// Length Of Service\n\t\twidgetContainer = $( '<div class=\\'widget-h-box\\'></div>' );\n\n\t\tvar label_1 = $( '<span class=\\'widget-right-label\\'> ' + $.i18n._( 'After' ) + ': ' + ' </span>' );\n\t\tvar label_2 = $( '<span class=\\'widget-right-label\\'> </span>' );\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'length_of_service', width: 30 } );\n\t\tform_item_input.setValue( data.length_of_service ? data.length_of_service : 0 );\n\t\tform_item_input.attr( 'milestone_id', row_id );\n\n\t\tthis.setWidgetEnableBaseOnParentController( form_item_input );\n\n\t\tvar form_item_combobox = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_combobox.TComboBox( { field: 'length_of_service_unit_id' } );\n\t\tform_item_combobox.setSourceData( this.parent_controller.length_of_service_unit_array );\n\t\tform_item_combobox.setValue( data.length_of_service_unit_id ? data.length_of_service_unit_id : 10 );\n\n\t\tform_item_combobox.bind( 'formItemChange', function( e, target ) {\n\t\t\t$this.parent_controller.isDisplayLengthOfServiceHoursBasedOn();\n\t\t} );\n\n\t\tthis.setWidgetEnableBaseOnParentController( form_item_input );\n\t\tthis.setWidgetEnableBaseOnParentController( form_item_combobox );\n\n\t\twidgetContainer.append( label_1 );\n\t\twidgetContainer.append( form_item_input );\n\t\twidgetContainer.append( label_2 );\n\t\twidgetContainer.append( form_item_combobox );\n\n\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\twidgets[form_item_combobox.getField()] = form_item_combobox;\n\t\trow.children().eq( 0 ).append( widgetContainer );\n\n\t\t// Accrual Rate/Year\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\twidgetContainer = $( '<div class=\\'widget-h-box\\'></div>' );\n\t\tform_item_input.TTextInput( { field: 'accrual_rate_hourly', width: 90, need_parser_sec: false } );\n\t\tform_item_input.setPlaceHolder( '' );\n\t\tform_item_input.setValue( data.accrual_rate ? data.accrual_rate : '0.000' );\n\t\twidgetContainer.append( form_item_input );\n\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\trow.children().eq( 1 ).append( widgetContainer );\n\t\tthis.setWidgetEnableBaseOnParentController( form_item_input );\n\n\t\twidgetContainer = $( '<div class=\\'widget-h-box\\'></div>' );\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( {\n\t\t\tfield: 'accrual_rate_yearly',\n\t\t\twidth: 90,\n\t\t\tmode: 'time_unit',\n\t\t\tneed_parser_sec: true\n\t\t} );\n\t\tform_item_input.setValue( data.accrual_rate ? data.accrual_rate : '0' );\n\t\twidgetContainer.append( form_item_input );\n\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\trow.children().eq( 1 ).append( widgetContainer );\n\t\tthis.setWidgetEnableBaseOnParentController( form_item_input );\n\n\t\tif ( data.type_id == 30 ) {\n\t\t\twidgets.accrual_rate_hourly.show();\n\t\t\twidgets.accrual_rate_yearly.hide();\n\t\t} else {\n\t\t\twidgets.accrual_rate_yearly.show();\n\t\t\twidgets.accrual_rate_hourly.hide();\n\t\t}\n\n\t\t//Annual Accrual Maximum\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( {\n\t\t\tfield: 'annual_maximum_time',\n\t\t\twidth: 90,\n\t\t\tmode: 'time_unit',\n\t\t\tneed_parser_sec: true\n\t\t} );\n\t\tform_item_input.setValue( data.annual_maximum_time ? data.annual_maximum_time : '0' );\n\n\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\trow.children().eq( 2 ).append( form_item_input );\n\n\t\tthis.setWidgetEnableBaseOnParentController( form_item_input );\n\n\t\t// Accrual Total Maximum\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'maximum_time', width: 90, mode: 'time_unit', need_parser_sec: true } );\n\t\tform_item_input.setValue( data.maximum_time ? data.maximum_time : '0' );\n\n\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\trow.children().eq( 3 ).append( form_item_input );\n\n\t\tthis.setWidgetEnableBaseOnParentController( form_item_input );\n\n\t\t// Annual Maximum Rollover\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'rollover_time', width: 90, mode: 'time_unit', need_parser_sec: true } );\n\t\tform_item_input.setValue( data.rollover_time ? data.rollover_time : '0' );\n\n\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\trow.children().eq( 4 ).append( form_item_input );\n\n\t\tthis.setWidgetEnableBaseOnParentController( form_item_input );\n\n\t\tif ( typeof index != 'undefined' ) {\n\n\t\t\trow.insertAfter( $( render ).find( 'tr' ).eq( index ) );\n\t\t\tthis.rows_widgets_array.splice( ( index ), 0, widgets );\n\n\t\t} else {\n\t\t\t$( render ).append( row );\n\t\t\tthis.rows_widgets_array.push( widgets );\n\t\t}\n\n\t\tif ( this.parent_controller.is_viewing ) {\n\t\t\trow.find( '.control-icon' ).hide();\n\t\t}\n\n\t\tthis.addIconsEvent( row ); //Bind event to add and minus icon\n\t\tthis.removeLastRowLine();\n\n\t\tthis.parent_controller.setAccrualRageFormat();\n\t}\n\n\tinsideEditorRemoveRow( row ) {\n\t\tvar index = row[0].rowIndex - 1;\n\t\tvar remove_id = this.rows_widgets_array[index].length_of_service.attr( 'milestone_id' );\n\t\tif ( remove_id && TTUUID.isUUID( remove_id ) && remove_id != TTUUID.not_exist_id && remove_id != TTUUID.zero_id ) {\n\t\t\tthis.delete_ids.push( remove_id );\n\t\t}\n\t\trow.remove();\n\t\tthis.rows_widgets_array.splice( index, 1 );\n\t\tthis.removeLastRowLine();\n\n\t\tthis.parent_controller.isDisplayLengthOfServiceHoursBasedOn();\n\t}\n\n\tinsideEditorGetValue( current_edit_item_id ) {\n\t\tvar len = this.rows_widgets_array.length;\n\n\t\tvar result = [];\n\n\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\tvar row = this.rows_widgets_array[i];\n\t\t\tvar accrual_rate = 0;\n\n\t\t\tif ( this.parent_controller.current_edit_record.type_id == 30 ) {\n\t\t\t\taccrual_rate = row.accrual_rate_hourly.getValue();\n\t\t\t} else {\n\t\t\t\taccrual_rate = row.accrual_rate_yearly.getValue();\n\t\t\t}\n\n\t\t\tvar data = {\n\t\t\t\tlength_of_service: row.length_of_service.getValue(),\n\t\t\t\tlength_of_service_unit_id: row.length_of_service_unit_id.getValue(),\n\t\t\t\taccrual_rate: accrual_rate,\n\t\t\t\tmaximum_time: row.maximum_time.getValue(),\n\t\t\t\trollover_time: row.rollover_time.getValue()\n\n\t\t\t};\n\n\t\t\tif ( this.parent_controller.current_edit_record.type_id == 30 ) {\n\t\t\t\tdata.annual_maximum_time = row.annual_maximum_time.getValue();\n\t\t\t}\n\n\t\t\tdata.id = row.length_of_service.attr( 'milestone_id' );\n\n\t\t\tdata.accrual_policy_id = current_edit_item_id;\n\t\t\tresult.push( data );\n\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tsetEditViewDataDone() {\n\t\tsuper.setEditViewDataDone();\n\n\t\tthis.onApplyFrequencyChange();\n\n\t\tthis.onTypeChange();\n\n\t\tthis.onMilestoneRolloverHireDate();\n\n\t\tthis.initInsideEditorData();\n\t}\n\n\tinitInsideEditorData() {\n\n\t\tvar $this = this;\n\t\tvar args = {};\n\t\targs.filter_data = {};\n\n\t\tif ( this.mass_edit || ( ( !this.current_edit_record || !this.current_edit_record.id ) && !this.copied_record_id ) ) {\n\t\t\t$this.editor.removeAllRows();\n\t\t\t$this.editor.addRow();\n\t\t\t$this.isDisplayLengthOfServiceHoursBasedOn();\n\t\t\t$this.original_milestone_data = [];\n\t\t} else {\n\t\t\targs.filter_data.accrual_policy_id = this.current_edit_record.id ? this.current_edit_record.id : this.copied_record_id;\n\t\t\tthis.copied_record_id = '';\n\t\t\tthis.accrual_policy_milestone_api.getAccrualPolicyMilestone( args, true, {\n\t\t\t\tonResult: function( res ) {\n\t\t\t\t\tif ( !$this.edit_view ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar data = res.getResult();\n\t\t\t\t\tif ( data === true ) { // result is null\n\t\t\t\t\t\t$this.original_milestone_data = [];\n\t\t\t\t\t\t$this.editor.addRow();\n\t\t\t\t\t} else if ( data.length > 0 ) {\n\t\t\t\t\t\t$this.original_milestone_data = _.map(data, _.clone);\n\t\t\t\t\t\t$this.editor.setValue( data );\n\t\t\t\t\t}\n\n\t\t\t\t\t$this.isDisplayLengthOfServiceHoursBasedOn();\n\n\t\t\t\t}\n\t\t\t} );\n\n\t\t}\n\n//\t\tif ( !accrual_policy_id ) {\n//\t\t\tthis.editor.removeAllRows();\n//\t\t\tthis.editor.addRow();\n//\n//\t\t} else {\n//\t\t\targs.filter_data.accrual_policy_id = accrual_policy_id;\n//\t\t\tthis.accrual_policy_milestone_api.getAccrualPolicyMilestone( args, true, {onResult: function( res ) {\n//\t\t\t\tvar data = res.getResult();\n//\t\t\t\tif ( data === true ) { // result is null\n//\t\t\t\t\t$this.editor.addRow();\n//\t\t\t\t} else if ( data.length > 0 ) {\n//\t\t\t\t\t$this.editor.setValue( data );\n//\t\t\t\t}\n//\n//\t\t\t}} );\n//\t\t}\n\t}\n\n\tsaveInsideEditorData( result, callBack ) {\n\t\tvar $this = this;\n\t\tvar data = this.editor.getValue( this.refresh_id );\n\t\tvar remove_ids = $this.editor.delete_ids;\n\t\tif ( remove_ids.length > 0 ) {\n\t\t\t$this.accrual_policy_milestone_api.deleteAccrualPolicyMilestone( remove_ids, {\n\t\t\t\tonResult: function( res ) {\n\t\t\t\t\tif ( res.isValid() ) {\n\t\t\t\t\t\t$this.editor.delete_ids = [];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tlet changed_data = this.getChangedRecords( data, this.original_milestone_data, [] );\n\n\t\tif ( Array.isArray( changed_data ) && changed_data.length > 0 ) {\n\t\t\t$this.accrual_policy_milestone_api.setAccrualPolicyMilestone( changed_data, {\n\t\t\t\tonResult: function( res ) {\n\t\t\t\t\tvar res_data = res.getResult();\n\t\t\t\t\tif ( Global.isSet( result ) ) {\n\t\t\t\t\t\tresult();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\tif ( Global.isSet( result ) ) {\n\t\t\t\tresult();\n\t\t\t}\n\t\t}\n\t}\n\n\tonSaveResult( result ) {\n\t\tif ( result.isValid() ) {\n\t\t\tvar result_data = result.getResult();\n\t\t\tif ( result_data === true ) {\n\t\t\t\tthis.refresh_id = this.current_edit_record.id; // as add\n\t\t\t} else if ( result_data && TTUUID.isUUID( result_data ) && result_data != TTUUID.not_exist_id && result_data != TTUUID.zero_id ) {\n\t\t\t\tthis.refresh_id = result_data;\n\t\t\t}\n\n\t\t\tif ( this.is_mass_editing == false ) {\n\t\t\t\tvar $this = this;\n\t\t\t\t$this.saveInsideEditorData( function() {\n\t\t\t\t\t$this.search();\n\t\t\t\t\t$this.onSaveDone( result );\n\n\t\t\t\t\t$this.removeEditView();\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tthis.search();\n\t\t\t\tthis.onSaveDone( result );\n\t\t\t\tthis.removeEditView();\n\t\t\t}\n\n\t\t} else {\n\t\t\tthis.setErrorMenu();\n\t\t\tthis.setErrorTips( result );\n\t\t}\n\t}\n\n\tremoveEditView() {\n\n\t\tsuper.removeEditView();\n\t\tthis.sub_accrual_policy_user_modifier_view_controller = null;\n\t}\n\n\t// onSaveAndContinueResult( result ) {\n\t//\n\t// \tvar $this = this;\n\t// \tif ( result.isValid() ) {\n\t// \t\tvar result_data = result.getResult();\n\t// \t\tif ( result_data === true ) {\n\t// \t\t\t$this.refresh_id = $this.current_edit_record.id;\n\t//\n\t// \t\t} else if ( result_data && TTUUID.isUUID( result_data ) && result_data != TTUUID.not_exist_id && result_data != TTUUID.zero_id ) { // as new\n\t// \t\t\t$this.refresh_id = result_data;\n\t// \t\t}\n\t//\n\t// \t\t$this.saveInsideEditorData( function() {\n\t// \t\t\t$this.search( false );\n\t// \t\t\t$this.onEditClick( $this.refresh_id, true );\n\t//\n\t// \t\t\t$this.onSaveAndContinueDone( result );\n\t//\n\t// \t\t} );\n\t//\n\t// \t} else {\n\t// \t\t$this.setErrorTips( result );\n\t// \t\t$this.setErrorMenu();\n\t// \t}\n\t// },\n\n\t// onSaveAndNewResult: function( result ) {\n\t// \tvar $this = this;\n\t// \tif ( result.isValid() ) {\n\t// \t\tvar result_data = result.getResult();\n\t// \t\tif ( result_data === true ) {\n\t// \t\t\t$this.refresh_id = $this.current_edit_record.id;\n\t//\n\t// \t\t} else if ( result_data && TTUUID.isUUID( result_data ) && result_data != TTUUID.not_exist_id && result_data != TTUUID.zero_id ) { // as new\n\t// \t\t\t$this.refresh_id = result_data;\n\t// \t\t}\n\t//\n\t// \t\t$this.saveInsideEditorData( function() {\n\t// \t\t\t$this.search( false );\n\t// \t\t\t$this.onAddClick( true );\n\t//\n\t// \t\t} );\n\t// \t} else {\n\t// \t\t$this.setErrorTips( result );\n\t// \t\t$this.setErrorMenu();\n\t// \t}\n\t// },\n\n\tonSaveAndCopyResult( result ) {\n\t\tvar $this = this;\n\t\tif ( result.isValid() ) {\n\t\t\tvar result_data = result.getResult();\n\t\t\tif ( result_data === true ) {\n\t\t\t\t$this.refresh_id = $this.current_edit_record.id;\n\n\t\t\t} else if ( result_data && TTUUID.isUUID( result_data ) && result_data != TTUUID.not_exist_id && result_data != TTUUID.zero_id ) {\n\t\t\t\t$this.refresh_id = result_data;\n\t\t\t}\n\n\t\t\t$this.saveInsideEditorData( function() {\n\t\t\t\t$this.search( false );\n\t\t\t\t$this.onCopyAsNewClick();\n\n\t\t\t} );\n\n\t\t} else {\n\t\t\t$this.setErrorTips( result );\n\t\t\t$this.setErrorMenu();\n\t\t}\n\t}\n\n\t// onSaveAndNextResult( result ) {\n\t// \tvar $this = this;\n\t// \tif ( result.isValid() ) {\n\t// \t\tvar result_data = result.getResult();\n\t// \t\tif ( result_data === true ) {\n\t// \t\t\t$this.refresh_id = $this.current_edit_record.id;\n\t//\n\t// \t\t} else if ( result_data && TTUUID.isUUID( result_data ) && result_data != TTUUID.not_exist_id && result_data != TTUUID.zero_id ) {\n\t// \t\t\t$this.refresh_id = result_data;\n\t// \t\t}\n\t//\n\t// \t\t$this.saveInsideEditorData( function() {\n\t// \t\t\t$this.onRightArrowClick();\n\t// \t\t\t$this.search( false );\n\t// \t\t\t$this.onSaveAndNextDone( result );\n\t//\n\t// \t\t} );\n\t//\n\t// \t} else {\n\t// \t\t$this.setErrorTips( result );\n\t// \t\t$this.setErrorMenu();\n\t// \t}\n\t// },\n\n\t_continueDoCopyAsNew() {\n\t\tLocalCacheData.current_doing_context_action = 'copy_as_new';\n\t\tthis.is_add = true;\n\t\tif ( Global.isSet( this.edit_view ) ) {\n\t\t\tfor ( var i = 0; i < this.editor.rows_widgets_array.length; i++ ) {\n\t\t\t\tthis.editor.rows_widgets_array[i].length_of_service.attr( 'milestone_id', '' );\n\t\t\t}\n\t\t}\n\t\tsuper._continueDoCopyAsNew();\n\t}\n\n\tonCopyAsNewResult( result ) {\n\t\tvar $this = this;\n\t\tvar result_data = result.getResult();\n\n\t\tif ( !result_data ) {\n\t\t\tTAlertManager.showAlert( $.i18n._( 'Record does not exist' ) );\n\t\t\t$this.onCancelClick();\n\t\t\treturn;\n\t\t}\n\n\t\t$this.openEditView(); // Put it here is to avoid if the selected one is not existed in data or have deleted by other pragram. in this case, the edit view should not be opend.\n\n\t\tresult_data = result_data[0];\n\n\t\tthis.copied_record_id = result_data.id;\n\n\t\tresult_data.id = '';\n\n\t\tif ( $this.sub_view_mode && $this.parent_key ) {\n\t\t\tresult_data[$this.parent_key] = $this.parent_value;\n\t\t}\n\n\t\t$this.current_edit_record = result_data;\n\t\t$this.initEditView();\n\t}\n\n\tbuildSearchFields() {\n\n\t\tsuper.buildSearchFields();\n\t\tthis.search_fields = [\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Name' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'name',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tform_item_type: FormItemType.TEXT_INPUT\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Type' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'type_id',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tlayout_name: 'global_option_column',\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Created By' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'created_by',\n\t\t\t\tlayout_name: 'global_user',\n\t\t\t\tapi_class: TTAPI.APIUser,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Updated By' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'updated_by',\n\t\t\t\tlayout_name: 'global_user',\n\t\t\t\tapi_class: TTAPI.APIUser,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} )\n\t\t];\n\t}\n\n\tinitSubAccrualPolicyUserModifier() {\n\t\tvar $this = this;\n\n\t\tif ( Global.getProductEdition() <= 10 ) { //This must go before the current_edit_record.id check below, otherwise we return too early and it displays the wrong div.\n\t\t\tthis.edit_view_tab.find( '#tab_employee_settings' ).find( '.first-column-sub-view' ).css( 'display', 'none' );\n\t\t\tthis.edit_view.find( '.save-and-continue-div' ).css( 'display', 'none' );\n\t\t\tthis.edit_view.find( '.permission-defined-div' ).css( 'display', 'block' );\n\t\t\tthis.edit_view.find( '.permission-message' ).html( Global.getUpgradeMessage() );\n\t\t} else {\n\t\t\tthis.edit_view_tab.find( '#tab_employee_settings' ).find( '.first-column-sub-view' ).css( 'display', 'block' );\n\t\t\tthis.edit_view.find( '.permission-defined-div' ).css( 'display', 'none' );\n\t\t}\n\n\t\tif ( !this.current_edit_record.id ) {\n\t\t\tTTPromise.resolve( 'BaseViewController', 'onTabShow' ); //Since search() isn't called in this case, and we just display the \"Please Save This Record ...\" message, resolve the promise.\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.sub_accrual_policy_user_modifier_view_controller ) {\n\t\t\tthis.sub_accrual_policy_user_modifier_view_controller.buildContextMenu( true );\n\t\t\tthis.sub_accrual_policy_user_modifier_view_controller.setDefaultMenu();\n\t\t\t$this.sub_accrual_policy_user_modifier_view_controller.parent_key = 'accrual_policy_id';\n\t\t\t$this.sub_accrual_policy_user_modifier_view_controller.parent_value = $this.current_edit_record.id;\n\t\t\t$this.sub_accrual_policy_user_modifier_view_controller.parent_edit_record = $this.current_edit_record;\n\t\t\t$this.sub_accrual_policy_user_modifier_view_controller.initData(); //Init data in this parent view\n\t\t\treturn;\n\t\t}\n\n\t\tif ( Global.getProductEdition() >= 15 ) {\n\t\t\tGlobal.loadScript( 'views/policy/accrual_policy/AccrualPolicyUserModifierViewController.js', function() {\n\t\t\t\tvar tab_accrual_policy = $this.edit_view_tab.find( '#tab_employee_settings' );\n\n\t\t\t\tvar firstColumn = tab_accrual_policy.find( '.first-column-sub-view' );\n\n\t\t\t\tGlobal.trackView( 'Sub' + 'AccrualPolicyUserModifier' + 'View' );\n\t\t\t\tAccrualPolicyUserModifierViewController.loadSubView( firstColumn, beforeLoadView, afterLoadView );\n\t\t\t} );\n\t\t}\n\n\t\tfunction beforeLoadView( tpl ) {\n\t\t\tvar args = { parent_view: 'accrual_policy' };\n\t\t\treturn { template: _.template( tpl ), args: args };\n\t\t}\n\n\t\tfunction afterLoadView( subViewController ) {\n\t\t\t$this.sub_accrual_policy_user_modifier_view_controller = subViewController;\n\t\t\t$this.sub_accrual_policy_user_modifier_view_controller.parent_key = 'accrual_policy_id';\n\t\t\t$this.sub_accrual_policy_user_modifier_view_controller.parent_value = $this.current_edit_record.id;\n\t\t\t$this.sub_accrual_policy_user_modifier_view_controller.parent_edit_record = $this.current_edit_record;\n\t\t\t$this.sub_accrual_policy_user_modifier_view_controller.parent_view_controller = $this;\n\t\t\tTTPromise.wait( 'BaseViewController', 'initialize', function() {\n\t\t\t\t$this.sub_accrual_policy_user_modifier_view_controller.initData(); //Init data in this parent view\n\t\t\t} );\n\t\t}\n\t}\n\n\tgetAccrualPolicyLengthOfServiceMilestonesTabHtml() {\n\t\treturn `<div id=\"tab_length_of_service_milestones\" class=\"edit-view-tab-outside\">\n\t\t\t\t\t<div class=\"edit-view-tab\" id=\"tab_length_of_service_milestones_content_div\">\n\t\t\t\t\t\t<div class=\"first-column full-width-column\"></div>\n\t\t\t\t\t\t<div class=\"inside-editor-div full-width-column\">\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>`;\n\t}\n\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTU5NC5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7QUFBTztBQUNQLDJCQUEyQjtBQUMzQixFQUFFLENBQUM7QUFDSDs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0EsSUFBSTs7QUFFSjtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtB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