kenseye Posted September 18, 2004 Posted September 18, 2004 I have an invoice file (table), an invoice items file and an exam file with 5 procedure fields. The exam file is related to the invoice by exam#. The invoice is related to the invoice item file by invoice#. There may be anywhere from one to five procedures per exam. I would like to create an invoice from the exam record while automatically entering each procedure as an invoice item. What is the process by which i can identify the number of procedures and enter them automatically. i thought maybe a loop checking if Procedures1-5 were empty and if not create a new invoice item setting the invoice item description = procedure.
ESpringer Posted September 19, 2004 Posted September 19, 2004 Kensey, Sorry if I'm being dense, but it seems there's exactly one invoice per exam, and that the line items on the invoice correspond to the procedures in the exam. If so, then the invoice could just be built out of the exam record. (Perhaps you have other reasons not to do so?) To do so, though, you'd have your procedures not as fields within the exam table, but as another table. Each record would have a procedure name and a field for the exam to which it belongs (probably by exam code, not by name), and any other details that go along with the procedure (cost, sequence order within the exam, whatever). If you do it that way, you don't need a script here at all: just a portal. If your invoice relates to one or more exams, and each exam has procedures (each of which has a cost), then you can have a portal from the invoice record (or the exam record) to all the procedures within the one or more exams being billed. (each procedure will count as a "line item" -- there are lots of good posts on the forums about line item / invoice structures.) There will always be obstacles if you make essentially equivalent entities (procedures within an exam) sit in different fields, rather than in a related table... I hope others will chime in, but that this will offer a start to working out your solution.
kenseye Posted September 19, 2004 Author Posted September 19, 2004 I resorted to using the go to portal line to enter the procedure into a specific line item in the portal. I need to be able to add adjustment entries into the invoice without showing on the exam. The procedure entries would not correspond 1:1.
Recommended Posts
This topic is 7373 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now