Преглед изворни кода

wip:invoice - trying to fix id bug / other fixes

invoice
Simondb пре 3 година
родитељ
комит
68e40be3a4
1 измењених фајлова са 83 додато и 75 уклоњено
  1. 83
    75
      frontend/pages/projects/invoice/_id.vue

+ 83
- 75
frontend/pages/projects/invoice/_id.vue Прегледај датотеку

@@ -1,85 +1,90 @@
<template>
<div class="invoice-container">
<div class="invoice-header">
<div class="invoice-header-items">
<h2>Invoice</h2>
<div>
<div>
<div v-if="$fetchState.pending">fetching</div>
<div v-else class="invoice-container">
<Loader />
<div class="invoice-header">
<div class="invoice-header-items">
<h2>Invoice</h2>
<div>
<h2>{{ project.name }}</h2>
<div>
<h2>{{ project.name }}</h2>
</div>
<div>{{ project.team_name }}</div>
<div>{{ project.city }}</div>
<div>{{ project.country }}</div>
</div>
<div>{{ project.team_name }}</div>
<div>{{ project.city }}</div>
<div>{{ project.country }}</div>
</div>
</div>
</div>
<div class="invoice">
<div class="invoice-top">
<div>
<h5>BILL TO:</h5>
<div>{{ project.client_name }}</div>
<div>{{ project.btw_nr }}</div>
<div>{{ project.address }}</div>
<div class="invoice">
<div class="invoice-top">
<div>
<h5>BILL TO:</h5>
<div>{{ project.client_name }}</div>
<div>{{ project.btw_nr }}</div>
<div>{{ project.address }}</div>
</div>
<div>
<h5>invoice #</h5>
<div>{{ InvoiceNumber }}</div>
<h5>Date</h5>
<div>{{ Today }}</div>
<h5>Invoie due date</h5>
<div>{{ InvoiceDueDate }}</div>
</div>
</div>
<div>
<h5>invoice #</h5>
<div>{{ InvoiceNumber }}</div>
<h5>Date</h5>
<div>{{ Today }}</div>
<h5>Invoie due date</h5>
<div>{{ InvoiceDueDate }}</div>
<div class="invoice-bottom">
<table class="invoice-table">
<thead>
<tr>
<th>
TASKS
</th>
<th>
DESCRPTION
</th>
<th>
HRS
</th>
<th>
PRICE
</th>
<th>
TAX
</th>
<th>
AMOUNT
</th>
</tr>
</thead>
<tbody v-for="state in mergeStates" :key="state.id">
<tr v-for="Taskitem in state.tasks" :key="Taskitem.id">
<td>{{ Taskitem.name }}</td>
<td>{{ Taskitem.description }}</td>
<td>{{ Taskitem.time }}</td>
<td>50</td>
<td>20%</td>
<td>
{{ ((50 * Taskitem.time) / 100) * 20 + 50 * Taskitem.time }}
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="invoice-bottom">
<table class="invoice-table">
<thead>
<tr>
<th>
TASKS
</th>
<th>
DESCRPTION
</th>
<th>
HRS
</th>
<th>
PRICE
</th>
<th>
TAX
</th>
<th>
AMOUNT
</th>
</tr>
</thead>
<tbody v-for="state in mergeStates" :key="state.id">
<tr v-for="Taskitem in state.tasks" :key="Taskitem.id">
<td>{{ Taskitem.name }}</td>
<td>{{ Taskitem.description }}</td>
<td>{{ Taskitem.time }}</td>
<td>50</td>
<td>20%</td>
<td>
{{ ((50 * Taskitem.time) / 100) * 20 + 50 * Taskitem.time }}
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="invoice-footer">
<div class="invoice-footer-left">
<h5>Extra:</h5>
<div class="invoice-footer-description">{{ project.description }}</div>
</div>
<div class="invoice-footer-right">
<div>Total</div>
<div>€{{ Total }}</div>
<div class="invoice-footer">
<div class="invoice-footer-left">
<h5>Extra:</h5>
<div class="invoice-footer-description">
{{ project.description }}
</div>
</div>
<div class="invoice-footer-right">
<div>Total</div>
<div>€{{ Total }}</div>
</div>
</div>
</div>
<Loader />
</div>
</template>

@@ -99,6 +104,12 @@ export default {
InvoiceDueDate: '',
};
},
async fetch() {
this.id = await Number(this.$route.params.id);
await this.fetchMergeStates({ id: this.id });
await this.fetchProject(this.id);
},
fetchOnServer: false,
layout: 'nav&foot',
computed: {
...mapState({
@@ -113,10 +124,7 @@ export default {
},
created() {},
mounted() {
this.id = Number(this.$route.params.id);
this.fetchMergeStates({ id: this.id });
console.log(this.id);
this.fetchProject(this.id);

this.CreateInvoiceNumber();
this.GetDate();

Loading…
Откажи
Сачувај