How i get remaining amout reducing insurance and prepayment for billing?

morevishal142 wrote on Friday, December 09, 2016:

I want to send remaining amount to payment gateway in patient portal how i calculate remaining amount reducing insurance and prepayment and which table i use for this purpose?

cmswest wrote on Friday, December 09, 2016:

hi Vishal Vilas More, take a look here, openemr/statement.inc.php at b8c19f1c59dbf5db34413e2e2ff2fb7636b8efb3 · openemr/openemr · GitHub