"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["company-payroll_remittance_agency-PayrollRemittanceAgencyViewController"],{3665:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"PayrollRemittanceAgencyViewController\": () => (/* binding */ PayrollRemittanceAgencyViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass PayrollRemittanceAgencyViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#payroll_remittance_agency_view_container',\n\n\n\n\t\t\tstatus_array: null,\n\t\t\ttype_array: null,\n\t\t\tagency_array: null,\n\t\t\tcountry_array: null,\n\t\t\tprovince_array: null,\n\t\t\tdistrict_array: null,\n\n\t\t\tremittance_source_account_array: null,\n\t\t\tsub_event_view_controller: null,\n\n\t\t\te_province_array: null,\n\t\t\tcompany_api: null,\n\t\t\tremittance_source_account_api: null,\n\t\t\talways_week_day_array: null,\n\n\t\t\tdate_api: null\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit() {\n\t\tthis.edit_view_tpl = 'PayrollRemittanceAgencyEditView.html';\n\t\tthis.permission_id = 'payroll_remittance_agency';\n\t\tthis.viewId = 'PayrollRemittanceAgency';\n\t\tthis.script_name = 'PayrollRemittanceAgencyView';\n\t\tthis.table_name_key = 'payroll_remittance_agency';\n\t\tthis.context_menu_name = $.i18n._( 'Remittance Agencies' );\n\t\tthis.navigation_label = $.i18n._( 'Remittance Agency' );\n\t\tthis.api = TTAPI.APIPayrollRemittanceAgency;\n\t\tthis.company_api = TTAPI.APICompany;\n\t\tthis.date_api = TTAPI.APITTDate;\n\t\tthis.remittance_source_account_api = TTAPI.APIRemittanceSourceAccount;\n\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\n\t\tthis.initData();\n\t}\n\n\t//Don't initOptions if edit_only_mode. Do it in sub views\n\tinitOptions( callback ) {\n\t\tvar $this = this;\n\n\t\tvar options = [\n\t\t\t{ option_name: 'status', api: this.api },\n\t\t\t{ option_name: 'type', api: this.api },\n\t\t\t{ option_name: 'country', field_name: 'country', api: this.company_api },\n\t\t];\n\n\t\tthis.initDropDownOptions( options );\n\n\t\tthis.api.getOptions( 'always_week_day', {\n\t\t\tonResult: function( res ) {\n\t\t\t\tres = res.getResult();\n\t\t\t\t$this.always_week_day_array = Global.buildRecordArray( res );\n\t\t\t\tif ( typeof callback == 'function' ) {\n\t\t\t\t\tcallback( res ); // First to initialize drop down options, and then to initialize edit view UI.\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\topenEditView( record_id ) {\n\n\t\tvar $this = this;\n\t\tif ( this.edit_only_mode ) {\n\n\t\t\tthis.initOptions( function( result ) {\n\t\t\t\tif ( !$this.edit_view ) {\n\t\t\t\t\t$this.initEditViewUI( $this.viewId, $this.edit_view_tpl );\n\t\t\t\t}\n\n\t\t\t\tvar filter = {};\n\t\t\t\tfilter.filter_data = { id: record_id };\n\n\t\t\t\t$this.api.getPayrollRemittanceAgency( filter, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\tresult = result.getResult()[0];\n\t\t\t\t\t\t//Error: Uncaught TypeError: Cannot read property 'user_id' of null in interface/html5/#!m=TimeSheet&date=20150915&user_id=42175&show_wage=0 line 79\n\t\t\t\t\t\tif ( !result ) {\n\t\t\t\t\t\t\tTAlertManager.showAlert( $.i18n._( 'Invalid agency id' ) );\n\t\t\t\t\t\t\t$this.onCancelClick();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Waiting for the TTAPI.API returns data to set the current edit record.\n\t\t\t\t\t\t\t$this.current_edit_record = result;\n\n\t\t\t\t\t\t\t$this.initEditView();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} );\n\t\t} else {\n\t\t\tsuper.openEditView();\n\t\t}\n\t}\n\n\tgetFilterColumnsFromDisplayColumns() {\n\t\tvar column_filter = {};\n\t\tcolumn_filter.is_owner = true;\n\t\tcolumn_filter.id = true;\n\t\tcolumn_filter.is_child = true;\n\t\tcolumn_filter.in_use = true;\n\t\tcolumn_filter.first_name = true;\n\t\tcolumn_filter.last_name = true;\n\t\tcolumn_filter.type_id = true;\n\t\tcolumn_filter.country = true;\n\t\tcolumn_filter.province = true;\n\t\tcolumn_filter.district = true;\n\n\t\t// Error: Unable to get property 'getGridParam' of undefined or null reference\n\t\tvar display_columns = [];\n\t\tif ( this.grid ) {\n\t\t\tdisplay_columns = this.grid.getGridParam( 'colModel' );\n\t\t}\n\t\t//Fixed possible exception -- Error: Unable to get property 'length' of undefined or null reference in /interface/html5/views/BaseViewController.js?v=7.4.3-20140924-090129 line 5031\n\t\tif ( display_columns ) {\n\t\t\tvar len = display_columns.length;\n\n\t\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\t\tvar column_info = display_columns[i];\n\t\t\t\tcolumn_filter[column_info.name] = true;\n\t\t\t}\n\t\t}\n\n\t\treturn column_filter;\n\t}\n\n\tonSetSearchFilterFinished() {\n\t\tvar combo;\n\t\tvar select_value;\n\t\tif ( this.search_panel.getSelectTabIndex() === 0 ) {\n\t\t\tcombo = this.basic_search_field_ui_dic['country'];\n\t\t\tselect_value = combo.getValue();\n\t\t\tthis.setProvince( select_value );\n\t\t} else if ( this.search_panel.getSelectTabIndex() === 1 ) {\n\t\t\tcombo = this.adv_search_field_ui_dic['country'];\n\t\t\tselect_value = combo.getValue();\n\t\t\tthis.setProvince( select_value );\n\t\t}\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\texclude: ['export_excel'],\n\t\t\tinclude: []\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\tonBuildAdvUIFinished() {\n\n\t\tthis.adv_search_field_ui_dic['country'].change( $.proxy( function() {\n\t\t\tvar combo = this.adv_search_field_ui_dic['country'];\n\t\t\tvar selectVal = combo.getValue();\n\n\t\t\tthis.setProvince( selectVal );\n\n\t\t\tthis.adv_search_field_ui_dic['province'].setValue( null );\n\n\t\t}, this ) );\n\t}\n\n\tonBuildBasicUIFinished() {\n\t\tthis.basic_search_field_ui_dic['country'].change( $.proxy( function() {\n\t\t\tvar combo = this.basic_search_field_ui_dic['country'];\n\t\t\tvar selectVal = combo.getValue();\n\n\t\t\tthis.setProvince( selectVal );\n\n\t\t\tthis.basic_search_field_ui_dic['province'].setValue( null );\n\n\t\t}, this ) );\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\tswitch ( key ) {\n\t\t\tcase 'country':\n\t\t\tcase 'province':\n\t\t\t\tif ( c_value.toString() === this.current_edit_record[key].toString() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'type_id':\n\t\t\t\tif ( c_value.toString() === this.current_edit_record[key].toString() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.onTypeChange( c_value );\n\t\t\t\tbreak;\n\t\t\tcase 'agency_id':\n\t\t\t\tthis.onAgencyIdChange();\n\t\t\t\tbreak;\n\t\t}\n\n\t\tthis.current_edit_record[key] = c_value;\n\n\t\tif ( key === 'country' || key === 'type_id' || key === 'province' || key === 'district' ) {\n\n\t\t\tif ( key != 'province' ) {\n\t\t\t\tthis.detachElement( 'province' );\n\t\t\t\tthis.eSetProvince( this.current_edit_record['country'] );\n\t\t\t}\n\t\t\tif ( key != 'district' ) {\n\t\t\t\tthis.detachElement( 'district' );\n\t\t\t\tthis.setDistrict( this.current_edit_record['country'], this.current_edit_record['province'] );\n\t\t\t}\n\n\t\t\tthis.current_edit_record['type_id'] = this.edit_view_ui_dic['type_id'].getValue();\n\t\t\tthis.current_edit_record['country'] = this.edit_view_ui_dic['country'].getValue();\n\t\t\tthis.current_edit_record['province'] = this.edit_view_ui_dic['province'].getValue() ? this.edit_view_ui_dic['province'].getValue() : '00';\n\t\t\tthis.current_edit_record['district'] = this.edit_view_ui_dic['district'].getValue() ? this.edit_view_ui_dic['district'].getValue() : '00';\n\n\t\t\tthis.getAgencyOptions();\n\t\t}\n\n\t\tif ( key === 'legal_entity_id' ) {\n\t\t\tthis.getRemittanceSourceAccount();\n\t\t}\n\n\t\tif ( !doNotValidate ) {\n\t\t\tthis.validate();\n\t\t}\n\t}\n\n\tonAgencyIdChange() {\n\t\tvar id_field_array_api_params = { 'agency_id': this.edit_view_ui_dic.agency_id.getValue() };\n\t\tvar id_field_array = this.api.getOptions( 'agency_id_field_labels', id_field_array_api_params, { async: false } ).getResult();\n\n\t\tthis.detachElement( 'primary_identification' );\n\t\tthis.detachElement( 'secondary_identification' );\n\t\tthis.detachElement( 'tertiary_identification' );\n\n\t\tfor ( var key in id_field_array ) {\n\t\t\tthis.attachElement( key );\n\t\t\tthis.edit_view_form_item_dic[key].find( '.edit-view-form-item-label' ).text( id_field_array[key] );\n\t\t}\n\t\tthis.editFieldResize();\n\t}\n\n\tgetAgencyOptions() {\n\t\tvar params = {\n\t\t\t'type_id': this.current_edit_record['type_id'],\n\t\t\t'country': this.current_edit_record['country'],\n\t\t\t'province': this.current_edit_record['province'],\n\t\t\t'district': this.current_edit_record['district']\n\t\t};\n\t\tvar $this = this;\n\t\tthis.api.getOptions( 'agency', params, {\n\t\t\tasync: false,\n\t\t\tonResult: function( res ) {\n\t\t\t\tvar result = res.getResult();\n\t\t\t\tif ( !result ) {\n\t\t\t\t\tresult = [];\n\t\t\t\t}\n\t\t\t\t$this.agency_array = Global.buildRecordArray( result );\n\n\t\t\t\tif ( Global.isSet( $this.basic_search_field_ui_dic['agency_id'] ) ) {\n\t\t\t\t\t$this.basic_search_field_ui_dic['agency_id'].setSourceData( Global.buildRecordArray( result ) );\n\t\t\t\t}\n\n\t\t\t\tif ( Global.isSet( $this.adv_search_field_ui_dic['agency_id'] ) ) {\n\t\t\t\t\t$this.adv_search_field_ui_dic['agency_id'].setSourceData( Global.buildRecordArray( result ) );\n\t\t\t\t}\n\n\t\t\t\t$this.edit_view_ui_dic['agency_id'].setSourceData( $this.agency_array );\n\t\t\t\tif ( $this.current_edit_record['agency_id'] && res[$this.current_edit_record['agency_id']] ) {\n\t\t\t\t\t$this.edit_view_ui_dic['agency_id'].setValue( $this.current_edit_record['agency_id'] );\n\t\t\t\t} else {\n\t\t\t\t\t$this.current_edit_record['agency_id'] = $this.edit_view_ui_dic['agency_id'].getValue();\n\t\t\t\t}\n\t\t\t\t$this.onAgencyIdChange();\n\t\t\t}\n\t\t} );\n\t}\n\n\tgetRemittanceSourceAccount() {\n\t\tvar $this = this;\n\n\t\tvar legal_entity_id = this.edit_view_ui_dic['legal_entity_id'].getValue();\n\n\t\tif ( !Global.isSet( legal_entity_id ) || Global.isFalseOrNull( legal_entity_id ) ) {\n\t\t\tlegal_entity_id = this.current_edit_record['legal_entity_id'];\n\t\t}\n\n\t\tif ( TTUUID.isUUID( legal_entity_id ) ) {\n\t\t\tvar source_account_args = {};\n\t\t\tsource_account_args.filter_data = {};\n\t\t\tsource_account_args.filter_data.legal_entity_id = legal_entity_id;\n\t\t\tsource_account_args.filter_columns = {};\n\t\t\tsource_account_args.filter_columns.id = true;\n\t\t\tsource_account_args.filter_columns.name = true;\n\n\t\t\t$this.remittance_source_account_api.getRemittanceSourceAccount( source_account_args, {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\tresult = result.getResult();\n\t\t\t\t\t$this.remittance_source_account_array = result;\n\t\t\t\t\t$this.edit_view_ui_dic['remittance_source_account_id'].setSourceData( result );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\tonTypeChange( arg ) {\n\t\tif ( !Global.isSet( arg ) || Global.isFalseOrNull( arg ) ) {\n\t\t\tif ( !Global.isSet( this.current_edit_record['type_id'] ) || Global.isFalseOrNull( this.current_edit_record['type_id'] ) ) {\n\t\t\t\tthis.current_edit_record['type_id'] = 10;\n\t\t\t}\n\t\t}\n\n\t\tthis.editFieldResize();\n\t}\n\n\tsetDistrict( c, p ) {\n\t\tvar $this = this;\n\n\t\tif ( this.edit_view_ui_dic.type_id.getValue() == 30 ) {\n\t\t\tthis.api.getDistrictOptions( c, p, {\n\t\t\t\tasync: false, onResult: function( res ) {\n\t\t\t\t\tres = res.getResult();\n\t\t\t\t\t//#2486 When there are no provinces for 3rd party agencies in countries outside those with scripted agencies, we must hide the field\n\t\t\t\t\tif ( Object.keys( res ).length == 0 || Object.keys( res ).length == 1 && res['00'] ) {\n\t\t\t\t\t\t$this.current_edit_record['district'] = '00';\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !res ) {\n\t\t\t\t\t\tres = [];\n\t\t\t\t\t}\n\t\t\t\t\t$this.attachElement( 'district' );\n\n\t\t\t\t\tvar first_element = null;\n\t\t\t\t\tif ( res.length <= 1 ) {\n\t\t\t\t\t\tfirst_element = {\n\t\t\t\t\t\t\tlabel: '-- ' + $.i18n._( 'Other' ) + ' --',\n\t\t\t\t\t\t\tvalue: '00',\n\t\t\t\t\t\t\tfullValue: '00',\n\t\t\t\t\t\t\torderValue: -1,\n\t\t\t\t\t\t\tid: '00'\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\t$this.district_array = Global.buildRecordArray( res, first_element );\n\n\t\t\t\t\t$this.edit_view_ui_dic['district'].setSourceData( $this.district_array );\n\n\t\t\t\t\tif ( $this.current_edit_record['district'] && res[$this.current_edit_record['district']] ) {\n\t\t\t\t\t\t$this.edit_view_ui_dic['district'].setValue( $this.current_edit_record['district'] );\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tvar district = $this.edit_view_ui_dic['district'].getValue();\n\t\t\t\t\t\tif ( district == TTUUID.not_exist_id || district == TTUUID.zero_id || district == false || district == null ) {\n\t\t\t\t\t\t\tdistrict = '00';\n\t\t\t\t\t\t\t$this.edit_view_ui_dic['district'].setValue( district );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this.current_edit_record['district'] = district;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\t$this.current_edit_record['district'] = '00';\n\t\t\t$this.edit_view_ui_dic['district'].setValue( '00' );\n\t\t}\n\t}\n\n\tsetCurrentEditRecordData() {\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\n\t\t\tvar widget = this.edit_view_ui_dic[key];\n\t\t\tif ( Global.isSet( widget ) ) {\n\t\t\t\tswitch ( key ) {\n\t\t\t\t\tdefault:\n\t\t\t\t\t\twidget.setValue( this.current_edit_record[key] );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tthis.collectUIDataToCurrentEditRecord();\n\t\tthis.setEditViewDataDone();\n\t}\n\n\teSetProvince( val, refresh ) {\n\t\tvar $this = this;\n\n\t\tif ( this.edit_view_ui_dic.type_id.getValue() > 10 ) {\n\t\t\tthis.api.getProvinceOptions( val, {\n\t\t\t\tasync: false, onResult: function( result ) {\n\t\t\t\t\tresult = result.getResult();\n\n\t\t\t\t\tif ( !result ) {\n\t\t\t\t\t\tresult = [];\n\t\t\t\t\t}\n\n\t\t\t\t\t//#2486 When there are no provinces for 3rd party agencies in countries outside those with scripted agencies, we must hide the field\n\t\t\t\t\tif ( $this.edit_view_ui_dic.type_id.getValue() < 20 || ( Object.keys( result ).length == 0 || Object.keys( result ).length == 1 && result['00'] ) ) {\n\t\t\t\t\t\t$this.current_edit_record['province'] = '00';\n\t\t\t\t\t\t//Field stays hidden. value is set to '00'\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t$this.attachElement( 'province' );\n\n\t\t\t\t\tvar first_element = null;\n\t\t\t\t\tif ( result.length <= 1 ) {\n\t\t\t\t\t\tfirst_element = {\n\t\t\t\t\t\t\tlabel: '-- ' + $.i18n._( 'Other' ) + ' --',\n\t\t\t\t\t\t\tvalue: '00',\n\t\t\t\t\t\t\tfullValue: '00',\n\t\t\t\t\t\t\torderValue: -1,\n\t\t\t\t\t\t\tid: '00'\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\t$this.province_array = Global.buildRecordArray( result, first_element );\n\t\t\t\t\t$this.edit_view_ui_dic['province'].setSourceData( $this.province_array );\n\n\t\t\t\t\tif ( $this.current_edit_record['province'] && Global.isSet( result[$this.current_edit_record['province']] ) ) {\n\t\t\t\t\t\t$this.edit_view_ui_dic['province'].setValue( $this.current_edit_record['province'] );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar province = $this.edit_view_ui_dic['province'].getValue();\n\t\t\t\t\t\tif ( province == TTUUID.not_exist_id || province == TTUUID.zero_id || province == false || province == null ) {\n\t\t\t\t\t\t\tprovince = '00';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this.current_edit_record['province'] = province;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\t$this.current_edit_record['province'] = '00';\n\t\t\t$this.edit_view_ui_dic['province'].setValue( '00 ' );\n\t\t}\n\t}\n\n\tsetEditViewDataDone() {\n\t\tsuper.setEditViewDataDone();\n\t\tthis.onTypeChange();\n\n\t\tthis.detachElement( 'province' );\n\t\tthis.detachElement( 'district' );\n\t\tthis.eSetProvince( this.current_edit_record['country'] );\n\t\tthis.setDistrict( this.current_edit_record['country'], this.current_edit_record['province'] );\n\n\t\tthis.getAgencyOptions();\n\t}\n\n\tbuildEditViewUI() {\n\t\tsuper.buildEditViewUI();\n\n\t\tvar $this = this;\n\n\t\tvar tab_model = {\n\t\t\t'tab_payroll_remittance_agency': { 'label': $.i18n._( 'Remittance Agency' ), 'is_multi_column': true },\n\t\t\t'tab_payroll_remittance_agency_event': {\n\t\t\t\t'label': $.i18n._( 'Events' ),\n\t\t\t\t'init_callback': 'initSubEventView',\n\t\t\t\t'display_on_mass_edit': false,\n\t\t\t\t'html_template': this.getPayrollRemittanceAgencyEventTabHtml()\n\t\t\t},\n\t\t\t'tab_audit': true,\n\t\t};\n\t\tthis.setTabModel( tab_model );\n\n\t\tif ( this.navigation ) {\n\t\t\tthis.navigation.AComboBox( {\n\t\t\t\tapi_class: TTAPI.APIPayrollRemittanceAgency,\n\t\t\t\tid: this.script_name + '_navigation',\n\t\t\t\tallow_multiple_selection: false,\n\t\t\t\tlayout_name: 'global_payroll_remittance_agency',\n\t\t\t\tnavigation_mode: true,\n\t\t\t\tshow_search_inputs: true\n\t\t\t} );\n\t\t\tthis.setNavigation();\n\t\t}\n\n\t\tvar tab_payroll_remittance_agency = this.edit_view_tab.find( '#tab_payroll_remittance_agency' );\n\t\tvar tab_payroll_remittance_agency_column1 = tab_payroll_remittance_agency.find( '.first-column' );\n\t\tvar tab_payroll_remittance_agency_column2 = tab_payroll_remittance_agency.find( '.second-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_payroll_remittance_agency_column1 );\n\t\tthis.edit_view_tabs[0].push( tab_payroll_remittance_agency_column2 );\n\n\t\t// tab_employee_contact column1\n\n\t\t// Legal Entity\n\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APILegalEntity,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_legal_entity',\n\t\t\tfield: 'legal_entity_id',\n\t\t\tset_empty: true,\n\t\t\tshow_search_inputs: true\n\t\t} );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Legal Entity' ), form_item_input, tab_payroll_remittance_agency_column1, '' );\n\n\t\t// Status\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( {\n\t\t\tfield: 'status_id'\n\t\t} );\n\t\tform_item_input.setSourceData( $this.status_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Status' ), form_item_input, tab_payroll_remittance_agency_column1 );\n\n\t\t// Name\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'name', width: '100%' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Name' ), form_item_input, tab_payroll_remittance_agency_column1 );\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_payroll_remittance_agency_column1 );\n\t\tform_item_input.parent().width( '45%' );\n\n\t\t// Type\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( {\n\t\t\tfield: 'type_id'\n\t\t} );\n\t\tform_item_input.setSourceData( $this.type_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Type' ), form_item_input, tab_payroll_remittance_agency_column1 );\n\n\t\t// Country\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( {\n\t\t\tset_empty: false,\n\t\t\tfield: 'country'\n\t\t} );\n\t\tform_item_input.setSourceData( $this.country_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Country' ), form_item_input, tab_payroll_remittance_agency_column1 );\n\n\t\t// Province/State\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( {\n\t\t\tset_empty: false,\n\t\t\tfield: 'province'\n\t\t} );\n\t\tform_item_input.setSourceData( [] );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Province/State' ), form_item_input, tab_payroll_remittance_agency_column1, '', null, true );\n\n\t\t// District\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( {\n\t\t\tset_empty: false,\n\t\t\tfield: 'district'\n\t\t} );\n\t\tform_item_input.setSourceData( [] );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'District' ), form_item_input, tab_payroll_remittance_agency_column1, '', null, true );\n\n\t\t// Agency\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( {\n\t\t\tset_empty: false,\n\t\t\tfield: 'agency_id'\n\t\t} );\n\t\tform_item_input.setSourceData( [] );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Agency' ), form_item_input, tab_payroll_remittance_agency_column1 );\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'primary_identification', width: 200 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Primary Identification' ), form_item_input, tab_payroll_remittance_agency_column1, '', null, true );\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'secondary_identification', width: 200 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Secondary Identification' ), form_item_input, tab_payroll_remittance_agency_column1, '', null, true );\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'tertiary_identification', width: 200 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Tertiary Identification' ), form_item_input, tab_payroll_remittance_agency_column1, '', null, true );\n\n\t\t//prevent flashing province and district on addclick.\n\t\tthis.detachElement( 'primary_identification' );\n\t\tthis.detachElement( 'secondary_identification' );\n\t\tthis.detachElement( 'tertiary_identification' );\n\n\t\t// column2\n\n\t\t// Start Date\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\t\tform_item_input.TDatePicker( {\n\t\t\tfield: 'start_date'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Start Date' ), form_item_input, tab_payroll_remittance_agency_column2 );\n\n\t\t// Start Date\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\t\tform_item_input.TDatePicker( {\n\t\t\tfield: 'end_date'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'End Date' ), form_item_input, tab_payroll_remittance_agency_column2 );\n\n\t\t// Contact\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIUser,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_user',\n\t\t\tfield: 'contact_user_id',\n\t\t\tset_empty: true,\n\t\t\tshow_search_inputs: true\n\t\t} );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Contact' ), form_item_input, tab_payroll_remittance_agency_column2, '' );\n\n\t\t// Remittance Source Account\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIRemittanceSourceAccount,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_remittance_source_account',\n\t\t\tfield: 'remittance_source_account_id',\n\t\t\tset_empty: true,\n\t\t\tshow_search_inputs: true\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Remittance Source Account' ), form_item_input, tab_payroll_remittance_agency_column2, '' );\n\n\t\t// Always On Business Day\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'always_week_day_id' } );\n\t\tform_item_input.setSourceData( this.always_week_day_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Events Always On Business Day' ), form_item_input, tab_payroll_remittance_agency_column2 );\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIRecurringHoliday,\n\t\t\tallow_multiple_selection: true,\n\t\t\tlayout_name: 'global_recurring_holiday',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'recurring_holiday_policy_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Recurring Holidays' ), form_item_input, tab_payroll_remittance_agency_column2 );\n\n\t\t//prevent flashing province and district on addclick.\n\t\tthis.detachElement( 'province' );\n\t\tthis.detachElement( 'district' );\n\t}\n\n\tsetProvince( val, m ) {\n\t\tvar $this = this;\n\n\t\tif ( !val || val === TTUUID.not_exist_id || val === TTUUID.zero_id ) {\n\t\t\t$this.province_array = [];\n\t\t\tthis.adv_search_field_ui_dic['province'].setSourceData( [] );\n\t\t\tthis.basic_search_field_ui_dic['province'].setSourceData( [] );\n\n\t\t} else {\n\t\t\tthis.company_api.getOptions( 'province', val, {\n\t\t\t\tasync: false,\n\t\t\t\tonResult: function( res ) {\n\t\t\t\t\tres = res.getResult();\n\t\t\t\t\tif ( !res ) {\n\t\t\t\t\t\tres = [];\n\t\t\t\t\t}\n\n\t\t\t\t\t$this.province_array = Global.buildRecordArray( res, {\n\t\t\t\t\t\tlabel: '-- ' + $.i18n._( 'Other' ) + ' --',\n\t\t\t\t\t\tvalue: '00',\n\t\t\t\t\t\tfullValue: '00',\n\t\t\t\t\t\torderValue: -1,\n\t\t\t\t\t\tid: '00'\n\t\t\t\t\t} );\n\t\t\t\t\t$this.adv_search_field_ui_dic['province'].setSourceData( $this.province_array );\n\t\t\t\t\t$this.basic_search_field_ui_dic['province'].setSourceData( $this.province_array );\n\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\tbuildSearchFields() {\n\n\t\tsuper.buildSearchFields();\n\t\tthis.search_fields = [\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Legal Entity' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'legal_entity_id',\n\t\t\t\tlayout_name: 'global_legal_entity',\n\t\t\t\tapi_class: TTAPI.APILegalEntity,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\n\t\t\t\tscript_name: 'LegalEntityView',\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Status' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'status_id',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\n\t\t\t\tlayout_name: 'global_option_column',\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\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: true,\n\t\t\t\tform_item_type: FormItemType.TEXT_INPUT\n\t\t\t} ),\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Country' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'country',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\n\t\t\t\tlayout_name: 'global_option_column',\n\t\t\t\tform_item_type: FormItemType.COMBO_BOX\n\t\t\t} ),\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Province/State' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'province',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\n\t\t\t\tlayout_name: 'global_option_column',\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Created By' ),\n\t\t\t\tin_column: 3,\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: false,\n\t\t\t\tadv_search: true,\n\t\t\t\tscript_name: 'EmployeeView',\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: 3,\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: false,\n\t\t\t\tadv_search: true,\n\t\t\t\tscript_name: 'EmployeeView',\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} )\n\n\t\t];\n\t}\n\n\tinitSubEventView() {\n\t\tvar $this = this;\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_event_view_controller ) {\n\t\t\tthis.sub_event_view_controller.buildContextMenu( true );\n\t\t\tthis.sub_event_view_controller.setDefaultMenu();\n\t\t\t$this.sub_event_view_controller.parent_value = $this.current_edit_record.id;\n\t\t\t$this.sub_event_view_controller.parent_edit_record = $this.current_edit_record;\n\t\t\t$this.sub_event_view_controller.initData(); //Init data in this parent view\n\t\t\treturn;\n\t\t}\n\n\t\tGlobal.loadScript( 'views/company/payroll_remittance_agency/PayrollRemittanceAgencyEventViewController.js', function() {\n\t\t\tif ( !$this.edit_view_tab ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar tab_event = $this.edit_view_tab.find( '#tab_payroll_remittance_agency_event' );\n\t\t\tvar firstColumn = tab_event.find( '.first-column-sub-view' );\n\t\t\tGlobal.trackView( 'Sub' + 'PayrollRemittanceEvent' + 'View' );\n\t\t\tPayrollRemittanceAgencyEventViewController.loadSubView( firstColumn, beforeLoadView, afterLoadView );\n\n\t\t} );\n\n\t\tfunction beforeLoadView() {\n\n\t\t}\n\n\t\tfunction afterLoadView( subViewController ) {\n\n\t\t\t$this.sub_event_view_controller = subViewController;\n\t\t\t$this.sub_event_view_controller.parent_key = 'payroll_remittance_agency_id';\n\t\t\t$this.sub_event_view_controller.parent_value = $this.current_edit_record.id;\n\t\t\t$this.sub_event_view_controller.parent_edit_record = $this.current_edit_record;\n\t\t\t$this.sub_event_view_controller.parent_view_controller = $this;\n\t\t\t$this.sub_event_view_controller.postInit = function() {\n\t\t\t\tthis.initData();\n\t\t\t};\n\t\t}\n\t}\n\n\tonCancelClick() {\n\t\tsuper.onCancelClick();\n\t\tthis.sub_event_view_controller = null;\n\t}\n\n\tonSaveClick( ignore_warning ) {\n\t\tsuper.onSaveClick( ignore_warning );\n\t\tthis.sub_event_view_controller = null;\n\t}\n\n\tuniformVariable( data ) {\n\t\tif ( data ) {\n\t\t\tsuper.collectUIDataToCurrentEditRecord();\n\n\t\t\tif ( this.is_mass_editing != true ) {\n\t\t\t\tdata.payroll_remittance_agency_id = this.parent_value;\n\n\t\t\t\tif ( data.type_id != 30 || data.district == TTUUID.not_exist_id || data.district == TTUUID.zero_id || data.district == false || data.district == null ) {\n\t\t\t\t\tdata.district = '00';\n\t\t\t\t}\n\n\t\t\t\tif ( data.type_id <= 10 || data.province == TTUUID.not_exist_id || data.province == TTUUID.zero_id || data.province == false || data.province == null ) {\n\t\t\t\t\tdata.province = '00';\n\t\t\t\t}\n\n\t\t\t\tvar agency_identifier = '0000';\n\t\t\t\tif ( data.agency_id ) {\n\t\t\t\t\tagency_identifier = data.agency_id.slice( -4 );\n\t\t\t\t}\n\t\t\t\tdata.agency_id = data.type_id + ':' + data.country + ':' + data.province + ':' + data.district + ':' + agency_identifier;\n\t\t\t}\n\t\t}\n\n\t\treturn data;\n\t}\n\n\tgetPayrollRemittanceAgencyEventTabHtml() {\n\t\treturn `
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
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