Koha/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt
Galen Charlton 0456f6ade0 Bug 6273: (follow-up) fix various issues
This patch fixes various issues that prevented the account
type from being set correctly when recording SIP2 payments:

- the fixed fields in the fee paid message were not getting
  parsed correclty
- accountlines.accounttype is only five characters wide, so
  SIP2 payments are now records as 'Pay00', 'Pay02', etc. rather
  than 'Pay-00'.
- removed regression on bug 2546 and made the new payment types
  translatable

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2014-04-30 17:11:58 +00:00

170 lines
6.8 KiB
Text

[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Patrons &rsaquo; Pay Fines for [% borrower.firstname %] [% borrower.surname %]</title>
[% INCLUDE 'doc-head-close.inc' %]
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
<script type= "text/javascript">
//<![CDATA[
function enableCheckboxActions(){
// Enable/disable controls if checkboxes are checked
var checkedBoxes = $("input.cb:checked");
if ($(checkedBoxes).size()) {
$("#payselected").prop("disabled",false);
} else {
$("#payselected").prop("disabled",true);
}
}
$(document).ready(function(){
$('#pay-fines-form').preventDoubleFormSubmit();
$("#woall").click(function(event){
var msg = _("Are you sure you want to write off %s in outstanding fines? This cannot be undone!").format( "[% total | format('%.2f') %]" );
var answer = confirm(msg);
if (!answer){
event.preventDefault();
}
});
$('#CheckAll').click(function(){
$("#finest").checkCheckboxes();
enableCheckboxActions();
return false;
});
$('#CheckNone').click(function(){
$("#finest").unCheckCheckboxes();
enableCheckboxActions();
return false;
});
$(".cb").change(function(){
enableCheckboxActions();
});
enableCheckboxActions();
});
//]]>
</script>
</head>
<body id="pat_pay" class="pat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> &rsaquo; Pay fines for [% borrower.firstname %] [% borrower.surname %]</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
[% INCLUDE 'members-toolbar.inc' borrowernumber=borrower.borrowernumber %]
<!-- The manual invoice and credit buttons -->
<div class="statictabs">
<ul>
<li><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Account</a></li>
<li class="active"><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]" >Pay fines</a></li>
<li><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% borrower.borrowernumber %]" >Create manual invoice</a></li>
<li><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% borrower.borrowernumber %]" >Create manual credit</a></li>
</ul>
<div class="tabs-container">
[% IF ( accounts ) %]
<form action="/cgi-bin/koha/members/pay.pl" method="post" id="pay-fines-form">
<input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" />
<p><span class="checkall"><a id="CheckAll" href="#">Select all</a></span> | <span class="clearall"><a id="CheckNone" href="#">Clear all</a></span></p>
<table id="finest">
<thead>
<tr>
<th>&nbsp;</th>
<th>Fines &amp; charges</th>
<th>Description</th>
<th>Payment note</th>
<th>Account type</th>
<th>Notify id</th>
<th>Level</th>
<th>Amount</th>
<th>Amount outstanding</th>
</tr>
</thead>
<tfoot>
<tr>
<td class="total" colspan="8">Total due:</td>
<td>[% total | format('%.2f') %]</td>
</tr>
</tfoot>
<tbody>
[% FOREACH account_grp IN accounts %]
[% FOREACH line IN account_grp.accountlines %]
<tr>
<td>
[% IF ( line.amountoutstanding > 0 ) %]
<input class="cb" type="checkbox" checked="checked" name="incl_par_[% line.accountno %]" />
[% END %]
</td>
<td>
[% IF ( line.amountoutstanding > 0 ) %]
<input type="submit" name="pay_indiv_[% line.accountno %]" value="Pay" />
[% IF CAN_user_updatecharges_writeoff %]<input type="submit" name="wo_indiv_[% line.accountno %]" value="Write off" />[% END %]
[% END %]
<input type="hidden" name="itemnumber[% line.accountno %]" value="[% line.itemnumber %]" />
<input type="hidden" name="description[% line.accountno %]" value="[% line.description %]" />
<input type="hidden" name="accounttype[% line.accountno %]" value="[% line.accounttype %]" />
<input type="hidden" name="amount[% line.accountno %]" value="[% line.amount %]" />
<input type="hidden" name="accountlines_id[% line.accountno %]" value="[% line.accountlines_id %]" />
<input type="hidden" name="amountoutstanding[% line.accountno %]" value="[% line.amountoutstanding %]" />
<input type="hidden" name="borrowernumber[% line.accountno %]" value="[% line.borrowernumber %]" />
<input type="hidden" name="accountno[% line.accountno %]" value="[% line.accountno %]" />
<input type="hidden" name="notify_id[% line.accountno %]" value="[% line.notify_id %]" />
<input type="hidden" name="notify_level[% line.accountno %]" value="[% line.notify_level %]" />
<input type="hidden" name="totals[% line.accountno %]" value="[% line.totals %]" />
</td>
<td>
[% SWITCH line.accounttype %]
[% CASE 'Pay' %]Payment,thanks
[% CASE 'Pay00' %]Payment,thanks (cash via SIP2)
[% CASE 'Pay01' %]Payment,thanks (VISA via SIP2)
[% CASE 'Pay02' %]Payment,thanks (credit card via SIP2)
[% CASE 'N' %]New Card
[% CASE 'F' %]Fine
[% CASE 'A' %]Account management fee
[% CASE 'M' %]Sundry
[% CASE 'L' %]Lost Item
[% CASE 'W' %]Writeoff
[% CASE %][% line.accounttype %]
[%- END -%]
[%- IF line.description %], [% line.description %][% END %]
[% IF line.title %]([% line.title |html_entity %])[% END %]
</td>
<td><input type="text" name="payment_note_[% line.accountno %]" /></td>
<td>[% line.accounttype %]</td>
<td>[% line.notify_id %]</td>
<td>[% line.notify_level %]</td>
<td class="debit">[% line.amount | format('%.2f') %]</td>
<td class="debit">[% line.amountoutstanding | format('%.2f') %]</td>
</tr>
[% END %]
[% IF ( account_grp.total ) %]
<tr>
<td class="total" colspan="8">Sub total:</td>
<td>[% account_grp.total | format('%.2f') %]</td>
</tr>
[% END %]
[% END %]
</tbody>
</table>
<fieldset class="action">
<input type="submit" id="paycollect" name="paycollect" value="Pay amount" class="submit" />
[% IF CAN_user_updatecharges_writeoff %]<input type="submit" name="woall" id="woall" value="Write off all" class="submit" />[% END %]
<input type="submit" id="payselected" name="payselected" value="Pay selected" class="submit" />
<a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a>
</fieldset>
</form>
[% ELSE %]
<p>[% borrower.firstname %] [% borrower.surname %] has no outstanding fines.</p>
[% END %]
</div></div>
</div>
</div>
<div class="yui-b">
[% INCLUDE 'circ-menu.tt' %]
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]