mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
fix invoice & estimate view issue
This commit is contained in:
@ -151,6 +151,7 @@ export default {
|
||||
id: null,
|
||||
count: null,
|
||||
estimates: [],
|
||||
estimate: null,
|
||||
currency: null,
|
||||
searchData: {
|
||||
orderBy: null,
|
||||
@ -165,10 +166,6 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
estimate () {
|
||||
return this.$store.getters['estimate/getEstimate'](this.$route.params.id)
|
||||
},
|
||||
|
||||
getOrderBy () {
|
||||
if (this.searchData.orderBy === 'asc' || this.searchData.orderBy == null) {
|
||||
return true
|
||||
@ -180,8 +177,14 @@ export default {
|
||||
return `/estimates/pdf/${this.estimate.unique_hash}`
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route (to, from) {
|
||||
this.loadEstimate()
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.loadEstimates()
|
||||
this.loadEstimate()
|
||||
this.onSearched = _.debounce(this.onSearched, 500)
|
||||
},
|
||||
methods: {
|
||||
@ -192,7 +195,8 @@ export default {
|
||||
'markAsSent',
|
||||
'sendEmail',
|
||||
'deleteEstimate',
|
||||
'selectEstimate'
|
||||
'selectEstimate',
|
||||
'fetchViewEstimate'
|
||||
]),
|
||||
async loadEstimates () {
|
||||
let response = await this.fetchEstimates()
|
||||
@ -200,6 +204,13 @@ export default {
|
||||
this.estimates = response.data.estimates.data
|
||||
}
|
||||
},
|
||||
async loadEstimate () {
|
||||
let response = await this.fetchViewEstimate(this.$route.params.id)
|
||||
|
||||
if (response.data) {
|
||||
this.estimate = response.data.estimate
|
||||
}
|
||||
},
|
||||
async onSearched () {
|
||||
let data = ''
|
||||
if (this.searchData.searchText !== '' && this.searchData.searchText !== null && this.searchData.searchText !== undefined) {
|
||||
|
||||
@ -154,6 +154,7 @@ export default {
|
||||
id: null,
|
||||
count: null,
|
||||
invoices: [],
|
||||
invoice: null,
|
||||
currency: null,
|
||||
searchData: {
|
||||
orderBy: null,
|
||||
@ -167,9 +168,7 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
invoice () {
|
||||
return this.$store.getters['invoice/getInvoice'](this.$route.params.id)
|
||||
},
|
||||
|
||||
getOrderBy () {
|
||||
if (this.searchData.orderBy === 'asc' || this.searchData.orderBy == null) {
|
||||
return true
|
||||
@ -180,8 +179,14 @@ export default {
|
||||
return `/invoices/pdf/${this.invoice.unique_hash}`
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route (to, from) {
|
||||
this.loadInvoice()
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.loadInvoices()
|
||||
this.loadInvoice()
|
||||
this.onSearch = _.debounce(this.onSearch, 500)
|
||||
},
|
||||
methods: {
|
||||
@ -192,7 +197,8 @@ export default {
|
||||
'markAsSent',
|
||||
'sendEmail',
|
||||
'deleteInvoice',
|
||||
'selectInvoice'
|
||||
'selectInvoice',
|
||||
'fetchViewInvoice'
|
||||
]),
|
||||
async loadInvoices () {
|
||||
let response = await this.fetchInvoices()
|
||||
@ -200,6 +206,13 @@ export default {
|
||||
this.invoices = response.data.invoices.data
|
||||
}
|
||||
},
|
||||
async loadInvoice () {
|
||||
let response = await this.fetchViewInvoice(this.$route.params.id)
|
||||
|
||||
if (response.data) {
|
||||
this.invoice = response.data.invoice
|
||||
}
|
||||
},
|
||||
async onSearch () {
|
||||
let data = ''
|
||||
if (this.searchData.searchText !== '' && this.searchData.searchText !== null && this.searchData.searchText !== undefined) {
|
||||
|
||||
@ -410,7 +410,7 @@
|
||||
<div class="bill-address-container">
|
||||
@include('app.pdf.estimate.partials.billing-address')
|
||||
</div>
|
||||
@if($estimate->user->billingaddress->name || $estimate->user->billingaddress->address_street_1 || $estimate->user->billingaddress->address_street_2 || $estimate->user->billingaddress->country || $estimate->user->billingaddress->state || $estimate->user->billingaddress->city || $estimate->user->billingaddress->zip || $estimate->user->billingaddress->phone)
|
||||
@if($estimate->user->billingaddress && ($estimate->user->billingaddress->name || $estimate->user->billingaddress->address_street_1 || $estimate->user->billingaddress->address_street_2 || $estimate->user->billingaddress->country || $estimate->user->billingaddress->state || $estimate->user->billingaddress->city || $estimate->user->billingaddress->zip || $estimate->user->billingaddress->phone))
|
||||
<div class="ship-address-container">
|
||||
@else
|
||||
<div class="ship-address-container " style="float:left;padding-left:0px;">
|
||||
|
||||
@ -421,7 +421,7 @@
|
||||
<div class="ship-address-container">
|
||||
@include('app.pdf.estimate.partials.shipping-address')
|
||||
</div>
|
||||
@if($estimate->user->shippingaddress->name || $estimate->user->shippingaddress->address_street_1 || $estimate->user->shippingaddress->address_street_2 || $estimate->user->shippingaddress->country || $estimate->user->shippingaddress->state || $estimate->user->shippingaddress->city || $estimate->user->shippingaddress->zip || $estimate->user->phone)
|
||||
@if($estimate->user->shippingaddress && ($estimate->user->shippingaddress->name || $estimate->user->shippingaddress->address_street_1 || $estimate->user->shippingaddress->address_street_2 || $estimate->user->shippingaddress->country || $estimate->user->shippingaddress->state || $estimate->user->shippingaddress->city || $estimate->user->shippingaddress->zip || $estimate->user->phone))
|
||||
<div class="bill-address-container">
|
||||
@else
|
||||
<div class="bill-address-container" style="float:right;padding-right:0px;">
|
||||
|
||||
@ -426,7 +426,7 @@
|
||||
<div style="float:left;">
|
||||
@include('app.pdf.estimate.partials.billing-address')
|
||||
</div>
|
||||
@if($estimate->user->billingaddress->name || $estimate->user->billingaddress->address_street_1 || $estimate->user->billingaddress->address_street_2 || $estimate->user->billingaddress->country || $estimate->user->billingaddress->state || $estimate->user->billingaddress->city || $estimate->user->billingaddress->zip || $estimate->user->billingaddress->phone)
|
||||
@if($estimate->user->billingaddress && ($estimate->user->billingaddress->name || $estimate->user->billingaddress->address_street_1 || $estimate->user->billingaddress->address_street_2 || $estimate->user->billingaddress->country || $estimate->user->billingaddress->state || $estimate->user->billingaddress->city || $estimate->user->billingaddress->zip || $estimate->user->billingaddress->phone))
|
||||
<div style="float:right;">
|
||||
@else
|
||||
<div style="float:left;">
|
||||
|
||||
Reference in New Issue
Block a user