Merge branch 'auto-update' of https://gitlab.com/mohit.panjvani/crater-web into auto-update

This commit is contained in:
Aman upadhyay
2019-11-15 17:41:11 +05:30
29 changed files with 221 additions and 88 deletions

View File

@ -396,7 +396,7 @@ export default {
swal({
title: this.$t('general.are_you_sure'),
text: this.$tc('estimates.confirm_delete', 1),
icon: 'error',
icon: '/assets/icon/trash-solid.svg',
buttons: true,
dangerMode: true
}).then(async (willDelete) => {
@ -416,7 +416,7 @@ export default {
swal({
title: this.$t('general.are_you_sure'),
text: this.$t('estimates.confirm_conversion'),
icon: 'error',
icon: '/assets/icon/envelope-solid.svg',
buttons: true,
dangerMode: true
}).then(async (willDelete) => {
@ -433,14 +433,24 @@ export default {
})
},
async onMarkAsSent (id) {
const data = {
id: id
}
let response = await this.markAsSent(data)
this.$refs.table.refresh()
if (response.data) {
window.toastr['success'](this.$tc('estimates.mark_as_sent'))
}
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) {
const data = {
id: id
}
let response = await this.markAsSent(data)
this.$refs.table.refresh()
if (response.data) {
window.toastr['success'](this.$tc('estimates.mark_as_sent_successfully'))
}
}
})
},
async removeInvoice (id) {
@ -448,7 +458,7 @@ export default {
swal({
title: this.$t('general.are_you_sure'),
text: this.$tc('invoices.confirm_delete'),
icon: 'error',
icon: '/assets/icon/trash-solid.svg',
buttons: true,
dangerMode: true
}).then(async (willDelete) => {
@ -465,24 +475,44 @@ export default {
},
async sendInvoice (id) {
const data = {
id: id
}
let response = await this.sendEmail(data)
this.$refs.table.refresh()
if (response.data) {
window.toastr['success'](this.$tc('invoices.send_invoice'))
}
swal({
title: this.$t('general.are_you_sure'),
text: this.$t('invoices.confirm_send'),
icon: '/assets/icon/paper-plane-solid.svg',
buttons: true,
dangerMode: true
}).then(async (willSendInvoice) => {
if (willSendInvoice) {
const data = {
id: id
}
let response = await this.sendEmail(data)
this.$refs.table.refresh()
if (response.data) {
window.toastr['success'](this.$tc('invoices.send_invoice_successfully'))
}
}
})
},
async sentInvoice (id) {
const data = {
id: id
}
let response = await this.markAsSent(data)
this.$refs.table.refresh()
if (response.data) {
window.toastr['success'](this.$tc('invoices.mark_as_sent'))
}
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 (willMarkAsSend) => {
if (willMarkAsSend) {
const data = {
id: id
}
let response = await this.markAsSent(data)
this.$refs.table.refresh()
if (response.data) {
window.toastr['success'](this.$tc('invoices.mark_as_sent_successfully'))
}
}
})
}
}

View File

@ -553,6 +553,8 @@ export default {
if (response.data) {
this.selectCustomer(response.data.estimate.user_id)
this.newEstimate = response.data.estimate
this.newEstimate.estimate_date = moment(response.data.estimate.estimate_date, 'YYYY-MM-DD').toString()
this.newEstimate.expiry_date = moment(response.data.estimate.expiry_date, 'YYYY-MM-DD').toString()
this.discountPerItem = response.data.discount_per_item
this.taxPerItem = response.data.tax_per_item
this.selectedCurrency = this.defaultCurrency

View File

@ -425,7 +425,7 @@ export default {
if (response.data) {
this.filters.status = 'ACCEPTED'
this.$refs.table.refresh()
window.toastr['success'](this.$tc('estimates.marked_as_rejected_message'))
window.toastr['success'](this.$tc('estimates.confirm_mark_as_accepted'))
}
}
})
@ -570,7 +570,7 @@ export default {
let response = await this.markAsSent(data)
this.refreshTable()
if (response.data) {
window.toastr['success'](this.$tc('estimates.mark_as_sent'))
window.toastr['success'](this.$tc('estimates.mark_as_sent_successfully'))
}
}
})
@ -590,7 +590,7 @@ export default {
let response = await this.sendEmail(data)
this.refreshTable()
if (response.data) {
window.toastr['success'](this.$tc('estimates.mark_as_sent'))
window.toastr['success'](this.$tc('estimates.send_estimate_successfully'))
}
}
})

View File

