Skip to content
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

Merged
merged 2 commits into from Jul 11, 2019
Merged

Payment method report fix #2531

merged 2 commits into from Jul 11, 2019

Conversation

TheYairDa
Copy link
Contributor

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".

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 )";
Copy link
Sponsor Member

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']);
Copy link
Sponsor Member

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).
@TheYairDa
Copy link
Contributor Author

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).

@bradymiller
Copy link
Sponsor Member

hi @TheYairDa , Code looks good and bringing this into codebase. Thanks for the fix and congrats on your first OpenEMR commit!! -brady

@bradymiller bradymiller merged commit 0012b2c into openemr:master Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants