Please some one tell me the reason for this. some times I got -0.00 as balance in patient ledger. Client is asking for reason. I cant able to explain. But fixed the issue. It is disappointing very much.
Not sure what you mean by “patient ledger”. Please indicate exactly what you do to select the report in question, and where in that report the -0.00 appears, and I can surely point you in the right direction.
This is also something I have experienced on our install. I just reproduced the issue with patient “John Doe” on the demo. The only place I’m seeing the -0 is in the billing view of the encounters frame. The -0 does not appear on the billing ledger (statement) or billing widget above patient demographics.
I haven’t looked into the code, but it doesn’t seem there is a database entry for this value. Is this balance calculated on the fly from (Charge - Adjustment - Payment = Balance)? If so, perhaps the above fix can be utilized in /interface/patient_file/history/encounters.php
Rod,
Got a solution 0.00 instead of -0.00 while i were use round(),But i need to make sure is this is right fix.Also is there any chance to get -0.00 in any cases.please let me know.
I think if any PHP float is negative then the negative sign appears. This can happen because of computer arithmetic where string or integer formats are converted or other reasons. It appears the rounding will fix it because the negative values are in the higher decimal places. To be certain, you should create a set of test cases.
My suggestion was to modify the oeFormatMoney() function in library/formatting.inc.php. This is what takes a monetary amount which might be floating point and converts it to display format. For example after the “function” line try adding this:
$amount = round($amount, $GLOBALS) + 0;
That’s just a suggestion based on the link in your first post. If it doesn’t work, try some other tweak in that same location. Doing it there will also take care of the same problem in other areas.