aboutsummaryrefslogtreecommitdiff
path: root/src/components/BillingPage.js
diff options
context:
space:
mode:
authorMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-05-02 19:51:35 +0530
committerMikunoNaka <bokuwakanojogahoshii@yahoo.com>2021-05-02 19:51:35 +0530
commit060d935a47b244656e53c880cc9e792fd5841982 (patch)
treee5b6e106c89c9858e2e385c7a1ed37cb94cb1d0a /src/components/BillingPage.js
parentc7768652ed63e408e19c7e68d2ab8e78c70da94f (diff)
fixed errors and added new incomplete form to register a new client
Diffstat (limited to 'src/components/BillingPage.js')
-rw-r--r--src/components/BillingPage.js37
1 files changed, 27 insertions, 10 deletions
diff --git a/src/components/BillingPage.js b/src/components/BillingPage.js
index 6ebaa1c..be2e299 100644
--- a/src/components/BillingPage.js
+++ b/src/components/BillingPage.js
@@ -12,6 +12,8 @@ import axios from "axios";
import AddNewItemForm from "./Form/Items/AddNewItemForm";
import RegisterItemForm from "./Form/Items/RegisterItemForm";
+import RegisterPersonForm from "./Form/People/RegisterPersonForm";
+
import MetaInfoForm from "./Form/MetaInfoForm";
import ItemsDisplay from "./Display/ItemsDisplay";
@@ -19,7 +21,8 @@ import SummaryDisplay from "./Display/SummaryDisplay";
const BillingPage = () => {
const [savedItems, getSavedItems] = useState([]);
- const [registerFormVisibility, setRegisterFormVisibility] = useState(false);
+ const [registerItemFormVisibility, setRegisterItemFormVisibility] = useState(false);
+ const [registerPersonFormVisibility, setRegisterPersonFormVisibility] = useState(false);
const getRegisteredItems = () => {
axios.get(`/api/items`)
@@ -49,21 +52,35 @@ const BillingPage = () => {
return (
<>
- <AddNewItemForm savedItems={savedItems}
- addItem={getItems}
- defGSTValue={defGSTValue}
- registerFormVisibility={setRegisterFormVisibility}
- />
-
- {registerFormVisibility &&
+ {registerItemFormVisibility &&
<RegisterItemForm
defGSTValue={defGSTValue}
updateItemsList={getRegisteredItems}
- setVisibility={setRegisterFormVisibility}
+ setVisibility={setRegisterItemFormVisibility}
/>
}
- <ItemsDisplay items={items} defGSTValue={defGSTValue}/>
+ {registerPersonFormVisibility &&
+ <RegisterPersonForm
+ defGSTValue={defGSTValue}
+ updateItemsList={getRegisteredItems}
+ setVisibility={setRegisterPersonFormVisibility}
+ />
+ }
+
+ <AddNewItemForm
+ savedItems={savedItems}
+ addItem={getItems}
+ defGSTValue={defGSTValue}
+ registerItemFormVisibility={setRegisterItemFormVisibility}
+ registerPersonFormVisibility={setRegisterPersonFormVisibility}
+ />
+
+ <ItemsDisplay
+ items={items}
+ defGSTValue={defGSTValue}
+ />
+
<div className={"BillingPageFlex"}>
<MetaInfoForm/>
<SummaryDisplay items={items}/>