New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Payment method report fix #2531
Conversation
The payment method report was showing the payment method as `payment_method` instead of `title` (e.g. "cash" instead of "Cash" or "credit_card" instead of "Credit Card".
"FROM ar_activity AS a " . | ||
"JOIN form_encounter AS fe ON fe.pid = a.pid AND fe.encounter = a.encounter " . | ||
"JOIN forms AS f ON f.pid = a.pid AND f.encounter = a.encounter AND f.formdir = 'newpatient' " . | ||
"LEFT JOIN ar_session AS s ON s.session_id = a.session_id " . | ||
"LEFT JOIN insurance_companies AS i ON i.id = s.payer_id " . | ||
"LEFT JOIN list_options AS l ON l.option_id = s.payment_method " . | ||
"WHERE ( a.pay_amount != 0 OR a.adj_amount != 0 )"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @TheYairDa , thanks for the pull request, you'll need to tie list_id to payment_method or else you'll grab entries meant for pricelevel
@@ -588,7 +589,7 @@ function sel_procedure() { | |||
if (empty($row['session_id'])) { | |||
$rowmethod = trim($row['memo']); | |||
} else { | |||
$rowmethod = trim($row['payment_method']); | |||
$rowmethod = trim($row['title']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than querying list_options, much better to use the following getListItemTitle function on the option_id (will collect the title from an option_id and also translate it):
https://github.com/openemr/openemr/blob/master/library/options.inc.php#L3756
Thank you @stephenwaite @bradymiller. I've implemented your feedback, please give it a review as I'm not too familiar with php syntax (I've tested the edits and they work on my instance).
Thank you @stephenwaite @bradymiller. I've implemented your feedback, please give it a review as I'm not too familiar with php syntax (I've tested the edits and they work on my instance). |
hi @TheYairDa , Code looks good and bringing this into codebase. Thanks for the fix and congrats on your first OpenEMR commit!! -brady |
The payment method report was showing the payment method as
payment_method
instead oftitle
(e.g. "cash" instead of "Cash" or "credit_card" instead of "Credit Card".