mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-31 05:31:10 -04:00 
			
		
		
		
	fix production build issues and refactor variable names
This commit is contained in:
		| @ -349,7 +349,7 @@ export default { | ||||
|     updated_message: 'Invoice updated successfully', | ||||
|     deleted_message: 'Invoice deleted successfully | Invoices deleted successfully', | ||||
|     marked_as_sent_message: 'Invoice marked as sent successfully', | ||||
|     invalid_due_amount_message: 'The payment entered is more than the total amount due for this invoice. Please check and retry' | ||||
|     invalid_due_amount_message: 'Total Invoice amount cannot be less than total paid amount for this Invoice. Please update the invoice or delete the associated payments to continue.' | ||||
|   }, | ||||
|   credit_notes: { | ||||
|     title: 'Credit Notes', | ||||
| @ -677,7 +677,8 @@ export default { | ||||
|       update_progress: 'Update in progress...', | ||||
|       progress_text: 'It will just take a few minutes. Please do not refresh the screen or close the window before the update finishes', | ||||
|       update_success: 'App has been updated successfully', | ||||
|       latest_message: 'No update available! You are on the latest version.' | ||||
|       latest_message: 'No update available! You are on the latest version.', | ||||
|       current_version: 'Current Version' | ||||
|     } | ||||
|   }, | ||||
|   wizard: { | ||||
|  | ||||
| @ -188,13 +188,13 @@ | ||||
|           sort-as="estimate_date" | ||||
|           show="formattedEstimateDate" /> | ||||
|         <table-column | ||||
|           :label="$t('estimates.contact')" | ||||
|           :label="$t('estimates.customer')" | ||||
|           sort-as="name" | ||||
|           show="name" /> | ||||
|         <table-column | ||||
|         <!-- <table-column | ||||
|           :label="$t('estimates.expiry_date')" | ||||
|           sort-as="expiry_date" | ||||
|           show="formattedExpiryDate" /> | ||||
|           show="formattedExpiryDate" /> --> | ||||
|         <table-column | ||||
|           :label="$t('estimates.status')" | ||||
|           show="status" > | ||||
|  | ||||
| @ -140,10 +140,11 @@ | ||||
|     </div> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script> | ||||
| import { mapActions } from 'vuex' | ||||
|  | ||||
| const _ = require('lodash') | ||||
|  | ||||
| export default { | ||||
|   data () { | ||||
|     return { | ||||
| @ -230,14 +231,14 @@ export default { | ||||
|       return true | ||||
|     }, | ||||
|     async onMarkAsSent () { | ||||
|       swal({ | ||||
|       window.swal({ | ||||
|         title: this.$t('general.are_you_sure'), | ||||
|         text: this.$t('estimates.confirm_mark_as_sent'), | ||||
|         icon: '/assets/icon/check-circle-solid.svg', | ||||
|         buttons: true, | ||||
|         dangerMode: true | ||||
|       }).then(async (willMarkAsSent) => { | ||||
|         if (willMarkAsSent) { | ||||
|       }).then(async (value) => { | ||||
|         if (value) { | ||||
|           this.isMarkAsSent = true | ||||
|           let response = await this.markAsSent({id: this.estimate.id}) | ||||
|           this.isMarkAsSent = false | ||||
| @ -248,14 +249,14 @@ export default { | ||||
|       }) | ||||
|     }, | ||||
|     async onSendEstimate (id) { | ||||
|       swal({ | ||||
|       window.swal({ | ||||
|         title: this.$t('general.are_you_sure'), | ||||
|         text: this.$t('estimates.confirm_send_estimate'), | ||||
|         icon: '/assets/icon/paper-plane-solid.svg', | ||||
|         buttons: true, | ||||
|         dangerMode: true | ||||
|       }).then(async (willSendEstimate) => { | ||||
|         if (willSendEstimate) { | ||||
|       }).then(async (value) => { | ||||
|         if (value) { | ||||
|           this.isSendingEmail = true | ||||
|           let response = await this.sendEmail({id: this.estimate.id}) | ||||
|           this.isSendingEmail = false | ||||
| @ -266,17 +267,15 @@ export default { | ||||
|       }) | ||||
|     }, | ||||
|     async removeEstimate (id) { | ||||
|       this.selectEstimate([parseInt(id)]) | ||||
|       this.id = id | ||||
|       swal({ | ||||
|       window.swal({ | ||||
|         title: 'Deleted', | ||||
|         text: 'you will not be able to recover this estimate!', | ||||
|         icon: '/assets/icon/trash-solid.svg', | ||||
|         buttons: true, | ||||
|         dangerMode: true | ||||
|       }).then(async (willDelete) => { | ||||
|         if (willDelete) { | ||||
|           let request = await this.deleteEstimate(this.id) | ||||
|       }).then(async (value) => { | ||||
|         if (value) { | ||||
|           let request = await this.deleteEstimate(id) | ||||
|           if (request.data.success) { | ||||
|             window.toastr['success'](this.$tc('estimates.deleted_message', 1)) | ||||
|             this.$router.push('/admin/estimates') | ||||
|  | ||||
| @ -60,7 +60,7 @@ | ||||
|           icon="search" | ||||
|           type="text" | ||||
|           align-icon="right" | ||||
|           @input="onSearched()" | ||||
|           @input="onSearch" | ||||
|         /> | ||||
|         <div | ||||
|           class="btn-group ml-3" | ||||
| @ -82,7 +82,7 @@ | ||||
|                 name="filter" | ||||
|                 class="inv-radio" | ||||
|                 value="invoice_date" | ||||
|                 @change="onSearched" | ||||
|                 @change="onSearch" | ||||
|               > | ||||
|               <label class="inv-label" for="filter_invoice_date">{{ $t('invoices.invoice_date') }}</label> | ||||
|             </div> | ||||
| @ -94,7 +94,7 @@ | ||||
|                 name="filter" | ||||
|                 class="inv-radio" | ||||
|                 value="due_date" | ||||
|                 @change="onSearched" | ||||
|                 @change="onSearch" | ||||
|               > | ||||
|               <label class="inv-label" for="filter_due_date">{{ $t('invoices.due_date') }}</label> | ||||
|             </div> | ||||
| @ -106,7 +106,7 @@ | ||||
|                 name="filter" | ||||
|                 class="inv-radio" | ||||
|                 value="invoice_number" | ||||
|                 @change="onSearched" | ||||
|                 @change="onSearch" | ||||
|               > | ||||
|               <label class="inv-label" for="filter_invoice_number">{{ $t('invoices.invoice_number') }}</label> | ||||
|             </div> | ||||
| @ -182,7 +182,7 @@ export default { | ||||
|   }, | ||||
|   created () { | ||||
|     this.loadInvoices() | ||||
|     this.onSearched = _.debounce(this.onSearched, 500) | ||||
|     this.onSearch = _.debounce(this.onSearch, 500) | ||||
|   }, | ||||
|   methods: { | ||||
|     ...mapActions('invoice', [ | ||||
| @ -200,7 +200,7 @@ export default { | ||||
|         this.invoices = response.data.invoices.data | ||||
|       } | ||||
|     }, | ||||
|     async onSearched () { | ||||
|     async onSearch () { | ||||
|       let data = '' | ||||
|       if (this.searchData.searchText !== '' && this.searchData.searchText !== null && this.searchData.searchText !== undefined) { | ||||
|         data += `search=${this.searchData.searchText}&` | ||||
| @ -223,22 +223,22 @@ export default { | ||||
|     sortData () { | ||||
|       if (this.searchData.orderBy === 'asc') { | ||||
|         this.searchData.orderBy = 'desc' | ||||
|         this.onSearched() | ||||
|         this.onSearch() | ||||
|         return true | ||||
|       } | ||||
|       this.searchData.orderBy = 'asc' | ||||
|       this.onSearched() | ||||
|       this.onSearch() | ||||
|       return true | ||||
|     }, | ||||
|     async onMarkAsSent () { | ||||
|       swal({ | ||||
|       window.swal({ | ||||
|         title: this.$t('general.are_you_sure'), | ||||
|         text: this.$t('invoices.invoice_mark_as_sent'), | ||||
|         icon: '/assets/icon/check-circle-solid.svg', | ||||
|         buttons: true, | ||||
|         dangerMode: true | ||||
|       }).then(async (willMarkAsSent) => { | ||||
|         if (willMarkAsSent) { | ||||
|       }).then(async (value) => { | ||||
|         if (value) { | ||||
|           this.isMarkingAsSent = true | ||||
|           let response = await this.markAsSent({id: this.invoice.id}) | ||||
|           this.isMarkingAsSent = false | ||||
| @ -249,14 +249,14 @@ export default { | ||||
|       }) | ||||
|     }, | ||||
|     async onSendInvoice () { | ||||
|       swal({ | ||||
|       window.swal({ | ||||
|         title: this.$tc('general.are_you_sure'), | ||||
|         text: this.$tc('invoices.confirm_send_invoice'), | ||||
|         icon: '/assets/icon/paper-plane-solid.svg', | ||||
|         buttons: true, | ||||
|         dangerMode: true | ||||
|       }).then(async (willSendInvoice) => { | ||||
|         if (willSendInvoice) { | ||||
|       }).then(async (value) => { | ||||
|         if (value) { | ||||
|           this.isSendingEmail = true | ||||
|           let response = await this.sendEmail({id: this.invoice.id}) | ||||
|           this.isSendingEmail = false | ||||
| @ -269,14 +269,14 @@ export default { | ||||
|     async removeInvoice (id) { | ||||
|       this.selectInvoice([parseInt(id)]) | ||||
|       this.id = id | ||||
|       swal({ | ||||
|       window.swal({ | ||||
|         title: 'Deleted', | ||||
|         text: 'you will not be able to recover this invoice!', | ||||
|         icon: '/assets/icon/trash-solid.svg', | ||||
|         buttons: true, | ||||
|         dangerMode: true | ||||
|       }).then(async (willDelete) => { | ||||
|         if (willDelete) { | ||||
|       }).then(async (value) => { | ||||
|         if (value) { | ||||
|           let request = await this.deleteInvoice(this.id) | ||||
|           if (request.data.success) { | ||||
|             window.toastr['success'](this.$tc('invoices.deleted_message', 1)) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user