4 [% USE TablesSettings %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha › Administration › Currencies & Exchange rates ›
9 [% IF op == 'add_form' %][% IF currency %]Modify currency '[% currency.currency | html %]'[% ELSE %]New currency[% END %][% END %]
10 [% IF op == 'delete_confirm' %]Confirm deletion of currency '[% currency.currency | html %]'[% END %]
11 [% IF op == 'list' %]Currencies[% END %]</title>
12 [% INCLUDE 'doc-head-close.inc' %]
15 <body id="admin_currency" class="admin">
16 [% INCLUDE 'header.inc' %]
17 [% INCLUDE 'currencies-admin-search.inc' %]
19 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
22 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
25 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
28 <a href="/cgi-bin/koha/admin/currency.pl">Currencies & Exchange rates</a>
31 [% IF op == 'add_form' %]
33 <a href="#" aria-current="page">
35 Modify currency '[% currency.currency | html %]'
43 [% IF op == 'delete_confirm' %]
45 <a href="#" aria-current="page">
46 Confirm deletion of currency [% currency.currency | $HtmlTags tag='span' attributes=>'class="ex"' %]
50 [% ELSIF op == 'list' %]
52 <a href="#" aria-current="page">
60 <div class="main container-fluid">
62 <div class="col-sm-10 col-sm-push-2">
66 <div id="toolbar" class="btn-toolbar">
67 <a class="btn btn-default" id="newcurrency" href="/cgi-bin/koha/admin/currency.pl?op=add_form"><i class="fa fa-plus"></i> New currency</a>
71 [% FOR m IN messages %]
72 <div class="dialog [% m.type | html %]">
74 [% CASE 'error_on_update' %]
75 An error occurred when updating this currency. Perhaps it already exists.
76 [% CASE 'error_on_insert' %]
77 An error occurred when adding this currency. The currency code might already exist.
78 [% CASE 'error_on_delete' %]
79 An error occurred when deleting this currency. Check the logs.
80 [% CASE 'success_on_update' %]
81 Currency updated successfully.
82 [% CASE 'success_on_insert' %]
83 Currency added successfully.
84 [% CASE 'success_on_delete' %]
85 Currency deleted successfully.
94 [% IF op == 'add_form' %]
96 <form action="/cgi-bin/koha/admin/currency.pl" name="Aform" method="post" class="validated">
97 <input type="hidden" name="op" value="add_validate" />
98 <fieldset class="rows">
109 <span class="label">Currency: </span>
110 <input type="hidden" name="is_a_modif" value="1" />
111 <input type="hidden" name="currency_code" id="currency" value="[% currency.currency | html %]" />[% currency.currency | html %]
113 <label for="currency_code" class="required">Currency: </label>
114 <input type="text" name="currency_code" id="currency_code" size="50" maxlength="50" required="required" class="required" /> <span class="required">Required</span>
118 <label for="rate" class="required">Rate: </label>
119 <input type="text" name="rate" id="rate" size="10" maxlength="10" value="[% currency.rate | html %]" required="required" class="required" /> <span class="required">Required</span>
122 <label for="symbol" class="required">Symbol: </label>
123 <input type="text" name="symbol" id="symbol" size="5" maxlength="5" value="[% currency.symbol | html %]" required="required" class="required" /> <span class="required">Required</span>
126 <label for="isocode">ISO code: </label>
127 <input type="text" name="isocode" id="isocode" size="5" maxlength="5" value="[% currency.isocode | html %]" />
130 <span class="label">Last updated: </span>[% currency.timestamp | $KohaDates %]
133 <label for="p_sep_by_space">Space separation between symbol and value: </label>
134 [% IF currency.p_sep_by_space %]
135 <input type="checkbox" id="p_sep_by_space" name="p_sep_by_space" value="1" checked="checked" />
137 <input type="checkbox" id="p_sep_by_space" name="p_sep_by_space" value="1" />
141 <label for="active">Active: </label>
142 [% IF currency.active %]
143 <input type="checkbox" id="active" name="active" value="1" checked="checked" />
145 <input type="checkbox" id="active" name="active" value="1" />
147 <span id="hint" class="hint"></span>
152 <fieldset class="action">
153 <input type="submit" value="Submit" />
154 <a href="/cgi-bin/koha/admin/currency.pl" class="cancel">Cancel</a>
160 [% IF op =='delete_confirm' %]
161 [% IF nb_of_orders or nb_of_vendors %]
162 <div class="dialog alert">
163 <h3>Cannot delete currency [% currency.currency | $HtmlTags tag='span' attributes=>'class="ex"' %]</h3>
165 [% IF nb_of_orders %]
166 This currency is used by [% nb_of_orders | html %] orders.
167 [% ELSIF nb_of_vendors %]
168 This currency is used by [% nb_of_vendors | html %] vendors.
170 Deletion not possible
172 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
173 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
177 <div class="dialog alert">
178 <h3>Confirm deletion of currency [% currency.currency | $HtmlTags tag='span' attributes=>'class="ex"' %]</h3>
180 <tr><th>Currency</th>
181 <td>[% currency.currency | html %]</td>
184 <td>[% currency.rate | html %]</td>
187 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
188 <input type="hidden" name="op" value="delete_confirmed" />
189 <input type="hidden" name="currency_code" value="[% currency.currency | html %]" />
190 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this currency</button>
192 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
193 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
199 [% IF op == 'list' %]
201 <h2>Currencies and exchange rates</h2>
203 [% IF currencies and no_active_currency %]
204 <div class="dialog alert"><h3>No active currency is defined</h3><p>Please edit one currency and mark it as active.</p></div>
208 You searched for [% searchfield | html %]</span>
211 <table id='currencies-table'>
218 <th>Last updated</th>
221 <th class="NoSort noExport">Actions</th>
225 [% FOREACH currency IN currencies %]
227 <td>[% currency.currency | html %]</td>
228 <td>[% currency.rate | html %]</td>
229 <td>[% currency.symbol | html %]</td>
230 <td>[% currency.isocode | html %]</td>
231 <td data-order="[% currency.timestamp | html %]">[% currency.timestamp | $KohaDates %]</td>
232 <td style="color:green;">[% IF currency.active %]✓[% END %]</td>
233 <td>[% IF currency.archived %]Yes[% END %]</td>
235 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/currency.pl?op=add_form&currency_code=[% currency.currency | html %]"><i class="fa fa-pencil"></i> Edit</a>
236 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/currency.pl?op=delete_confirm&currency_code=[% currency.currency | html %]"><i class="fa fa-trash"></i> Delete</a>
246 When importing MARC files via the staging tools, the tool will attempt to find and use the price of the currently active currency.
249 Some examples of compatible price fields include "$9.99", "9.99 USD", "$9.99 USD", "9.99 USD (10.00 CAN)", "$9.99 USD (paperback)".
250 These examples assume USD is the active currency.
257 </div> <!-- /.col-sm-10.col-sm-push-2 -->
259 <div class="col-sm-2 col-sm-pull-10">
261 [% INCLUDE 'admin-menu.inc' %]
263 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
264 </div> <!-- /.row -->
266 [% MACRO jsinclude BLOCK %]
267 [% Asset.js("js/admin-menu.js") | $raw %]
268 [% INCLUDE 'datatables.inc' %]
269 [% INCLUDE 'columns_settings.inc' %]
272 function check_currency(val) {
274 $("#active").prop('disabled', false);
277 $("#active").prop('checked', false);
278 $("#active").prop('disabled', true);
279 $("#hint").html(_("The active currency must have a rate of 1.0"));
283 $(document).ready(function() {
284 columns_settings = [% TablesSettings.GetColumns( 'admin', 'currency', 'currencies-table', 'json' ) | $raw %]
285 var issuest = KohaTable("currencies-table", {
286 dom: 'B<"clearfix">t',
287 }, columns_settings );
289 // prevents users to check active with a currency != 1
290 $("#rate").keyup(function() {
291 check_currency( $(this).val() );
293 check_currency( $("#rate").val() );
294 $("#currency_code").on("blur",function(){
301 [% INCLUDE 'intranet-bottom.inc' %]