4 [% USE ColumnsSettings %]
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' %]
13 [% Asset.css("css/datatables.css") | $raw %]
16 <body id="admin_currency" class="admin">
17 [% INCLUDE 'header.inc' %]
18 [% INCLUDE 'currencies-admin-search.inc' %]
20 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › <a href="/cgi-bin/koha/admin/currency.pl">Currencies & Exchange rates</a> › [% IF op == 'add_form' %][% IF currency %]Modify currency '[% currency.currency | html %]'[% ELSE %]New currency[% END %][% END %]
21 [% IF op == 'delete_confirm' %]Confirm deletion of currency [% currency.currency | $HtmlTags tag='span' attributes=>'class="ex"' | html %]
22 [% ELSIF op == 'list' %]Currencies
26 <div id="doc3" class="yui-t2">
32 <div id="toolbar" class="btn-toolbar">
33 <a class="btn btn-default btn-sm" id="newcurrency" href="/cgi-bin/koha/admin/currency.pl?op=add_form"><i class="fa fa-plus"></i> New currency</a>
37 [% FOR m IN messages %]
38 <div class="dialog [% m.type | html %]">
40 [% CASE 'error_on_update' %]
41 An error occurred when updating this currency. Perhaps it already exists.
42 [% CASE 'error_on_insert' %]
43 An error occurred when adding this currency. The currency code might already exist.
44 [% CASE 'error_on_delete' %]
45 An error occurred when deleting this currency. Check the logs.
46 [% CASE 'success_on_update' %]
47 Currency updated successfully.
48 [% CASE 'success_on_insert' %]
49 Currency added successfully.
50 [% CASE 'success_on_delete' %]
51 Currency deleted successfully.
60 [% IF op == 'add_form' %]
62 <form action="/cgi-bin/koha/admin/currency.pl" name="Aform" method="post" class="validated">
63 <input type="hidden" name="op" value="add_validate" />
64 <fieldset class="rows">
75 <span class="label">Currency: </span>
76 <input type="hidden" name="is_a_modif" value="1" />
77 <input type="hidden" name="currency_code" id="currency" value="[% currency.currency | html %]" />[% currency.currency | html %]
79 <label for="currency_code" class="required">Currency: </label>
80 <input type="text" name="currency_code" id="currency_code" size="50" maxlength="50" required="required" class="required" /> <span class="required">Required</span>
84 <label for="rate" class="required">Rate: </label>
85 <input type="text" name="rate" id="rate" size="10" maxlength="10" value="[% currency.rate | html %]" required="required" class="required" /> <span class="required">Required</span>
88 <label for="symbol" class="required">Symbol: </label>
89 <input type="text" name="symbol" id="symbol" size="5" maxlength="5" value="[% currency.symbol | html %]" required="required" class="required" /> <span class="required">Required</span>
92 <label for="isocode">ISO code: </label>
93 <input type="text" name="isocode" id="isocode" size="5" maxlength="5" value="[% currency.isocode | html %]" />
96 <span class="label">Last updated: </span>[% currency.timestamp | $KohaDates %]
99 <label for="p_sep_by_space">Space separation between symbol and value: </label>
100 [% IF currency.p_sep_by_space %]
101 <input type="checkbox" id="p_sep_by_space" name="p_sep_by_space" value="1" checked="checked" />
103 <input type="checkbox" id="p_sep_by_space" name="p_sep_by_space" value="1" />
107 <label for="active">Active: </label>
108 [% IF currency.active %]
109 <input type="checkbox" id="active" name="active" value="1" checked="checked" />
111 <input type="checkbox" id="active" name="active" value="1" />
113 <span id="hint" class="hint"></span>
118 <fieldset class="action">
119 <input type="submit" value="Submit" />
120 <a href="/cgi-bin/koha/admin/currency.pl" class="cancel">Cancel</a>
126 [% IF op =='delete_confirm' %]
127 [% IF nb_of_orders or nb_of_vendors %]
128 <div class="dialog alert">
129 <h3>Cannot delete currency [% currency.currency | $HtmlTags tag='span' attributes=>'class="ex"' | html %]</h3>
131 [% IF nb_of_orders %]
132 This currency is used by [% nb_of_orders | html %] orders.
133 [% ELSIF nb_of_vendors %]
134 This currency is used by [% nb_of_vendors | html %] vendors.
136 Deletion not possible
138 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
139 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
143 <div class="dialog alert">
144 <h3>Confirm deletion of currency [% currency.currency | $HtmlTags tag='span' attributes=>'class="ex"' | html %]</h3>
146 <tr><th>Currency</th>
147 <td>[% currency.currency | html %]</td>
150 <td>[% currency.rate | html %]</td>
153 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
154 <input type="hidden" name="op" value="delete_confirmed" />
155 <input type="hidden" name="currency_code" value="[% currency.currency | html %]" />
156 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this currency</button>
158 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
159 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
165 [% IF op == 'list' %]
167 <h2>Currencies and exchange rates</h2>
169 [% IF currencies and no_active_currency %]
170 <div class="dialog alert"><h3>No active currency is defined</h3><p>Please edit one currency and mark it as active.</p></div>
174 You searched for [% searchfield | html %]</span>
177 <table id='currencies-table'>
184 <th class="title-string">Last updated</th>
191 [% FOREACH currency IN currencies %]
193 <td>[% currency.currency | html %]</td>
194 <td>[% currency.rate | html %]</td>
195 <td>[% currency.symbol | html %]</td>
196 <td>[% currency.isocode | html %]</td>
197 <td><span title="[% currency.timestamp | html %]">[% currency.timestamp | $KohaDates %]</span></td>
198 <td style="color:green;">[% IF currency.active %]✓[% END %]</td>
199 <td>[% IF currency.archived %]Yes[% END %]</td>
201 <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>
202 <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>
212 When importing MARC files via the staging tools, the tool will attempt to find and use the price of the currently active currency.
215 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)".
216 These examples assume USD is the active currency.
225 [% INCLUDE 'admin-menu.inc' %]
229 [% MACRO jsinclude BLOCK %]
230 [% Asset.js("js/admin-menu.js") | $raw %]
231 [% INCLUDE 'datatables.inc' %]
232 [% INCLUDE 'columns_settings.inc' %]
233 <script type="text/javascript">
235 function check_currency(val) {
237 $("#active").prop('disabled', false);
240 $("#active").prop('checked', false);
241 $("#active").prop('disabled', true);
242 $("#hint").html(_("The active currency must have a rate of 1.0"));
246 $(document).ready(function() {
247 columns_settings = [% ColumnsSettings.GetColumns( 'admin', 'currency', 'currencies-table', 'json' ).raw %]
248 var issuest = KohaTable("currencies-table", {
249 dom: 'B<"clearfix">t',
251 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
252 { "sType": "title-string", "aTargets" : [ "title-string" ] }
254 }, columns_settings );
256 // prevents users to check active with a currency != 1
257 $("#rate").keyup(function() {
258 check_currency( $(this).val() );
260 check_currency( $("#rate").val() );
261 $("#currency_code").on("blur",function(){
268 [% INCLUDE 'intranet-bottom.inc' %]