aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.com>2023-12-07 05:01:08 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.com>2023-12-07 05:01:08 +0530
commit4c48edc7905d6fb16b01ea707ee7e730dff78ced (patch)
tree343839b5c7bcd7abf24ba7ef9f3ba7c33ccf78f8 /src/components
parent464dac56714f4fb187785abda04bf3f2170af2a2 (diff)
added view invoice page with print button!0.3.0
Diffstat (limited to 'src/components')
-rw-r--r--src/components/invoice_header_editor.vue2
-rw-r--r--src/components/invoice_summary.vue9
-rw-r--r--src/components/sidebar.vue4
3 files changed, 12 insertions, 3 deletions
diff --git a/src/components/invoice_header_editor.vue b/src/components/invoice_header_editor.vue
index 0a39ce5..6bd62b8 100644
--- a/src/components/invoice_header_editor.vue
+++ b/src/components/invoice_header_editor.vue
@@ -58,7 +58,7 @@ const submit = async (e: Event) => {
"customerwebsite": c.Website,
})
- route.push({ name: "edit-draft", params: { id: res.data.data.ID }})
+ route.push({ name: "edit-invoice", params: { id: res.data.data.ID }})
} catch (err: any) {
const statusCode: any = err.request.status
const res: any = JSON.parse(err.request.response)
diff --git a/src/components/invoice_summary.vue b/src/components/invoice_summary.vue
new file mode 100644
index 0000000..6ca7907
--- /dev/null
+++ b/src/components/invoice_summary.vue
@@ -0,0 +1,9 @@
+<script setup lang="js">
+import currency from "currency.js"
+
+const props = defineProps(["items", "isLoading"])
+</script>
+
+<template>
+ Total: {{ props.items.reduce((t, c) => t.add(c.TotalAmount), currency(0)) }}
+</template>
diff --git a/src/components/sidebar.vue b/src/components/sidebar.vue
index 4c4623f..ada509e 100644
--- a/src/components/sidebar.vue
+++ b/src/components/sidebar.vue
@@ -1,5 +1,5 @@
<script setup lang="js">
-import { watch, ref, toRaw } from 'vue'
+import { watch, ref } from 'vue'
import { RouterLink, useRoute } from 'vue-router'
import { BIconHouseDoor, BIconPlusSquare, BIconPersonCircle, BIconStack, BIconBuildings } from 'bootstrap-icons-vue';
@@ -36,7 +36,7 @@ watch(
<li class="nav-item">
<RouterLink
to="/invoice/new"
- :class="`nav-link ${(route.name === 'new-invoice' || route.name === 'edit-draft') ? 'active' : ''} py-3 border-secondary border-bottom text-white`"
+ :class="`nav-link ${(route.name === 'new-invoice' || route.name === 'edit-invoice') ? 'active' : ''} py-3 border-secondary border-bottom text-white`"
aria-current="page"
title="New Invoice"
data-bs-toggle="tooltip"