1 line
16 KiB
JavaScript
1 line
16 KiB
JavaScript
|
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["company-currency-CurrencyRateViewController"],{4607:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"CurrencyRateViewController\": () => (/* binding */ CurrencyRateViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass CurrencyRateViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\n\t\t\tel: '#currency_rate_view_container', //Must set el here and can only set string, so events can work\n\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\n\t\t//this._super('initialize', options );\n\t\tthis.edit_view_tpl = 'CurrencyRateEditView.html';\n\t\tthis.permission_id = 'currency';\n\t\tthis.script_name = 'CurrencyRateView';\n\t\tthis.viewId = 'CurrencyRate';\n\t\tthis.table_name_key = 'currency_rate';\n\t\tthis.context_menu_name = $.i18n._( 'Rates' );\n\t\tthis.navigation_label = $.i18n._( 'Rate' );\n\t\tthis.api = TTAPI.APICurrencyRate;\n\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\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\texclude: ['copy'],\n\t\t\tinclude: []\n\t\t};\n\n\t\treturn context_menu_model;\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_currency_rate': { 'label': $.i18n._( 'Currency Rate' ) },\n\t\t\t'tab_audit': true,\n\t\t};\n\t\tthis.setTabModel( tab_model );\n\n\t\tvar form_item_input;\n\t\tvar widgetContainer;\n\n\t\tthis.navigation.AComboBox( {\n\t\t\tapi_class: TTAPI.APICurrencyRate,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_currency_rate',\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_rate = this.edit_view_tab.find( '#tab_currency_rate' );\n\n\t\tvar tab_currency_rate_column1 = tab_currency_rate.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_currency_rate_column1 );\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\tfield: 'currency_id',\n\t\t\tset_empty: false,\n\t\t\tshow_search_inputs: true\n\t\t} );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Currency' ), form_item_input, tab_currency_rate_column1 );\n\n\t\t// Date\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\n\t\tform_item_input.TDatePicker( { field: 'date_stamp' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Date' ), form_item_input, tab_currency_rate_column1 );\n\n\t\t// Conversion Rate\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'conversion_rate', width: 114 } );\n\t\twidgetContainer = $( '<div class=\\'\\'></div>' );\n\t\tvar conversion_rate_clarification_box = $( '<span id=\\'rate_conversion_rate_clarification_box\\'></span>' );\n\t\twidgetContainer.append( form_item_input );\n\t\twidgetContainer.append( conversion_rate_clarification_box );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Conversion Rate' ), [form_item_input], tab_currency_rate_column1, '', widgetContainer, false, true );\n\t}\n\n\tonMassEditClick() {\n\n\t\tvar $this = this;\n\t\t$this.is_add = false;\n\t\t$this.is_viewing = false;\n\t\t$this.is_mass_editing = true;\n\t\tLocalCacheData.current_doing_context_action = 'mass_edit';\n\
|