1 line
24 KiB
JavaScript
1 line
24 KiB
JavaScript
|
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["company-currency-CurrencyViewController"],{1297:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"CurrencyViewController\": () => (/* binding */ CurrencyViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass CurrencyViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#currency_view_container',\n\n\t\t\tstatus_array: null,\n\t\t\tiso_codes_array: null,\n\t\t\tround_decimal_places_array: null,\n\t\t\tsub_currency_rate_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 = 'CurrencyEditView.html';\n\t\tthis.permission_id = 'currency';\n\t\tthis.viewId = 'Currency';\n\t\tthis.script_name = 'CurrencyView';\n\t\tthis.table_name_key = 'currency';\n\t\tthis.context_menu_name = $.i18n._( 'Currencies' );\n\t\tthis.navigation_label = $.i18n._( 'Currency' );\n\t\tthis.api = TTAPI.APICurrency;\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( 'round_decimal_places', 'round_decimal_places' );\n\t\tthis.api.getISOCodesArray( '', false, false, {\n\t\t\tonResult: function( res ) {\n\t\t\t\tres = res.getResult();\n\t\t\t\tres = Global.buildRecordArray( res );\n\t\t\t\t$this.basic_search_field_ui_dic['iso_code'].setSourceData( res );\n\t\t\t\t$this.iso_codes_array = res;\n\n\t\t\t}\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_currency': { 'label': $.i18n._( 'Currency' ) },\n\t\t\t'tab_rates': {\n\t\t\t\t'label': $.i18n._( 'Rates' ),\n\t\t\t\t'init_callback': 'initSubCurrencyRateView',\n\t\t\t\t'display_on_mass_edit': false\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.APICurrency,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_currency',\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_currency = this.edit_view_tab.find( '#tab_currency' );\n\n\t\tvar tab_currency_column1 = tab_currency.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_currency_column1 );\n\n\t\tvar form_item_input;\n\t\tvar widgetContainer;\n\n\t\t//Status\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'status_id' } );\n\t\tform_item_input.setSourceData( $this.status_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Status' ), form_item_input, tab_currency_column1, '' );\n\n\t\t// ISO Currency\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'iso_code' } );\n\t\tform_item_input.setSourceData( $this.iso_codes_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'ISO Currency' ), form_item_input, tab_currency_column1 );\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_currency_column1 );\n\n\t\tform_item_input.parent().width( '45%' );\n\n\t\t// Base Currency\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'is_base' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Base Currency' ), form_item_input, tab_currency_column1 );\n\n\t\t// Conversion Rate\n\t\tfor
|