HTML + JavaScript small script
Budget: $20 – $100 USD
Hello,
I need an HTML + JavaScript script which adds an invoice to a database.
Requirements:
- the add invoice screen only needs to add one Invoice at a time
- each invoice has one or more Transactions (but minimum 1). There should be a button (plus sign) which allows the user to add more Transactions and a minus button which removes Transactions (the first Transaction doesn't need a remove button since there always must be at least one Transaction)
- each transaction has one or more Allocations (but minimum 1). There should be a button (plus sign) which allows the user to add more Allocations under the respective Transaction and a minus button which removes Allocations (the first Allocation in each group doesn't need a remove button since there always must be at least one Allocation per Transaction)
- when a Transaction is removed, the Allocations belonging to that Transaction must also be removed
Verification before form submission:
- the sum of all Transactions must equal the amount of the Invoice
- the sum of all Allocations under a specific Transaction must equal the amount of the Transaction
Here is an example of the basic structure:
Invoice: $1,000
Transaction 1: $800
Allocation 1.1.: $200
Allocation 1.2: $300
Allocation 1.3: $300
Transaction 2: $200
Allocation 2.1: $200
Attached is a simple html file that shows how I visually envision this screen, but I am happy to accept other ideas visually more pleasant.
In the end, I will use PHP to save this data to a database (there are separate relational tables for Invoices, Transactions - linked to the invoice_id, and Allocations - linked to transaction_id)
Thank you
I need an HTML + JavaScript script which adds an invoice to a database.
Requirements:
- the add invoice screen only needs to add one Invoice at a time
- each invoice has one or more Transactions (but minimum 1). There should be a button (plus sign) which allows the user to add more Transactions and a minus button which removes Transactions (the first Transaction doesn't need a remove button since there always must be at least one Transaction)
- each transaction has one or more Allocations (but minimum 1). There should be a button (plus sign) which allows the user to add more Allocations under the respective Transaction and a minus button which removes Allocations (the first Allocation in each group doesn't need a remove button since there always must be at least one Allocation per Transaction)
- when a Transaction is removed, the Allocations belonging to that Transaction must also be removed
Verification before form submission:
- the sum of all Transactions must equal the amount of the Invoice
- the sum of all Allocations under a specific Transaction must equal the amount of the Transaction
Here is an example of the basic structure:
Invoice: $1,000
Transaction 1: $800
Allocation 1.1.: $200
Allocation 1.2: $300
Allocation 1.3: $300
Transaction 2: $200
Allocation 2.1: $200
Attached is a simple html file that shows how I visually envision this screen, but I am happy to accept other ideas visually more pleasant.
In the end, I will use PHP to save this data to a database (there are separate relational tables for Invoices, Transactions - linked to the invoice_id, and Allocations - linked to transaction_id)
Thank you