TimeTrex/interface/html5/dist/company-payroll_remittance_agency-PayrollRemittanceAgencyViewController.bundle.js

1 line
79 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["company-payroll_remittance_agency-PayrollRemittanceAgencyViewController"],{3665:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"PayrollRemittanceAgencyViewController\": () => (/* binding */ PayrollRemittanceAgencyViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass PayrollRemittanceAgencyViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#payroll_remittance_agency_view_container',\n\n\n\n\t\t\tstatus_array: null,\n\t\t\ttype_array: null,\n\t\t\tagency_array: null,\n\t\t\tcountry_array: null,\n\t\t\tprovince_array: null,\n\t\t\tdistrict_array: null,\n\n\t\t\tremittance_source_account_array: null,\n\t\t\tsub_event_view_controller: null,\n\n\t\t\te_province_array: null,\n\t\t\tcompany_api: null,\n\t\t\tremittance_source_account_api: null,\n\t\t\talways_week_day_array: null,\n\n\t\t\tdate_api: null\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit() {\n\t\tthis.edit_view_tpl = 'PayrollRemittanceAgencyEditView.html';\n\t\tthis.permission_id = 'payroll_remittance_agency';\n\t\tthis.viewId = 'PayrollRemittanceAgency';\n\t\tthis.script_name = 'PayrollRemittanceAgencyView';\n\t\tthis.table_name_key = 'payroll_remittance_agency';\n\t\tthis.context_menu_name = $.i18n._( 'Remittance Agencies' );\n\t\tthis.navigation_label = $.i18n._( 'Remittance Agency' );\n\t\tthis.api = TTAPI.APIPayrollRemittanceAgency;\n\t\tthis.company_api = TTAPI.APICompany;\n\t\tthis.date_api = TTAPI.APITTDate;\n\t\tthis.remittance_source_account_api = TTAPI.APIRemittanceSourceAccount;\n\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\n\t\tthis.initData();\n\t}\n\n\t//Don't initOptions if edit_only_mode. Do it in sub views\n\tinitOptions( callback ) {\n\t\tvar $this = this;\n\n\t\tvar options = [\n\t\t\t{ option_name: 'status', api: this.api },\n\t\t\t{ option_name: 'type', api: this.api },\n\t\t\t{ option_name: 'country', field_name: 'country', api: this.company_api },\n\t\t];\n\n\t\tthis.initDropDownOptions( options );\n\n\t\tthis.api.getOptions( 'always_week_day', {\n\t\t\tonResult: function( res ) {\n\t\t\t\tres = res.getResult();\n\t\t\t\t$this.always_week_day_array = Global.buildRecordArray( res );\n\t\t\t\tif ( typeof callback == 'function' ) {\n\t\t\t\t\tcallback( res ); // First to initialize drop down options, and then to initialize edit view UI.\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\topenEditView( record_id ) {\n\n\t\tvar $this = this;\n\t\tif ( this.edit_only_mode ) {\n\n\t\t\tthis.initOptions( function( result ) {\n\t\t\t\tif ( !$this.edit_view ) {\n\t\t\t\t\t$this.initEditViewUI( $this.viewId, $this.edit_view_tpl );\n\t\t\t\t}\n\n\t\t\t\tvar filter = {};\n\t\t\t\tfilter.filter_data = { id: record_id };\n\n\t\t\t\t$this.api.getPayrollRemittanceAgency( filter, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\tresult = result.getResult()[0];\n\t\t\t\t\t\t//Error: Uncaught TypeError: Cannot read property 'user_id' of null in interface/html5/#!m=TimeSheet&date=20150915&user_id=42175&show_wage=0 line 79\n\t\t\t\t\t\tif ( !result ) {\n\t\t\t\t\t\t\tTAlertManager.showAlert( $.i18n._( 'Invalid agency id' ) );\n\t\t\t\t\t\t\t$this.onCancelClick();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Waiting for the TTAPI.API returns data to set the current edit record.\n\t\t\t\t\t\t\t$this.current_edit_record = result;\n\n\t\t\t\t\t\t\t$this.initEditView();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} );\n\t\t} else {\n\t\t\tsuper.openEditView();\n\t\t}\n\t}\n\n\tgetFilterColumnsFromDisplayColumns() {\n\t\tvar column_filter = {};\n\t\tcolumn_filter.is_owner = true;\n\t\tcolumn_filter.id = true;\n\t\tcolumn_filter.is_child = true;\n\t\tcolumn_filter.in_use = true;\n\t\tcolumn_filter.first_name = true;\n\t\tcolumn_filter.last_name