2 [% USE ColumnsSettings %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha › Administration › Currencies & Exchange rates ›
7 [% IF op == 'add_form' %][% IF currency %]Modify currency '[% currency.currency %]'[% ELSE %]New currency[% END %][% END %]
8 [% IF op == 'delete_confirm' %]Confirm deletion of currency '[% currency.currency %]'[% END %]
9 [% IF op == 'list' %]Currencies[% END %]</title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
14 <body id="admin_currency" class="admin">
15 [% INCLUDE 'header.inc' %]
16 [% INCLUDE 'currencies-admin-search.inc' %]
18 <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 %]'[% ELSE %]New currency[% END %][% END %]
19 [% IF op == 'delete_confirm' %]Confirm deletion of currency [% currency.currency | $HtmlTags tag='span' attributes=>'class="ex"' %]
20 [% ELSIF op == 'list' %]Currencies
24 <div id="doc3" class="yui-t2">
30 <div id="toolbar" class="btn-toolbar">
31 <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>
35 [% FOR m IN messages %]
36 <div class="dialog [% m.type %]">
38 [% CASE 'error_on_update' %]
39 An error occurred when updating this currency. Perhaps it already exists.
40 [% CASE 'error_on_insert' %]
41 An error occurred when adding this currency. The currency code might already exist.
42 [% CASE 'error_on_delete' %]
43 An error occurred when deleting this currency. Check the logs.
44 [% CASE 'success_on_update' %]
45 Currency updated successfully.
46 [% CASE 'success_on_insert' %]
47 Currency added successfully.
48 [% CASE 'success_on_delete' %]
49 Currency deleted successfully.
58 [% IF op == 'add_form' %]
60 <form action="/cgi-bin/koha/admin/currency.pl" name="Aform" method="post" class="validated">
61 <input type="hidden" name="op" value="add_validate" />
62 <fieldset class="rows">
73 <span class="label">Currency: </span>
74 <input type="hidden" name="is_a_modif" value="1" />
75 <input type="hidden" name="currency_code" id="currency" value="[% currency.currency %]" />[% currency.currency %]
77 <label for="currency_code" class="required">Currency: </label>
78 <input type="text" name="currency_code" id="currency_code" size="50" maxlength="50" required="required" class="required" /> <span class="required">Required</span>
82 <label for="rate" class="required">Rate: </label>
83 <input type="text" name="rate" id="rate" size="10" maxlength="10" value="[% currency.rate %]" required="required" class="required" /> <span class="required">Required</span>
86 <label for="symbol" class="required">Symbol: </label>
87 <input type="text" name="symbol" id="symbol" size="5" maxlength="5" value="[% currency.symbol %]" required="required" class="required" /> <span class="required">Required</span>
90 <label for="isocode">ISO code: </label>
91 <input type="text" name="isocode" id="isocode" size="5" maxlength="5" value="[% currency.isocode %]" />
94 <span class="label">Last updated: </span>[% currency.timestamp | $KohaDates %]
97 <label for="p_sep_by_space">Space separation between symbol and value: </label>
98 [% IF currency.p_sep_by_space %]
99 <input type="checkbox" id="p_sep_by_space" name="p_sep_by_space" value="1" checked="checked" />
101 <input type="checkbox" id="p_sep_by_space" name="p_sep_by_space" value="1" />
105 <label for="active">Active: </label>
106 [% IF currency.active %]
107 <input type="checkbox" id="active" name="active" value="1" checked="checked" />
109 <input type="checkbox" id="active" name="active" value="1" />
111 <span id="hint" class="hint"></span>
116 <fieldset class="action">
117 <input type="submit" value="Submit" />
118 <a href="/cgi-bin/koha/admin/currency.pl" class="cancel">Cancel</a>
124 [% IF op =='delete_confirm' %]
125 [% IF nb_of_orders or nb_of_vendors %]
126 <div class="dialog alert">
127 <h3>Cannot delete currency [% currency.currency | $HtmlTags tag='span' attributes=>'class="ex"' %]</h3>
129 [% IF nb_of_orders %]
130 This currency is used by [% nb_of_orders %] orders.
131 [% ELSIF nb_of_vendors %]
132 This currency is used by [% nb_of_vendors %] vendors.
134 Deletion not possible
136 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
137 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
141 <div class="dialog alert">
142 <h3>Confirm deletion of currency [% currency.currency | $HtmlTags tag='span' attributes=>'class="ex"' %]</h3>
144 <tr><th>Currency</th>
145 <td>[% currency.currency %]</td>
148 <td>[% currency.rate %]</td>
151 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
152 <input type="hidden" name="op" value="delete_confirmed" />
153 <input type="hidden" name="currency_code" value="[% currency.currency %]" />
154 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this currency</button>
156 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
157 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
163 [% IF op == 'list' %]
165 <h2>Currencies and exchange rates</h2>
167 [% IF currencies and no_active_currency %]
168 <div class="dialog alert"><h3>No active currency is defined</h3><p>Please edit one currency and mark it as active.</p></div>
172 You searched for [% searchfield |html %]</span>
175 <table id='currencies-table'>
182 <th class="title-string">Last updated</th>
189 [% FOREACH currency IN currencies %]
191 <td>[% currency.currency %]</td>
192 <td>[% currency.rate %]</td>
193 <td>[% currency.symbol |html %]</td>
194 <td>[% currency.isocode |html %]</td>
195 <td><span title="[% currency.timestamp %]">[% currency.timestamp | $KohaDates %]</span></td>
196 <td style="color:green;">[% IF currency.active %]✓[% END %]</td>
197 <td>[% IF currency.archived %]Yes[% END %]</td>
199 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/currency.pl?op=add_form&currency_code=[% currency.currency %]"><i class="fa fa-pencil"></i> Edit</a>
200 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/currency.pl?op=delete_confirm&currency_code=[% currency.currency %]"><i class="fa fa-trash"></i> Delete</a>
210 When importing MARC files via the staging tools, the tool will attempt to find and use the price of the currently active currency.
213 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)".
214 These examples assume USD is the active currency.
223 [% INCLUDE 'admin-menu.inc' %]
227 [% MACRO jsinclude BLOCK %]
228 <script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu_[% KOHA_VERSION %].js"></script>
229 [% INCLUDE 'datatables.inc' %]
230 [% INCLUDE 'columns_settings.inc' %]
231 <script type="text/javascript">
233 function check_currency(val) {
235 $("#active").prop('disabled', false);
238 $("#active").prop('checked', false);
239 $("#active").prop('disabled', true);
240 $("#hint").html(_("The active currency must have a rate of 1.0"));
244 $(document).ready(function() {
245 columns_settings = [% ColumnsSettings.GetColumns( 'admin', 'currency', 'currencies-table', 'json' ) %]
246 var issuest = KohaTable("currencies-table", {
247 dom: 'B<"clearfix">t',
249 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
250 { "sType": "title-string", "aTargets" : [ "title-string" ] }
252 }, columns_settings );
254 // prevents users to check active with a currency != 1
255 $("#rate").keyup(function() {
256 check_currency( $(this).val() );
258 check_currency( $("#rate").val() );
259 $("#currency_code").on("blur",function(){
266 [% INCLUDE 'intranet-bottom.inc' %]