Jump to content

Automatic entry of invoice items

This topic is 7217 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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.

Link to comment
Share on other sites


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.

Link to comment
Share on other sites

This topic is 7217 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.