TimeTrex/interface/html5/dist/invoice-client-ClientViewController.bundle.js

1 line
64 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["invoice-client-ClientViewController"],{1475:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ClientViewController\": () => (/* binding */ ClientViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass ClientViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#client_view_container',\n\n\t\t\tstatus_array: null,\n\t\t\tindustry_array: null,\n\t\t\tclient_group_array: null,\n\t\t\tclient_group_api: null,\n\n\t\t\tsub_client_contact_view_controller: null,\n\t\t\tsub_client_payment_view_controller: null,\n\t\t\tsub_document_view_controller: null,\n\t\t\tsub_transaction_view_controller: null,\n\t\t\tsub_invoice_view_controller: null,\n\n\t\t\tdocument_object_type_id: 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 = 'ClientEditView.html';\n\t\tthis.permission_id = 'client';\n\t\tthis.viewId = 'Client';\n\t\tthis.script_name = 'ClientView';\n\t\tthis.table_name_key = 'client';\n\t\tthis.context_menu_name = $.i18n._( 'Clients' );\n\t\tthis.navigation_label = $.i18n._( 'Client' );\n\t\tthis.document_object_type_id = 80;\n\t\tthis.api = TTAPI.APIClient;\n\t\tthis.client_group_api = TTAPI.APIClientGroup;\n\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\n\t\tthis.initData();\n\t}\n\n\tremoveEditView() {\n\t\tsuper.removeEditView();\n\t\tthis.sub_client_contact_view_controller = null;\n\t\tthis.sub_invoice_view_controller = null;\n\t\tthis.sub_client_payment_view_controller = null;\n\t\tthis.sub_transaction_view_controller = null;\n\t}\n\n\tinitOptions( callBack ) {\n\t\tvar $this = this;\n\t\tvar filter = {};\n\t\tfilter.filter_columns = { id: true, company_name: true };\n\n\t\tthis.initDropDownOption( 'industry' );\n\t\tthis.initDropDownOption( 'status', 'status_id', this.api, function() {\n\n\t\t\t$this.client_group_api.getClientGroup( '', false, false, {\n\t\t\t\tonResult: function( res ) {\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\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\n\t\t\t\t\t$this.client_group_array = res;\n\n\t\t\t\t\tif ( callBack ) {\n\t\t\t\t\t\tcallBack();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} );\n\n\t\t} );\n\t}\n\n\tgetClientData( id, callBack ) {\n\n\t\tvar filter = {};\n\t\tfilter.filter_data = {};\n\t\tfilter.filter_data.id = [id];\n\n\t\tthis.api['get' + this.api.key_name]( filter, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tvar result_data = result.getResult();\n\n\t\t\t\tif ( !result_data ) {\n\t\t\t\t\tresult_data = [];\n\t\t\t\t}\n\t\t\t\tresult_data = result_data[0];\n\n\t\t\t\tcallBack( result_data );\n\n\t\t\t}\n\t\t} );\n\t}\n\n\topenEditView( id ) {\n\t\tGlobal.setUINotready();\n\t\tTTPromise.add( 'init', 'init' );\n\t\tTTPromise.wait();\n\n\t\tvar $this = this;\n\n\t\tif ( $this.edit_only_mode ) {\n\n\t\t\t$this.initOptions(\n\t\t\t\tfunction( result ) {\n\t\t\t\t\tif ( !$this.edit_view ) {\n\t\t\t\t\t\t$this.initEditViewUI( $this.viewId, $this.edit_view_tpl );\n\t\t\t\t\t}\n\n\t\t\t\t\t$this.getClientData( id, function( result ) {\n\t\t\t\t\t\t$this.current_edit_record = result;\n\n\t\t\t\t\t\t$this.initEditView();\n\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\t\t\t);\n\n\t\t} else {\n\n\t\t\tif ( !this.edit_view ) {\n\t\t\t\tthis.initEditViewUI( this.viewId, this.edit_view_tpl );\n\t\t\t}\n\n\t\t}\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\texclude: ['