Day 4: the heading, file initialization and tables for input of data
In between the header tags type Accounts Receivable Program for. Enclose it with h1 tags. <h1> and </h1>
Now for the sub heading. <h3>Bromley's Mens Wear</h3>
Save and test your application as a web page.
File Initialiation
The first thing in the nav section is a button when pressed initializes the localStorage area and sets the variables to zero.
Copy the information for javaScript function initialize.
Paste the information into Notepad++ in between the script tags.
Save your file in your working folder.
The variable naming process is quite easy.
We have three customer variables named customer1, customer2, customer3
We have three transactions for each customer.
Each transaction has three inputs: date, debit or charge and credit or payment.
Customer one is A, customer 2 is B, and customer 3 is C
Using a combination of customers and transactions, variables can be determined.
After initializing the variables, setting them equal to nothing, they are stored in the local storage of html.
To see the saved variables, you need to get into the javascript debugger.
On Chrome, after you have run the application, press the F12 key, click on >> then application , then local storage, then file.
Don't run your application yet, since we do not have the code for the button, that executes the initialization function.
The input table for customer 1,2,3
I used a table to organize the tags for a user to input information. I included table headers for each category. Below is the HTML5 code for the input part of the program.
Copy the information for the table for data entry.
Paste the information into Notepad++ in the nav section.
Save your file in your working folder and save your application.
Run your program and press the initialization button. Press F12 key and look to see that all your variables have been set to null or zero.
Day 5: Entering Data and Testing Accuracy
There are three inputs per transaction. The one for the date allows you to click on the icon and see a calendar for the current month, then you can select the date by clicking on it.
The numbers can be input by clicking on the up and down arrows to find the amount you need. The maximum amount is 500. After entering the whole number, you can then key in a decimal point and the cents.
Getting the information from the user JQuery
Javascript needs to get the information from user input, and save the transaction. Here is the jQuery code that activates after the buttons are pressed to store the records.
Copy the information for the javascript functions.
Paste the information into Notepad++ in the script section of your application.
Save the file in your working folder.
The save procedure on button clicks
There are three buttons, one for each customer. When the button is clicked, the javaScript code gets the information input by the user and then stores it in local storage in key pairs.
If the variable already exists in local storage, It will not be overwritten if nothing is entered.
Run the application and enter the following information for customer 1. Press the store record button. Press F12 to open the javasctipt debugger to see if the information you entered got saved in local storage.
Customer 1 is Janice Deerfield
Date
Charge
Payment
May 28
300.94
50.00
May 29
42.95
11.49
May 30
200.65
37.87
Run the application and enter the following information for customer 2. Press the store record button. Press F12 to open the javasctipt debugger to see if the information you entered got saved in local storage.
Customer 2 is Alberto Gomez
Date
Charge
Payment
May 31
65.99
2.87
June 1
193.87
29.52
June2
25.53
19.99
Run the application and enter the following information for customer 3. Press the store record button. Press F12 to open the javasctipt debugger to see if the information you entered got saved in local storage.