From 3ebd619d89aa20b57542888ac1dac47451c4b1a9 Mon Sep 17 00:00:00 2001
From: Vidhu Kant Sharma <vidhukant@vidhukant.com>
Date: Thu, 7 Dec 2023 16:17:28 +0530
Subject: making print preview slightly better

---
 src/views/EditInvoice.vue | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

(limited to 'src/views/EditInvoice.vue')

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>
-- 
cgit v1.2.3

