aboutsummaryrefslogtreecommitdiff
path: root/src/views
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-10-16 12:46:41 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.xyz>2022-10-16 12:46:41 +0530
commit5f8407ae4c60922057e2f88f65178773786bddb4 (patch)
tree0016085e04520cd8f831374b2c7cc6342e1c92a2 /src/views
parent097a393b2bf170d69ba1cef16c5e70f204e2fe65 (diff)
calculating currency/other floating point values with currency.js
Diffstat (limited to 'src/views')
-rw-r--r--src/views/invoice/new.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/views/invoice/new.js b/src/views/invoice/new.js
index 429808f..be180cf 100644
--- a/src/views/invoice/new.js
+++ b/src/views/invoice/new.js
@@ -21,7 +21,7 @@ import ItemTable from '../../components/tables/invoice-item-table';
import InvoiceSummary from '../../components/tables/invoice-summary';
import { InvoiceClient } from '../../classes/client';
-import { calcSum } from '../../classes/item';
+import { calcSum, currency } from '../../classes/item';
import { useState, useEffect } from 'react';
@@ -31,7 +31,13 @@ const NewInvoicePage = () => {
const [items, setItems] = useState([]);
//const [isInterstate, setIsInterstate] = useState(false);
const isInterstate = false; // temporary
- const [sum, setSum] = useState({});
+ const [sum, setSum] = useState({
+ GST: currency(0),
+ Discount: currency(0),
+ UnitPrice: currency(0),
+ Amount: currency(0),
+ Quantity: currency(0)
+ });
useEffect(() => setShippingAddressId(-1), [client]);