# Receipt for Payment

**URL:** <https://community.open-emr.org/t/receipt-for-payment/3078>\
**Category:** Day-to-Day Users\
**Created:** [April 22, 2015, 8:02pm UTC](https://community.open-emr.org/t/receipt-for-payment/3078 "2015-04-22T20:02:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [April 22, 2015, 8:02pm UTC](https://community.open-emr.org/t/receipt-for-payment/3078/1 "2015-04-22T20:02:12Z")

</div>

**[arnabnaha](https://sourceforge.net/u/arnabnaha/)** wrote on [Wednesday, April 22, 2015](https://sourceforge.net/p/openemr/discussion/202504/thread/36b7429b/#b841):

Hello…  
After doing an encounter with a patient, we enter the fee details to the fee sheet. Now The patient pays me the money by cash for the encounter. I click Payments in the left nav and enter the amount paid by the patient. (In India, we have self payment, no insurance issues)

After saving it, it produces a receipt to be printed.

Can we have total Amount paid and Due amount shown on the receipt just like the statement? It would be really useful.

Dr. Arnab Naha

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [April 22, 2015, 8:21pm UTC](https://community.open-emr.org/t/receipt-for-payment/3078/2 "2015-04-22T20:21:21Z")

</div>

**[fsgl](https://sourceforge.net/u/fsgl/)** wrote on [Wednesday, April 22, 2015](https://sourceforge.net/p/openemr/discussion/202504/thread/36b7429b/#9db4):

Menu\>Popups\>Payment.

It will generate one receipt for multiple dates of service.

The closest we have to a Patient Ledger is Past Documents & Encounters Billing View. Take screenshot of the DOS’ & print.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [April 22, 2015, 8:25pm UTC](https://community.open-emr.org/t/receipt-for-payment/3078/3 "2015-04-22T20:25:02Z")

</div>

**[arnabnaha](https://sourceforge.net/u/arnabnaha/)** wrote on [Wednesday, April 22, 2015](https://sourceforge.net/p/openemr/discussion/202504/thread/36b7429b/#8dbb):

Menu\>popups\>payments and Left menu\>fees\>Payments is all same fsgl. My question is regarding adding a line in the printed receipt about “TOTAL AMOUNT PAID” and " AMOUNT DUE"

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [April 22, 2015, 9:36pm UTC](https://community.open-emr.org/t/receipt-for-payment/3078/4 "2015-04-22T21:36:35Z")

</div>

**[fsgl](https://sourceforge.net/u/fsgl/)** wrote on [Wednesday, April 22, 2015](https://sourceforge.net/p/openemr/discussion/202504/thread/36b7429b/#a778):

Payment will tally all payments giving a total, just not balance due.

Printing Payment will give total paid while printing Patient Statement will give balance due.

You can try your hand at changing statement.inc.php to add a tally of all payments.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [April 23, 2015, 2:48am UTC](https://community.open-emr.org/t/receipt-for-payment/3078/5 "2015-04-23T02:48:07Z")

</div>

**[banaitv](https://sourceforge.net/u/banaitv/)** wrote on [Thursday, April 23, 2015](https://sourceforge.net/p/openemr/discussion/202504/thread/36b7429b/#b841/a367):

Please correct. In India we have multiple modes of payment… Self paying, insurance, paid by government eg CGHS offices.

Vaibhav Banait

-----Original Message-----  
From: “Arnab Naha” [arnabnaha@users.sf.net](mailto:arnabnaha@users.sf.net)  
Sent: ‎23-‎04-‎2015 01:32  
To: "[openemr:discussion] " [202504@discussion.openemr.p.re.sf.net](mailto:202504@discussion.openemr.p.re.sf.net)  
Subject: [openemr:discussion] Receipt for Payment

Hello…  
After doing an encounter with a patient, we enter the fee details to the fee sheet. Now The patient pays me the money by cash for the encounter. I click Payments in the left nav and enter the amount paid by the patient. (In India, we have self payment, no insurance issues)  
After saving it, it produces a receipt to be printed.  
Can we have total Amount paid and Due amount shown on the receipt just like the statement? It would be really useful.  
Dr. Arnab Naha

Receipt for Payment

Sent from [sourceforge.net](http://sourceforge.net) because you indicated interest in [https://sourceforge.net/p/openemr/discussion/202504/](https://sourceforge.net/p/openemr/discussion/202504/)  
To unsubscribe from further messages, please visit [https://sourceforge.net/auth/subscriptions/](https://sourceforge.net/auth/subscriptions/)

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [April 23, 2015, 3:10am UTC](https://community.open-emr.org/t/receipt-for-payment/3078/6 "2015-04-23T03:10:25Z")

</div>

**[arnabnaha](https://sourceforge.net/u/arnabnaha/)** wrote on [Thursday, April 23, 2015](https://sourceforge.net/p/openemr/discussion/202504/thread/36b7429b/#b4d2):

Yes vaibhav…In India we have multiple modes of payment but insurance, ESI, CGHS and others are mainly limited to hospitals…very few independent private practitioners use them…me myself have self payment only…more than 90% of doctors in india have self payment as the sole option. Just needed addition of two lines at the end of the receipt…one called total amount paid and the other amount fue…if we add these two lines, the receipt will really look like a receipt…

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [April 23, 2015, 3:19am UTC](https://community.open-emr.org/t/receipt-for-payment/3078/7 "2015-04-23T03:19:53Z")

</div>

**[banaitv](https://sourceforge.net/u/banaitv/)** wrote on [Thursday, April 23, 2015](https://sourceforge.net/p/openemr/discussion/202504/thread/36b7429b/#b841/03ab):

Dear Arnab  
Could you modify the report template and prescription template to include headers and footers as are conventional in most of our clinics. If so would you like to share those with us?

Vaibhav Banait

-----Original Message-----  
From: “Arnab Naha” [arnabnaha@users.sf.net](mailto:arnabnaha@users.sf.net)  
Sent: ‎23-‎04-‎2015 01:32  
To: "[openemr:discussion] " [202504@discussion.openemr.p.re.sf.net](mailto:202504@discussion.openemr.p.re.sf.net)  
Subject: [openemr:discussion] Receipt for Payment

Hello…  
After doing an encounter with a patient, we enter the fee details to the fee sheet. Now The patient pays me the money by cash for the encounter. I click Payments in the left nav and enter the amount paid by the patient. (In India, we have self payment, no insurance issues)  
After saving it, it produces a receipt to be printed.  
Can we have total Amount paid and Due amount shown on the receipt just like the statement? It would be really useful.  
Dr. Arnab Naha

Receipt for Payment

Sent from [sourceforge.net](http://sourceforge.net) because you indicated interest in [https://sourceforge.net/p/openemr/discussion/202504/](https://sourceforge.net/p/openemr/discussion/202504/)  
To unsubscribe from further messages, please visit [https://sourceforge.net/auth/subscriptions/](https://sourceforge.net/auth/subscriptions/)

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [April 23, 2015, 3:25am UTC](https://community.open-emr.org/t/receipt-for-payment/3078/8 "2015-04-23T03:25:31Z")

</div>

**[arnabnaha](https://sourceforge.net/u/arnabnaha/)** wrote on [Thursday, April 23, 2015](https://sourceforge.net/p/openemr/discussion/202504/thread/36b7429b/#79f6):

Dear vaibhab…i am not a developer…i am a doctor…dont know php and coding much…only learnt 1% while testing openemr for the last 5 yrs. Neways…you dont need to print headers along with the prescriptions. What I do is, I have preprinted A4 sheets with headers and I adjusted the pdf from openemr globals to print on that preprinted sheets…that is quite convenient and good about openemr. None of the software prints headers and footers, its better to have them preprinted and rest of the matter should be printed by the software.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [April 23, 2015, 10:19am UTC](https://community.open-emr.org/t/receipt-for-payment/3078/9 "2015-04-23T10:19:37Z")

</div>

**[visolveemr](https://sourceforge.net/u/visolveemr/)** wrote on [Thursday, April 23, 2015](https://sourceforge.net/p/openemr/discussion/202504/thread/36b7429b/#5cab):

Hello Arnab Naha,  
To print total Amount paid and Due amount on the receipt for the particular encounter, we can apply the following code change,

After line 363, add the following lines

```
$tot = sqlQuery("select sum(pay_amount) as tot from ar_activity where encounter=?", array($payrow['encounter']));
$fe = sqlQuery("select fee as fees from billing where encounter=?", array($payrow['encounter']));
$due = $fe['fees'] - $tot['tot'];

```

and after line 455 add

```
<tr>
	<td><?php echo xlt('Total Amount Paid'); ?>:</td>
	<td><?php echo text($tot['tot']) ?></td>
</tr>
<tr>
	<td><?php echo xlt('Due Amount'); ?>:</td>
	<td><?php echo text($due) ?></td>
</tr>

```

Thanks  
_OpenEMR Customization/Support Team,  
 [ViSolve Inc](http://www.visolve.com)  
 [services@visolve.com](mailto:services@visolve.com) | Phone: 408-850-2243  
Demo’s @ [ViSolve Demo Library](http://demo.visolve.com)_

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [April 23, 2015, 10:29am UTC](https://community.open-emr.org/t/receipt-for-payment/3078/10 "2015-04-23T10:29:39Z")

</div>

**[arnabnaha](https://sourceforge.net/u/arnabnaha/)** wrote on [Thursday, April 23, 2015](https://sourceforge.net/p/openemr/discussion/202504/thread/36b7429b/#594f):

Thank you…Thank you so much visolve…awesome…it works great…

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [April 23, 2015, 10:38am UTC](https://community.open-emr.org/t/receipt-for-payment/3078/11 "2015-04-23T10:38:02Z")

</div>

**[arnabnaha](https://sourceforge.net/u/arnabnaha/)** wrote on [Thursday, April 23, 2015](https://sourceforge.net/p/openemr/discussion/202504/thread/36b7429b/#d600):

There is a small issue visolve.

Suppose a patient pays for current encounter and last day’s encounter (suppose rs. 800 for each visit) then it is showing

Amount for This Visit: 1,600.00  
Amount for Past Balance: 0.00

The amount for past visit should be 800 and amount for this visit should be 800

Total Amount Paid: 800.00  
Due Amount: 0

The total amount paid (this is the newly added part) is showing as 800 instead of 1600

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [April 23, 2015, 2:32pm UTC](https://community.open-emr.org/t/receipt-for-payment/3078/12 "2015-04-23T14:32:01Z")

</div>

**[visolveemr](https://sourceforge.net/u/visolveemr/)** wrote on [Thursday, April 23, 2015](https://sourceforge.net/p/openemr/discussion/202504/thread/36b7429b/#4858):

Hello Arnab Naha,  
After line `$var_index=0;` add,

```
$tot_charges=0;

```

replace the line `global $var_index;` with

```
global $var_index,$tot_charges;
$tot_charges += $ptpaid;

```

After the line 1238 with `calctotal();` add

```
$(document).ready(function() {
	$('#tot_char').val(<?php echo $tot_charges ?>);
});

```

After line 1223 with `<input type='text' name='form_paytotal' value='' style='color:#00aa00;width:50px' readonly />` add

```
<input type="hidden" name="tot_char" id="tot_char" value=0 />

```

Change the already added lines

```
$tot = sqlQuery("select sum(pay_amount) as tot from ar_activity where pid=?", array($form_pid));
$fe = sqlQuery("select sum(fee) as fees from billing where pid=?", array($form_pid));
$due = $fe['fees'] - ($_POST['form_paytotal'] + $_POST['tot_char']);

```

and

```
<tr>
	<td><?php echo xlt('Total Amount Paid'); ?>:</td>
	<td><?php echo text($_POST['form_paytotal'] + $_POST['tot_char']) ?></td>
</tr>
<tr>
	<td><?php echo xlt('Due Amount'); ?>:</td>
	<td><?php echo ($due) ?></td>
</tr>

```

Thanks  
_OpenEMR Customization/Support Team,  
 [ViSolve Inc](http://www.visolve.com)  
 [services@visolve.com](mailto:services@visolve.com) | Phone: 408-850-2243  
Demo’s @ [ViSolve Demo Library](http://demo.visolve.com)_

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [April 23, 2015, 3:04pm UTC](https://community.open-emr.org/t/receipt-for-payment/3078/13 "2015-04-23T15:04:41Z")

</div>

**[arnabnaha](https://sourceforge.net/u/arnabnaha/)** wrote on [Thursday, April 23, 2015](https://sourceforge.net/p/openemr/discussion/202504/thread/36b7429b/#4de8):

Did the changes…works wonderfully…Thank you so so much visolve. All issues resolved

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [April 25, 2015, 3:38am UTC](https://community.open-emr.org/t/receipt-for-payment/3078/14 "2015-04-25T03:38:10Z")

</div>

**[jjcahs](https://sourceforge.net/u/jjcahs/)** wrote on [Saturday, April 25, 2015](https://sourceforge.net/p/openemr/discussion/202504/thread/36b7429b/#b841/3e33):

Arnab,

I am wondering about the use of OpenEMR in India. If you can please reach out to me about this at your earliest convenience. Thanks,  
Jit

[jc@acehealthsolutions.com](mailto:jc@acehealthsolutions.com)

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [April 26, 2015, 7:23am UTC](https://community.open-emr.org/t/receipt-for-payment/3078/15 "2015-04-26T07:23:38Z")

</div>

**[bradymiller](https://sourceforge.net/u/bradymiller/)** wrote on [Sunday, April 26, 2015](https://sourceforge.net/p/openemr/discussion/202504/thread/36b7429b/#c660):

Hi,

Would this be change be useful for the main codebase?

-brady  
[OpenEMR](http://www.open-emr.org/)

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [April 27, 2015, 10:56am UTC](https://community.open-emr.org/t/receipt-for-payment/3078/16 "2015-04-27T10:56:40Z")

</div>

**[arnabnaha](https://sourceforge.net/u/arnabnaha/)** wrote on [Monday, April 27, 2015](https://sourceforge.net/p/openemr/discussion/202504/thread/36b7429b/#f581):

Hi brady…

Here is the changes made to the git branch. All credit to visolve for this. I would request Vi solve to include another line of “TOTAL CHARGE” in the receipt showing the total amount that needs to be paid, above the line of " Amount Paid"

> <https://github.com/arnabnaha/openemr/commit/5d4f7225684b46bcbe124186c417604a5d473773>
>
> Signed-off-by: Arnab Naha \<superarnab@gmail.com\>

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [April 27, 2015, 12:03pm UTC](https://community.open-emr.org/t/receipt-for-payment/3078/17 "2015-04-27T12:03:19Z")

</div>

**[visolveemr](https://sourceforge.net/u/visolveemr/)** wrote on [Monday, April 27, 2015](https://sourceforge.net/p/openemr/discussion/202504/thread/36b7429b/#f393):

Hello Arnab Naha,  
To include “TOTAL CHARGE” in the receipt, we can apply the following code changes in ‘interface/patient\_file/front\_payment.php’

After line 452 add,

```
<tr>
    <td><?php echo xlt('Total Charge'); ?>:</td>
    <td><?php echo text($fe['fees']) ?></td>
</tr>

```

Thanks  
_OpenEMR Customization/Support Team,  
 [ViSolve Inc](http://www.visolve.com)  
 [services@visolve.com](mailto:services@visolve.com) | Phone: 408-850-2243  
Demo’s @ [ViSolve Demo Library](http://demo.visolve.com)_

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [April 27, 2015, 12:29pm UTC](https://community.open-emr.org/t/receipt-for-payment/3078/18 "2015-04-27T12:29:26Z")

</div>

**[arnabnaha](https://sourceforge.net/u/arnabnaha/)** wrote on [Monday, April 27, 2015](https://sourceforge.net/p/openemr/discussion/202504/thread/36b7429b/#8405):

Thank you visolve…but I missed that there is already a line in the receipt where it shows the amount to be paid for a particular visit. Thank you for all the help with the coding.

Brady, if you wish you can push it to the codebase as it works well. I am not adding the last change (just above this post) by visolve to github as it is already present in the receipt.

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [April 27, 2015, 12:59pm UTC](https://community.open-emr.org/t/receipt-for-payment/3078/19 "2015-04-27T12:59:29Z")

</div>

**[arnabnaha](https://sourceforge.net/u/arnabnaha/)** wrote on [Monday, April 27, 2015](https://sourceforge.net/p/openemr/discussion/202504/thread/36b7429b/#fb8d):

Last request…

Beside the “Amount for past balance line” can the encounter Number and date of the past encounter be added for which the past balance is being collected? If there is no past balance, then no date and encounter number will appear.

Sorry for coming out in phases

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads-openemr.s3.dualstack.us-east-1.amazonaws.com/original/2X/b/bb9e4e8ae2ea7faac2e952fd9e38a3ce03aac403.png) [@system](https://community.open-emr.org/u/system)\
**Post date:** [April 28, 2015, 11:51am UTC](https://community.open-emr.org/t/receipt-for-payment/3078/20 "2015-04-28T11:51:52Z")

</div>

**[visolveemr](https://sourceforge.net/u/visolveemr/)** wrote on [Tuesday, April 28, 2015](https://sourceforge.net/p/openemr/discussion/202504/thread/36b7429b/#e878):

Hello Arnab Naha,

To include encounter number and its date for the past balance payments, apply the following code changes,

After line 370 ‘$due = $fe[‘fees’] - ($\_POST[‘form\_paytotal’] + $\_POST[‘tot\_char’]);’ add,

```
 $past_enc = sqlStatement("select encounter from payments where pid = ? and dtime = ? and amount2 != '0.00'", array($form_pid,$timestamp));
 $past_enc_date = array();
 while($row = sqlFetchArray($past_enc))
 {
 array_push($past_enc_date, sqlQuery("select encounter,date from form_encounter where encounter=?",array($row['encounter'])));
 }

```

After line 461 add,

```
<tr>
<td><?php echo xlt('Past Encounter and Date'); ?>:</td>
<td><table border=1>
<tr>
<td><b><?php echo xlt('Past Encounter No.'); ?></b></td>
<td><b><?php echo xlt('Past Encounter Date'); ?></b></td>
<?php foreach($past_enc_date as $value) { ?>
<tr>
<td> <?php echo text($value['encounter']) ?> </td>
<td> <?php echo text($value['date']) ?> </td>
</tr>
<?php } ?>
</tr>
</table></td>
</tr>

```

Thanks  
_OpenEMR Customization/Support Team,  
 [ViSolve Inc](http://www.visolve.com)  
 [services@visolve.com](mailto:services@visolve.com) | Phone: 408-850-2243  
Demo’s @ [ViSolve Demo Library](http://demo.visolve.com)_

[Next page](https://community.open-emr.org/t/receipt-for-payment/3078.md?page=2)
