forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
payment_master.inc.php
451 lines (449 loc) · 23.1 KB
/
payment_master.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
<?php
// +-----------------------------------------------------------------------------+
// Copyright (C) 2010 Z&H Consultancy Services Private Limited <[email protected]>
//
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// A copy of the GNU General Public License is included along with this program:
// openemr/interface/login/GnuGPL.html
// For more information write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// Author: Eldho Chacko <[email protected]>
// Paul Simon K <[email protected]>
//
// +------------------------------------------------------------------------------+
//===============================================================================
//Check/cash details are entered here.Used in New Payment and Edit Payment screen.
//===============================================================================
//Special list function
function generate_list_payment_category($tag_name, $list_id, $currvalue, $title,
$empty_name=' ', $class='', $onchange='',$PaymentType='insurance',$screen='new_payment')
{
$s = '';
$tag_name_esc = htmlspecialchars( $tag_name, ENT_QUOTES);
$s .= "<select name='$tag_name_esc' id='$tag_name_esc'";
if ($class) $s .= " class='$class'";
if ($onchange) $s .= " onchange='$onchange'";
$selectTitle = htmlspecialchars( $title, ENT_QUOTES);
$s .= " title='$selectTitle'>";
$selectEmptyName = htmlspecialchars( xl($empty_name), ENT_QUOTES);
if ($empty_name) $s .= "<option value=''>" . $selectEmptyName . "</option>";
$lres = sqlStatement("SELECT * FROM list_options " .
"WHERE list_id = ? ORDER BY seq, title", array($list_id) );
$got_selected = FALSE;
while ($lrow = sqlFetchArray($lres)) {
$optionValue = htmlspecialchars( $lrow['option_id'], ENT_QUOTES);
$s .= "<option id='option_" . $lrow['option_id'] . "'" . " value='$optionValue'";
if ((strlen($currvalue) == 0 && $lrow['is_default']) ||
(strlen($currvalue) > 0 && $lrow['option_id'] == $currvalue) ||
($lrow['option_id'] == 'insurance_payment' && $screen=='new_payment'))
{
$s .= " selected";
$got_selected = TRUE;
}
if (($PaymentType == 'insurance' || $screen=='new_payment') && ($lrow['option_id'] == 'family_payment' || $lrow['option_id'] == 'patient_payment'))
$s .= " style='background-color:#DEDEDE' ";
if ($PaymentType == 'patient' && $lrow['option_id'] == 'insurance_payment')
$s .= " style='background-color:#DEDEDE' ";
$optionLabel = htmlspecialchars( xl_list_label($lrow['title']), ENT_QUOTES);
$s .= ">$optionLabel</option>\n";
}
if (!$got_selected && strlen($currvalue) > 0) {
$currescaped = htmlspecialchars($currvalue, ENT_QUOTES);
$s .= "<option value='$currescaped' selected>* $currescaped *</option>";
$s .= "</select>";
$fontTitle = htmlspecialchars( xl('Please choose a valid selection from the list.'), ENT_QUOTES);
$fontText = htmlspecialchars( xl('Fix this'), ENT_QUOTES);
$s .= " <font color='red' title='$fontTitle'>$fontText!</font>";
}
else {
$s .= "</select>";
}
return $s;
}
//================================================================================================
if($payment_id>0)
{
$rs= sqlStatement("select pay_total,global_amount from ar_session where session_id='$payment_id'");
$row=sqlFetchArray($rs);
$pay_total=$row['pay_total'];
$global_amount=$row['global_amount'];
$rs= sqlStatement("select sum(pay_amount) sum_pay_amount from ar_activity where session_id='$payment_id'");
$row=sqlFetchArray($rs);
$pay_amount=$row['sum_pay_amount'];
$UndistributedAmount=$pay_total-$pay_amount-$global_amount;
$res = sqlStatement("SELECT check_date ,reference ,insurance_companies.name,
payer_id,pay_total,payment_type,post_to_date,patient_id ,
adjustment_code,description,deposit_date,payment_method
FROM ar_session left join insurance_companies on ar_session.payer_id=insurance_companies.id where ar_session.session_id ='$payment_id'");
$row = sqlFetchArray($res);
$InsuranceCompanyName=$row['name'];
$InsuranceCompanyId=$row['payer_id'];
$PatientId=$row['patient_id'];
$CheckNumber=$row['reference'];
$CheckDate=$row['check_date']=='0000-00-00'?'':$row['check_date'];
$PayTotal=$row['pay_total'];
$PostToDate=$row['post_to_date']=='0000-00-00'?'':$row['post_to_date'];
$PaymentMethod=$row['payment_method'];
$PaymentType=$row['payment_type'];
$AdjustmentCode=$row['adjustment_code'];
$DepositDate=$row['deposit_date']=='0000-00-00'?'':$row['deposit_date'];
$Description=$row['description'];
if($row['payment_type']=='insurance' || $row['payer_id']*1 > 0)
{
$res = sqlStatement("SELECT insurance_companies.name FROM insurance_companies
where insurance_companies.id ='$InsuranceCompanyId'");
$row = sqlFetchArray($res);
$div_after_save=$row['name'];
$TypeCode=$InsuranceCompanyId;
if($PaymentType=='')
{
$PaymentType='insurance';
}
}
elseif($row['payment_type']=='patient' || $row['patient_id']*1 > 0)
{
$res = sqlStatement("SELECT fname,lname,mname FROM patient_data
where pid ='$PatientId'");
$row = sqlFetchArray($res);
$fname=$row['fname'];
$lname=$row['lname'];
$mname=$row['mname'];
$div_after_save=$lname.' '.$fname.' '.$mname;
$TypeCode=$PatientId;
if($PaymentType=='')
{
$PaymentType='patient';
}
}
}
?>
<?php
//================================================================================================
if(($screen=='new_payment' && $payment_id*1==0) || ($screen=='edit_payment' && $payment_id*1>0))
{//New entry or edit in edit screen comes here.
?>
<table width="1024" border="0" cellspacing="0" cellpadding="10" bgcolor="#DEDEDE"><tr><td>
<table width="1004" border="0" style="border:1px solid black" cellspacing="0" cellpadding="0">
<tr height="5">
<td colspan="14" align="left" ></td>
</tr>
<tr>
<td colspan="14" align="left"> <font class='title'>
<?php
if($_REQUEST['ParentPage']=='new_payment')//This case comes when the Finish Payments is pressed from the New Payment screen.
{
?>
<?php echo htmlspecialchars( xl('Confirm Payment'), ENT_QUOTES) ?>
<?php
}
elseif($screen=='new_payment')
{
?>
<?php echo htmlspecialchars( xl('Batch Payment Entry'), ENT_QUOTES) ?>
<?php
}
else
{
?>
<?php echo htmlspecialchars( xl('Edit Payment'), ENT_QUOTES) ?>
<?php
}
?>
</font></td>
</tr>
<tr height="20">
<td align="left" width="5" ></td>
<td align="left" width="110" ></td>
<td align="left" width="128"></td>
<td align="left" width="25"></td>
<td align="left" width="5"></td>
<td align="left" width="85"></td>
<td align="left" width="128"></td>
<td align="left" width="25"></td>
<td align="left" width="5"></td>
<td align="left" width="113"></td>
<td align="left" width="125"></td>
<td align="left" width="5"></td>
<td align="left" width="93"></td>
<td align="left" width="152"></td>
</tr>
<tr>
<td align="left" class='text'></td>
<td align="left" class='text'><?php echo htmlspecialchars( xl('Date'), ENT_QUOTES).':' ?></td>
<td align="left" class="text" ><input type='text' size='9' name='check_date' id='check_date' class="class1 text " value="<?php echo htmlspecialchars(oeFormatShortDate($CheckDate));?>"/></td>
<td><img src='../../interface/main/calendar/modules/PostCalendar/pntemplates/default/images/new.jpg' align='absbottom'
id='img_checkdate' border='0' alt='[?]' style='cursor:pointer'
title='<?php echo htmlspecialchars( xl('Click here to choose a date'), ENT_QUOTES); ?>' />
<script>
Calendar.setup({inputField:"check_date", ifFormat:"<?php echo $DateFormat; ?>", button:"img_checkdate"});
</script></td>
<td></td>
<td align="left" class='text'><?php echo htmlspecialchars( xl('Post To Date'), ENT_QUOTES).':' ?></td>
<td align="left" class="text"><input type='text' size='9' name='post_to_date' id='post_to_date' class="class1 text " value="<?php echo $screen=='new_payment'?htmlspecialchars(oeFormatShortDate(date('Y-m-d'))):htmlspecialchars(oeFormatShortDate($PostToDate));?>" readonly="" /></td>
<td><img src='../../interface/main/calendar/modules/PostCalendar/pntemplates/default/images/new.jpg' align='absbottom'
id='img_post_to_date' border='0' alt='[?]' style='cursor:pointer'
title='<?php echo htmlspecialchars( xl('Click here to choose a date'), ENT_QUOTES); ?>' />
<script>
Calendar.setup({inputField:"post_to_date", ifFormat:"<?php echo $DateFormat; ?>", button:"img_post_to_date"});
</script></td>
<td></td>
<td align="left" class="text"><?php echo htmlspecialchars( xl('Payment Method'), ENT_QUOTES).':' ?></td>
<td align="left">
<?php
if($PaymentMethod=='' && $screen=='edit_payment')
$blankValue=' ';
else
$blankValue='';
echo generate_select_list("payment_method", "payment_method", "$PaymentMethod", "Payment Method","$blankValue","class1 text",'CheckVisible("yes")');
?>
</td>
<td></td>
<td align="left" class="text"><?php echo htmlspecialchars( xl('Check Number'), ENT_QUOTES).':' ?></td>
<td>
<?php
if($PaymentMethod=='check_payment' || $PaymentMethod=='bank_draft' || $CheckNumber!='' || $screen=='new_payment')
{
$CheckDisplay='';
$CheckDivDisplay=' display:none; ';
}
else
{
$CheckDisplay=' display:none; ';
$CheckDivDisplay='';
}
?>
<input type="text" name="check_number" style="width:140px;<?php echo $CheckDisplay;?>" autocomplete="off" value="<?php echo htmlspecialchars($CheckNumber);?>" onKeyUp="ConvertToUpperCase(this)" id="check_number" class="text " />
<div id="div_check_number" class="text" style="border:1px solid black; width:140px;<?php echo $CheckDivDisplay;?>"> </div>
</td>
</tr>
<tr height="1">
<td colspan="14" align="left" ></td>
</tr>
<tr>
<td align="left" class="text"></td>
<td align="left" class="text"><?php echo htmlspecialchars( xl('Payment Amount'), ENT_QUOTES).':' ?></td>
<td align="left"><input type="text" name="payment_amount" autocomplete="off" id="payment_amount" onchange="ValidateNumeric(this);<?php echo $screen=='new_payment'?'FillUnappliedAmount();':'FillAmount();';?>" value="<?php echo $screen=='new_payment'?htmlspecialchars('0.00'):htmlspecialchars($PayTotal);?>" style="text-align:right" class="class1 text " /></td>
<td align="left" ></td>
<td align="left" ></td>
<td align="left" class="text"><?php echo htmlspecialchars( xl('Paying Entity'), ENT_QUOTES).':' ?></td>
<td align="left"><?php
if($PaymentType=='' && $screen=='edit_payment')
$blankValue=' ';
else
$blankValue='';
echo generate_select_list("type_name", "payment_type", "$PaymentType", "Paying Entity","$blankValue","class1 text",'PayingEntityAction()');
?>
</td>
<td align="left" ></td>
<td align="left" ></td>
<td align="left" class="text"><?php echo htmlspecialchars( xl('Payment Category'), ENT_QUOTES).':' ?></td>
<td align="left"><?php
if($AdjustmentCode=='' && $screen=='edit_payment')
$blankValue=' ';
else
$blankValue='';
echo generate_list_payment_category("adjustment_code", "payment_adjustment_code", "$AdjustmentCode",
"Payment Category","$blankValue","class1 text",'FilterSelection(this)',"$PaymentType","$screen");
?>
</td>
<td align="left" ></td>
<td align="left" ></td>
<td align="left" ></td>
</tr>
<tr height="1">
<td colspan="14" align="left" ></td>
</tr>
<tr>
<td align="left" class="text"></td>
<td align="left" class="text"><?php echo htmlspecialchars( xl('Payment From'), ENT_QUOTES).':' ?></td>
<td align="left" colspan="5"><input type="hidden" id="hidden_ajax_close_value" value="<?php echo htmlspecialchars($div_after_save);?>" /><input name='type_code' id='type_code' class="text " style="width:369px" onKeyDown="PreventIt(event)" value="<?php echo htmlspecialchars($div_after_save);?>" autocomplete="off" /><br>
<!-- onKeyUp="ajaxFunction(event,'non','edit_payment.php');" -->
<div id='ajax_div_insurance_section'>
<div id='ajax_div_insurance_error'>
</div>
<div id="ajax_div_insurance" style="display:none;"></div>
</div>
</div>
</td>
<td align="left" colspan="5"><div name="div_insurance_or_patient" id="div_insurance_or_patient" class="text" style="border:1px solid black; padding-left:5px; width:55px; height:17px;"><?php echo htmlspecialchars($TypeCode);?></div></td>
<td align="left" ></td>
<td align="left" ></td>
</tr>
<tr>
<td align="left" class='text'></td>
<td align="left" class='text'><?php echo htmlspecialchars( xl('Deposit Date'), ENT_QUOTES).':' ?></td>
<td align="left"><input type='text' size='9' name='deposit_date' id='deposit_date' onKeyDown="PreventIt(event)" class="class1 text " value="<?php echo htmlspecialchars(oeFormatShortDate($DepositDate));?>" /> </td>
<td><img src='../../interface/main/calendar/modules/PostCalendar/pntemplates/default/images/new.jpg' align='absbottom'
id='img_depositdate' border='0' alt='[?]' style='cursor:pointer'
title='<?php echo htmlspecialchars( xl('Click here to choose a date'), ENT_QUOTES); ?>' />
<script>
Calendar.setup({inputField:"deposit_date", ifFormat:"<?php echo $DateFormat; ?>", button:"img_depositdate"});
</script></td>
<td></td>
<td align="left" class="text"><?php echo htmlspecialchars( xl('Description'), ENT_QUOTES).':' ?></td>
<td colspan="6" align="left"><input type="text" name="description" id="description" onKeyDown="PreventIt(event)" value="<?php echo htmlspecialchars($Description);?>" style="width:396px" class="text " /></td>
<td align="left" class="text"><font style="font-size:11px"><?php echo htmlspecialchars( xl('UNDISTRIBUTED'), ENT_QUOTES).':' ?></font><input name="HidUnappliedAmount" id="HidUnappliedAmount" value="<?php echo ($UndistributedAmount*1==0)? htmlspecialchars("0.00") : htmlspecialchars(number_format($UndistributedAmount,2,'.',','));?>" type="hidden"/><input name="HidUnpostedAmount" id="HidUnpostedAmount" value="<?php echo htmlspecialchars($UndistributedAmount); ?>" type="hidden"/><input name="HidCurrentPostedAmount" id="HidCurrentPostedAmount" value="" type="hidden"/></td>
<td align="left" class="text"><div id="TdUnappliedAmount" class="text" style="border:1px solid black; width:75px; background-color:#EC7676; padding-left:5px;"><?php echo ($UndistributedAmount*1==0)? htmlspecialchars("0.00") : htmlspecialchars(number_format($UndistributedAmount,2,'.',','));?></div></td>
</tr>
<?php
if($screen=='new_payment')
{
?>
<tr>
<td colspan="14" align="center" class="text" id="TdContainingButtons">
<table border="0" cellspacing="0" cellpadding="0" width="280">
<tr height="5">
<td ></td>
<td></td>
<td></td>
</tr>
<tr>
<td width="100"><a href="#" onClick="javascript:return SavePayment();" class="css_button"><span><?php echo htmlspecialchars( xl('Save Changes'), ENT_QUOTES);?></span></a></td>
<td width="110"><a href="#" onClick="javascript:ResetForm()" class="css_button"><span><?php echo htmlspecialchars( xl('Cancel Changes'), ENT_QUOTES);?></span></a></td>
<td width="70"><a href="#" class="css_button" onClick="javascript:OpenEOBEntry();"><span><?php echo htmlspecialchars( xl('Allocate'), ENT_QUOTES);?></span></a></td>
</tr>
</table> </td>
</tr>
<?php
}
?>
<tr height="5">
<td colspan="14" align="left" ></td>
</tr>
</table>
</td></tr></table>
<?php
}//if(($screen=='new_payment' && $payment_id*1==0) || ($screen=='edit_payment' && $payment_id*1>0))
//================================================================================================
?>
<?php
if($screen=='new_payment' && $payment_id*1>0)
{//After saving from the New Payment screen,all values are showed as labels.The date picker images are also removed.
?>
<table width="1024" border="0" cellspacing="0" cellpadding="10" bgcolor="#DEDEDE"><tr><td align="left">
<table width="1004" border="0" style="border:1px solid black" cellspacing="0" cellpadding="0">
<tr height="5">
<td colspan="13" align="left" ></td>
</tr>
<tr>
<td colspan="13" align="left" >
<table width="969" border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td colspan="13" align="left"> <font class='title'><?php echo htmlspecialchars( xl('Batch Payment Entry'), ENT_QUOTES) ?></font></td>
</tr>
<tr height="20">
<td align="left" width="5" ></td>
<td align="left" width="106" ></td>
<td align="left" width="128"></td>
<td align="left" width="5"></td>
<td align="left" width="84"></td>
<td align="left" width="128"></td>
<td align="left" width="5"></td>
<td align="left" width="113"></td>
<td align="left" width="135"></td>
<td align="left" width="5"></td>
<td align="left" width="92"></td>
<td align="left" width="158"></td>
<td align="left" width="5"></td>
</tr>
<tr>
<td align="left" class='text'></td>
<td align="left" class='text'><?php echo htmlspecialchars( xl('Date'), ENT_QUOTES).':' ?></td>
<td align="left" class="text bottom left top right"> <?php echo htmlspecialchars(oeFormatShortDate($CheckDate));?><input type="hidden" name="check_date" value="<?php echo htmlspecialchars(oeFormatShortDate($CheckDate));?>"/></td>
<td></td>
<td align="left" class='text'><?php echo htmlspecialchars( xl('Post To Date'), ENT_QUOTES).':' ?></td>
<td align="left" class="text bottom left top right"> <?php echo htmlspecialchars(oeFormatShortDate($PostToDate));?><input type="hidden" name="post_to_date" value="<?php echo htmlspecialchars(oeFormatShortDate($PostToDate));?>"/></td>
<td></td>
<td align="left" class="text"><?php echo htmlspecialchars( xl('Payment Method'), ENT_QUOTES).':' ?></td>
<td align="left" class="text bottom left top right"> <?php
$frow['data_type']=1;
$frow['list_id']='payment_method';
generate_print_field($frow, $PaymentMethod);
?><input type="hidden" name="payment_method" value="<?php echo htmlspecialchars($PaymentMethod);?>"/></td>
<td></td>
<td align="left" class="text"><?php echo htmlspecialchars( xl('Check Number'), ENT_QUOTES).':' ?></td>
<td class="text bottom left top right"> <?php echo htmlspecialchars($CheckNumber);?><input type="hidden" name="check_number" value="<?php echo htmlspecialchars($CheckNumber);?>"/></td>
<td class="text"></td>
</tr>
<tr height="1">
<td colspan="13" align="left" ></td>
</tr>
<tr>
<td align="left" class="text"></td>
<td align="left" class="text"><?php echo htmlspecialchars( xl('Payment Amount'), ENT_QUOTES).':' ?></td>
<td align="left" class="text bottom left top right"> <?php echo htmlspecialchars($PayTotal);?><input type="hidden" name="payment_amount" value="<?php echo htmlspecialchars($PayTotal);?>"/></td>
<td align="left" ></td>
<td align="left" class="text"><?php echo htmlspecialchars( xl('Paying Entity'), ENT_QUOTES).':' ?></td>
<td align="left" class="text bottom left top right"> <?php
$frow['data_type']=1;
$frow['list_id']='payment_type';
generate_print_field($frow, $PaymentType);
?><input type="hidden" name="type_name" id="type_name" value="<?php echo htmlspecialchars($PaymentType);?>"/></td>
<td align="left" ></td>
<td align="left" class="text"><?php echo htmlspecialchars( xl('Payment Category'), ENT_QUOTES).':' ?></td>
<td align="left" class="text bottom left top right"> <?php
$frow['data_type']=1;
$frow['list_id']='payment_adjustment_code';
generate_print_field($frow, $AdjustmentCode);
?><input type="hidden" name="adjustment_code" value="<?php echo htmlspecialchars($AdjustmentCode);?>"/></td>
<td align="left" ></td>
<td align="left" ></td>
<td align="left" ></td>
<td align="left" ></td>
</tr>
<tr height="1">
<td colspan="13" align="left" ></td>
</tr>
<tr>
<td align="left" class="text"></td>
<td align="left" class="text"><?php echo htmlspecialchars( xl('Payment From'), ENT_QUOTES).':' ?></td>
<td colspan="4" align="left" class="text bottom left top right"><div name="div_insurance_or_patient" id="div_insurance_or_patient" class="text" > <?php echo htmlspecialchars($div_after_save);?> </div></td>
<td align="left"></td>
<td align="left" ><div name="div_insurance_or_patient" id="div_insurance_or_patient" class="text" style="border:1px solid black; padding-left:5px; width:55px"><?php echo htmlspecialchars($TypeCode);?></div><input type="hidden" name="type_code" value="<?php echo htmlspecialchars($TypeCode);?>"/></td>
<td align="left" ></td>
<td align="left" ></td>
<td align="left" ></td>
<td align="left" ></td>
<td align="left" ></td>
</tr>
<tr height="1">
<td colspan="13" align="left" ></td>
</tr>
<tr>
<td align="left" class='text'></td>
<td align="left" class='text'><?php echo htmlspecialchars( xl('Deposit Date'), ENT_QUOTES).':' ?></td>
<td align="left" class="text bottom left top right"> <?php echo htmlspecialchars(oeFormatShortDate($DepositDate));?><input type="hidden" name="deposit_date" value="<?php echo htmlspecialchars(oeFormatShortDate($DepositDate));?>"/> </td>
<td></td>
<td align="left" class="text"><?php echo htmlspecialchars( xl('Description'), ENT_QUOTES).':' ?></td>
<td colspan="4" align="left" class="text bottom left top right"> <?php echo htmlspecialchars($Description);?><input type="hidden" name="description" value="<?php echo htmlspecialchars($Description);?>"/></td>
<td align="left" class='text'></td>
<td align="left" class="text"><font style="font-size:11px"><?php echo htmlspecialchars( xl('UNDISTRIBUTED'), ENT_QUOTES).':' ?></font><input name="HidUnappliedAmount" id="HidUnappliedAmount" value="<?php echo ($UndistributedAmount*1==0)? htmlspecialchars("0.00") : htmlspecialchars(number_format($UndistributedAmount,2,'.',','));?>" type="hidden"/><input name="HidUnpostedAmount" id="HidUnpostedAmount" value="<?php echo htmlspecialchars($UndistributedAmount); ?>" type="hidden"/>
<input name="HidCurrentPostedAmount" id="HidCurrentPostedAmount" value="" type="hidden"/></td>
<td align="left" ><div id="TdUnappliedAmount" class="text" style="border:1px solid black; background-color:#EC7676; width:75px; padding-left:5px;"><?php echo ($UndistributedAmount*1==0)? htmlspecialchars("0.00") : htmlspecialchars(number_format($UndistributedAmount,2,'.',','));?></div></td>
<td align="left" class="text"></td>
</tr>
<tr height="5">
<td colspan="13" align="left"></td>
</tr>
</table>
</td>
</tr>
</table>
</td></tr></table>
<?php
}//if($screen=='new_payment' && $payment_id*1>0)
//================================================================================================
?>