Populating a Field from a Lookup Table But Editable
Posted: 2014-05-30 07:39
Hello,
I hope you guys can be patient with me as I have just started with AppGini and a newbie on PHP.
Okay, to start off, I have three tables:
Invoices
---id
---InvoiceNumber
---Customerid (which is looked up on the Customers Table)
---DueDate
Services
---id
---Service
---UnitPrice
InvoiceDetails
---id
---InvoiceNumber (which is looked up from Invoices)
---Service (which is looked up from Services)
---Qty
---Unit_Price
---Amount
Here's my problem:
1. After selecting a Service from the Services table, I want the InvoiceDetails.Unit_Price to contain the Services.UnitPrice
2. However, the user may opt to change the value of the InvoiceDetails.Unit_Price
3. After changing the value of InvoiceDetails.Unit_Price, I want InvoiceDetails.Amount to contain InvoiceDetails.Unit_Price * InvoiceDetails.Qty
Actually, the problem is I don't know how to do it.
I would appreciate any help from you guys.
Thank you so much!
I hope you guys can be patient with me as I have just started with AppGini and a newbie on PHP.
Okay, to start off, I have three tables:
Invoices
---id
---InvoiceNumber
---Customerid (which is looked up on the Customers Table)
---DueDate
Services
---id
---Service
---UnitPrice
InvoiceDetails
---id
---InvoiceNumber (which is looked up from Invoices)
---Service (which is looked up from Services)
---Qty
---Unit_Price
---Amount
Here's my problem:
1. After selecting a Service from the Services table, I want the InvoiceDetails.Unit_Price to contain the Services.UnitPrice
2. However, the user may opt to change the value of the InvoiceDetails.Unit_Price
3. After changing the value of InvoiceDetails.Unit_Price, I want InvoiceDetails.Amount to contain InvoiceDetails.Unit_Price * InvoiceDetails.Qty
Actually, the problem is I don't know how to do it.
I would appreciate any help from you guys.
Thank you so much!