aboutsummaryrefslogtreecommitdiff
path: root/src/views/EditInvoice.vue
diff options
context:
space:
mode:
Diffstat (limited to 'src/views/EditInvoice.vue')
-rw-r--r--src/views/EditInvoice.vue12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/views/EditInvoice.vue b/src/views/EditInvoice.vue
index 69afc7e..0b6fa97 100644
--- a/src/views/EditInvoice.vue
+++ b/src/views/EditInvoice.vue
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue'
-import { useRoute } from "vue-router"
+import { useRoute, useRouter } from "vue-router"
import { useToast } from 'vue-toast-notification'
import axios from 'axios'
@@ -10,12 +10,14 @@ import { calculate } from "./../classes/invoice_item"
import invoiceHeader from './../components/invoice_header.vue'
import itemSelector from './../components/item_selector.vue'
import invoiceItemsTable from './../components/invoice_items_table.vue'
+import invoiceSummary from './../components/invoice_summary.vue'
const toast = useToast({
position: 'top-right'
})
const route = useRoute()
+const router = useRouter()
const invoiceId = route.params.id
const invoice = ref(new Invoice())
@@ -58,6 +60,10 @@ const refreshItems = async () => {
itemsTableIsLoading.value = false
}
+const handleSubmit = () => {
+ router.push({path: `/invoice/view/${invoiceId}`})
+}
+
onMounted(() => {
getInvoice()
})
@@ -73,4 +79,8 @@ onMounted(() => {
:items="items"
:isLoading="itemsTableIsLoading"
@refresh="refreshItems()" />
+ <invoiceSummary
+ :items="items"
+ :isLoading="itemsTableIsLoading"/>
+ <button class="btn btn-primary" @click="handleSubmit">Preview (Danger)</button>
</template>