Jonathan Druart
0ab22e1c7c
In order to simplify and make uniform the code, the controller scripts send a Koha::Patron object to the templates instead of all attributes of a patron. That will make the code much more easier to maintain and will be less error-prone. The variable "patron" sent to the templates is supposed to represent the patron the librarian is editing the detail. In the members module and some scripts of the circulation module, the patron's detail are sent one by one to the template. That leads to frustration from developpers (making sure everything is passed from all scripts) and to regression (we got tone of bugs in the last year because of this way to do). With this patch set it will be easy access patron's detail, passing only 1 variable from the controllers. Test plan: Play with the patron and circulation module and make sur the detail of the patron you are editing/seeing info are correctly displayed. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
90 lines
3.8 KiB
Text
90 lines
3.8 KiB
Text
[% USE Koha %]
|
|
[% SET footerjs = 1 %]
|
|
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Koha › Patrons › Create manual invoice</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
</head>
|
|
|
|
<body id="pat_maninvoice" class="pat">
|
|
[% INCLUDE 'header.inc' %]
|
|
[% INCLUDE 'patron-search.inc' %]
|
|
|
|
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Manual invoice</div>
|
|
|
|
<div id="doc3" class="yui-t2">
|
|
|
|
<div id="bd">
|
|
<div id="yui-main">
|
|
<div class="yui-b">
|
|
[% INCLUDE 'members-toolbar.inc' %]
|
|
|
|
<!-- The manual invoice and credit buttons -->
|
|
<div class="statictabs">
|
|
<ul>
|
|
<li><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber %]">Account</a></li>
|
|
<li><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber %]" >Pay fines</a></li>
|
|
<li class="active"><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% patron.borrowernumber %]" >Create manual invoice</a></li>
|
|
<li><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% patron.borrowernumber %]" >Create manual credit</a></li>
|
|
</ul>
|
|
<div class="tabs-container">
|
|
|
|
[% IF ( ERROR ) %]
|
|
[% IF ( ITEMNUMBER ) %]
|
|
ERROR an invalid itemnumber was entered, please hit back and try again
|
|
[% END %]
|
|
[% ELSE %]
|
|
<form action="/cgi-bin/koha/members/maninvoice.pl" method="post" id="maninvoice"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber %]" />
|
|
<fieldset class="rows">
|
|
<legend>Manual invoice</legend>
|
|
<ol>
|
|
<li>
|
|
<label for="type">Type: </label>
|
|
<select name="type" id="invoice_type">
|
|
<option value="L">Lost item</option>
|
|
<option value="F">Fine</option>
|
|
<option value="A">Account management fee</option>
|
|
<option value="N">New card</option>
|
|
<option value="M">Sundry</option>
|
|
[% FOREACH invoice_types_loo IN invoice_types_loop %]
|
|
<option value="[% invoice_types_loo.authorised_value %]">[% invoice_types_loo.authorised_value %]</option>
|
|
[% END %]
|
|
</select>
|
|
</li>
|
|
<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
|
|
<li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" /></li>
|
|
<li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
|
|
<li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li>
|
|
</ol></fieldset>
|
|
<fieldset class="action"><input type="submit" name="add" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber %]">Cancel</a></fieldset>
|
|
</form>
|
|
|
|
[% END %]
|
|
</div></div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="yui-b">
|
|
[% INCLUDE 'circ-menu.inc' %]
|
|
</div>
|
|
</div>
|
|
|
|
[% MACRO jsinclude BLOCK %]
|
|
<script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu_[% KOHA_VERSION %].js"></script>
|
|
<script type="text/javascript">
|
|
var type_fees = {'L':'','F':'','A':'','N':'','M':''};
|
|
[% FOREACH invoice_types_loo IN invoice_types_loop %]
|
|
type_fees['[% invoice_types_loo.authorised_value %]'] = "[% invoice_types_loo.lib %]";
|
|
[% END %]
|
|
$(document).ready(function(){
|
|
$('#maninvoice').preventDoubleFormSubmit();
|
|
$("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
|
|
$("#invoice_type").on("change",function(){
|
|
this.form.desc.value = this.options[this.selectedIndex].value;
|
|
this.form.amount.value = type_fees[this.options[this.selectedIndex].value];
|
|
});
|
|
});
|
|
</script>
|
|
[% END %]
|
|
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|