From 350105c637626f686369a1a52be08beefb5d88c7 Mon Sep 17 00:00:00 2001
From: Vidhu Kant Sharma <vidhukant@vidhukant.com>
Date: Sun, 7 Jul 2024 22:15:06 +0530
Subject: added total in words

---
 src/components/PrintPreviewFooter.vue | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'src/components/PrintPreviewFooter.vue')

diff --git a/src/components/PrintPreviewFooter.vue b/src/components/PrintPreviewFooter.vue
index 4594a92..48c9e51 100644
--- a/src/components/PrintPreviewFooter.vue
+++ b/src/components/PrintPreviewFooter.vue
@@ -1,6 +1,5 @@
 <script setup lang="ts">
-  import { toRaw, onMounted } from "vue"
-  import { InvoiceTotal } from "./../classes/invoice.ts"
+  import Converter from "number-to-words"
 
   const props = defineProps(["total"])
 </script>
@@ -9,7 +8,7 @@
   <div class="print-preview-footer">
     <div class="footer--col1">
       <div class="total-words-label"></div>
-      <div class="total-words"></div>
+      <div class="total-words">{{ Number.isFinite(props.total.TotalWithGST.value) && `${Converter.toWords(props.total.TotalWithGST.value)} only` }}</div>
     </div>
     <div class="footer--col2">
       <div class="total-summary">
@@ -36,6 +35,9 @@
 </template>
 
 <style>
+.total-words {
+  text-transform: capitalize;
+}
 .print-preview-footer {
   border: 1px solid gray;
   display: grid;
-- 
cgit v1.2.3

