TimeTrex/interface/html5/dist/invoice-district-InvoiceDistrictViewController.bundle.js

1 line
19 KiB
JavaScript
Raw Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["invoice-district-InvoiceDistrictViewController"],{5504:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"InvoiceDistrictViewController\": () => (/* binding */ InvoiceDistrictViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass InvoiceDistrictViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#invoice_district_view_container',\n\n\t\t\tstatus_array: null,\n\t\t\tcountry_array: null,\n\t\t\tprovince_array: null,\n\n\t\t\te_province_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 = 'InvoiceDistrictEditView.html';\n\t\tthis.permission_id = 'client';\n\t\tthis.viewId = 'InvoiceDistrict';\n\t\tthis.script_name = 'InvoiceDistrictView';\n\t\tthis.table_name_key = 'invoice_district';\n\t\tthis.context_menu_name = $.i18n._( 'District' );\n\t\tthis.navigation_label = $.i18n._( 'District' );\n\t\tthis.api = TTAPI.APIInvoiceDistrict;\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\tinitOptions() {\n\t\tvar $this = this;\n\n\t\tthis.initDropDownOption( 'status' );\n\t\tthis.initDropDownOption( 'country', 'country', this.company_api );\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}\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\n\t\tthis.setIsChanged( target );\n\t\tthis.setMassEditingFieldsWhenFormChange( target );\n\t\tvar key = target.getField();\n\n\t\tswitch ( key ) {\n\t\t\tcase 'country':\n\t\t\t\tvar widget = this.edit_view_ui_dic['province'];\n\t\t\t\twidget.setValue( null );\n\t\t\t\tbreak;\n\t\t}\n\n\t\tthis.current_edit_record[key] = target.getValue();\n\n\t\tif ( key === 'country' ) {\n\t\t\tthis.onCountryChange();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !doNotValidate ) {\n\t\t\tthis.validate();\n\t\t}\n\t}\n\n\tbuildEditViewUI() {\n\n\t\tsuper.buildEditViewUI();\n\t\tvar $this = this;\n\n\t\tvar tab_model = {\n\t\t\t'tab_district': { 'label': $.i18n._( 'District' ) },\n\t\t\t'tab_audit': true,\n\t\t};\n\t\tthis.setTabModel( tab_model );\n\n\t\tvar form_item_input;\n\n\t\tthis.navigation.AComboBox( {\n\t\t\tapi_class: TTAPI.APIInvoiceDistrict,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_invoice_district',\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_district = this.edit_view_tab.find( '#tab_district' );\n\n\t\tvar tab_district_column1 = tab_district.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_district_column1 );\n\n\t\t// Name\n\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_district_column1, '' );\n\t\tform_item_input.parent().width( '45%' );\n\n\t\t//Country\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\n\t\tform_ite