Skip to content

Commit

Permalink
fix: separate pt and enc billing note when saving invoice(openemr#7296)
Browse files Browse the repository at this point in the history
* separate out pt and enc billing note

* comment
  • Loading branch information
stephenwaite authored Mar 26, 2024
1 parent 3591dc6 commit 9b46487
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions interface/billing/sl_eob_invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ function updateFields(payField, adjField, balField, coPayField, isFirstProcCode)
$payer_type = $matches[1];
}

if (!empty($_POST['form_save']) || !empty($_POST['form_cancel']) || !empty($_POST['isLastClosed']) || !empty($_POST['billing_note'])) {
if (!empty($_POST['form_save']) || !empty($_POST['form_cancel']) || !empty($_POST['isLastClosed']) || !empty($_POST['enc_billing_note'])) {
if (!empty($_POST['form_save'])) {
if (!CsrfUtils::verifyCsrfToken($_POST["csrf_token_form"])) {
CsrfUtils::csrfNotVerified();
Expand Down Expand Up @@ -417,7 +417,7 @@ function updateFields(payField, adjField, balField, coPayField, isFirstProcCode)
if (!$debug && !$save_stay && !$_POST['isLastClosed']) {
echo "doClose();\n";
}
if (!$debug && ($save_stay || $_POST['isLastClosed'] || $_POST['billing_note'])) {
if (!$debug && ($save_stay || $_POST['isLastClosed'] || $_POST['enc_billing_note'])) {
if ($_POST['isLastClosed']) {
// save last closed level
$form_done = 0 + $_POST['form_done'];
Expand All @@ -430,9 +430,9 @@ function updateFields(payField, adjField, balField, coPayField, isFirstProcCode)
}
}

if ($_POST['billing_note']) {
// save last closed level
sqlStatement("UPDATE form_encounter SET billing_note = ? WHERE pid = ? AND encounter = ?", array($_POST['billing_note'], $patient_id, $encounter_id));
if ($_POST['enc_billing_note']) {
// save enc billing note
sqlStatement("UPDATE form_encounter SET billing_note = ? WHERE pid = ? AND encounter = ?", array($_POST['enc_billing_note'], $patient_id, $encounter_id));
}

// will reload page w/o reposting
Expand Down Expand Up @@ -509,8 +509,14 @@ function updateFields(payField, adjField, balField, coPayField, isFirstProcCode)
</div>
<div class="form-row">
<div class="form-group col-lg">
<label class="col-form-label" for="billing_note"><?php echo xlt('Billing Note'); ?>:</label>
<textarea name="billing_note" id="billing_note" class="form-control" cols="5" rows="2"><?php echo text(($pdrow['billing_note'] ?? '')) . "\n" . text(($bnrow['billing_note'] ?? '')); ?></textarea>
<label class="col-form-label" for="pt_billing_note"><?php echo xlt('Patient Billing Note'); ?>:</label>
<textarea name="pt_billing_note" id="pt_billing_note" class="form-control" cols="5" rows="1" readonly><?php echo text($pdrow['billing_note'] ?? ''); ?></textarea>
</div>
</div>
<div class="form-row">
<div class="form-group col-lg">
<label class="col-form-label" for="enc_billing_note"><?php echo xlt('Encounter Billing Note'); ?>:</label>
<textarea name="enc_billing_note" id="enc_billing_note" class="form-control" cols="5" rows="2"><?php echo text($bnrow['billing_note'] ?? ''); ?></textarea>
</div>
</div>
<div class="form-row">
Expand Down

0 comments on commit 9b46487

Please sign in to comment.