TimeTrex/interface/html5/dist/invoice-invoice_transaction-InvoiceTransactionViewController.bundle.js

1 line
58 KiB
JavaScript
Raw Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["invoice-invoice_transaction-InvoiceTransactionViewController"],{5229:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"InvoiceTransactionViewController\": () => (/* binding */ InvoiceTransactionViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass InvoiceTransactionViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#invoice_transaction_view_container',\n\n\t\t\tstatus_array: null,\n\t\t\ttype_array: null,\n\t\t\tpayment_type_array: null,\n\t\t\tcurrency_array: null,\n\t\t\tcurrency_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 = 'InvoiceTransactionEditView.html';\n\t\tthis.permission_id = 'transaction';\n\t\tthis.viewId = 'InvoiceTransaction';\n\t\tthis.script_name = 'InvoiceTransactionView';\n\t\tthis.table_name_key = 'invoice_transaction';\n\t\tthis.context_menu_name = $.i18n._( 'Transactions' );\n\t\tthis.navigation_label = $.i18n._( 'Transaction' );\n\t\tthis.api = TTAPI.APITransaction;\n\t\tthis.currency_api = TTAPI.APICurrency;\n\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\n\t\tif ( !this.sub_view_mode ) {\n\t\t\tthis.initData();\n\t\t}\n\t}\n\n\tinitOptions( callBack ) {\n\t\tvar $this = this;\n\t\tvar filter = { filter_columns: { name: true, id: true } };\n\n\t\tvar options = [\n\t\t\t{ option_name: 'status', field_name: null, api: null },\n\t\t\t{ option_name: 'type', field_name: null, api: null },\n\t\t\t{ option_name: 'payment_type', field_name: null, api: null }\n\t\t];\n\n\t\tthis.currency_api.getCurrency( filter, false, {\n\t\t\tonResult: function( res ) {\n\n\t\t\t\tres = res.getResult();\n\n\t\t\t\tvar temp_currency_arr = {};\n\n\t\t\t\t$.each( res, function( key, item ) {\n\t\t\t\t\ttemp_currency_arr[item.id] = item.name;\n\t\t\t\t} );\n\n\t\t\t\t$this.currency_array = Global.buildRecordArray( temp_currency_arr );\n\n\t\t\t\t$this.initDropDownOptions( options, function( result ) {\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\n\t\t\t}\n\t\t} );\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\texclude: ['default'],\n\t\t\tinclude: [\n\t\t\t\t'edit',\n\t\t\t\t'delete_icon',\n\t\t\t\t'delete_and_next',\n\t\t\t\t'save',\n\t\t\t\t'save_and_continue',\n\t\t\t\t'save_and_next',\n\t\t\t\t'cancel'\n\t\t\t]\n\t\t};\n\n\t\tif ( !this.sub_view_mode && !this.edit_only_mode ) {\n\n\t\t\tcontext_menu_model.include.push(\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Jump To' ),\n\t\t\t\t\tid: 'jump_to_header',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\taction_group: 'jump_to',\n\t\t\t\t\taction_group_header: true,\n\t\t\t\t\tpermission_result: false, // to hide it in legacy context menu and avoid errors in legacy parsers.\n\t\t\t\t\tsort_order: 9050,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Edit Client' ),\n\t\t\t\t\tid: 'edit_client',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\taction_group: 'jump_to',\n\t\t\t\t\tgroup: 'navigation',\n\t\t\t\t\tsort_order: 9050,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Client Contacts' ),\n\t\t\t\t\tid: 'client_contact',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\taction_group: 'jump_to',\n\t\t\t\t\tgroup: 'navigation',\n\t\t\t\t\tsort_order: 9050,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Invoices' ),\n\t\t\t\t\tid: 'invoice',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\taction_group: 'jump_to',\n\t\t\t\t\tgroup: 'navigation',\n\t\t\t\t\tsort_order: 9050,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Payment Methods' ),\n\t\t\t\t\tid: 'payment_method',\n\t\t\t\t\tmenu_align: 'right',