From 464dac56714f4fb187785abda04bf3f2170af2a2 Mon Sep 17 00:00:00 2001
From: Vidhu Kant Sharma <vidhukant@vidhukant.com>
Date: Thu, 7 Dec 2023 04:22:03 +0530
Subject: showing more useful information in invoice items table

---
 src/components/invoice_items_table.vue | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

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

diff --git a/src/components/invoice_items_table.vue b/src/components/invoice_items_table.vue
index 8d6ea6a..865ade2 100644
--- a/src/components/invoice_items_table.vue
+++ b/src/components/invoice_items_table.vue
@@ -11,11 +11,7 @@ const toast = useToast({
 
 const handleDelete = async (id) => {
   try {
-    const res = await axios.delete(`/invoice/item/${id}`)
-    if (res.status === 200) {
-      toast.success('Successfully deleted item')
-    }
-
+    await axios.delete(`/invoice/item/${id}`)
     emit("refresh")
   } catch (err) {
     toast.error('An unhandled exception occoured. Please check logs')
@@ -40,7 +36,9 @@ const handleDelete = async (id) => {
         <th scope="col">Brand</th>
         <th scope="col">HSN</th>
         <th scope="col">Unit Price</th>
-        <th scope="col">UOM</th>
+        <th scope="col">GST <span class="sup text-muted">%</span></th>
+        <th scope="col">Quantity <span class="sup text-muted">Unit</span></th>
+        <th scope="col">Amount</th>
 
         <th scope="col" class="table-action-column">
           <div class="wrapper">
@@ -60,7 +58,11 @@ const handleDelete = async (id) => {
         <td>{{ item.BrandName }}</td>
         <td>{{ item.HSN }}</td>
         <td>{{ item.UnitPrice }}</td>
-        <td>{{ item.UnitOfMeasure }}</td>
+        <td>
+          {{ item.GSTValue }} <span class="sup text-muted">{{ item.GSTPercentage }}%</span>
+        </td>
+        <td>{{ item.Quantity }} <span class="sup text-muted">{{ item.UnitOfMeasure }}</span></td>
+        <td>{{ item.TotalAmount }} <span class="sup text-muted">{{ item.AmountWithoutGST }} + {{ item.TotalGSTValue }}</span> </td>
 
         <td class="table-action-column">
           <div class="wrapper">
-- 
cgit v1.2.3

