Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
80 lines (79 sloc) 2.22 KB
<template>
<div class="app-content">
<div class="hero">
<div class="hero-body columns">
<div class="column">
<p class="is-size-5">Vendor</p>
<p>Name: {{vendor.name}}</p>
<p>Tax ID: {{vendor.taxId}}</p>
<p>Address: {{vendor.address.postalCode}} {{vendor.address.addressLine}} {{vendor.address.city}}</p>
</div>
<div class="column">
<p>Issued date: {{formatDate(bill.issuedDate)}}</p>
<p>Due date: {{formatDate(bill.dueDate)}}</p>
</div>
</div>
</div>
<div class="app-block">
<table class="table is-fullwidth is-striped">
<thead>
<tr>
<td>Position</td>
<td>Description</td>
<td>Rate</td>
<td>Quantity</td>
</tr>
</thead>
<tbody>
<tr v-for="item in bill.items" :key="item.position">
<td>{{item.position}}</td>
<td>{{item.description}}</td>
<td>EUR {{item.rate}}</td>
<td>x {{item.quantity}}</td>
</tr>
</tbody>
</table>
</div>
<div class="app-block has-text-right">
<p>Subtotal: {{bill.subtotal}}</p>
<p>Taxes: {{bill.tax}}</p>
<p class="is-size-4 has-text-primary">Total: {{bill.total}}</p>
</div>
</div>
</template>
<script>
import {AxiosClient} from '@/http/AxiosClient.js'
import {getAuthConfig} from '@/auth/AuthManager.js'
import moment from 'moment'
export default {
props: ['id'],
data() {
return {
bill: {},
vendor: {}
}
},
methods: {
getBill(){
let url = 'bills/one/' + this.id
AxiosClient.get(`${url}`, getAuthConfig()).then(res => {
this.bill = res.data
let vendorId = this.bill.vendorId
this.getVendor(vendorId)
})
},
getVendor(id){
let url = 'companies/one/' + id
AxiosClient.get(`${url}`, getAuthConfig()).then(res=>{
this.vendor = res.data
})
},
formatDate(date){
return moment.unix(date).format('DD.MM.YYYY')
}
},
created() {
this.getBill()
}
}
</script>
You can’t perform that action at this time.