"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["invoice-area_policy-AreaPolicyViewController"],{8477:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"AreaPolicyViewController\": () => (/* binding */ AreaPolicyViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass AreaPolicyViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#area_policy_view_container',\n\n\t\t\tstatus_array: null,\n\n\t\t\tcountry_array: null,\n\t\t\tdistrict_array: null,\n\t\t\tprovince_array: null,\n\n\t\t\tcompany_api: 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 = 'AreaPolicyEditView.html';\n\t\tthis.permission_id = 'area_policy';\n\t\tthis.viewId = 'AreaPolicy';\n\t\tthis.script_name = 'AreaPolicyView';\n\t\tthis.table_name_key = 'area_policy';\n\t\tthis.context_menu_name = $.i18n._( 'Area Policy' );\n\t\tthis.navigation_label = $.i18n._( 'Area' );\n\t\tthis.api = TTAPI.APIAreaPolicy;\n\t\tthis.company_api = TTAPI.APICompany;\n\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\n\t\tthis.initData();\n\t}\n\n\t//Don't call super if override this function.\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\t\tif ( c_value.toString() === this.current_edit_record[key].toString() ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tvar widget = this.edit_view_ui_dic['province'];\n\t\t\t\tvar widget2 = this.edit_view_ui_dic['district'];\n\t\t\t\twidget.setValue( null );\n\t\t\t\twidget2.setValue( null );\n\t\t\t\tthis.current_edit_record.province = false;\n\t\t\t\tthis.current_edit_record.district = false;\n\t\t\t\tvar p = this.edit_view_ui_dic['province'].getValue();\n\t\t\t\tthis.eSetProvince( c_value );\n\t\t\t\tthis.setDistrict( c_value, p );\n\t\t\t\tbreak;\n\t\t\tcase 'province':\n\n\t\t\t\tif ( c_value.toString() === this.current_edit_record[key].toString() ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\twidget = this.edit_view_ui_dic['district'];\n\t\t\t\twidget.setValue( null );\n\t\t\t\tvar c = this.edit_view_ui_dic['country'].getValue();\n\t\t\t\tthis.setDistrict( c, c_value );\n\t\t\t\tbreak;\n\t\t}\n\n\t\tthis.current_edit_record[key] = c_value;\n\n\t\tif ( key === 'country' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.validate();\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\n\n\t\tthis.initDropDownOption( 'country', null, this.company_api );\n\t}\n\n\tsetDistrict( c, p ) {\n\t\tvar $this = this;\n\t\tvar district_widget = $this.edit_view_ui_dic['district'];\n\n\t\tif ( !Global.isSet( c ) || c === '-1' || c === '0' || !Global.isSet( p ) || p === '-1' || p === '0' ) {\n\t\t\t$this.district_array = [];\n\t\t\tdistrict_widget.setSourceData( [] );\n\t\t} else {\n\n\t\t\tthis.api.getDistrictOptions( c, p, {\n\t\t\t\tonResult: function( res ) {\n\t\t\t\t\tres = res.getResult();\n\t\t\t\t\t$this.district_array = Global.buildRecordArray( res );\n\t\t\t\t\tdistrict_widget.setSourceData( $this.district_array );\n\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\teSetProvince( val, refresh ) {\n\t\tvar $this = this;\n\t\tvar province_widget = $this.edit_view_ui_dic['province'];\n\n\t\tif ( !val || val === '-1' || val === '0' ) {\n\t\t\t$this.e_province_array = [];\n\t\t\tprovince_widget.setSourceData( [] );\n\t\t} else {\n\t\t\tthis.api.getProvinceOptions( val, {\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\tprovince_widget.setSourceData( $this.province_array );\n\n\t\t\t\t}\n\t\t\t} );\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\t//Make sure reset data source everytime.\n\t\t\tthis.edit_view_ui_dic['province'].setSourceData( null );\n\t\t\tthis.edit_view_ui_dic['district'].setSourceData( null );\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\tcase 'country': //popular case\n\t\t\t\t\t\tthis.setCountryValue( widget, key );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'province': //popular case\n\t\t\t\t\t\tthis.setDistrict( this.current_edit_record['country'], this.current_edit_record[key] );\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\tcase '': //popular case\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\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\tbuildEditViewUI() {\n\n\t\tsuper.buildEditViewUI();\n\n\t\tvar $this = this;\n\n\t\tvar tab_model = {\n\t\t\t'tab_area': { 'label': $.i18n._( 'Area' ) },\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.APIAreaPolicy,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_area_policy',\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_area = this.edit_view_tab.find( '#tab_area' );\n\n\t\tvar tab_area_column1 = tab_area.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_area_column1 );\n\n\t\t// Name\n\n\t\tvar form_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_area_column1, '' );\n\t\tform_item_input.parent().width( '45%' );\n\n\t\t// Country\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input = form_item_input.AComboBox( {\n\t\t\tfield: 'country',\n\t\t\tset_empty: true,\n\t\t\tallow_multiple_selection: true,\n\t\t\tlayout_name: 'global_option_column',\n\t\t\tkey: 'value'\n\t\t} );\n\n\t\tform_item_input.setSourceData( this.country_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Country' ), form_item_input, tab_area_column1, '' );\n\n\t\t// Province\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input = form_item_input.AComboBox( {\n\t\t\tfield: 'province',\n\t\t\tset_empty: true,\n\t\t\tallow_multiple_selection: true,\n\t\t\tlayout_name: 'global_option_column',\n\t\t\tkey: 'value'\n\t\t} );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Province' ), form_item_input, tab_area_column1, '' );\n\n\t\t// Province\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input = form_item_input.AComboBox( {\n\t\t\tfield: 'district',\n\t\t\tset_empty: true,\n\t\t\tallow_multiple_selection: true,\n\t\t\tlayout_name: 'global_option_column',\n\t\t\tkey: 'value'\n\t\t} );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'District' ), form_item_input, tab_area_column1, '' );\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\tform_item_type: FormItemType.TEXT_INPUT\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}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODQ3Ny5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7QUFBTztBQUNQLDJCQUEyQjtBQUM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