From 13faea9acadc8d640bbe1e0d1ede4dbdcd69e7fa Mon Sep 17 00:00:00 2001 From: MikunoNaka Date: Mon, 3 May 2021 22:01:52 +0530 Subject: added a form to manipulate some data about the document and the client info --- src/components/Form/People/SelectClientForm.js | 107 +++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 src/components/Form/People/SelectClientForm.js (limited to 'src/components/Form/People') diff --git a/src/components/Form/People/SelectClientForm.js b/src/components/Form/People/SelectClientForm.js new file mode 100644 index 0000000..139ffdd --- /dev/null +++ b/src/components/Form/People/SelectClientForm.js @@ -0,0 +1,107 @@ +/* + * OpenBills - Self hosted browser app to generate and keep track of simple invoices + * Version - 0 + * Licensed under the MIT license - https://opensource.org/licenses/MIT + * + * Copyright (c) 2021 Vidhu Kant Sharma +*/ + +import React, { useState } from "react"; +import "./../Form.scss"; + +import ClientInfoDisplay from "./../../Display/ClientInfoDisplay"; + + +const DocumentInfoForm = (props) => { + const [clientID, setClientID] = useState(""); + /* TODO: implement a way such that the database also + * gives the ID of the client and all the functions + * are carried out from the ID because if two people + * with same name are added then this shit is done for + */ + + const selectPersonPrompt = "start typing here"; + const registerPersonPrompt = "add new"; + + // const emptyPersonNames = [enterItemNamePrompt, registerItemPrompt, ""]; + + // No need for this code but just in case + // Extract the model names from savedItems + /* + let savedPeopleNames = []; + if (props.savedPeople !== null) { + for (let i = 0; i < props.savedPeople.length; i++) { + savedPeopleNames.push(props.savedPeople[i].Name); + } + }*/ + + // set description and price + // when item is entered + /* + const setItemInfo = (itemName) => { + for (let i = 0; i < props.savedItems.length; i++) { + const mod = props.savedItems[i].Model.toLowerCase(); + const desc = props.savedItems[i].Description; + const price = props.savedItems[i].Price; + const hsn = props.savedItems[i].HSN; + const gst = props.savedItems[i].GST; + + if (mod === itemName) { + setItemDescValue(desc); + setItemPriceValue(price); + setItemHSNValue(hsn); + setItemGSTValue(gst); + break; + } + } + } + */ + + /* + const resetAllValues = () => { + setItemNameValue(""); + setItemDescValue(""); + setItemQtyValue(1); + setItemPriceValue(1); + setItemDiscountValue(0); + setItemHSNValue(0); + setItemGSTValue(props.defGSTValue); + } + */ + + return ( +
+ + +
+ ); +} + +export default DocumentInfoForm; -- cgit v1.2.3