Immunization saves twice on first entry [Solved]

We are experiencing an issue with the Immunization on two different installs. One is a windows server and one is a Linux server. Both are running 5.0.2(1).

When making the first entry, the system saves the same entry twice. We are not clicking print or back or anything. The double entry appears upon saving.

There are no error messages in the log nor are there any clues other than these

  PHP Notice:  Undefined variable: immuniz_amt_adminstrd

The weird thing is when I check the database, there is only one entry.

However, when I refreshed the screen without going back to the dashboard it made a new entry.

Not good. Is there anyone working on this bug?

I have dumped line 31 and the query returns the same value twice

  getImmunizationList($pid, $sortby, $showError)

In the immunization helper, I added “DISTINCT”. This stopped the double return.

  select DISTINCT i1.id ,i1.immunization_id, ...

Line 33.