(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["payroll-user_expense-UserExpenseViewController","filebrowser-TImageBrowser"],{8326:(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{eval("/* provided dependency */ var jQuery = __webpack_require__(9755);\n( function( $ ) {\n\n\t$.fn.TImageBrowser = function( options ) {\n\t\tGlobal.addCss( 'global/widgets/filebrowser/TImageBrowser.css' );\n\t\tvar opts = $.extend( {}, $.fn.TImageBrowser.defaults, options );\n\n\t\tvar $this = this;\n\t\tvar field;\n\t\tvar id = 'file_browser';\n\t\tvar name = 'filedata';\n\t\tvar browser;\n\n\t\tvar accept_filter = '';\n\n\t\tvar default_width = 177;\n\t\tvar default_height = 42;\n\t\tvar enabled = true;\n\n\t\tthis.setEnabled = function( val ) {\n\t\t\tenabled = val;\n\n\t\t\tvar btn = this.find( '.browser-form input' );\n\n\t\t\tif ( !val ) {\n\t\t\t\tbtn.attr( 'disabled', true );\n\t\t\t\tbtn.removeClass( 'disable-element' ).addClass( 'disable-element' );\n\t\t\t} else {\n\t\t\t\tbtn.removeAttr( 'disabled' );\n\t\t\t\tbtn.removeClass( 'disable-element' );\n\t\t\t}\n\n\t\t};\n\n\t\tthis.clearErrorStyle = function() {\n\n\t\t};\n\n\t\tthis.getFileName = function() {\n\n\t\t\treturn browser.val();\n\t\t};\n\n\t\tthis.getField = function() {\n\t\t\treturn field;\n\t\t};\n\n\t\tthis.setEnableDelete = function( val ) {\n\t\t\tvar image = $this.find( '.image' );\n\t\t\tif ( !val ) {\n\t\t\t\timage.removeAttr( 'enable-delete' );\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\timage.attr( 'enable-delete', 1 );\n\t\t\t}\n\t\t};\n\n\t\tthis.getValue = function() {\n\t\t\tvar form_data;\n\t\t\tif ( browser && browser.val() ) {\n\n\t\t\t\tif ( typeof FormData == 'undefined' ) {\n\t\t\t\t\tform_data = $this.find( '.browser-form' );\n\t\t\t\t} else {\n\t\t\t\t\tform_data = new FormData( $( $this.find( '.browser-form' ) )[0] );\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tform_data = null;\n\t\t\t}\n\n\t\t\treturn form_data;\n\t\t};\n\n\t\tthis.getImageSrc = function() {\n\t\t\tvar image = $this.find( '.image' );\n\t\t\treturn image.attr( 'src' );\n\t\t};\n\n\t\tthis.setImage = function( val ) {\n\t\t\tvar image = $this.find( '.image' );\n\n\t\t\tif ( !val ) {\n\t\t\t\timage.attr( 'src', '' );\n\t\t\t\timage.hide();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar d = new Date();\n\t\t\timage.hide();\n\t\t\timage.attr( 'src', val + '&t=' + d.getTime() );\n\t\t\timage.css( 'height', 'auto' );\n\t\t\timage.css( 'width', 'auto' );\n\n\t\t};\n\n\t\tvar onImageLoad = function( image ) {\n\n\t\t\tvar image_height = $( image ).height() > 0 ? $( image ).height() : image.naturalHeight;\n\t\t\tvar image_width = $( image ).width() > 0 ? $( image ).width() : image.naturalWidth;\n\n\t\t\tif ( image_height > default_height ) {\n\t\t\t\t$( image ).css( 'height', default_height );\n\n\t\t\t}\n\n\t\t\tif ( image_width > default_width ) {\n\t\t\t\t$( image ).css( 'width', default_width );\n\t\t\t\t$( image ).css( 'height', 'auto' );\n\t\t\t}\n\n\t\t\t$this.trigger( 'setSize' );\n\n\t\t\tif ( image_height < 5 ) {\n\t\t\t\t$( image ).hide();\n\t\t\t} else {\n\t\t\t\t$( image ).show();\n\t\t\t}\n\t\t};\n\n\t\tthis.setValue = function( val ) {\n\n\t\t\tif ( !val ) {\n\t\t\t\tval = '';\n\t\t\t}\n\n\t\t};\n\n\t\tthis.each( function() {\n\t\t\tvar o = $.meta ? $.extend( {}, opts, $( this ).data() ) : opts;\n\n\t\t\tfield = o.field;\n\n\t\t\t// var $this = this;\n\n\t\t\tif ( o.default_width > 0 ) {\n\t\t\t\tdefault_width = o.default_width;\n\t\t\t}\n\n\t\t\tif ( o.default_height > 0 ) {\n\t\t\t\tdefault_height = o.default_height;\n\t\t\t}\n\n\t\t\tif ( Global.isSet( o.name ) ) {\n\t\t\t\tname = o.name;\n\t\t\t}\n\n\t\t\tif ( Global.isSet( accept_filter ) ) {\n\t\t\t\taccept_filter = o.accept_filter;\n\t\t\t}\n\n\t\t\tbrowser = $( this ).find( '.browser' );\n\t\t\tvar image = $( this ).find( '.image' );\n\t\t\timage.hide();\n\t\t\timage.on( 'load', function() {\n\t\t\t\tonImageLoad( this );\n\n\t\t\t} );\n\n\t\t\tif ( accept_filter ) {\n\t\t\t\tbrowser.attr( 'accept', accept_filter );\n\t\t\t} else {\n\t\t\t\taccept_filter = 'image/*';\n\t\t\t\tbrowser.attr( 'accept', 'image/*' );\n\t\t\t}\n\n\t\t\tbrowser.attr( 'id', id );\n\t\t\tbrowser.attr( 'name', name );\n\n\t\t\tif ( Global.isSet( o.changeHandler ) ) {\n\n\t\t\t\t$this.bind( 'imageChange', o.changeHandler );\n\t\t\t}\n\t\t\tif ( Global.isSet( o.deleteImageHandler ) ) {\n\t\t\t\tthis.find( '.file-browser' ).on( 'deleteClick', function() {\n\t\t\t\t\to.deleteImageHandler();\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\tbrowser.bind( 'change', function() {\n\t\t\t\timage.hide();\n\n\t\t\t\tif ( typeof FileReader != 'undefined' ) {\n\n\t\t\t\t\tvar files = !!this.files ? this.files : [];\n\n\t\t\t\t\t// If no files were selected, or no FileReader support, return\n\t\t\t\t\tif ( !files.length || !window.FileReader ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( accept_filter === 'image/*' ) {\n\t\t\t\t\t\t// Create a new instance of the FileReader\n\t\t\t\t\t\tvar reader = new FileReader();\n\n\t\t\t\t\t\t// Read the local file as a DataURL\n\t\t\t\t\t\treader.readAsDataURL( files[0] );\n\n\t\t\t\t\t\t// When loaded, set image data as background of div\n\t\t\t\t\t\treader.onloadend = function() {\n\t\t\t\t\t\t\tvar url = this.result;\n\t\t\t\t\t\t\timage.attr( 'src', url );\n\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t$this.trigger( 'imageChange', [$this] );\n\n\t\t\t} );\n\n\t\t} );\n\n\t\treturn this;\n\n\t};\n\n\t$.fn.TImageBrowser.defaults = {};\n\t$.fn.TImageBrowser.html_template = `\n\t
\n\t\t
\n\t\t
\n\t
\n\t`;\n\n} )( jQuery );//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODMyNi5qcyIsIm1hcHBpbmdzIjoiO0FBQUE7O0FBRUE7QUFDQTtBQUNBLHlCQUF5Qjs7QUFFekI7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBOztBQUVBOztBQUVBOztBQUVBOztBQUVBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0EsTUFBTTtBQUNOO0FBQ0E7O0FBRUEsS0FBSzs7QUFFTDtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7O0FBRUE7QUFDQTs7QUFFQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7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XHR9XG5cblx0XHRcdFx0JHRoaXMudHJpZ2dlciggJ2ltYWdlQ2hhbmdlJywgWyR0aGlzXSApO1xuXG5cdFx0XHR9ICk7XG5cblx0XHR9ICk7XG5cblx0XHRyZXR1cm4gdGhpcztcblxuXHR9O1xuXG5cdCQuZm4uVEltYWdlQnJvd3Nlci5kZWZhdWx0cyA9IHt9O1xuXHQkLmZuLlRJbWFnZUJyb3dzZXIuaHRtbF90ZW1wbGF0ZSA9IGBcblx0PGRpdiBjbGFzcz1cImZpbGUtYnJvd3NlclwiPlxuXHRcdDxpbWcgY2xhc3M9XCJpbWFnZVwiPlxuXHRcdDxmb3JtIGVuY3R5cGU9XCJtdWx0aXBhcnQvZm9ybS1kYXRhXCIgY2xhc3M9XCJicm93c2VyLWZvcm1cIj5cblx0XHRcdDxpbnB1dCBuYW1lPVwiZmlsZWRhdGFcIiBjbGFzcz1cImJyb3dzZXJcIiB0eXBlPVwiZmlsZVwiLz5cblx0XHQ8L2Zvcm0+XG5cdDwvZGl2PlxuXHRgO1xuXG59ICkoIGpRdWVyeSApOyJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///8326\n")},3434:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"UserExpenseViewController\": () => (/* binding */ UserExpenseViewController)\n/* harmony export */ });\n/* harmony import */ var _global_widgets_filebrowser_TImageBrowser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8326);\n/* harmony import */ var _global_widgets_filebrowser_TImageBrowser__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_global_widgets_filebrowser_TImageBrowser__WEBPACK_IMPORTED_MODULE_0__);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\nclass UserExpenseViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#user_expense_view_container',\n\n\t\t\t// _required_files: ['TImageBrowser'],\n\n\t\t\tstatus_array: null,\n\n\t\t\thierarchy_level_array: null,\n\n\t\t\tsub_document_view_controller: null,\n\n\t\t\tdocument_object_type_id: null,\n\n\t\t\trelatedExpenseArray: null,\n\n\t\t\tdocument_api: null,\n\t\t\tpayment_method_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 = 'UserExpenseEditView.html';\n\t\tthis.permission_id = 'user_expense';\n\t\tthis.viewId = 'UserExpense';\n\t\tthis.script_name = 'UserExpenseView';\n\t\tthis.table_name_key = 'user_expense';\n\t\tthis.context_menu_name = $.i18n._( 'Expenses' );\n\t\tthis.navigation_label = $.i18n._( 'Expense' );\n\t\tthis.document_object_type_id = 400;\n\t\tthis.hierarchy_type_id = 200;\n\n\t\tthis.api = TTAPI.APIUserExpense;\n\n\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\tthis.job_api = TTAPI.APIJob;\n\t\t\tthis.job_item_api = TTAPI.APIJobItem;\n\t\t}\n\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\n\t\tthis.initData();\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\texclude: ['copy', 'mass_edit'],\n\t\t\tinclude: []\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\n\t\tthis.initDropDownOption( 'status' );\n\t\tthis.initDropDownOption( 'payment_method' );\n\n\t\tvar filter = {};\n\t\tfilter.filter_data = {};\n\t\tfilter.filter_data.type_id = [10, 20, 30];\n\t\tfilter.filter_data.user_id = [LocalCacheData.loginUser.id];\n\n\t\t$this.basic_search_field_ui_dic['expense_policy_id'].setDefaultArgs( filter );\n\t}\n\n\tgetFilterColumnsFromDisplayColumns() {\n\t\tvar column_filter = {};\n\t\tcolumn_filter.user = true;\n\t\tthis._getFilterColumnsFromDisplayColumns( column_filter, true );\n\t}\n\n\tgetSubViewFilter( filter ) {\n\n\t\tif ( filter.length === 0 ) {\n\t\t\tfilter = {};\n\t\t}\n\n\t\tfilter['parent_id'] = 0;\n\n\t\treturn filter;\n\t}\n\n\t/* jshint ignore:start */\n\tsetCurrentEditRecordData() {\n\t\tvar $this = this;\n\t\t//Set current edit record data to all widgets\n\n\t\tif ( Global.isFalseOrNull( this.current_edit_record['user_id'] ) ) {\n\t\t\tthis.current_edit_record['user_id'] = LocalCacheData.getLoginUser().id;\n\t\t}\n\n\t\tfor ( var key in this.current_edit_record ) {\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 'user_id':\n\t\t\t\t\t\tvar args = {};\n\t\t\t\t\t\tvar filter_data = {};\n\t\t\t\t\t\tfilter_data.type_id = [10, 20, 30];\n\t\t\t\t\t\tfilter_data.user_id = this.current_edit_record[key];\n\t\t\t\t\t\targs.filter_data = filter_data;\n\t\t\t\t\t\tthis.edit_view_ui_dic['expense_policy_id'].setDefaultArgs( args );\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 'expense_policy_id':\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 'gross_amount1':\n\t\t\t\t\t\twidget.setValue( this.current_edit_record['gross_amount'] );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'gross_amount':\n\t\t\t\t\tcase 'reimburse_amount':\n\t\t\t\t\tcase 'net_amount':\n\t\t\t\t\t\t// Don't do anything.\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'job_id':\n\t\t\t\t\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\t\t\twidget.setValue( this.current_edit_record[key] );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'job_item_id':\n\t\t\t\t\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\t\t\tvar args = {};\n\t\t\t\t\t\t\targs.filter_data = { job_id: this.current_edit_record.job_id };\n\t\t\t\t\t\t\twidget.setDefaultArgs( args );\n\t\t\t\t\t\t\twidget.setValue( this.current_edit_record[key] );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'job_quick_search':\n//\t\t\t\t\t\twidget.setValue( this.current_edit_record['job_id'] ? this.current_edit_record['job_id'] : 0 );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'job_item_quick_search':\n//\t\t\t\t\t\twidget.setValue( this.current_edit_record['job_item_id'] ? this.current_edit_record['job_item_id'] : 0 );\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\t/* jshint ignore:end */\n\n\tsetEditViewDataDone() {\n\t\tsuper.setEditViewDataDone();\n\n\t\tif ( Global.isSet( this.current_edit_record['related_expenses'] ) ) {\n\t\t\tthis.relatedExpenseArray = this.current_edit_record['related_expenses'];\n\t\t} else {\n\t\t\tthis.relatedExpenseArray = {};\n\t\t}\n\n\t\tthis.setRelatedExpense( this.relatedExpenseArray );\n\n\t\tthis.initInsideEditorData();\n\t\tAuthorizationHistory.init( this );\n\n\t\tthis.onExpensePolicyChange();\n\t}\n\n\tinitInsideEditorData() {\n\t\tvar $this = this;\n\t\tvar args = {};\n\t\targs.filter_data = {};\n\n\t\tif ( !this.current_edit_record || !this.current_edit_record.id ) {\n\t\t\t$this.editor.removeAllRows();\n\t\t\t$this.editor.getDefaultData();\n\n\t\t} else {\n\n\t\t\targs.filter_data.object_type_id = this.document_object_type_id;\n\t\t\targs.filter_data.object_id = this.current_edit_record['id'];\n\n\t\t\t$this.api['getAttachment']( args, {\n\t\t\t\tonResult: function( res ) {\n\n\t\t\t\t\tif ( !$this.edit_view ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tvar data = res.getResult();\n\t\t\t\t\t$this.editor.setValue( data );\n\n\t\t\t\t}\n\t\t\t} );\n\n\t\t}\n\t}\n\n\tinsideEditorSetValue( val ) {\n\t\tvar len = val.length;\n\t\tthis.removeAllRows();\n\n\t\tif ( len > 0 ) {\n\t\t\tfor ( var i = 0; i < val.length; i++ ) {\n\t\t\t\tif ( Global.isSet( val[i] ) ) {\n\t\t\t\t\tvar row = val[i];\n\t\t\t\t\tthis.addRow( row );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthis.getDefaultData();\n\t\t}\n\t}\n\n\tinsideEditorGetValue() {\n\n\t\tvar len = this.rows_widgets_array.length;\n\n\t\tvar result = [];\n\n\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\tvar row = this.rows_widgets_array[i];\n\t\t\tif ( Global.isSet( row.file ) ) {\n\t\t\t\tvar data = {\n\t\t\t\t\tname: row.name.getValue(),\n\t\t\t\t\tfile: row.file.getValue()\n\t\t\t\t};\n\n\t\t\t\tif ( data.name === 'No File Selected' ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tresult.push( data );\n\t\t\t}\n\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tinsideEditorAddRow( data, index ) {\n\n\t\tif ( !data ) {\n\t\t\tthis.getDefaultData( index );\n\t\t} else {\n\t\t\tvar row = this.getRowRender(); //Get Row render\n\t\t\tvar render = this.getRender(); //get render, should be a table\n\t\t\tvar widgets = {}; //Save each row's widgets\n\n\t\t\t//Build row widgets\n\n\t\t\t// Attachment Name\n\t\t\tvar form_item_file_name = Global.loadWidgetByName( FormItemType.TEXT );\n\t\t\tform_item_file_name.TText( { field: 'name', width: 400 } );\n\t\t\tform_item_file_name.setValue( data.name ? data.name : $.i18n._( 'No File Selected' ) );\n\t\t\tform_item_file_name.setClassStyle( data.name ? {\n\t\t\t\t'font-weight': 'bold',\n\t\t\t\t'line-height': 0\n\t\t\t} : { 'line-height': 0 } );\n\t\t\twidgets[form_item_file_name.getField()] = form_item_file_name;\n\t\t\trow.children().eq( 0 ).append( form_item_file_name );\n\t\t\tform_item_file_name.attr( 'document_id', ( data.id && this.parent_controller.current_edit_record.id ) ? data.id : '' );\n\t\t\tform_item_file_name.attr( 'document_revision_id', ( data.document_revision_id && this.parent_controller.current_edit_record.id ) ? data.document_revision_id : '' );\n\n\t\t\t// Action\n\t\t\tif ( data.name ) {\n\n\t\t\t\tvar widgetContainer = $( '' );\n\t\t\t\tvar download = $( '' );\n\t\t\t\tvar view = $( '' );\n\n\t\t\t\tdownload.attr( {\n\t\t\t\t\tdocument_id: data.id,\n\t\t\t\t\tdocument_revision_id: data.document_revision_id,\n\t\t\t\t\tobject_type_id: this.parent_controller.document_object_type_id\n\t\t\t\t} );\n\t\t\t\tview.attr( {\n\t\t\t\t\tdocument_id: data.id,\n\t\t\t\t\tdocument_revision_id: data.document_revision_id,\n\t\t\t\t\tobject_type_id: this.parent_controller.document_object_type_id\n\t\t\t\t} );\n\n\t\t\t\tdownload.bind( 'click', this.parent_controller.downloadFile );\n\t\t\t\tview.bind( 'click', this.parent_controller.downloadFile );\n\n\t\t\t\twidgetContainer.append( download );\n\t\t\t\twidgetContainer.append( view );\n\n\t\t\t\trow.children().eq( 1 ).append( widgetContainer );\n\t\t\t} else {\n\t\t\t\tvar form_item_file = Global.loadWidgetByName( FormItemType.IMAGE_BROWSER );\n\n\t\t\t\tvar $this = this.file_browser = form_item_file.TImageBrowser( {\n\t\t\t\t\t\tfield: 'file',\n\t\t\t\t\t\tname: 'filedata',\n\t\t\t\t\t\taccept_filter: '*',\n\t\t\t\t\t\tchangeHandler: function( a ) {\n\t\t\t\t\t\t\tvar file_name = $( this ).find( '.browser' )[0].files[0].name;\n\t\t\t\t\t\t\tform_item_file_name.setValue( file_name );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\twidgets[form_item_file.getField()] = form_item_file;\n\t\t\t\trow.children().eq( 1 ).append( form_item_file );\n\n\t\t\t}\n\n\t\t\t// end\n\n\t\t\tif ( typeof index != 'undefined' ) {\n\n\t\t\t\trow.insertAfter( $( render ).find( 'tr' ).eq( index ) );\n\t\t\t\tthis.rows_widgets_array.splice( ( index ), 0, widgets );\n\n\t\t\t} else {\n\t\t\t\t$( render ).append( row );\n\t\t\t\tthis.rows_widgets_array.push( widgets );\n\t\t\t}\n\n\t\t\tif ( this.parent_controller.is_viewing ) {\n\t\t\t\trow.find( '.control-icon' ).hide();\n\t\t\t}\n\n\t\t\tthis.addIconsEvent( row ); //Bind event to add and minus icon\n\t\t\tthis.removeLastRowLine();\n\t\t}\n\t}\n\n\tdownloadFile() {\n\n\t\tvar $this = $( this );\n\t\tvar document_attachment_id = $this.attr( 'document_id' );\n\t\tvar document_revision_id = $this.attr( 'document_revision_id' );\n\t\tvar object_type_id = $this.attr( 'object_type_id' );\n\n\t\tvar url = ServiceCaller.getURLByObjectType( 'file_download' ) + '&object_type=document&parent_id=' + document_attachment_id + '&parent_object_type_id=' + object_type_id + '&object_id=' + document_revision_id;\n\n\t\tGlobal.APIFileDownload( null, null, null, url );\n\t}\n\n\tinsideEditorRemoveRow( row ) {\n\n\t\tvar $this = this;\n\t\tvar index = row[0].rowIndex - 1;\n\t\tvar remove_id = this.rows_widgets_array[index].name.attr( 'document_id' );\n\t\tif ( TTUUID.isUUID( remove_id ) && remove_id != TTUUID.zero_id && remove_id != TTUUID.not_exist_id ) {\n\t\t\tTAlertManager.showConfirmAlert( Global.delete_confirm_message, null, function( result ) {\n\t\t\t\tif ( result ) {\n\t\t\t\t\tProgressBar.showOverlay();\n\t\t\t\t\t$this.api['delete' + $this.api.key_name]( remove_id, {\n\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t\tProgressBar.closeOverlay();\n\t\t\t\t\t\t\tif ( result.isValid() ) {\n\t\t\t\t\t\t\t\trow.remove();\n\t\t\t\t\t\t\t\t$this.rows_widgets_array.splice( index, 1 );\n\t\t\t\t\t\t\t\tif ( $this.rows_widgets_array.length === 0 ) {\n\t\t\t\t\t\t\t\t\t$this.getDefaultData();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\trow.remove();\n\t\t\t$this.rows_widgets_array.splice( index, 1 );\n\t\t}\n\n\t\tthis.removeLastRowLine();\n\t}\n\n\t/* jshint ignore:start */\n\tonFormItemChange( target, doNotValidate ) {\n\t\tvar $this = this;\n\n\t\tthis.setIsChanged( target );\n\t\tthis.setMassEditingFieldsWhenFormChange( target );\n\n\t\tvar key = target.getField();\n\t\tvar c_value = target.getValue();\n\n\t\tthis.current_edit_record[key] = c_value;\n\n\t\tvar amount_arr = false;\n\t\tswitch ( key ) {\n\t\t\tcase 'user_id':\n\t\t\t\tvar args = {};\n\t\t\t\tvar filter_data = {};\n\t\t\t\tfilter_data.type_id = [10, 20, 30];\n\t\t\t\tfilter_data.user_id = this.current_edit_record[key];\n\t\t\t\targs.filter_data = filter_data;\n\t\t\t\tthis.edit_view_ui_dic['expense_policy_id'].setSourceData( null );\n\t\t\t\tthis.edit_view_ui_dic['expense_policy_id'].setDefaultArgs( args );\n\t\t\t\tbreak;\n\t\t\tcase 'expense_policy_id':\n\t\t\t\tthis.onExpensePolicyChange();\n\t\t\t\tbreak;\n\t\t\tcase 'gross_amount1':\n\t\t\t\tthis.current_edit_record['gross_amount1'] = this.current_edit_record['gross_amount1'] ? this.current_edit_record['gross_amount1'] : this.current_edit_record['gross_amount'];\n\t\t\t\tif ( this.current_edit_record['expense_policy_id'] && this.current_edit_record['gross_amount1'] ) {\n\t\t\t\t\tthis.api['calcRelatedExpenses'](\n\t\t\t\t\t\tthis.current_edit_record['expense_policy_id'], this.current_edit_record['gross_amount1'], amount_arr, this.current_edit_record['is_reimbursable'],\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tonResult: function( res ) {\n\t\t\t\t\t\t\t\t$this.relatedExpenseArray = res.getResult();\n\t\t\t\t\t\t\t\t$this.setRelatedExpense( $this.relatedExpenseArray );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'is_reimbursable':\n\t\t\t\tthis.current_edit_record['gross_amount1'] = this.current_edit_record['gross_amount1'] ? this.current_edit_record['gross_amount1'] : this.current_edit_record['gross_amount'];\n\t\t\t\tamount_arr = this.relatedExpenseArray ? this.relatedExpenseArray : false;\n\t\t\t\tif ( this.current_edit_record['expense_policy_id'] && this.current_edit_record['gross_amount1'] ) {\n\t\t\t\t\tthis.api['calcRelatedExpenses'](\n\t\t\t\t\t\tthis.current_edit_record['expense_policy_id'], this.current_edit_record['gross_amount1'], amount_arr, this.current_edit_record['is_reimbursable'],\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tonResult: function( res ) {\n\t\t\t\t\t\t\t\t$this.relatedExpenseArray = res.getResult();\n\t\t\t\t\t\t\t\t$this.setRelatedExpense( $this.relatedExpenseArray );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'amount':\n\t\t\t\tvar related_expense_policy_id = target.attr( 'id' );\n\t\t\t\tthis.current_edit_record['gross_amount1'] = this.current_edit_record['gross_amount1'] ? this.current_edit_record['gross_amount1'] : this.current_edit_record['gross_amount'];\n\t\t\t\tthis.relatedExpenseArray['taxes'][related_expense_policy_id]['amount'] = c_value;\n\t\t\t\tamount_arr = this.relatedExpenseArray;\n\t\t\t\tif ( this.current_edit_record['expense_policy_id'] && this.current_edit_record['gross_amount1'] ) {\n\t\t\t\t\tthis.api['calcRelatedExpenses'](\n\t\t\t\t\t\tthis.current_edit_record['expense_policy_id'], this.current_edit_record['gross_amount1'], amount_arr, this.current_edit_record['is_reimbursable'],\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tonResult: function( res ) {\n\t\t\t\t\t\t\t\t$this.relatedExpenseArray = res.getResult();\n\t\t\t\t\t\t\t\t$this.setRelatedExpense( $this.relatedExpenseArray );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'job_id':\n\t\t\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tthis.edit_view_ui_dic['job_quick_search'].setValue( target.getValue( true ) ? ( target.getValue( true ).manual_id ? target.getValue( true ).manual_id : '' ) : '' );\n\t\t\t\t\tthis.setJobItemValueWhenJobChanged( target.getValue( true ) );\n\t\t\t\t\tthis.edit_view_ui_dic['job_quick_search'].setCheckBox( true );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'job_item_id':\n\t\t\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tthis.edit_view_ui_dic['job_item_quick_search'].setValue( target.getValue( true ) ? ( target.getValue( true ).manual_id ? target.getValue( true ).manual_id : '' ) : '' );\n\t\t\t\t\tthis.edit_view_ui_dic['job_item_quick_search'].setCheckBox( true );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'job_quick_search':\n\t\t\tcase 'job_item_quick_search':\n\t\t\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tthis.onJobQuickSearch( key, c_value );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( !doNotValidate ) {\n\t\t\tthis.validate();\n\t\t}\n\t}\n\n\tonExpensePolicyChange() {\n\t\tvar expense_policies = this.edit_view_ui_dic['expense_policy_id'].getSourceData();\n\t\tif ( expense_policies && Global.isArray( expense_policies ) && expense_policies.length > 0 ) {\n\t\t\tvar unit_name = $.i18n._( 'Amount' );\n\n\t\t\tfor ( var n in expense_policies ) {\n\t\t\t\tif ( expense_policies[n].id == this.edit_view_ui_dic['expense_policy_id'].getValue() && expense_policies[n].unit_name && expense_policies[n].unit_name.length > 0 && expense_policies[n].type_id == 30 ) {\n\t\t\t\t\tunit_name = expense_policies[n].unit_name;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.edit_view_ui_dic['gross_amount1'].parents( '.edit-view-form-item-div' ).find( '.edit-view-form-item-label' ).html( unit_name );\n\t\t}\n\t}\n\n\t/* jshint ignore:end */\n\tsetRelatedExpense( expenses ) {\n\t\t// Third column start\n\t\tvar tab_expense = this.edit_view_tab.find( '#tab_expense' );\n\t\tvar tab_expense_column3 = tab_expense.find( '.third-column' ).empty();\n\n\t\tif ( this.edit_view_tabs[0].length < 3 ) {\n\t\t\tthis.edit_view_tabs[0].push( tab_expense_column3 );\n\t\t}\n\n\t\tif ( expenses && expenses['taxes'] && Object.keys( expenses['taxes'] ).length > 0 ) {\n\t\t\t// Net Amount\n\t\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\t\tform_item_input.TTextInput( { field: 'net_amount' } );\n\t\t\tform_item_input.setValue( expenses['net_amount'] );\n\t\t\tform_item_input.setEnabled( ( this.is_viewing == false ) );\n\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Net Amount' ), form_item_input, tab_expense_column3, '', null, true );\n\t\t\tthis.edit_view_ui_dic['net_amount'].css( 'opacity', 1 );\n\n\t\t\tfor ( var key in expenses['taxes'] ) {\n\t\t\t\t// taxes\n\t\t\t\tvar item = expenses['taxes'][key];\n\t\t\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\t\t\tform_item_input.TTextInput( { field: 'amount' } );\n\t\t\t\tform_item_input.setValue( item['amount'] );\n\t\t\t\tform_item_input.attr( 'id', item['expense_policy_id'] );\n\t\t\t\tform_item_input.setEnabled( ( this.is_viewing == false ) );\n\t\t\t\tthis.addEditFieldToColumn( $.i18n._( item['expense_policy_name'] ), form_item_input, tab_expense_column3, '', null, true );\n\t\t\t\tthis.edit_view_ui_dic['amount'].css( 'opacity', 1 );\n\t\t\t}\n\n\t\t\t// Amount\n\t\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT );\n\t\t\tform_item_input.TText( { field: 'gross_amount' } );\n\t\t\tform_item_input.setValue( expenses['gross_amount'] );\n\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Amount' ), form_item_input, tab_expense_column3, '', null, true );\n\t\t\tthis.edit_view_ui_dic['gross_amount'].css( 'opacity', 1 );\n\t\t}\n\n\t\t// Reimburse Amount\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT );\n\t\tform_item_input.TText( { field: 'reimburse_amount' } );\n\t\tif ( expenses ) {\n\t\t\tif ( expenses['reimburse_amount'] && expenses['unit_amount'] && expenses['unit_name'] ) {\n\t\t\t\tform_item_input.setValue( expenses['reimburse_amount'] + ' (' + expenses['unit_amount'] + '/' + expenses['unit_name'] + ')' );\n\t\t\t} else {\n\t\t\t\tform_item_input.setValue( expenses['reimburse_amount'] );\n\t\t\t}\n\t\t} else {\n\t\t\tform_item_input.setValue( this.current_edit_record.reimburse_amount );\n\t\t}\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Reimburse Amount' ), form_item_input, tab_expense_column3, '', null, true );\n\n\t\tthis.edit_view_ui_dic['reimburse_amount'].css( 'opacity', 1 );\n\n\t\tthis.editFieldResize( 0 );\n\t}\n\n\tuniformVariable( records ) {\n\n\t\trecords.related_expenses = this.relatedExpenseArray;\n\t\trecords.gross_amount = this.relatedExpenseArray.gross_amount;\n\t\trecords.net_amount = this.relatedExpenseArray.net_amount;\n\t\trecords.reimburse_amount = this.relatedExpenseArray.reimburse_amount;\n\n\t\tif ( !Global.isSet( records.parent_id ) ) {\n\t\t\trecords.parent_id = false;\n\t\t}\n\n\t\treturn records;\n\t}\n\n\tonSaveResult( result ) {\n\t\tvar $this = this;\n\t\tif ( result.isValid() ) {\n\t\t\tvar result_data = result.getResult();\n\t\t\tif ( result_data === true ) {\n\t\t\t\t$this.refresh_id = $this.current_edit_record.id;\n\t\t\t} else if ( TTUUID.isUUID( result_data ) && result_data != TTUUID.zero_id && result_data != TTUUID.not_exist_id ) {\n\t\t\t\t$this.refresh_id = result_data;\n\t\t\t}\n\n\t\t\t$this.saveInsideEditorData( function() {\n\t\t\t\t$this.search();\n\t\t\t\t$this.onSaveDone( result );\n\n\t\t\t\t$this.removeEditView();\n\n\t\t\t\t$().TFeedback( {\n\t\t\t\t\tsource: 'Save'\n\t\t\t\t} );\n\t\t\t} );\n\n\t\t} else {\n\t\t\t$this.setErrorMenu();\n\t\t\t$this.setErrorTips( result );\n\n\t\t}\n\t}\n\n\t// onSaveAndContinueResult( result ) {\n\t//\n\t// \tvar $this = this;\n\t// \tif ( result.isValid() ) {\n\t// \t\tvar result_data = result.getResult();\n\t// \t\tif ( result_data === true ) {\n\t// \t\t\t$this.refresh_id = $this.current_edit_record.id;\n\t//\n\t// \t\t} else if ( TTUUID.isUUID( result_data ) && result_data != TTUUID.zero_id && result_data != TTUUID.not_exist_id ) { // as new\n\t// \t\t\t$this.refresh_id = result_data;\n\t// \t\t}\n\t//\n\t// \t\t$this.saveInsideEditorData( function() {\n\t// \t\t\t$this.search( false );\n\t// \t\t\t$this.onEditClick( $this.refresh_id, true );\n\t//\n\t// \t\t\t$this.onSaveAndContinueDone( result );\n\t//\n\t// \t\t} );\n\t//\n\t// \t} else {\n\t// \t\t$this.setErrorTips( result );\n\t// \t\t$this.setErrorMenu();\n\t// \t}\n\t// },\n\n\t// onSaveAndNewResult: function( result ) {\n\t// \tvar $this = this;\n\t// \tif ( result.isValid() ) {\n\t// \t\tvar result_data = result.getResult();\n\t// \t\tif ( result_data === true ) {\n\t// \t\t\t$this.refresh_id = $this.current_edit_record.id;\n\t//\n\t// \t\t} else if ( TTUUID.isUUID( result_data ) && result_data != TTUUID.zero_id && result_data != TTUUID.not_exist_id ) { // as new\n\t// \t\t\t$this.refresh_id = result_data;\n\t// \t\t}\n\t//\n\t// \t\t$this.saveInsideEditorData( function() {\n\t// \t\t\t$this.search( false );\n\t// \t\t\t$this.onAddClick( true );\n\t//\n\t// \t\t} );\n\t// \t} else {\n\t// \t\t$this.setErrorTips( result );\n\t// \t\t$this.setErrorMenu();\n\t// \t}\n\t// },\n\n\t_continueDoCopyAsNew() {\n\t\tthis.setCurrentEditViewState( 'new' );\n\t\tLocalCacheData.current_doing_context_action = 'copy_as_new';\n\n\t\tif ( Global.isSet( this.edit_view ) ) {\n\t\t\tthis.editor.removeAllRows();\n\t\t\tthis.editor.getDefaultData();\n\t\t}\n\t\tsuper._continueDoCopyAsNew();\n\t}\n\n\tonSaveAndCopyResult( result ) {\n\t\tvar $this = this;\n\t\tif ( result.isValid() ) {\n\t\t\tvar result_data = result.getResult();\n\t\t\tif ( result_data === true ) {\n\t\t\t\t$this.refresh_id = $this.current_edit_record.id;\n\n\t\t\t} else if ( TTUUID.isUUID( result_data ) && result_data != TTUUID.zero_id && result_data != TTUUID.not_exist_id ) {\n\t\t\t\t$this.refresh_id = result_data;\n\t\t\t}\n\n\t\t\t$this.saveInsideEditorData( function() {\n\t\t\t\t$this.search( false );\n\n\t\t\t\t$this.onCopyAsNewClick();\n\n\t\t\t} );\n\n\t\t} else {\n\t\t\t$this.setErrorTips( result );\n\t\t\t$this.setErrorMenu();\n\t\t}\n\t}\n\n\t// onSaveAndNextResult( result ) {\n\t// \tvar $this = this;\n\t// \tif ( result.isValid() ) {\n\t// \t\tvar result_data = result.getResult();\n\t// \t\tif ( result_data === true ) {\n\t// \t\t\t$this.refresh_id = $this.current_edit_record.id;\n\t//\n\t// \t\t} else if ( TTUUID.isUUID( result_data ) && result_data != TTUUID.zero_id && result_data != TTUUID.not_exist_id ) {\n\t// \t\t\t$this.refresh_id = result_data;\n\t// \t\t}\n\t//\n\t// \t\t$this.saveInsideEditorData( function() {\n\t// \t\t\t$this.onRightArrowClick();\n\t// \t\t\t$this.search( false );\n\t// \t\t\t$this.onSaveAndNextDone( result );\n\t//\n\t// \t\t} );\n\t//\n\t// \t} else {\n\t// \t\t$this.setErrorTips( result );\n\t// \t\t$this.setErrorMenu();\n\t// \t}\n\t// },\n\n\tsaveInsideEditorData( callBack ) {\n\t\tvar $this = this;\n\t\tvar data = this.editor.getValue();\n\t\tvar files = data.length;\n\t\tif ( files > 0 ) {\n\t\t\tvar success = 0;\n\t\t\tfor ( var key in data ) {\n\t\t\t\tvar fileItem = data[key];\n\t\t\t\tif ( Global.isSet( fileItem.file ) ) {\n\n\t\t\t\t\tvar document_revision_id = this.api.addAttachment( fileItem.name, this.document_object_type_id, this.refresh_id, { async: false } ).getResult();\n\t\t\t\t\t$this.api.uploadFile( fileItem.file, 'object_type=document_revision&object_id=' + document_revision_id + '&parent_object_type_id=' + $this.document_object_type_id, {} );\n\n\t\t\t\t\tsuccess++;\n\n\t\t\t\t} else {\n\t\t\t\t\tcallBack();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( success === files ) {\n\t\t\t\tcallBack();\n\t\t\t}\n\n\t\t} else {\n\t\t\tcallBack();\n\t\t}\n\t}\n\n\tuploadFile( document_result, file_data ) {\n\t\tvar document_revision_id = document_result.getResult();\n\t\tvar $this = this;\n\n\t\t$this.api.uploadFile( file_data, 'object_type=document_revision&object_id=' + document_revision_id, {\n\t\t\tonResult: function( upload_file_result ) {\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_expense': {\n\t\t\t\t'label': $.i18n._( 'Expense' ),\n\t\t\t\t'html_template': this.getUserExpenseTabHtml(),\n\t\t\t\t'is_multi_column': true\n\t\t\t},\n\t\t\t'tab_attachment': true,\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.APIUserExpense,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_expense',\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_expense = this.edit_view_tab.find( '#tab_expense' );\n\n\t\tvar tab_expense_column1 = tab_expense.find( '.first-column' );\n\t\tvar tab_expense_column2 = tab_expense.find( '.second-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_expense_column1 );\n\t\tthis.edit_view_tabs[0].push( tab_expense_column2 );\n\n\t\tvar form_item_input;\n\t\tvar widgetContainer;\n\t\tvar label;\n\n\t\t// Employee\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIUser,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_user',\n\t\t\tfield: 'user_id',\n\t\t\tset_empty: true,\n\t\t\tshow_search_inputs: true\n\t\t} );\n\n\t\tvar default_args = {};\n\t\tdefault_args.permission_section = 'user_expense';\n\t\tform_item_input.setDefaultArgs( default_args );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Employee' ), form_item_input, tab_expense_column1, '' );\n\n\t\t// Effective Date\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\n\t\tform_item_input.TDatePicker( { field: 'effective_date' } );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Effective Date' ), form_item_input, tab_expense_column1, '', null );\n\n\t\t// Date Incurred\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\n\t\tform_item_input.TDatePicker( { field: 'incurred_date' } );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Date Incurred' ), form_item_input, tab_expense_column1, '', null );\n\n\t\t// Description\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_AREA );\n\t\tform_item_input.TTextArea( { field: 'description', width: '100%' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Description' ), form_item_input, tab_expense_column1, '', null, null, true );\n\n\t\tform_item_input.parent().width( '45%' );\n\n\t\t// Payment Method\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\n\t\tform_item_input.TComboBox( { field: 'payment_method_id', set_empty: false } );\n\t\tform_item_input.setSourceData( $this.payment_method_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Payment Method' ), form_item_input, tab_expense_column1 );\n\n\t\t// Type\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIExpensePolicy,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_expense_policy',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'expense_policy_id',\n\t\t\talways_include_columns: ['type_id', 'unit_name'],\n\t\t\tinit_data_immediately: true,\n\t\t\tsetRealValueCallBack: ( function( val ) {\n\t\t\t\tif ( val ) {\n\t\t\t\t\t$this.onExpensePolicyChange();\n\t\t\t\t}\n\t\t\t} ),\n\t\t} );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Type' ), form_item_input, tab_expense_column1 );\n\n\t\t//Amount\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'gross_amount1' } );\n\n\t\twidgetContainer = $( '' );\n\t\tlabel = $( ' ' + $.i18n._( 'Reimburse' ) + ': ' );\n\n\t\tvar widget_checkbox = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\twidget_checkbox.TCheckbox( { field: 'is_reimbursable' } );\n\n\t\twidgetContainer.append( form_item_input );\n\t\twidgetContainer.append( label );\n\t\twidgetContainer.append( widget_checkbox );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Amount' ), [form_item_input, widget_checkbox], tab_expense_column1, 'last', widgetContainer );\n\n\t\t// Currency\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\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\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'currency_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Currency' ), form_item_input, tab_expense_column2, '' );\n\n\t\t// Branch\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIBranch,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_branch',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'branch_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Branch' ), form_item_input, tab_expense_column2 );\n\n\t\t//Department\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIDepartment,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_department',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'department_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Department' ), form_item_input, tab_expense_column2 );\n\n\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\t//Job\n\t\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\t\tform_item_input.AComboBox( {\n\t\t\t\tapi_class: TTAPI.APIJob,\n\t\t\t\tallow_multiple_selection: false,\n\t\t\t\tlayout_name: 'global_job',\n\t\t\t\tshow_search_inputs: true,\n\t\t\t\tset_empty: true,\n\t\t\t\tsetRealValueCallBack: ( function( val ) {\n\n\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\tjob_coder.setValue( val.manual_id );\n\t\t\t\t\t}\n\t\t\t\t} ),\n\t\t\t\tfield: 'job_id'\n\t\t\t} );\n\n\t\t\twidgetContainer = $( '' );\n\n\t\t\tvar job_coder = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\t\tjob_coder.TTextInput( { field: 'job_quick_search', disable_keyup_event: true } );\n\t\t\tjob_coder.addClass( 'job-coder' );\n\n\t\t\twidgetContainer.append( job_coder );\n\t\t\twidgetContainer.append( form_item_input );\n\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Job' ), [form_item_input, job_coder], tab_expense_column2, '', widgetContainer, true );\n\n\t\t\t//Job Item\n\t\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\t\tform_item_input.AComboBox( {\n\t\t\t\tapi_class: TTAPI.APIJobItem,\n\t\t\t\tallow_multiple_selection: false,\n\t\t\t\tlayout_name: 'global_job_item',\n\t\t\t\tshow_search_inputs: true,\n\t\t\t\tset_empty: true,\n\t\t\t\tsetRealValueCallBack: ( function( val ) {\n\n\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\tjob_item_coder.setValue( val.manual_id );\n\t\t\t\t\t}\n\t\t\t\t} ),\n\t\t\t\tfield: 'job_item_id'\n\t\t\t} );\n\n\t\t\twidgetContainer = $( '' );\n\n\t\t\tvar job_item_coder = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\t\tjob_item_coder.TTextInput( { field: 'job_item_quick_search', disable_keyup_event: true } );\n\t\t\tjob_item_coder.addClass( 'job-coder' );\n\n\t\t\twidgetContainer.append( job_item_coder );\n\t\t\twidgetContainer.append( form_item_input );\n\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Task' ), [form_item_input, job_item_coder], tab_expense_column2, '', widgetContainer, true );\n\t\t}\n\t\t//Tags\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TAG_INPUT );\n\n\t\tform_item_input.TTagInput( { field: 'tag', object_type_id: 930 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Tags' ), form_item_input, tab_expense_column2, '', null, null, true );\n\n\t\t//Inside editor\n\n\t\tvar inside_editor_div = tab_expense.find( '.inside-editor-div' );\n\n\t\tvar inside_editor_args = {\n\t\t\tname: $.i18n._( 'Attachment Name' ),\n\t\t\taction: $.i18n._( 'Action' )\n\t\t};\n\n\t\tthis.editor = Global.loadWidgetByName( FormItemType.INSIDE_EDITOR );\n\t\tthis.editor.InsideEditor( {\n\t\t\taddRow: this.insideEditorAddRow,\n\t\t\tremoveRow: this.insideEditorRemoveRow,\n\t\t\tgetValue: this.insideEditorGetValue,\n\t\t\tsetValue: this.insideEditorSetValue,\n\t\t\tparent_controller: this,\n\t\t\tapi: this.document_api,\n\t\t\trender: getRender(),\n\t\t\trender_args: inside_editor_args,\n\t\t\trender_inline_html: true,\n\t\t\trow_render: getRowRender()\n\n\t\t} );\n\n\t\tfunction getRender() {\n\t\t\treturn `\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t<%= name %> | \n\t\t\t\t\t<%= action %> | \n\t\t\t\t
\n\t\t\t
`;\n\t\t}\n\n\t\tfunction getRowRender() {\n\t\t\treturn `\n\t\t\t\n\t\t\t\t | \n\t\t\t\t | \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t | \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t | \n\t\t\t
`;\n\t\t}\n\n\t\tinside_editor_div.append( this.editor );\n\t}\n\n\tbuildSearchFields() {\n\n\t\tsuper.buildSearchFields();\n\t\tvar default_args = {};\n\t\tdefault_args.permission_section = 'user_expense';\n\t\tthis.search_fields = [\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Employee' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'user_id',\n\t\t\t\tdefault_args: default_args,\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._( 'Tags' ),\n\t\t\t\tfield: 'tag',\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tin_column: 1,\n\t\t\t\tobject_type_id: 930,\n\t\t\t\tform_item_type: FormItemType.TAG_INPUT\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Type' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'expense_policy_id',\n\t\t\t\tlayout_name: 'global_expense_policy',\n\t\t\t\tapi_class: TTAPI.APIExpensePolicy,\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._( 'Status' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'status_id',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tlayout_name: 'global_option_column',\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} )\n\t\t];\n\n\t}\n\n\tgetUserExpenseTabHtml() {\n\t\treturn `\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t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