1 line
90 KiB
JavaScript
1 line
90 KiB
JavaScript
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["attendance-timesheet-UserDateTotalViewController"],{827:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"UserDateTotalViewController\": () => (/* binding */ UserDateTotalViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass UserDateTotalViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#user_date_total_view_container', //Must set el here and can only set string, so events can work\n\n\t\t\tpunch_tag_api: null,\n\t\t\tdefault_punch_tag: [],\n\t\t\tprevious_punch_tag_selection: []\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 = 'UserDateTotalEditView.html';\n\t\tthis.permission_id = 'user_date_total';\n\t\tthis.script_name = 'UserDateTotalView';\n\t\tthis.viewId = 'UserDateTotal';\n\t\tthis.table_name_key = 'user_date_total';\n\t\tthis.context_menu_name = $.i18n._( 'Accumulated Time' );\n\t\tthis.navigation_label = $.i18n._( 'Accumulated Time' );\n\t\tthis.api = TTAPI.APIUserDateTotal;\n\t\tthis.currency_api = TTAPI.APICurrency;\n\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\tthis.job_api = TTAPI.APIJob;\n\t\t\tthis.job_item_api = TTAPI.APIJobItem;\n\t\t\tthis.punch_tag_api = TTAPI.APIPunchTag;\n\t\t}\n\n\t\tif ( PermissionManager.validate( this.permission_id, 'add' ) || PermissionManager.validate( this.permission_id, 'edit' ) ) {\n\t\t\t$( this.el ).find( '.warning-message' ).text( $.i18n._( 'WARNING: Manually modifying Accumulated Time records may prevent policies from being calculated properly and should only be done as a last resort when instructed to do so by a support representative.' ) );\n\t\t} else {\n\t\t\t$( this.el ).find( '.warning-message' ).hide();\n\t\t}\n\n\t\tthis.initPermission();\n\t\tthis.render();\n\n\t\tif ( this.sub_view_mode ) {\n\t\t\tthis.buildContextMenu( true );\n\t\t} else {\n\t\t\tthis.buildContextMenu();\n\t\t}\n\n\t\t//call init data in parent view\n\t\tif ( !this.sub_view_mode ) {\n\t\t\tthis.initData();\n\t\t}\n\t}\n\n\tsetGridSize() {\n\t\t// if ( ( !this.grid || !this.grid.grid.is( ':visible' ) ) ) {\n\t\t// \treturn;\n\t\t// }\n\t\t//this.grid.grid.setGridWidth( $( this.el ).parent().width() - 2 );\n\n\t\tvar message_offset = ( $( this.el ).find( '.warning-message' ).outerHeight() * 2 ) + 27;\n\t\tthis.grid.grid.setGridHeight( $( this.el ).parents( '#tab_user_date_total_parent' ).height() - message_offset );\n\t}\n\n\tsetGridCellBackGround() {\n\n\t\tvar data = this.grid.getGridParam( 'data' );\n\n\t\t//Error: TypeError: data is undefined in /interface/html5/framework/jquery.min.js?v=7.4.6-20141027-074127 line 2 > eval line 70\n\t\tif ( !data ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar len = data.length;\n\n\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\tvar item = data[i];\n\n\t\t\tif ( item.is_override === true ) {\n\t\t\t\t$( 'tr[id=\\'' + item.id + '\\']' ).addClass( 'user-data-total-override' );\n\t\t\t}\n\t\t}\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\n\n\t\tthis.initDropDownOption( 'object_type' );\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\texclude: ['copy', 'export_excel'],\n\t\t\tinclude: ['default']\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\tonFormItemChange( target, doNotValidate ) {\n\t\tvar $this = this;\n\n\t\tthis.setIsChanged( target );\n\t\tthis.setMassEditingFieldsWhenFormChange( target );\n\t\tvar key = target.getField();\n\t\tvar c_value = target.getValue();\n\t\tthis.current_edit_record[key] = c_value;\n\n\t\tswitch ( key ) {\n\t\t\tcase 'object_type_id':\n\t\t\t\tthis.onTypeChange( true );\n\t\t\t\tbreak;\n\t\t\tcase 'regular_policy_id':\n\t\t\tcase 'absence_policy_id':\n\t\t\tcase 'overtime_policy_id':\n\t\t\tcase 'premium_policy_id':\n\t\t\tcase 'break_policy_id':\n\t\t\tcase 'meal_policy_id':\n\t\t\t\tthis.current_edit_record.src_object_id = c_value;\n\t\t\t\tdelete this.current_edit_record[key];\n\t\t\t\tthis.onSrcObjectChange( key );\n\t\t\t\tbreak;\n\t\t\tcase 'total_time':\n\t\t\t\tif ( this.current_edit_record.total_time == 0 ) {\n\t\t\t\t\tthis.edit_view_ui_dic.start_time_stamp.setValue( '' );\n\t\t\t\t\tthis.edit_view_ui_dic.end_time_stamp.setValue( '' );\n\t\t\t\t\tthis.current_edit_record.start_time_stamp = '';\n\t\t\t\t\tthis.current_edit_record.end_time_stamp = '';\n\n\t\t\t\t\t//Trigger onChange event for above fields, so in mass edit they are marked as changed.\n\t\t\t\t\tthis.edit_view_form_item_dic.start_time_stamp.find( 'input' ).trigger( 'change', '' );\n\t\t\t\t\tthis.edit_view_form_item_dic.end_time_stamp.find( 'input' ).trigger( 'change', '' );\n\t\t\t\t}\n\t\t\t\tthis.calculateAmount();\n\t\t\t\tbreak;\n\t\t\tcase 'hourly_rate':\n\t\t\t\tthis.calculateAmount();\n\t\t\t\tbreak;\n\t\t\tcase 'job_id':\n\t\t\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tthis.edit_view_ui_dic['job_quick_search'].setValue( target.getValue( true ) ? ( target.getValue( true ).manual_id ? target.getValue( true ).manual_id : '' ) : '' );\n\t\t\t\t\tthis.setJobItemValueWhenJobChanged( target.getValue( true ), 'job_item_id', {\n\t\t\t\t\t\tstatus_id: 10,\n\t\t\t\t\t\tjob_id: this.current_edit_record.job_id\n\t\t\t\t\t} );\n\t\t\t\t\tthis.edit_view_ui_dic['job_quick_search'].setCheckBox( true );\n\t\t\t\t\tthis.setPunchTagValuesWhenCriteriaChanged( this.getPunchTagFilterData(), 'punch_tag_id' );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 'job_item_id':\n\t\t\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tthis.edit_view_ui_dic['job_item_quick_search'].setValue( target.getValue( true ) ? ( target.getValue( true ).manual_id ? target.getValue( true ).manual_id : '' ) : '' );\n\t\t\t\t\tthis.edit_view_ui_dic['job_item_quick_search'].setCheckBox( true );\n\t\t\t\t\tthis.setPunchTagValuesWhenCriteriaChanged( this.getPunchTagFilterData(), 'punch_tag_id' );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'punch_tag_id':\n\t\t\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tif ( c_value !== TTUUID.zero_id && c_value !== false && c_value.length > 0 ) {\n\t\t\t\t\t\tthis.setPunchTagQuickSearchManualIds( target.getSelectItems() );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.edit_view_ui_dic['punch_tag_quick_search'].setValue( '' );\n\t\t\t\t\t}\n\t\t\t\t\t$this.previous_punch_tag_selection = c_value;\n\t\t\t\t\t//Reset source data to make sure correct punch tags are always shown.\n\t\t\t\t\tthis.edit_view_ui_dic['punch_tag_id'].setSourceData( null );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'user_id':\n\t\t\tcase 'branch_id':\n\t\t\tcase 'department_id':\n\t\t\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tthis.setPunchTagValuesWhenCriteriaChanged( this.getPunchTagFilterData(), 'punch_tag_id' );\n\t\t\t\t\tthis.setJobValueWhenCriteriaChanged( 'job_id', {\n\t\t\t\t\t\tstatus_id: 10,\n\t\t\t\t\t\tuser_id: this.current_edit_record.user_id,\n\t\t\t\t\t\tpunch_branch_id: this.current_edit_record.branch_id,\n\t\t\t\t\t\tpunch_department_id: this.current_edit_record.department_id\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'job_quick_search':\n\t\t\tcase 'job_item_quick_search':\n\t\t\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tthis.onJobQuickSearch( key, c_value );\n\t\t\t\t\tTTPromise.wait( 'BaseViewController', 'onJobQuickSearch', function() {\n\t\t\t\t\t\t$this.setPunchTagValuesWhenCriteriaChanged( $this.getPunchTagFilterData(), 'punch_tag_id' );\n\t\t\t\t\t} );\n\t\t\t\t\t//Don't validate immediately as onJobQuickSearch is doing async API calls, and it would cause a guaranteed validation failure.\n\t\t\t\t\tdoNotValidate = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'punch_tag_quick_search':\n\t\t\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tthis.onPunchTagQuickSearch( c_value, this.getPunchTagFilterData(), 'punch_tag_id' );\n\n\t\t\t\t\t//Don't validate immediately as onPunchTagQuickSearch is doing async API calls, and it would cause a guaranteed validation failure.\n\t\t\t\t\tdoNotValidate = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( key !== 'override' ) {\n\t\t\tthis.edit_view_ui_dic.override.setValue( true );\n\t\t\tthis.current_edit_record.override = true;\n\t\t\tthis.edit_view_form_item_dic.override.find( 'input' ).trigger( 'change', '1' ); //Trigger onChange event for above fields, so in mass edit they are marked as changed.\n\t\t}\n\n\t\tif ( !doNotValidate ) {\n\t\t\tthis.validate();\n\t\t}\n\t}\n\n\tcalculateAmount() {\n\t\tthis.current_edit_record.total_time_amount = ( this.current_edit_record.total_time / 3600 ) * parseFloat( this.current_edit_record.hourly_rate );\n\t\tthis.edit_view_ui_dic.total_time_amount.setValue( this.current_edit_record.total_time_amount.toFixed( 4 ) );\n\t}\n\n\tonAddClick() {\n\t\tvar $this = this;\n\t\tthis.setCurrentEditViewState( 'new' );\n\t\t$this.openEditView();\n\n\t\t//Error: Uncaught TypeError: undefined is not a function in /interface/html5/views/BaseViewController.js?v=8.0.0-20141117-111140 line 897\n\t\tif ( $this.api ) {\n\t\t\t$this.api['get' + $this.api.key_name + 'DefaultData'](\n\t\t\t\tthis.parent_edit_record.user_id,\n\t\t\t\tthis.parent_edit_record.date_stamp, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t$this.onAddResult( result );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t}\n\t}\n\n\tonAddResult( result ) {\n\t\tvar $this = this;\n\t\tvar result_data = result.getResult();\n\n\t\tif ( !result_data ) {\n\t\t\tresult_data = [];\n\t\t}\n\n\t\tresult_data.company = LocalCacheData.current_company.name;\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\tif ( !result_data.date_stamp ) {\n\t\t\tresult_data.date_stamp = this.parent_edit_record.date_stamp;\n\t\t}\n\n\t\t$this.current_edit_record = result_data;\n\t\t$this.initEditView();\n\t}\n\n\t/* jshint ignore:end */\n\n\tinitPermission() {\n\t\tsuper.initPermission();\n\n\t\tif ( this.jobUIValidate() ) {\n\t\t\tthis.show_job_ui = true;\n\t\t} else {\n\t\t\tthis.show_job_ui = false;\n\t\t}\n\n\t\tif ( this.jobItemUIValidate() ) {\n\t\t\tthis.show_job_item_ui = true;\n\t\t} else {\n\t\t\tthis.show_job_item_ui = false;\n\t\t}\n\n\t\tif ( this.punchTagUIValidate() ) {\n\t\t\tthis.show_punch_tag_ui = true;\n\t\t} else {\n\t\t\tthis.show_punch_tag_ui = false;\n\t\t}\n\n\t\tif ( this.branchUIValidate() ) {\n\t\t\tthis.show_branch_ui = true;\n\t\t} else {\n\t\t\tthis.show_branch_ui = false;\n\t\t}\n\n\t\tif ( this.departmentUIValidate() ) {\n\t\t\tthis.show_department_ui = true;\n\t\t} else {\n\t\t\tthis.show_department_ui = false;\n\t\t}\n\n\t\tif ( this.goodQuantityUIValidate() ) {\n\t\t\tthis.show_good_quantity_ui = true;\n\t\t} else {\n\t\t\tthis.show_good_quantity_ui = false;\n\t\t}\n\n\t\tif ( this.badQuantityUIValidate() ) {\n\t\t\tthis.show_bad_quantity_ui = true;\n\t\t} else {\n\t\t\tthis.show_bad_quantity_ui = false;\n\t\t}\n\n\t\tif ( this.noteUIValidate() ) {\n\t\t\tthis.show_note_ui = true;\n\t\t} else {\n\t\t\tthis.show_note_ui = false;\n\t\t}\n\t}\n\n\tnoteUIValidate( p_id ) {\n\n\t\tif ( !p_id ) {\n\t\t\tp_id = 'punch';\n\t\t}\n\n\t\tif ( PermissionManager.validate( p_id, 'edit_note' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tbranchUIValidate( p_id ) {\n\n\t\tif ( !p_id ) {\n\t\t\tp_id = 'punch';\n\t\t}\n\n\t\tif ( PermissionManager.validate( p_id, 'edit_branch' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tdepartmentUIValidate( p_id ) {\n\n\t\tif ( !p_id ) {\n\t\t\tp_id = 'punch';\n\t\t}\n\n\t\tif ( PermissionManager.validate( p_id, 'edit_department' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tjobUIValidate( p_id ) {\n\n\t\tif ( !p_id ) {\n\t\t\tp_id = 'punch';\n\t\t}\n\n\t\tif ( PermissionManager.validate( 'job', 'enabled' ) &&\n\t\t\tPermissionManager.validate( p_id, 'edit_job' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tjobItemUIValidate( p_id ) {\n\n\t\tif ( !p_id ) {\n\t\t\tp_id = 'punch';\n\t\t}\n\n\t\tif ( PermissionManager.validate( p_id, 'edit_job_item' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpunchTagUIValidate( p_id ) {\n\n\t\tif ( !p_id ) {\n\t\t\tp_id = 'punch';\n\t\t}\n\n\t\tif ( PermissionManager.validate( p_id, 'edit_punch_tag' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tgoodQuantityUIValidate( p_id ) {\n\n\t\tif ( !p_id ) {\n\t\t\tp_id = 'punch';\n\t\t}\n\n\t\tif ( PermissionManager.validate( p_id, 'edit_quantity' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tbadQuantityUIValidate( p_id ) {\n\n\t\tif ( !p_id ) {\n\t\t\tp_id = 'punch';\n\t\t}\n\n\t\tif ( PermissionManager.validate( p_id, 'edit_quantity' ) &&\n\t\t\tPermissionManager.validate( p_id, 'edit_bad_quantity' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tsetCurrency() {\n\t\tvar $this = this;\n\t\tif ( Global.isSet( this.current_edit_record.user_id ) ) {\n\t\t\tvar filter = {};\n\t\t\tfilter.filter_data = { user_id: this.current_edit_record.user_id };\n\t\t\tthis.currency_api.getCurrency( filter, false, false, {\n\t\t\t\tonResult: function( res ) {\n\t\t\t\t\tres = res.getResult();\n\t\t\t\t\tif ( Global.isArray( res ) ) {\n\t\t\t\t\t\t$( '.userDateTotal-currency' ).text( res[0].symbol );\n\t\t\t\t\t\t$( '.userDateTotal-code' ).text( res[0].iso_code );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$( '.userDateTotal-currency' ).text( '' );\n\t\t\t\t\t\t$( '.userDateTotal-code' ).text( '' );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\tsetCurrentEditRecordData() {\n\t\tvar $this = this;\n\t\tthis.setCurrency();\n\t\t//Set current edit record data to all widgets\n\t\tfor ( var key in this.current_edit_record ) {\n\n\t\t\tif ( !this.current_edit_record.hasOwnProperty( key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvar widget = this.edit_view_ui_dic[key];\n\t\t\tswitch ( key ) {\n\t\t\t\tcase 'user_id':\n\t\t\t\t\tvar current_widget = this.edit_view_ui_dic['first_last_name'];\n\t\t\t\t\tTTAPI.APIUser.getUser( { filter_data: { id: this.current_edit_record[key] } }, {\n\t\t\t\t\t\tonResult: function( result ) {\n\n\t\t\t\t\t\t\tif ( result.isValid() ) {\n\t\t\t\t\t\t\t\tvar user_data = result.getResult()[0];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//Error: Unable to get property 'first_name' of undefined or null reference in /interface/html5/ line 511\n\t\t\t\t\t\t\tif ( user_data && user_data.first_name ) {\n\t\t\t\t\t\t\t\tcurrent_widget.setValue( user_data.first_name + ' ' + user_data.last_name );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcurrent_widget.setValue( '' );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'job_id':\n\t\t\t\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\t\tvar args = {};\n\t\t\t\t\t\targs.filter_data = {\n\t\t\t\t\t\t\tstatus_id: 10,\n\t\t\t\t\t\t\tuser_id: this.current_edit_record.user_id,\n\t\t\t\t\t\t\tpunch_branch_id: this.current_edit_record.branch_id,\n\t\t\t\t\t\t\tpunch_department_id: this.current_edit_record.department_id\n\t\t\t\t\t\t};\n\t\t\t\t\t\twidget.setDefaultArgs( args );\n\t\t\t\t\t\twidget.setValue( this.current_edit_record[key] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'date_stamp':\n\t\t\t\t\twidget.setEnabled( false );\n\t\t\t\t\twidget.setValue( this.current_edit_record[key] );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'punch_tag_id':\n\t\t\t\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\t\twidget.setValue( this.current_edit_record[key] );\n\t\t\t\t\t\tthis.previous_punch_tag_selection = this.current_edit_record[key];\n\n\t\t\t\t\t\tvar punch_tag_widget = widget;\n\t\t\t\t\t\tTTPromise.wait( null, null, function() {\n\t\t\t\t\t\t\t//Update default args for punch tags AComboBox last as they rely on data from job, job item and related fields.\n\t\t\t\t\t\t\tvar args = {};\n\t\t\t\t\t\t\targs.filter_data = $this.getPunchTagFilterData();\n\t\t\t\t\t\t\tpunch_tag_widget.setDefaultArgs( args );\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif ( widget ) {\n\t\t\t\t\t\twidget.setValue( this.current_edit_record[key] );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tthis.collectUIDataToCurrentEditRecord();\n\t\tthis.setEditViewDataDone();\n\t}\n\n\tsetEditViewDataDone() {\n\t\tvar $this = this;\n\t\tsuper.setEditViewDataDone();\n\t\tthis.onTypeChange();\n\t}\n\n\tonTypeChange( reset ) {\n\t\tthis.detachElement( 'regular_policy_id' );\n\t\tthis.detachElement( 'absence_policy_id' );\n\t\tthis.detachElement( 'overtime_policy_id' );\n\t\tthis.detachElement( 'premium_policy_id' );\n\t\tthis.detachElement( 'meal_policy_id' );\n\t\tthis.detachElement( 'break_policy_id' );\n\t\tvar key = '';\n\t\tif ( this.current_edit_record['object_type_id'] == 20 ) {\n\t\t\tkey = 'regular_policy_id';\n\t\t} else if ( this.current_edit_record['object_type_id'] == 25 || this.current_edit_record['object_type_id'] == 50 ) {\n\t\t\tkey = 'absence_policy_id';\n\t\t} else if ( this.current_edit_record['object_type_id'] == 30 ) {\n\t\t\tkey = 'overtime_policy_id';\n\t\t} else if ( this.current_edit_record['object_type_id'] == 40 ) {\n\t\t\tkey = 'premium_policy_id';\n\t\t} else if ( this.current_edit_record['object_type_id'] == 100 || this.current_edit_record['object_type_id'] == 101 ) {\n\t\t\tkey = 'meal_policy_id';\n\t\t} else if ( this.current_edit_record['object_type_id'] == 110 || this.current_edit_record['object_type_id'] == 111 ) {\n\t\t\tkey = 'break_policy_id';\n\t\t}\n\t\tif ( key ) {\n\t\t\tthis.attachElement( key );\n\t\t\tif ( reset ) {\n\t\t\t\tthis.edit_view_ui_dic[key].setValue( '' );\n\t\t\t\tthis.edit_view_ui_dic['pay_code_id'].setValue( '' );\n\t\t\t\tthis.current_edit_record.src_object_id = false;\n\t\t\t\tthis.current_edit_record.pay_code_id = false;\n\t\t\t\tthis.edit_view_ui_dic['pay_code_id'].setEnabled( true );\n\t\t\t} else if ( this.current_edit_record.src_object_id ) {\n\t\t\t\tthis.edit_view_ui_dic[key].setValue( this.current_edit_record.src_object_id );\n\t\t\t\tthis.edit_view_ui_dic['pay_code_id'].setEnabled( false );\n\t\t\t}\n\t\t} else {\n\t\t\tthis.edit_view_ui_dic['pay_code_id'].setEnabled( true );\n\t\t\tthis.current_edit_record.src_object_id = false;\n\t\t}\n\t\tthis.editFieldResize();\n\t}\n\n\tonSrcObjectChange( key ) {\n\t\tvar full_value = this.edit_view_ui_dic[key].getValue( true );\n\t\tif ( full_value && full_value.pay_code_id ) {\n\t\t\tthis.edit_view_ui_dic['pay_code_id'].setEnabled( false );\n\t\t\tthis.edit_view_ui_dic['pay_code_id'].setValue( full_value.pay_code_id );\n\t\t\tthis.current_edit_record.pay_code_id = full_value.pay_code_id;\n\t\t} else {\n\t\t\tthis.edit_view_ui_dic['pay_code_id'].setEnabled( true );\n\t\t\tthis.edit_view_ui_dic['pay_code_id'].setValue( '' );\n\t\t\tthis.current_edit_record.pay_code_id = false;\n\t\t}\n\t}\n\n\tsearch( set_default_menu, page_action, page_number, callBack ) {\n\t\tthis.refresh_id = null;\n\t\tsuper.search( set_default_menu, page_action, page_number, callBack );\n\t}\n\n\tgetProperObjectType() {\n\t\tvar array = [];\n\n\t\tfor ( var i = 0; i < this.object_type_array.length; i++ ) {\n\t\t\tvar item = this.object_type_array[i];\n\n\t\t\tif ( item.value == 20 ||\n\t\t\t\titem.value == 25 ||\n\t\t\t\titem.value == 30 ||\n\t\t\t\titem.value == 40 ||\n\t\t\t\titem.value == 100 ||\n\t\t\t\titem.value == 110 ) {\n\t\t\t\tarray.push( item );\n\t\t\t}\n\n\t\t}\n\n\t\treturn array;\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_user_date_total': { 'label': $.i18n._( 'Accumulated Time' ), 'is_multi_column': true },\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.APIUserDateTotal,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_wage',\n\t\t\tshow_search_inputs: true,\n\t\t\tnavigation_mode: true\n\t\t} );\n\n\t\tthis.setNavigation();\n\n\t\tvar form_item_input;\n\t\tvar widgetContainer;\n\n\t\t//Tab 0 start\n\t\tvar tab_user_date_total = this.edit_view_tab.find( '#tab_user_date_total' );\n\n\t\tvar tab_user_date_total_column1 = tab_user_date_total.find( '.first-column' );\n\t\tvar tab_user_date_total_column2 = tab_user_date_total.find( '.second-column' );\n\n\t\t//Employee\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT );\n\t\tform_item_input.TText( { field: 'first_last_name' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Employee' ), form_item_input, tab_user_date_total_column1, '' );\n\n\t\t//Date\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\t\tform_item_input.TDatePicker( { field: 'date_stamp' } );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Date' ), form_item_input, tab_user_date_total_column1 );\n\n\t\t//Time\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'total_time', mode: 'time_unit', need_parser_sec: true } );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Time' ), form_item_input, tab_user_date_total_column1, '', null, true );\n\n\t\t//Type\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\n\t\tform_item_input.TComboBox( { field: 'object_type_id' } );\n\t\tform_item_input.setSourceData( this.getProperObjectType() );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Type' ), form_item_input, tab_user_date_total_column1 );\n\n\t\t//Regular Policy\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIRegularTimePolicy,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_regular_time',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'regular_policy_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Policy' ), form_item_input, tab_user_date_total_column1, null, null, true );\n\t\tthis.detachElement( 'regular_policy_id' );\n\n\t\t//Absence Policy\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIAbsencePolicy,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_absences',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'absence_policy_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Policy' ), form_item_input, tab_user_date_total_column1, null, null, true );\n\t\tthis.detachElement( 'absence_policy_id' );\n\n\t\t//Overtime Policy\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIOverTimePolicy,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_over_time',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'overtime_policy_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Policy' ), form_item_input, tab_user_date_total_column1, null, null, true );\n\t\tthis.detachElement( 'overtime_policy_id' );\n\n\t\t//Premium Policy\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIPremiumPolicy,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_premium',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'premium_policy_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Policy' ), form_item_input, tab_user_date_total_column1, null, null, true );\n\t\tthis.detachElement( 'premium_policy_id' );\n\n\t\t//Meal Policy\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIMealPolicy,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_meal',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'meal_policy_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Policy' ), form_item_input, tab_user_date_total_column1, null, null, true );\n\t\tthis.detachElement( 'meal_policy_id' );\n\n\t\t//Break Policy\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIBreakPolicy,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_break',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'break_policy_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Policy' ), form_item_input, tab_user_date_total_column1, null, null, true );\n\t\tthis.detachElement( 'break_policy_id' );\n\n\t\t//Pay Code\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIPayCode,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_pay_code',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'pay_code_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Pay Code' ), form_item_input, tab_user_date_total_column1 );\n\n\t\t//Default Branch\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIBranch,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_branch',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'branch_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Branch' ), form_item_input, tab_user_date_total_column1, '', null, true );\n\n\t\tif ( !this.show_branch_ui ) {\n\t\t\tthis.detachElement( 'branch_id' );\n\t\t}\n\n\t\t//Department\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIDepartment,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_department',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'department_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Department' ), form_item_input, tab_user_date_total_column1, '', null, true );\n\n\t\tif ( !this.show_department_ui ) {\n\t\t\tthis.detachElement( 'department_id' );\n\t\t}\n\n\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\n\t\t\t//Job\n\t\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\t\tform_item_input.AComboBox( {\n\t\t\t\tapi_class: TTAPI.APIJob,\n\t\t\t\tallow_multiple_selection: false,\n\t\t\t\tlayout_name: 'global_job',\n\t\t\t\tshow_search_inputs: true,\n\t\t\t\tset_empty: true,\n\t\t\t\tsetRealValueCallBack: ( function( val ) {\n\n\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\tjob_coder.setValue( val.manual_id );\n\t\t\t\t\t}\n\t\t\t\t} ),\n\t\t\t\tfield: 'job_id'\n\t\t\t} );\n\n\t\t\twidgetContainer = $( '<div class=\\'widget-h-box\\'></div>' );\n\n\t\t\tvar job_coder = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\t\tjob_coder.TTextInput( { field: 'job_quick_search', disable_keyup_event: true } );\n\t\t\tjob_coder.addClass( 'job-coder' );\n\n\t\t\twidgetContainer.append( job_coder );\n\t\t\twidgetContainer.append( form_item_input );\n\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Job' ), [form_item_input, job_coder], tab_user_date_total_column1, '', widgetContainer, true );\n\n\t\t\tif ( !this.show_job_ui ) {\n\t\t\t\tthis.detachElement( 'job_id' );\n\t\t\t}\n\n\t\t\t//Job Item\n\t\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\t\tform_item_input.AComboBox( {\n\t\t\t\tapi_class: TTAPI.APIJobItem,\n\t\t\t\tallow_multiple_selection: false,\n\t\t\t\tlayout_name: 'global_job_item',\n\t\t\t\tshow_search_inputs: true,\n\t\t\t\tset_empty: true,\n\t\t\t\tsetRealValueCallBack: ( function( val ) {\n\n\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\tjob_item_coder.setValue( val.manual_id );\n\t\t\t\t\t}\n\t\t\t\t} ),\n\t\t\t\tfield: 'job_item_id'\n\t\t\t} );\n\n\t\t\twidgetContainer = $( '<div class=\\'widget-h-box\\'></div>' );\n\n\t\t\tvar job_item_coder = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\t\tjob_item_coder.TTextInput( { field: 'job_item_quick_search', disable_keyup_event: true } );\n\t\t\tjob_item_coder.addClass( 'job-coder' );\n\n\t\t\twidgetContainer.append( job_item_coder );\n\t\t\twidgetContainer.append( form_item_input );\n\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Task' ), [form_item_input, job_item_coder], tab_user_date_total_column1, '', widgetContainer, true );\n\n\t\t\tif ( !this.show_job_item_ui ) {\n\t\t\t\tthis.detachElement( 'job_item_id' );\n\t\t\t}\n\n\t\t\t//Punch Tag\n\t\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\t\tform_item_input.AComboBox( {\n\t\t\t\tapi_class: TTAPI.APIPunchTag,\n\t\t\t\tallow_multiple_selection: true,\n\t\t\t\tlayout_name: 'global_punch_tag',\n\t\t\t\tshow_search_inputs: true,\n\t\t\t\tset_empty: true,\n\t\t\t\tget_real_data_on_multi: true,\n\t\t\t\tsetRealValueCallBack: ( ( punch_tags, get_real_data ) => {\n\t\t\t\t\tif ( punch_tags ) {\n\t\t\t\t\t\tthis.setPunchTagQuickSearchManualIds( punch_tags, get_real_data );\n\t\t\t\t\t}\n\t\t\t\t} ),\n\t\t\t\tfield: 'punch_tag_id'\n\t\t\t} );\n\n\t\t\twidgetContainer = $( '<div class=\\'widget-h-box\\'></div>' );\n\n\t\t\tvar punch_tag_coder = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\t\tpunch_tag_coder.TTextInput( { field: 'punch_tag_quick_search', disable_keyup_event: true } );\n\t\t\tpunch_tag_coder.addClass( 'job-coder' );\n\n\t\t\twidgetContainer.append( punch_tag_coder );\n\t\t\twidgetContainer.append( form_item_input );\n\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Tags' ), [form_item_input, punch_tag_coder], tab_user_date_total_column1, '', widgetContainer, true );\n\n\t\t\tif ( !this.show_punch_tag_ui ) {\n\t\t\t\tthis.detachElement( 'punch_tag_id' );\n\t\t\t}\n\t\t}\n\n\t\t//Start Date Time\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\t\tform_item_input.TDatePicker( { field: 'start_time_stamp', mode: 'date_time' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Start Date/Time' ), form_item_input, tab_user_date_total_column2, '', null, true, true );\n\n\t\t//End Date Time\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\t\tform_item_input.TDatePicker( { field: 'end_time_stamp', mode: 'date_time' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'End Date/Time' ), form_item_input, tab_user_date_total_column2, '', null, true, true );\n\n\t\t//Currency\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APICurrency,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_currency',\n\t\t\tshow_search_inputs: true,\n\t\t\tfield: 'currency_id',\n\t\t\tset_empty: true\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Currency' ), form_item_input, tab_user_date_total_column2 );\n\n\t\t//Base Hourly Rate\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'base_hourly_rate', width: 90 } );\n\n\t\twidgetContainer = $( '<div class=\\'widget-h-box\\'></div>' );\n\t\tvar currency = $( '<span class=\\'userDateTotal-currency widget-left-label\\'></span>' );\n\t\tvar code = $( '<span class=\\'userDateTotal-code widget-right-label\\'></span>' );\n\t\twidgetContainer.append( currency );\n\t\twidgetContainer.append( form_item_input );\n\t\twidgetContainer.append( code );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Base Hourly Rate' ), form_item_input, tab_user_date_total_column2, '', widgetContainer, true );\n\n\t\t//Hourly Rate\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'hourly_rate', width: 90 } );\n\n\t\twidgetContainer = $( '<div class=\\'widget-h-box\\'></div>' );\n\t\tcurrency = $( '<span class=\\'userDateTotal-currency widget-left-label\\'></span>' );\n\t\tcode = $( '<span class=\\'userDateTotal-code widget-right-label\\'></span>' );\n\t\twidgetContainer.append( currency );\n\t\twidgetContainer.append( form_item_input );\n\t\twidgetContainer.append( code );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Hourly Rate' ), form_item_input, tab_user_date_total_column2, '', widgetContainer, true );\n\n\t\t//Total Amount\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT );\n\t\tform_item_input.TText( { field: 'total_time_amount' } );\n\t\twidgetContainer = $( '<div class=\\'widget-h-box\\'></div>' );\n\t\tcurrency = $( '<span class=\\'userDateTotal-currency widget-left-label\\'></span>' );\n\t\tcode = $( '<span class=\\'userDateTotal-code widget-right-label\\'></span>' );\n\t\twidgetContainer.append( currency );\n\t\twidgetContainer.append( form_item_input );\n\t\twidgetContainer.append( code );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Total Amount' ), form_item_input, tab_user_date_total_column2, '', widgetContainer, true );\n\n\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\n\t\t\t//Quanitity\n\t\t\tvar good = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\t\tgood.TTextInput( { field: 'quantity', width: 50 } );\n\t\t\tgood.addClass( 'quantity-input' );\n\n\t\t\tvar good_label = $( '<span class=\\'widget-right-label\\'>' + $.i18n._( 'Good' ) + ': </span>' );\n\n\t\t\tvar bad = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\t\tbad.TTextInput( { field: 'bad_quantity', width: 50 } );\n\t\t\tbad.addClass( 'quantity-input' );\n\n\t\t\tvar bad_label = $( '<span class=\\'widget-right-label\\'>/ ' + $.i18n._( 'Bad' ) + ': </span>' );\n\n\t\t\twidgetContainer = $( '<div class=\\'widget-h-box\\'></div>' );\n\n\t\t\twidgetContainer.append( good_label );\n\t\t\twidgetContainer.append( good );\n\t\t\twidgetContainer.append( bad_label );\n\t\t\twidgetContainer.append( bad );\n\n\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Quantity' ), [good, bad], tab_user_date_total_column2, '', widgetContainer, true );\n\n\t\t\tif ( !this.show_bad_quantity_ui && !this.show_good_quantity_ui ) {\n\t\t\t\tthis.detachElement( 'quantity' );\n\t\t\t} else {\n\t\t\t\tif ( !this.show_bad_quantity_ui ) {\n\t\t\t\t\tbad_label.hide();\n\t\t\t\t\tbad.hide();\n\t\t\t\t}\n\n\t\t\t\tif ( !this.show_good_quantity_ui ) {\n\t\t\t\t\tgood_label.hide();\n\t\t\t\t\tgood.hide();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Note\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_AREA );\n\t\tform_item_input.TTextArea( { field: 'note', width: '100%' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Note' ), form_item_input, tab_user_date_total_column2, '', null, true, true );\n\t\tform_item_input.parent().width( '45%' );\n\n\t\tif ( !this.show_note_ui ) {\n\t\t\tthis.detachElement( 'note' );\n\t\t}\n\n\t\t//Override\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'override' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Override' ), form_item_input, tab_user_date_total_column2, '', null, true, true );\n\t}\n\n\tcleanWhenUnloadView( callBack ) {\n\n\t\t$( '#user_date_total_view_container' ).remove();\n\t\tsuper.cleanWhenUnloadView( callBack );\n\n\t}\n}\n\nUserDateTotalViewController.loadView = function( container ) {\n\n\tGlobal.loadViewSource( 'UserDateTotal', 'UserDateTotalView.html', function( result ) {\n\n\t\tvar args = {};\n\t\tvar template = _.template( result );\n\n\t\tif ( Global.isSet( container ) ) {\n\t\t\tcontainer.html( template( args ) );\n\t\t} else {\n\t\t\tGlobal.contentContainer().html( template( args ) );\n\t\t}\n\n\t} );\n\n};\n\nUserDateTotalViewController.loadSubView = function( container, beforeViewLoadedFun, afterViewLoadedFun ) {\n\n\tGlobal.loadViewSource( 'UserDateTotal', 'SubUserDateTotalView.html', function( result ) {\n\n\t\tvar args = {};\n\t\tvar template = _.template( result );\n\n\t\tif ( Global.isSet( beforeViewLoadedFun ) ) {\n\t\t\tbeforeViewLoadedFun();\n\t\t}\n\n\t\tif ( Global.isSet( container ) ) {\n\t\t\tcontainer.html( template( args ) );\n\n\t\t\tif ( Global.isSet( afterViewLoadedFun ) ) {\n\n\t\t\t\tTTPromise.wait( 'BaseViewController', 'initialize', function() {\n\t\t\t\t\tafterViewLoadedFun( sub_user_date_total_view_controller );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t}\n\n\t} );\n\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODI3LmpzIiwibWFwcGluZ3MiOiI7Ozs7OztBQUFPO0FBQ1AsMkJBQTJCO0FBQzNCLEVBQUUsQ0FBQztBQUNIOztBQUVBO0FBQ0E7QUFDQTtBQUNBLElBQUk7O0FBRUo7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLDJCQUEyQixDQUFDO0FBQzVCLDBCQUEwQixDQUFDO0FBQzNCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0EsR0FBRyxDQUFDLDZDQUE2QyxDQUFDO0FBQ2xELElBQUk7QUFDSixHQUFHLENBQUM7QUFDSjs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQSxJQUFJO0FBQ0o7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEseUJBQXlCLENBQUM7QUFDMUIsZ0NBQWdDLENBQUM7QUFDakM7O0FBRUE7O0FBRUE7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUEsbUJBQW1CLFNBQVM7QUFDNUI7O0FBRUE7QUFDQSxJQUFJLENBQUM7QUFDTDtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0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