"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["invoice-products-ProductViewController"],{1744:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ProductViewController\": () => (/* binding */ ProductViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass ProductViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#product_view_container',\n\n\t\t\ttype_array: null,\n\t\t\tapply_frequency_array: null,\n\t\t\tmonth_of_year_array: null,\n\t\t\tday_of_month_array: null,\n\t\t\tday_of_week_array: null,\n\t\t\tlength_of_service_unit_array: null,\n\t\t\tdate_api: null,\n\t\t\tgroup_api: null,\n\n\t\t\tproduct_price_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 = 'ProductEditView.html';\n\t\tthis.permission_id = 'product';\n\t\tthis.viewId = 'Product';\n\t\tthis.script_name = 'ProductView';\n\t\tthis.table_name_key = 'product';\n\t\tthis.context_menu_name = $.i18n._( 'Products' );\n\t\tthis.navigation_label = $.i18n._( 'Product' );\n\t\tthis.api = TTAPI.APIProduct;\n\t\tthis.date_api = TTAPI.APITTDate;\n\t\tthis.group_api = TTAPI.APIProductGroup;\n\t\tthis.product_price_api = TTAPI.APIProductPrice;\n\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\n\t\tthis.initData();\n\t}\n\n\tinitOptions( callBack ) {\n\t\tvar $this = this;\n\t\tvar options = [\n\t\t\t{ option_name: 'type', field_name: null, api: null },\n\t\t\t{ option_name: 'status', field_name: null, api: null },\n\t\t\t{ option_name: 'unit_price_type', field_name: null, api: null },\n\t\t\t{ option_name: 'weight_unit', field_name: null, api: null },\n\t\t\t{ option_name: 'dimension_unit', field_name: null, api: null },\n\t\t\t{ option_name: 'country', field_name: null, api: TTAPI.APICompany }\n\n\t\t];\n\n\t\tthis.initDropDownOptions( options, function( result ) {\n\n\t\t\t$this.group_api.getProductGroup( '', false, false, {\n\t\t\t\tonResult: function( res ) {\n\n\t\t\t\t\tres = res.getResult();\n\t\t\t\t\tres = Global.buildTreeRecord( res );\n\n\t\t\t\t\tif ( !$this.edit_only_mode ) {\n\t\t\t\t\t\tif ( !$this.sub_view_mode && $this.basic_search_field_ui_dic['group_id'] ) {\n\t\t\t\t\t\t\t$this.basic_search_field_ui_dic['group_id'].setSourceData( res );\n//\t\t\t\t\t\t$this.adv_search_field_ui_dic['group_id'].setSourceData( res );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this.group_array = res;\n\n\t\t\t\t\tif ( callBack ) {\n\t\t\t\t\t\tcallBack( result ); // First to initialize drop down options, and then to initialize edit view UI.\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} );\n\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_product': { 'label': $.i18n._( 'Product' ) },\n\t\t\t'tab_pricing': {\n\t\t\t\t'label': $.i18n._( 'Pricing' ),\n\t\t\t\t'html_template': this.getProductPricingTabHtml()\n\t\t\t},\n\t\t\t'tab_shipping': { 'label': $.i18n._( 'Shipping' ) },\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.APIProduct,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_product',\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_product = this.edit_view_tab.find( '#tab_product' );\n\n\t\tvar tab_product_column1 = tab_product.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_product_column1 );\n\n\t\t//Type\n\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\n\t\tform_item_input.TComboBox( { field: 'type_id', set_empty: false } );\n\t\tform_item_input.setSourceData( $this.type_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Type' ), form_item_input, tab_product_column1, '' );\n\n\t\t//Status\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\n\t\tform_item_input.TComboBox( { field: 'status_id', set_empty: false } );\n\t\tform_item_input.setSourceData( $this.status_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Status' ), form_item_input, tab_product_column1, '' );\n\n\t\t//Group\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\tform_item_input.AComboBox( {\n\t\t\ttree_mode: true,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_tree_column',\n\t\t\tset_empty: true,\n\t\t\tfield: 'group_id'\n\t\t} );\n\t\tform_item_input.setSourceData( $this.group_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Group' ), form_item_input, tab_product_column1 );\n\n\t\t//Part Number\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'part_number' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Part Number' ), form_item_input, tab_product_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_product_column1, '' );\n\n\t\tform_item_input.parent().width( '45%' );\n\n\t\t//Description\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'description', width: '100%' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Description' ), form_item_input, tab_product_column1, '' );\n\n\t\tform_item_input.parent().width( '45%' );\n\n\t\t// Lock Description\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'description_locked' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Lock Description' ), form_item_input, tab_product_column1 );\n\n\t\t//UPC\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'upc' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'UPC' ), form_item_input, tab_product_column1, '' );\n\n\t\t//Current Stock\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'quantity' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Current Stock' ), form_item_input, tab_product_column1, '' );\n\n\t\t// Include Tax Policy\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APITaxPolicy,\n\t\t\tallow_multiple_selection: true,\n\t\t\tlayout_name: 'global_tax_policy',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'include_tax_policy'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Include Tax Policy' ), form_item_input, tab_product_column1, '' );\n\n\t\t// Exclude Tax Policy\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APITaxPolicy,\n\t\t\tallow_multiple_selection: true,\n\t\t\tlayout_name: 'global_tax_policy',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'exclude_tax_policy'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Exclude Tax Policy' ), form_item_input, tab_product_column1, '' );\n\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: 900 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Tags' ), form_item_input, tab_product_column1, '', null, null, true );\n\n\t\t//Tab 1 start\n\n\t\tvar tab_pricing = this.edit_view_tab.find( '#tab_pricing' );\n\n\t\tvar tab_pricing_column1 = tab_pricing.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[1] = [];\n\n\t\tthis.edit_view_tabs[1].push( tab_pricing_column1 );\n\n\t\t//Unit Cost\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'unit_cost', width: 80 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Unit Cost' ), form_item_input, tab_pricing_column1, '' );\n\n\t\t//Currency\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\tfield: 'currency_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Currency' ), form_item_input, tab_pricing_column1 );\n\n\t\t//Minimum Quantity\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'minimum_purchase_quantity', width: 80 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Minimum Quantity' ), form_item_input, tab_pricing_column1, '' );\n\n\t\t//Maximum Quantity\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'maximum_purchase_quantity', width: 80 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Maximum Quantity' ), form_item_input, tab_pricing_column1, '' );\n\n\t\t// Lock Price\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'price_locked' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Lock Price' ), form_item_input, tab_pricing_column1 );\n\n\t\t// Price Type\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\n\t\tform_item_input.TComboBox( { field: 'unit_price_type_id' } );\n\t\tform_item_input.setSourceData( $this.unit_price_type_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Price Type' ), form_item_input, tab_pricing_column1, '' );\n\n\t\t//Unit Price\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'unit_price', width: 80 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Unit Price' ), form_item_input, tab_pricing_column1, '', null, true );\n\n\t\t//Inside editor\n\t\tvar inside_editor_div = tab_pricing.find( '.inside-editor-div' );\n\t\tvar args = {\n\t\t\tquantity: $.i18n._( 'Quantity' ),\n\t\t\tunit_price: $.i18n._( 'Unit Price' )\n\n\t\t};\n\n\t\tthis.editor = Global.loadWidgetByName( FormItemType.INSIDE_EDITOR );\n\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\trender: getRender(),\n\t\t\trender_args: args,\n\t\t\trender_inline_html: true,\n\t\t\trow_render: getRowRender(),\n\t\t\tparent_controller: this\n\t\t} );\n\n\t\tfunction getRender() {\n\t\t\treturn `\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t<%= quantity %> | \n\t\t\t\t\t\t<%= unit_price %> | \n\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}\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\n\t\t//Tab 2 start\n\n\t\tvar tab_shipping = this.edit_view_tab.find( '#tab_shipping' );\n\n\t\tvar tab_shipping_column1 = tab_shipping.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[2] = [];\n\n\t\tthis.edit_view_tabs[2].push( tab_shipping_column1 );\n\n\t\t// Weight Unit\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\n\t\tform_item_input.TComboBox( { field: 'weight_unit_id' } );\n\t\tform_item_input.setSourceData( $this.weight_unit_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Weight Unit' ), form_item_input, tab_shipping_column1, '' );\n\n\t\t//Weight\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'weight' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Weight' ), form_item_input, tab_shipping_column1, '' );\n\n\t\t// Dimension Unit\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\n\t\tform_item_input.TComboBox( { field: 'dimension_unit_id' } );\n\t\tform_item_input.setSourceData( $this.dimension_unit_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Dimension Unit' ), form_item_input, tab_shipping_column1, '' );\n\n\t\t//Length\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'dimension_length' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Length' ), form_item_input, tab_shipping_column1, '' );\n\n\t\t//Width\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'dimension_width' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Width' ), form_item_input, tab_shipping_column1, '' );\n\n\t\t//Height\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'dimension_height' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Height' ), form_item_input, tab_shipping_column1, '' );\n\n\t\t// Country\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\n\t\tform_item_input.TComboBox( { field: 'origin_country', set_empty: true } );\n\t\tform_item_input.setSourceData( $this.country_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Origin Country' ), form_item_input, tab_shipping_column1, '' );\n\n\t\t//Tariff Code\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'tariff_code' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Tariff Code' ), form_item_input, tab_shipping_column1, '' );\n\n\t\t//Custom Unit Value\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'customs_unit_value' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Custom Unit Value' ), form_item_input, tab_shipping_column1, '' );\n\t}\n\n\tonTypeChange() {\n\n\t\tif ( this.current_edit_record['type_id'] != 10 && this.current_edit_record.type_id != 62 ) {\n\t\t\t$( this.edit_view_tab.find( 'ul li' )[2] ).hide();\n\n\t\t\tif ( this.getEditViewTabIndex() == 2 ) {\n\t\t\t\tthis.edit_view_tab.tabs( 'option', 'active', 0 );\n\t\t\t}\n\n\t\t} else {\n\t\t\t$( this.edit_view_tab.find( 'ul li' )[2] ).show();\n\t\t}\n\n\t\tif ( ( this.current_edit_record['unit_price_type_id'] == 20 ||\n\t\t\tthis.current_edit_record.unit_price_type_id == 30 ) && !this.is_mass_editing ) {\n\n\t\t\tthis.detachElement( 'unit_price' );\n\t\t\tthis.editor.css( 'display', 'block' );\n\n\t\t} else {\n\n\t\t\tthis.attachElement( 'unit_price' );\n\t\t\tthis.editor.css( 'display', 'none' );\n\t\t}\n\n\t\tthis.editFieldResize();\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\t\tvar c_value = target.getValue();\n\t\tthis.current_edit_record[key] = c_value;\n\t\tif ( key === 'type_id' || key === 'unit_price_type_id' ) {\n\n\t\t\tthis.onTypeChange();\n\t\t}\n\n\t\tif ( !doNotValidate ) {\n\t\t\tthis.validate();\n\t\t}\n\t}\n\n\tinsideEditorSetValue( val ) {\n\t\tvar len = val.length;\n\n\t\tthis.removeAllRows();\n\t\tfor ( var i = 0; i < val.length; i++ ) {\n\t\t\tif ( Global.isSet( val[i] ) ) {\n\t\t\t\tvar row = val[i];\n\t\t\t\trow['accrual_rate'] = Global.getTimeUnit( row['accrual_rate'] );\n\t\t\t\trow['maximum_time'] = Global.getTimeUnit( row['maximum_time'] );\n\t\t\t\trow['rollover_time'] = Global.getTimeUnit( row['rollover_time'] );\n\t\t\t\tif ( Global.isSet( this.parent_id ) ) {\n\t\t\t\t\trow['id'] = '';\n\t\t\t\t}\n\t\t\t\tthis.addRow( row );\n\t\t\t}\n\n\t\t}\n\t}\n\n\tinsideEditorAddRow( data, index ) {\n\n\t\tif ( !data ) {\n\t\t\tdata = {};\n\t\t}\n\n\t\tvar $this = this;\n\t\tvar row = this.getRowRender(); //Get Row render\n\t\tvar render = this.getRender(); //get render, should be a table\n\t\tvar widgets = {}; //Save each row's widgets\n\n\t\tvar form_item_input;\n\t\tvar widgetContainer;\n\t\tvar label;\n\n\t\t//Build row widgets\n\n\t\t// Quantity\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'quantity', width: 60 } );\n\t\tform_item_input.setValue( data.quantity ? data.quantity : 0 );\n\t\twidgetContainer = $( '' );\n\t\tlabel = $( ' ' + $.i18n._( 'or more' ) + '' );\n\n\t\twidgetContainer.append( form_item_input );\n\t\twidgetContainer.append( label );\n\n\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\trow.children().eq( 0 ).append( widgetContainer );\n\n\t\tthis.setWidgetEnableBaseOnParentController( form_item_input );\n\n\t\t// Unit Price\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'unit_price', width: 60 } );\n\t\tform_item_input.setValue( data.unit_price ? data.unit_price : '0.00' );\n\t\twidgetContainer = $( '' );\n\n\t\twidgetContainer.append( form_item_input );\n\n\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\trow.children().eq( 1 ).append( widgetContainer );\n\n\t\tthis.setWidgetEnableBaseOnParentController( form_item_input );\n\n\t\twidgets.current_edit_item = data;\n\n\t\tif ( !this.parent_controller.current_edit_record.id ) {\n\t\t\twidgets.current_edit_item.id = '';\n\t\t}\n\n\t\tif ( typeof index != 'undefined' ) {\n\n\t\t\trow.insertAfter( $( render ).find( 'tr' ).eq( index ) );\n\t\t\tthis.rows_widgets_array.splice( ( index ), 0, widgets );\n\n\t\t} else {\n\t\t\t$( render ).append( row );\n\t\t\tthis.rows_widgets_array.push( widgets );\n\t\t}\n\t\tif ( this.parent_controller.is_viewing ) {\n\t\t\trow.find( '.control-icon' ).hide();\n\t\t}\n\n\t\tthis.addIconsEvent( row ); //Bind event to add and minus icon\n\t\tthis.removeLastRowLine();\n\t}\n\n\tinsideEditorRemoveRow( row ) {\n\t\tvar index = row[0].rowIndex - 1;\n\t\tvar remove_id = this.rows_widgets_array[index].current_edit_item.id;\n\t\tif ( TTUUID.isUUID( remove_id ) && remove_id != TTUUID.zero_id && remove_id != TTUUID.not_exist_id ) {\n\t\t\tthis.delete_ids.push( remove_id );\n\t\t}\n\t\trow.remove();\n\t\tthis.rows_widgets_array.splice( index, 1 );\n\t\tthis.removeLastRowLine();\n\t}\n\n\tinsideEditorGetValue( current_edit_item_id ) {\n\t\tvar len = this.rows_widgets_array.length;\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\tvar data = row.current_edit_item;\n\t\t\tdata.quantity = row.quantity.getValue();\n\t\t\tdata.unit_price = row.unit_price.getValue();\n\t\t\tdata.product_id = current_edit_item_id;\n\t\t\tresult.push( data );\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tsetEditViewDataDone() {\n\t\tsuper.setEditViewDataDone();\n\t\tthis.onTypeChange();\n\t\tthis.initInsideEditorData();\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 ) && !this.copied_record_id ) {\n\t\t\t$this.editor.removeAllRows();\n\t\t\t$this.editor.addRow();\n\n\t\t} else {\n\t\t\targs.filter_data.product_id = this.current_edit_record.id ? this.current_edit_record.id : this.copied_record_id;\n\t\t\tthis.copied_record_id = '';\n\t\t\tthis.product_price_api.getProductPrice( args, true, {\n\t\t\t\tonResult: function( res ) {\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\tif ( data === true ) { // result is null\n\t\t\t\t\t\t$this.editor.addRow();\n\t\t\t\t\t} else if ( data.length > 0 ) {\n\t\t\t\t\t\t$this.editor.setValue( data );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\tsaveInsideEditorData( callBack ) {\n\t\tif ( ( this.current_edit_record['unit_price_type_id'] != 20 &&\n\t\t\tthis.current_edit_record.unit_price_type_id != 30 ) || this.is_mass_editing ) {\n\t\t\tif ( Global.isSet( callBack ) ) {\n\t\t\t\tcallBack();\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tvar $this = this;\n\t\tvar data = this.editor.getValue( this.refresh_id );\n\t\tvar remove_ids = $this.editor.delete_ids;\n\t\tif ( remove_ids.length > 0 ) {\n\t\t\t$this.product_price_api.deleteProductPrice( remove_ids, {\n\t\t\t\tonResult: function( res ) {\n\t\t\t\t\tif ( res.isValid() ) {\n\t\t\t\t\t\t$this.editor.delete_ids = [];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t$this.product_price_api.setProductPrice( data, {\n\t\t\tonResult: function( res ) {\n\t\t\t\tvar res_data = res.getResult();\n\t\t\t\tif ( Global.isSet( callBack ) ) {\n\t\t\t\t\tcallBack();\n\t\t\t\t}\n\t\t\t}\n\t\t} );\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; // as add\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\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\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// 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\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\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\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\tfor ( var i = 0; i < this.editor.rows_widgets_array.length; i++ ) {\n\t\t\t\tthis.editor.rows_widgets_array[i].current_edit_item.id = '';\n\t\t\t}\n\t\t}\n\t\tsuper._continueDoCopyAsNew();\n\t}\n\n\tonCopyAsNewResult( result ) {\n\t\tvar $this = this;\n\t\tvar result_data = result.getResult();\n\n\t\tif ( !result_data ) {\n\t\t\tTAlertManager.showAlert( $.i18n._( 'Record does not exist' ) );\n\t\t\t$this.onCancelClick();\n\t\t\treturn;\n\t\t}\n\n\t\t$this.openEditView(); // Put it here is to avoid if the selected one is not existed in data or have deleted by other pragram. in this case, the edit view should not be opend.\n\n\t\tresult_data = result_data[0];\n\t\tthis.copied_record_id = result_data.id;\n\t\tresult_data.id = '';\n\n\t\tif ( $this.sub_view_mode && $this.parent_key ) {\n\t\t\tresult_data[$this.parent_key] = $this.parent_value;\n\t\t}\n\n\t\t$this.current_edit_record = result_data;\n\t\t$this.initEditView();\n\t}\n\n\tbuildSearchFields() {\n\n\t\tsuper.buildSearchFields();\n\t\tthis.search_fields = [\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Name' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'name',\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.TEXT_INPUT\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Type' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'type_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\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Status' ),\n\t\t\t\tin_column: 1,\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\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Group' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tmultiple: true,\n\t\t\t\tfield: 'group_id',\n\t\t\t\tlayout_name: 'global_tree_column',\n\t\t\t\ttree_mode: 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: 900,\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._( 'Part Number' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'part_number',\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.TEXT_INPUT\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Description' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'description',\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.TEXT_INPUT\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Created By' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'created_by',\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._( 'Updated By' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'updated_by',\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\t\t];\n\t}\n\n\tgetProductPricingTabHtml() {\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
\n\t\t\t\t
`;\n\t}\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTc0NC5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7QUFBTztBQUNQLDJCQUEyQjtBQUMzQixFQUFFLENBQUM7QUFDSDs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztB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