Invoice with different payer
I am trying to setup my invoice part of my patient database, so that I can choose a different payer than the patient. Sometimes it is an insurance company, the patients company, etc that should be billed.
In the patients table I have the following fields:
I would like to be able to click a two choices radiobutton: ("Patient " and "Company")(I would like to avoid to click on a button/run a script every time I need to generate the billing address as the billing address would rarely change. That´s why I would like a radiobutton) and depending on what radiobutton I have marked, I would like the following fields (I have created in the invoice table) to be populated :
If I mark the "Patient" radiobutton it should get the information from the patient table field mentioned in the beginning.
If I mark the "Company" radiobutton it would be perfect if it could get the information from PatientCompany (which is a valuelist and just the name of the company) or, if the company is not created in this list, just manually input it.
My plan was to use "PayerName"... etc as a merge field on the invoice layout to get the correct information on the invoice.
I need it to be a lookup of some kind, so that all the former invoices of the patient don´t change when I make changes to the payer ( I know that I could probably use "set field" in a script if the changing of all the former invoices wasn´t a problem, but I don´t know if I could create it somehow different)
Any thoughts on how it can be done would be greatly appreciated, thanks!