@ -5,6 +5,7 @@
<div class="page-actions row">
<div class="col-xs-2">
<base-button
v-if="estimate.status !== 'SENT'"
:loading="isRequestOnGoing"
:disabled="isRequestOnGoing"
:outline="true"
@ -33,7 +34,7 @@
</v-dropdown>
</div>
</div>
<div class="estimate-sidebar">
<div class="estimate-si debar">
<base-loader v-if="isSearching" />
<div v-else class="side-header">
<base-input
@ -144,6 +145,8 @@ export default {
orderByField: null,
searchText: null
},
status: ['DRAFT', 'SENT', 'VIEWED', 'EXPIRED', 'ACCEPTED', 'REJECTED'],
isMarkAsSent: false,
isRequestOnGoing: false,
isSearching: false
}
@ -230,11 +233,11 @@ export default {
dangerMode: true
}).then(async (willMarkAsSent) => {
if (willMarkAsSent) {
this.isRequestOnGoing = true
this.isMarkAsSent = true
let response = await this.markAsSent({id: this.estimate.id})
this.isRequestOnGoing = false
this.isMarkAsSent = false
if (response.data) {
window.toastr['success'](this.$tc('estimates.mark_as_sent'))
window.toastr['success'](this.$tc('estimates.mark_as_sent_successfully'))
}
}
})

View File

@ -554,6 +554,8 @@ export default {
if (response.data) {
this.selectCustomer(response.data.invoice.user_id)
this.newInvoice = response.data.invoice
this.newInvoice.invoice_date = moment(response.data.invoice.invoice_date, 'YYYY-MM-DD').toString()
this.newInvoice.due_date = moment(response.data.invoice.due_date, 'YYYY-MM-DD').toString()
this.discountPerItem = response.data.discount_per_item
this.taxPerItem = response.data.tax_per_item
this.selectedCurrency = this.defaultCurrency

View File

@ -390,15 +390,15 @@ export default {
icon: '/assets/icon/paper-plane-solid.svg',
buttons: true,
dangerMode: true
}).then(async (Send_Invoice) => {
if (Send_Invoice) {
}).then(async (willSendInvoice) => {
if (willSendInvoice) {
const data = {
id: id
}
let response = await this.sendEmail(data)
this.refreshTable()
if (response.data) {
window.toastr['success'](this.$tc('invoices.send_invoice'))
window.toastr['success'](this.$tc('invoices.send_invoice_successfully'))
}
}
})
@ -410,15 +410,15 @@ export default {
icon: '/assets/icon/check-circle-solid.svg',
buttons: true,
dangerMode: true
}).then(async (MarkAsSend_Invoice) => {
if (MarkAsSend_Invoice) {
}).then(async (willMarkAsSend) => {
if (willMarkAsSend) {
const data = {
id: id
}
let response = await this.markAsSent(data)
this.refreshTable()
if (response.data) {
window.toastr['success'](this.$tc('invoices.mark_as_sent'))
window.toastr['success'](this.$tc('invoices.mark_as_sent_successfully'))
}
}
})

View File

@ -97,7 +97,6 @@
</div>
<div class="col-md-6">
<label class="form-label">{{ $t('wizard.database.password') }}</label>
<span class="text-danger"> *</span>
<base-input
v-model.trim="databaseData.database_password"
type="password"
@ -154,7 +153,7 @@ export default {
database_name: null,
database_username: null,
database_password: null,
app_url: null
app_url: window.location.origin
},
loading: false,
connections: [
@ -207,8 +206,8 @@ export default {
}
this.loading = false
} catch (e) {
console.log(e)
window.toastr['error']('Something went wrong')
console.log(e.response)
window.toastr['error'](e.response.data.message)
}
}
}

View File

@ -67,8 +67,8 @@ export default {
data () {
return {
loading: false,
tab: 'step_1',
step: 1
tab: 'step_3',
step: 3
}
},
created () {

View File

@ -35,7 +35,7 @@
</div>
</div>
<base-button
v-if="requirements"
v-if="hasNext"
:loading="loading"
class="pull-right mt-4"
icon="arrow-right"
@ -46,7 +46,7 @@
{{ $t('wizard.continue') }}
</base-button>
<base-button
v-else
v-if="!requirements"
:loading="loading"
class="pull-right mt-4"
color="theme"
@ -74,6 +74,20 @@ export default {
isShow: true
}
},
computed: {
hasNext () {
if (this.requirements) {
let isRequired = true
for (const key in this.requirements) {
if (!this.requirements[key]) {
isRequired = false
}
}
return this.requirements && this.phpSupportInfo.supported && isRequired
}
return false
}
},
methods: {
listToggle () {
this.isShow = !this.isShow