3 * Payments in database can be searched through this screen and edit popup is also its part.
4 * Deletion of the payment is done with logging.
8 * @link http://www.open-emr.org
9 * @author Eldho Chacko <eldho@zhservices.com>
10 * @author Paul Simon K <paul@zhservices.com>
11 * @author Brady Miller <brady.g.miller@gmail.com>
12 * @copyright Copyright (c) 2010 Z&H Consultancy Services Private Limited <sam@zhservices.com>
13 * @copyright Copyright (c) 2019 Brady Miller <brady.g.miller@gmail.com>
14 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
18 require_once("../globals.php");
19 require_once("../../library/acl.inc");
20 require_once("../../custom/code_types.inc.php");
21 require_once("$srcdir/patient.inc");
22 require_once("$srcdir/billrep.inc");
23 require_once("$srcdir/options.inc.php");
24 require_once("$srcdir/payment.inc.php");
26 use OpenEMR\Core\Header
;
27 use OpenEMR\OeUI\OemrUI
;
29 //===============================================================================
30 //Deletion of payment and its corresponding distributions.
31 //===============================================================================
33 if (isset($_POST["mode"])) {
34 if ($_POST["mode"] == "DeletePayments") {
35 $DeletePaymentId = isset($_POST['DeletePaymentId']) ?
trim($_POST['DeletePaymentId']) : '';
36 $ResultSearch = sqlStatement("SELECT distinct encounter,pid from ar_activity where session_id =?", [$DeletePaymentId]);
37 if (sqlNumRows($ResultSearch)>0) {
38 while ($RowSearch = sqlFetchArray($ResultSearch)) {
39 $Encounter=$RowSearch['encounter'];
40 $PId=$RowSearch['pid'];
41 sqlStatement("update form_encounter set last_level_closed=last_level_closed - 1 where pid =? and encounter=?", [$PId, $Encounter]);
45 //delete and log that action
46 row_delete("ar_session", "session_id ='" . add_escape_custom($DeletePaymentId) . "'");
47 row_delete("ar_activity", "session_id ='" . add_escape_custom($DeletePaymentId) . "'");
50 $_POST["mode"] = "SearchPayment";
53 //===============================================================================
55 //===============================================================================
56 if ($_POST["mode"] == "SearchPayment") {
57 $FromDate = isset($_POST['FromDate']) ?
trim($_POST['FromDate']) : '';
58 $ToDate = isset($_POST['ToDate']) ?
trim($_POST['ToDate']) : '';
59 $PaymentMethod = isset($_POST['payment_method']) ?
trim($_POST['payment_method']) : '';
60 $CheckNumber = isset($_POST['check_number']) ?
trim($_POST['check_number']) : '';
61 $PaymentAmount = isset($_POST['payment_amount']) ?
trim($_POST['payment_amount']) : '';
62 $PayingEntity = isset($_POST['type_name']) ?
trim($_POST['type_name']) : '';
63 $PaymentCategory = isset($_POST['adjustment_code']) ?
trim($_POST['adjustment_code']) : '';
64 $PaymentFrom = isset($_POST['hidden_type_code']) ?
trim($_POST['hidden_type_code']) : '';
65 $PaymentStatus = isset($_POST['PaymentStatus']) ?
trim($_POST['PaymentStatus']) : '';
66 $PaymentSortBy = isset($_POST['PaymentSortBy']) ?
trim($_POST['PaymentSortBy']) : '';
67 $PaymentDate = isset($_POST['payment_date']) ?
trim($_POST['payment_date']) : '';
68 $QueryString .= "Select * from ar_session where ";
71 $sqlBindArray = array();
73 if ($PaymentDate=='date_val') {
74 $PaymentDateString=' check_date ';
75 } elseif ($PaymentDate=='post_to_date') {
76 $PaymentDateString=' post_to_date ';
77 } elseif ($PaymentDate=='deposit_date') {
78 $PaymentDateString=' deposit_date ';
82 $QueryString.=" $And $PaymentDateString >=?";
84 $sqlBindArray[] = DateToYYYYMMDD($FromDate);
88 $QueryString.=" $And $PaymentDateString <=?";
90 $sqlBindArray[] = DateToYYYYMMDD($ToDate);
93 if ($PaymentMethod!='') {
94 $QueryString.=" $And payment_method =?";
96 $sqlBindArray[] = $PaymentMethod;
99 if ($CheckNumber!='') {
100 $QueryString.=" $And reference like ?";
102 $sqlBindArray[] = '%' . $CheckNumber . '%';
105 if ($PaymentAmount!='') {
106 $QueryString.=" $And pay_total =?";
108 $sqlBindArray[] = $PaymentAmount;
111 if ($PayingEntity!='') {
112 if ($PayingEntity=='insurance') {
113 $QueryString.=" $And payer_id !='0'";
116 if ($PayingEntity=='patient') {
117 $QueryString.=" $And payer_id ='0'";
123 if ($PaymentCategory!='') {
124 $QueryString.=" $And adjustment_code =?";
126 $sqlBindArray[] = $PaymentCategory;
129 if ($PaymentFrom!='') {
130 if ($PayingEntity=='insurance' ||
$PayingEntity=='') {
131 //-------------------
132 $res = sqlStatement("SELECT insurance_companies.name FROM insurance_companies
133 where insurance_companies.id =?", [$PaymentFrom]);
134 $row = sqlFetchArray($res);
135 $div_after_save=$row['name'];
136 //-------------------
138 $QueryString.=" $And payer_id =?";
139 $sqlBindArray[] = $PaymentFrom;
142 if ($PayingEntity=='patient') {
143 //-------------------
144 $res = sqlStatement("SELECT fname,lname,mname FROM patient_data
145 where pid =?", [$PaymentFrom]);
146 $row = sqlFetchArray($res);
147 $fname=$row['fname'];
148 $lname=$row['lname'];
149 $mname=$row['mname'];
150 $div_after_save=$lname.' '.$fname.' '.$mname;
151 //-------------------
153 $QueryString.=" $And patient_id =?";
154 $sqlBindArray[] = $PaymentFrom;
160 if ($PaymentStatus!='') {
161 $QsString="select ar_session.session_id,pay_total,global_amount,sum(pay_amount) sum_pay_amount from ar_session,ar_activity
162 where ar_session.session_id=ar_activity.session_id group by ar_activity.session_id,ar_session.session_id
163 having pay_total-global_amount-sum_pay_amount=0 or pay_total=0";
164 $rs= sqlStatement($QsString);
165 while ($rowrs=sqlFetchArray($rs)) {
166 $StringSessionId.=$rowrs['session_id'].',';
169 $QsString="select ar_session.session_id from ar_session where pay_total=0";
170 $rs= sqlStatement($QsString);
171 while ($rowrs=sqlFetchArray($rs)) {
172 $StringSessionId.=$rowrs['session_id'].',';
175 $StringSessionId=substr($StringSessionId, 0, -1);
176 if ($PaymentStatus=='fully_paid') {
177 $QueryString.=" $And session_id in(" . add_escape_custom($StringSessionId) . ") ";
178 } elseif ($PaymentStatus=='unapplied') {
179 $QueryString.=" $And session_id not in(" . add_escape_custom($StringSessionId) . ") ";
185 if ($PaymentSortBy!='') {
186 $SortFieldOld = isset($_POST['SortFieldOld']) ?
trim($_POST['SortFieldOld']) : '';
187 $Sort = isset($_POST['Sort']) ?
trim($_POST['Sort']) : '';
188 if ($SortFieldOld==$PaymentSortBy) {
189 if ($Sort=='DESC' ||
$Sort=='') {
198 $QueryString.=" order by " . escape_sql_column_name($PaymentSortBy, ['ar_session']) . " " . escape_sort_order($Sort);
201 $ResultSearch = sqlStatement($QueryString, $sqlBindArray);
205 //===============================================================================
211 <?php Header
::setupHeader(['jquery-ui', 'datetime-picker']); ?
>
213 <?php
include_once("{$GLOBALS['srcdir']}/payment_jav.inc.php"); ?
>
214 <?php
include_once("{$GLOBALS['srcdir']}/ajax/payment_ajax_jav.inc.php"); ?
>
216 <script type
='text/javascript'>
219 $
(".medium_modal").on('click', function (e
) {
222 dlgopen('', '', 1050, 350, '', '', {
224 {text
: <?php
echo xlj('Close'); ?
>, close
: true, style
: 'default btn-sm'}
228 url
: $
(this
).attr('href')
232 $
('.datepicker').datetimepicker({
233 <?php
$datetimepicker_timepicker = false; ?
>
234 <?php
$datetimepicker_showseconds = false; ?
>
235 <?php
$datetimepicker_formatInput = true; ?
>
236 <?php
require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?
>
237 <?php
// can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
242 <script language
='JavaScript'>
245 <script language
='JavaScript'>
246 function SearchPayment()
247 {//Search validations.
248 if(document
.getElementById('FromDate').value
=='' && document
.getElementById('ToDate').value
=='' && document
.getElementById('PaymentStatus').selectedIndex
==0 && document
.getElementById('payment_method').selectedIndex
==0 && document
.getElementById('type_name').selectedIndex
==0 && document
.getElementById('adjustment_code').selectedIndex
==0 && document
.getElementById('check_number').value
=='' && document
.getElementById('payment_amount').value
=='' && document
.getElementById('hidden_type_code').value
=='' )
250 alert(<?php
echo xlj('Please select any Search Option.'); ?
>);
253 if(document
.getElementById('FromDate').value
!='' && document
.getElementById('ToDate').value
!='')
255 if(!DateCheckGreater(document
.getElementById('FromDate').value
,document
.getElementById('ToDate').value
,'<?php echo DateFormatRead();?>'))
257 alert(<?php
echo xlj('From Date Cannot be Greater than To Date.'); ?
>);
258 document
.getElementById('FromDate').focus();
262 top
.restoreSession();
263 document
.getElementById('mode').value
='SearchPayment';
264 document
.forms
[0].submit();
266 function DeletePayments(DeleteId
)
267 {//Confirms deletion of payment and all its distribution.
268 if(confirm(<?php
echo xlj('Would you like to Delete Payments?'); ?
>))
270 document
.getElementById('mode').value
='DeletePayments';
271 document
.getElementById('DeletePaymentId').value
=DeleteId
;
272 top
.restoreSession();
273 document
.forms
[0].submit();
278 function OnloadAction()
279 {//Displays message after deletion.
280 after_value
=document
.getElementById('after_value').value
;
281 if(after_value
=='Delete')
283 alert(<?php
echo xlj('Successfully Deleted'); ?
>)
286 function SearchPayingEntityAction()
288 //Which ajax is to be active(patient,insurance), is decided by the 'Paying Entity' drop down, where this function is called.
289 //So on changing some initialization is need.Done below.
290 document
.getElementById('type_code').value
='';
291 document
.getElementById('hidden_ajax_close_value').value
='';
292 document
.getElementById('hidden_type_code').value
='';
293 document
.getElementById('div_insurance_or_patient').innerHTML
=' ';
294 document
.getElementById('description').value
='';
295 if(document
.getElementById('ajax_div_insurance'))
297 $
("#ajax_div_patient_error").empty();
298 $
("#ajax_div_patient").empty();
299 $
("#ajax_div_insurance_error").empty();
300 $
("#ajax_div_insurance").empty();
301 $
("#ajax_div_insurance").hide();
302 document
.getElementById('payment_method').style
.display
='';
306 <script language
="javascript" type
="text/javascript">
307 document
.onclick
=HideTheAjaxDivs
;
310 .class1
{width
:125px
;}
311 .class2
{width
:250px
;}
312 .class3
{width
:100px
;}
313 .class4
{width
:103px
;}
314 #ajax_div_insurance {
317 background
-color
: #FBFDD0;
318 border
: 1px solid
#ccc;
324 background
-color
: #FBFDD0;
325 border
: 1px solid
#ccc;
329 border
-bottom
: 1px solid black
;
332 border
-top
: 1px solid black
;
335 border
-left
: 1px solid black
;
338 border
-right
: 1px solid black
;
343 @media only screen
and (max
-width
: 768px
) {
346 text
-align
: left
!Important
;
348 .navbar
-toggle
>span
.icon
-bar
{
349 background
-color
: #68171A ! Important;
351 .navbar
-default .navbar
-toggle
{
352 border
-color
: #4a4a4a;
354 .navbar
-default .navbar
-toggle
:focus
, .navbar
-default .navbar
-toggle
:hover
{
355 background
-color
: #f2f2f2 !Important;
356 font
-weight
: 900 !Important
;
357 color
: #000000 !Important;
360 background
-color
: #E5E5E5;
363 background
-color
: #68171A;
370 background
-color
: #f2f2f2;
373 float: none
!important
;
378 .navbar
-collapse
.collapse
.in
{
380 background
-color
: #dfdfdf;
382 color
: #000000 !Important;
387 width
: 90%
!important
;
389 @media
(min
-width
: 992px
) {
391 width
: 1000px
!Important
;
395 width
: 65%
!Important
;
398 padding
: 20px
0px
20px
0px
;
401 overflow
-x
: hidden
!Important
;
404 <title
><?php
echo xlt("Search Payments"); ?
></title
>
406 $arrOeUiSettings = array(
407 'heading_title' => xl('Payments'),
408 'include_patient_name' => false,// use only in appropriate pages
409 'expandable' => true,
410 'expandable_files' => array("search_payments_xpd", "new_payment_xpd", "era_payments_xpd"),//all file names need suffix _xpd
411 'action' => "",//conceal, reveal, search, reset, link or back
412 'action_title' => "",
413 'action_href' => "",//only for actions - reset, link or back
414 'show_help_icon' => false,
415 'help_file_name' => ""
417 $oemr_ui = new OemrUI($arrOeUiSettings);
420 <body
class="body_top" onload
="OnloadAction()">
421 <div id
="container_div" class="<?php echo attr($oemr_ui->oeContainer()); ?>">
423 <div
class="col-sm-12">
424 <div
class="page-header">
425 <?php
echo $oemr_ui->pageHeading() . "\r\n"; ?
>
430 <div
class="col-sm-12">
431 <nav
class="navbar navbar-default navbar-color navbar-static-top" >
432 <div
class="container-fluid">
433 <div
class="navbar-header">
434 <button
class="navbar-toggle" data
-target
="#myNavbar" data
-toggle
="collapse" type
="button"><span
class="icon-bar"></span
><span
class="icon-bar"></span
><span
class="icon-bar"></span
></button
>
436 <div
class="collapse navbar-collapse" id
="myNavbar" >
437 <ul
class="nav navbar-nav" >
438 <li
class="oe-bold-black">
439 <a href
='new_payment.php' style
="font-weight:700; color:#000000"><?php
echo xlt('New Payment'); ?
></a
>
441 <li
class="active oe-bold-black" >
442 <a href
='search_payments.php' style
="font-weight:700; color:#000000"><?php
echo xlt('Search Payment'); ?
></a
>
444 <li
class="oe-bold-black">
445 <a href
='era_payments.php' style
="font-weight:700; color:#000000"><?php
echo xlt('ERA Posting'); ?
></a
>
454 <div
class="col-sm-12">
455 <form id
="new_payment" method
='post' name
='new_payment' style
="display:inline">
457 <div
class="col-xs-12 h3">
458 <?php
echo xlt('Payment List'); ?
>
460 <div
class="col-xs-12 oe-custom-line">
461 <div
class="forms col-xs-2">
462 <label
class="control-label" for="payment_date"><?php
echo xlt('Payment date'); ?
>:</label
>
463 <?php
echo generate_select_list("payment_date", "payment_date", "$PaymentDate", "Payment Date", "", "");?
>
465 <div
class="forms col-xs-2">
466 <label
class="control-label" for="FromDate"><?php
echo xlt('From'); ?
>:</label
>
467 <input
class="form-control datepicker" id
='FromDate' name
='FromDate' type
='text' value
='<?php echo attr($FromDate); ?>'>
469 <div
class="forms col-xs-2">
470 <label
class="control-label" for="ToDate"><?php
echo xlt('To'); ?
>:</label
>
471 <input
class="form-control datepicker" id
='ToDate' name
='ToDate' type
='text' value
='<?php echo attr($ToDate); ?>'>
473 <div
class="forms col-xs-3">
474 <label
class="control-label" for="payment_method"><?php
echo xlt('Payment Method'); ?
>:</label
>
475 <?php
echo generate_select_list("payment_method", "payment_method", "$PaymentMethod", "Payment Method", " ", "");?
>
477 <div
class="forms col-xs-3">
478 <label
class="control-label" for="check_number"><?php
echo xlt('Check Number'); ?
>:</label
>
479 <input autocomplete
="off" class="form-control" id
="check_number" name
="check_number" type
="text" value
="<?php echo attr($_POST['check_number']); ?>">
482 <div
class="col-xs-12 oe-custom-line">
483 <div
class="forms col-xs-4">
484 <label
class="control-label" for="payment_method"><?php
echo xlt('Payment Amount'); ?
>:</label
>
485 <input autocomplete
="off" class="form-control" id
="payment_amount" name
="payment_amount" onkeyup
="ValidateNumeric(this);" type
="text" value
="<?php echo attr($_POST['payment_amount']);?>">
487 <div
class="forms col-xs-2">
488 <label
class="control-label" for="type_name"><?php
echo xlt('Paying Entity'); ?
>:</label
>
489 <?php
echo generate_select_list("type_name", "payment_type", "$type_name", "Paying Entity", " ", "", "SearchPayingEntityAction()");?
>
491 <div
class="forms col-xs-3">
492 <label
class="control-label" for="adjustment_code"><?php
echo xlt('Payment Category'); ?
>:</label
>
493 <?php
echo generate_select_list("adjustment_code", "payment_adjustment_code", "$adjustment_code", "Paying Category", " ", "");?
>
495 <div
class="forms col-xs-3">
496 <label
class="control-label" for="PaymentStatus"><?php
echo xlt('Pay Status'); ?
>:</label
>
497 <?php
echo generate_select_list("PaymentStatus", "payment_status", "$PaymentStatus", "Pay Status", " ", "");?
>
500 <div
class="col-xs-12 oe-custom-line">
501 <div
class="forms col-xs-4">
502 <label
class="control-label" for="type_code"><?php
echo xlt('Payment From'); ?
>:</label
>
503 <input id
="hidden_ajax_close_value" type
="hidden" value
="<?php echo attr($div_after_save);?>">
504 <input autocomplete
="off" class="form-control" id
='type_code' name
='type_code' onkeydown
="PreventIt(event)" type
="text" value
="<?php echo attr($div_after_save);?>">
505 <!--onKeyUp
="ajaxFunction(event,'non','search_payments.php');"-->
506 <div id
='ajax_div_insurance_section'>
507 <div id
='ajax_div_insurance_error'></div
>
508 <div id
="ajax_div_insurance" style
="display:none;"></div
>
511 <div
class="forms col-xs-2">
512 <label
class="control-label" for="div_insurance_or_patient"><?php
echo xlt('Payor ID'); ?
>:</label
>
513 <div
class="form-control" id
="div_insurance_or_patient"><?php
echo attr($_POST['hidden_type_code']);?
></div
>
514 <input id
="description" name
="description" type
="hidden">
515 <input id
="deposit_date" name
="deposit_date" style
="display:none" type
="text">
517 <div
class="forms col-xs-3">
518 <label
class="control-label" for="PaymentSortBy"><?php
echo xlt('Sort Result by'); ?
>:</label
>
519 <?php
echo generate_select_list("PaymentSortBy", "payment_sort_by", "$PaymentSortBy", "Sort Result by", " ", "");?
>
522 </fieldset
><!--End of Search
-->
523 <?php
//can change position of buttons by creating a class 'position-override' and adding rule text-align:center or right as the case may be in individual stylesheets ?>
524 <div
class="form-group clearfix">
525 <div
class="col-sm-12 text-left position-override">
526 <div
class="btn-group" role
="group">
527 <a
class="btn btn-default btn-search" href
="#" onclick
="javascript:return SearchPayment();"><span
><?php
echo xlt('Search');?
></span
></a
>
532 if ($_POST["mode"] == "SearchPayment") {
533 echo " " ."<br>"; // do not remove else below div will not display !!
535 <div
class = "table-responsive">
536 <table
class="table">
538 if (sqlNumRows($ResultSearch)>0) {
540 <thead bgcolor
="#DDDDDD" class="">
541 <td
class="left top" width
="25"> 
;</td
>
542 <td
class="left top"><?php
echo xlt('ID'); ?
></td
>
543 <td
class="left top" ><?php
echo xlt('Date'); ?
></td
>
544 <td
class="left top" ><?php
echo xlt('Paying Entity'); ?
></td
>
545 <td
class="left top" ><?php
echo xlt('Payer'); ?
></td
>
546 <td
class="left top" ><?php
echo xlt('Ins Code'); ?
></td
>
547 <td
class="left top" ><?php
echo xlt('Payment Method'); ?
></td
>
548 <td
class="left top" ><?php
echo xlt('Check Number'); ?
></td
>
549 <td
class="left top" ><?php
echo xlt('Pay Status'); ?
></td
>
550 <td
class="left top" ><?php
echo xlt('Payment'); ?
></td
>
551 <td
class="left top right" ><?php
echo xlt('Undistributed'); ?
></td
>
555 while ($RowSearch = sqlFetchArray($ResultSearch)) {
557 if ($RowSearch['payer_id']*1 >0) {
558 //-------------------
559 $res = sqlStatement("SELECT insurance_companies.name FROM insurance_companies
560 where insurance_companies.id =?", [$RowSearch['payer_id']]);
561 $row = sqlFetchArray($res);
563 //-------------------
564 } elseif ($RowSearch['patient_id']*1 >0) {
565 //-------------------
566 $res = sqlStatement("SELECT fname,lname,mname FROM patient_data
567 where pid =?", [$RowSearch['patient_id']]);
568 $row = sqlFetchArray($res);
569 $fname=$row['fname'];
570 $lname=$row['lname'];
571 $mname=$row['mname'];
572 $Payer=$lname.' '.$fname.' '.$mname;
573 //-------------------
575 //=============================================
577 if ($CountIndex==sqlNumRows($ResultSearch)) {
578 $StringClass=' bottom left top ';
580 $StringClass=' left top ';
582 if ($CountIndex%2
==1) {
588 <tr bgcolor
='<?php echo attr($bgcolor); ?>' class="text">
589 <td
class="<?php echo attr($StringClass); ?>">
590 <!--<a href
="#" onclick
="javascript:return DeletePayments(<?php echo htmlspecialchars($RowSearch['session_id']); ?>);"><img border
="0" src
="../pic/Delete.gif"></a
>-->
592 <a href
="#" onclick
="javascript:return DeletePayments(<?php echo attr_js($RowSearch['session_id']); ?>);"><img border
="0" src
="../pic/Delete.gif"></a
>
594 <td
class="<?php echo attr($StringClass); ?>">
595 <a
class="" data
-toggle
="modal" data
-target
="#myModal" onclick
="loadiframe('edit_payment.php?payment_id=<?php echo attr_url($RowSearch['session_id']); ?>')"><?php
echo text($RowSearch['session_id']); ?
></a
>
597 <td
class="<?php echo attr($StringClass); ?>">
598 <a
class="" data
-toggle
="modal" data
-target
="#myModal" onclick
="loadiframe('edit_payment.php?payment_id=<?php echo attr_url($RowSearch['session_id']); ?>')"><?php
echo $RowSearch['check_date']=='0000-00-00' ?
' ' : text(oeFormatShortDate($RowSearch['check_date'])); ?
></a
>
600 <td
class="<?php echo attr($StringClass); ?>">
601 <a
class="" data
-toggle
="modal" data
-target
="#myModal" onclick
="loadiframe('edit_payment.php?payment_id=<?php echo attr_url($RowSearch['session_id']); ?>')">
603 $frow['data_type']=1;
604 $frow['list_id']='payment_type';
606 if ($RowSearch['payment_type']=='insurance' ||
$RowSearch['payer_id']*1 >0) {
607 $PaymentType='insurance';
608 } elseif ($RowSearch['payment_type']=='patient' ||
$RowSearch['patient_id']*1 >0) {
609 $PaymentType='patient';
610 } elseif (($RowSearch['payer_id']*1 == 0 && $RowSearch['patient_id']*1 == 0)) {
613 generate_print_field($frow, $PaymentType);
616 <td
class="<?php echo attr($StringClass); ?>">
617 <!--<a
class='iframe medium_modal' href
="edit_payment.php?payment_id=<?php echo htmlspecialchars($RowSearch['session_id']); ?>"><?php
echo $Payer=='' ?
' ' : htmlspecialchars($Payer) ;?
></a
>-->
618 <a
class="" data
-target
="#myModal" data
-toggle
="modal" onclick
="loadiframe('edit_payment.php?payment_id=<?php echo attr_url($RowSearch['session_id']); ?>')"><?php
echo $Payer=='' ?
' ' : text($Payer) ;?
></a
><!--link to iframe
-->
620 <td
class="<?php echo attr($StringClass); ?>">
621 <a
class="" data
-toggle
="modal" data
-target
="#myModal" onclick
="loadiframe('edit_payment.php?payment_id=<?php echo attr_url($RowSearch['session_id']); ?>')"><?php
echo $RowSearch['payer_id']*1 >0 ?
text($RowSearch['payer_id']) : ' '; ?
></a
>
623 <td align
="left" class="<?php echo attr($StringClass); ?>">
624 <!--<a
class='iframe medium_modal' href
="edit_payment.php?payment_id=<?php echo attr_url($RowSearch['session_id']); ?>"><?php
625 $frow['data_type']=1;
626 $frow['list_id']='payment_method';
627 generate_print_field($frow, $RowSearch['payment_method']);
629 <a
class="" data
-toggle
="modal" data
-target
="#myModal" onclick
="loadiframe('edit_payment.php?payment_id=<?php echo attr_url($RowSearch['session_id']); ?>')">
631 $frow['data_type']=1;
632 $frow['list_id']='payment_method';
633 generate_print_field($frow, $RowSearch['payment_method']);
636 <td align
="left" class="<?php echo attr($StringClass); ?>">
637 <!--<a
class='iframe medium_modal' href
="edit_payment.php?payment_id=<?php echo attr_url($RowSearch['session_id']); ?>"><?php
echo $RowSearch['reference']=='' ?
' ' : text($RowSearch['reference']); ?
></a
>-->
638 <a
class="" data
-toggle
="modal" data
-target
="#myModal" onclick
="loadiframe('edit_payment.php?payment_id=<?php echo attr_url($RowSearch['session_id']); ?>')"><?php
echo $RowSearch['reference']=='' ?
' ' : text($RowSearch['reference']); ?
></a
>
640 <td align
="left" class="<?php echo attr($StringClass); ?>">
641 <a
class="" data
-toggle
="modal" data
-target
="#myModal" onclick
="loadiframe('edit_payment.php?payment_id=<?php echo attr_url($RowSearch['session_id']); ?>')"><?php
642 $rs= sqlStatement("select pay_total,global_amount from ar_session where session_id=?", [$RowSearch['session_id']]);
643 $row=sqlFetchArray($rs);
644 $pay_total=$row['pay_total'];
645 $global_amount=$row['global_amount'];
646 $rs= sqlStatement("select sum(pay_amount) sum_pay_amount from ar_activity where session_id=?", [$RowSearch['session_id']]);
647 $row=sqlFetchArray($rs);
648 $pay_amount=$row['sum_pay_amount'];
649 $UndistributedAmount=$pay_total-$pay_amount-$global_amount;
650 echo $UndistributedAmount*1==0 ?
xlt('Fully Paid') : xlt('Unapplied'); ?
></a
>
652 <td align
="right" class="<?php echo attr($StringClass); ?>">
653 <a
class="" data
-toggle
="modal" data
-target
="#myModal" onclick
="loadiframe('edit_payment.php?payment_id=<?php echo attr_url($RowSearch['session_id']); ?>')"><?php
echo text($RowSearch['pay_total']); ?
></a
>
655 <td align
="right" class="<?php echo attr($StringClass); ?>right">
656 <a
class="" data
-toggle
="modal" data
-target
="#myModal" onclick
="loadiframe('edit_payment.php?payment_id=<?php echo attr_url($RowSearch['session_id']); ?>')"><?php
echo text(number_format($UndistributedAmount, 2)); ?
></a
>
660 }//End of while ($RowSearch = sqlFetchArray($ResultSearch))
661 } //End of if(sqlNumRows($ResultSearch)>0)
665 <td
class="text" colspan
="11"><?php
echo xlt('No Result Found, for the above search criteria.'); ?
></td
>
671 </div
><!--End of table
-responsive div
-->
673 }// End of if ($_POST["mode"] == "SearchPayment")
676 <input id
='mode' name
='mode' type
='hidden' value
=''>
677 <input id
='ajax_mode' name
='ajax_mode' type
='hidden' value
=''>
678 <input id
="hidden_type_code" name
="hidden_type_code" type
="hidden" value
="<?php echo attr($_POST['hidden_type_code']);?>">
679 <input id
='DeletePaymentId' name
='DeletePaymentId' type
='hidden' value
=''>
680 <input id
='SortFieldOld' name
='SortFieldOld' type
='hidden' value
='<?php echo attr($PaymentSortBy);?>'>
681 <input id
='Sort' name
='Sort' type
='hidden' value
='<?php echo attr($Sort);?>'>
682 <input id
="after_value" name
="after_value" type
="hidden" value
="<?php echo attr($Message);?>">
687 </div
><!--end of container div
-->
688 <?php
$oemr_ui->oeBelowContainerDiv();?
>