1 line
16 KiB
JavaScript
1 line
16 KiB
JavaScript
|
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["invoice-tax_policy-TaxPolicyViewController"],{5265:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"TaxPolicyViewController\": () => (/* binding */ TaxPolicyViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass TaxPolicyViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#tax_policy_view_container',\n\n\t\t\tstatus_array: 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 = 'TaxPolicyEditView.html';\n\t\tthis.permission_id = 'tax_policy';\n\t\tthis.viewId = 'TaxPolicy';\n\t\tthis.script_name = 'TaxPolicyView';\n\t\tthis.table_name_key = 'tax_policy';\n\t\tthis.context_menu_name = $.i18n._( 'Tax' );\n\t\tthis.navigation_label = $.i18n._( 'Tax' );\n\t\tthis.api = TTAPI.APITaxPolicy;\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\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_tax': { 'label': $.i18n._( 'Tax' ) },\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.APITaxPolicy,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_tax_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_tax = this.edit_view_tab.find( '#tab_tax' );\n\n\t\tvar tab_tax_column1 = tab_tax.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_tax_column1 );\n\n\t\tvar form_item_input;\n\t\tvar widgetContainer;\n\t\tvar label;\n\n\t\t//Product\n\t\tvar args = { filter_data: {} };\n\t\targs.filter_data.type_id = 50;\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIProduct,\n\t\t\tlayout_name: 'global_product',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'product_id'\n\t\t} );\n\t\tform_item_input.setDefaultArgs( args );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Product' ), form_item_input, tab_tax_column1, '' );\n\n\t\t//Code\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'code' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Code' ), form_item_input, tab_tax_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_tax_column1 );\n\n\t\tform_item_input.parent().width( '45%' );\n\n\t\t// Tax Number\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'number' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Tax Number' ), form_item_input, tab_tax_column1 );\n\n\t\t// Percent\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'percent', width: 80 } );\n\n\t\twidgetContainer = $( '<div class=\\'widget-h-box\\'></div>' );\n\t\tlabel = $( '<span class=\\'widget-right-label\\'>%</span>' );\n\n\t\twidgetContainer.append( form_item_input );\n\t\twidgetContainer.append( label );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Percent' ), form_item_input, tab_tax_column1, '', widgetContainer, true );\n\n\t\t//Priority\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field
|