Skip to content

Camera: Functions

Kev edited this page Apr 26, 2020 · 2 revisions

Functions:

1. wrongStep

  • Redirects the user back to step 1.
  • This function would only activate if there's a BUG.
  • Changes the state.

2. nextStep

  • Moves onto the next step of the multi-step form.
  • Changes the state.

3. prevStep

  • Moves onto the previous step of the multi-step form.
  • Changes the state.

4. handleChange

  • Handles form changes.
  • Changes the state.

5. changeSubtotal

  • Changes the subtotal.
  • Changes the state.

6. changeTax

  • Changes the tax.
  • Changes the state.

7. setTax

  • If there is no tax set, it is defaulted to be 0.
  • Changes the state.

8. changeTaxPercent

  • Using the subtotal and tax, calculate the tax percentage.
  • Changes the state.

9. changeTotal

  • Using the subtotal and tax, calculate the total.
  • Changes the state.

10. handleImageChange

  • Given an image, reads it, and saves it as a state. It also resets the last image data.
  • Changes the state.

11. generateText

  • Using Tesseract, generate the text of the image.
  • Changes the state.

12. parse

  • Parses the text and obtains appropriate values.
  • Changes the state.

13. resetParse

  • It resets the parses data. So resets, subtotal, tax, taxPercent, total, and orders.
  • Changes the state.

14. changeOrderQuantity

  • Changes the order quantity of an order.
  • Changes the state.

15. checkOrderQuantity

  • Check to see if the order quantity of an order is blank or less than or equal to zero.
  • Results a boolean expression

16. changeOrders

  • Changes the order name of an order.
  • Changes the state.

17. setOrders

  • If there is no order name of an order, it is automatically filled in.
  • Changes the state.

18. changeOrderCost

  • Changes the order cost of an order.
  • Changes the state.

19. checkOrderCost

  • Check to see if the order quantity of an order is blank or less than to zero.
  • Results a boolean expression

20. removeOrderSpecificRow

  • Removes an order.
  • Changes the state.

21. addOrderRow

  • Add an order.
  • Changes the state.

22. changeNames

  • Changes the name of a user.
  • Changes the state.

23. setNames

  • If there is no name of a user, it is automatically filled in.
  • Changes the state.

24. changeCheck

  • Changes the checkbox of a user.
  • Changes the state.

25. userSearch

  • Searches for the user inside the database.
  • Changes the state.

26. checkUsers

  • Checks to see if the users are all found inside the database.
  • Results a boolean expression.

27. removeNameSpecificRow

  • Removes a user.
  • Changes the state.

28. addNameRow

  • Add a user.
  • Changes the state.

29. changeAssociation

  • Changes the association of an order.
  • Changes the state.

30. checkAssociation

  • Check to see if the association of an order is blank.
  • Results a boolean expression.

31. resetAssociation

  • It resets the association of an order.
  • Changes the state.

32. setNameSubtotal

  • It sets the subtotal for each user. It uses the association and cost of the order.
  • Changes the state.

33. setNamePayment

  • It sets the tax and total for each user. It uses the subtotal and tax percentages.
  • Changes the state.

34. resetNamePayment

  • It resets the subtotal, tax, and total for each user.
  • Changes the state.

35. setNameTotal

  • It creates a new user that contains the subtotal, tax, and total of all the users.
  • Changes the state.

36. resetNameTotal

  • It removes the new user that contains the subtotal, tax, and total of all the users.
  • Changes the state.