TimeTrex/interface/html5/dist/payroll-pay_stub-PayStubViewController.bundle.js

1 line
286 KiB
JavaScript
Raw Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["payroll-pay_stub-PayStubViewController"],{3436:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"PayStubViewController\": () => (/* binding */ PayStubViewController)\n/* harmony export */ });\n/* harmony import */ var decimal_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(482);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\nclass PayStubViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#pay_stub_view_container',\n\n\t\t\tfiltered_status_array: null,\n\t\t\tuser_status_array: null,\n\t\t\tuser_group_array: null,\n\t\t\tuser_destination_account_array: null,\n\t\t\tcurrency_array: null,\n\t\t\ttype_array: null,\n\n\t\t\tcountry_array: null,\n\t\t\tprovince_array: null,\n\n\t\t\te_province_array: null,\n\n\t\t\tuser_api: null,\n\t\t\tuser_group_api: null,\n\t\t\tcompany_api: null,\n\n\t\t\tpay_stub_entry_api: null,\n\n\t\t\tinclude_pay_stub_accounts: true,\n\t\t\ttransaction_status_array: false,\n\n\t\t\tnet_pay_amount: false,\n\n\t\t\tpseal_link: false,\n\n\t\t\toriginal_status_id: 10\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 = 'PayStubEditView.html';\n\t\tthis.permission_id = 'pay_stub';\n\t\tthis.viewId = 'PayStub';\n\t\tthis.script_name = 'PayStubView';\n\t\tthis.table_name_key = 'pay_stub';\n\t\tthis.context_menu_name = $.i18n._( 'Pay Stub' );\n\t\tthis.navigation_label = $.i18n._( 'Pay Stubs' );\n\t\tthis.api = TTAPI.APIPayStub;\n\t\tthis.user_api = TTAPI.APIUser;\n\t\tthis.pay_stub_entry_api = TTAPI.APIPayStubEntry;\n\t\tthis.pay_stub_entry_account_link_api = TTAPI.APIPayStubEntryAccountLink;\n\t\tthis.user_group_api = TTAPI.APIUserGroup;\n\t\tthis.company_api = TTAPI.APICompany;\n\t\tthis.pay_period_api = TTAPI.APIPayPeriod;\n\t\tthis.pay_stub_transaction_api = TTAPI.APIPayStubTransaction;\n\t\tthis.remittance_destination_account_api = TTAPI.APIRemittanceDestinationAccount;\n\n\t\tvar $this = this;\n\t\t$.when(\n\t\t\tthis.preloadTransactionOptions( new $.Deferred() ),\n\t\t\tthis.preloadPayStubAccountLinks( new $.Deferred() )\n\t\t).done( function() {\n\t\t\t$this.completeInit();\n\t\t} );\n\t}\n\n\tisEditMode() {\n\t\tif ( this.is_add || ( this.is_edit && this.original_status_id == 25 ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpreloadTransactionOptions( dfd ) {\n\t\tvar $this = this;\n\t\tthis.pay_stub_transaction_api.getOptions( 'status', false, false, {\n\t\t\tonResult: function( result ) {\n\t\t\t\t$this.transaction_status_array = result.getResult();\n\t\t\t\tdfd.resolve( true );\n\t\t\t}\n\t\t} );\n\n\t\treturn dfd.promise();\n\t}\n\n\tpreloadPayStubAccountLinks( dfd ) {\n\t\tvar $this = this;\n\t\tthis.pay_stub_entry_account_link_api.getPayStubEntryAccountLink( '', false, false, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tvar data = result.getResult()[0];\n\t\t\t\tif ( data ) {\n\t\t\t\t\t$this.pseal_link = {\n\t\t\t\t\t\ttotal_gross_entry_account_id: false,\n\t\t\t\t\t\ttotal_deductions_entry_account_id: false,\n\t\t\t\t\t\tnet_pay_entry_account_id: false,\n\t\t\t\t\t\tcontributions_entry_account_id: false\n\t\t\t\t\t};\n\n\t\t\t\t\t$this.pseal_link.total_gross_entry_account_id = data.total_gross;\n\t\t\t\t\t$this.pseal_link.total_deductions_entry_account_id = data.total_employee_deduction;\n\t\t\t\t\t$this.pseal_link.net_pay_entry_account_id = data.total_net_pay;\n\t\t\t\t\t$this.pseal_link.contributions_entry_account_id = data.total_employer_deduction;\n\t\t\t\t}\n\t\t\t\tdfd.resolve( true );\n\t\t\t}\n\t\t} );\n\n\t\treturn dfd.promise();\n\t}\n\n\tcompleteInit() {\n\t\tthis.initPermission();\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\n\t\tthis.initData();\n\t}\n\n\tinitPermission() {\n\n\t\tsuper