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="active">Active: </label>
98 [% IF currency.active %]
99 <input type="checkbox" id="active" name="active" value="1" checked="checked" />
101 <input type="checkbox" id="active" name="active" value="1" />
103 <span id="hint" class="hint"></span>
108 <fieldset class="action">
109 <input type="submit" value="Submit" />
110 <a href="/cgi-bin/koha/admin/currency.pl" class="cancel">Cancel</a>
116 [% IF op =='delete_confirm' %]
117 [% IF nb_of_orders or nb_of_vendors %]
118 <div class="dialog alert">
119 <h3>Cannot delete currency [% currency.currency | $HtmlTags tag='span' attributes=>'class="ex"' %]</h3>
121 [% IF nb_of_orders %]
122 This currency is used by [% nb_of_orders %] orders.
123 [% ELSIF nb_of_vendors %]
124 This currency is used by [% nb_of_vendors %] vendors.
126 Deletion not possible
128 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
129 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
133 <div class="dialog alert">
134 <h3>Confirm deletion of currency [% currency.currency | $HtmlTags tag='span' attributes=>'class="ex"' %]</h3>
136 <tr><th>Currency</th>
137 <td>[% currency.currency %]</td>
140 <td>[% currency.rate %]</td>
143 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
144 <input type="hidden" name="op" value="delete_confirmed" />
145 <input type="hidden" name="currency_code" value="[% currency.currency %]" />
146 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this currency</button>
148 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
149 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
155 [% IF op == 'list' %]
157 <h2>Currencies and exchange rates</h2>
159 [% IF currencies and no_active_currency %]
160 <div class="dialog alert"><h3>No active currency is defined</h3><p>Please edit one currency and mark it as active.</p></div>
164 You searched for [% searchfield |html %]</span>
167 <table id='currencies-table'>
174 <th class="title-string">Last updated</th>
181 [% FOREACH currency IN currencies %]
183 <td>[% currency.currency %]</td>
184 <td>[% currency.rate %]</td>
185 <td>[% currency.symbol |html %]</td>
186 <td>[% currency.isocode |html %]</td>
187 <td><span title="[% currency.timestamp %]">[% currency.timestamp | $KohaDates %]</span></td>
188 <td style="color:green;">[% IF currency.active %]✓[% END %]</td>
189 <td>[% IF currency.archived %]Yes[% END %]</td>
191 <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>
192 <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>
202 When importing MARC files via the staging tools, the tool will attempt to find and use the price of the currently active currency.
205 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)".
206 These examples assume USD is the active currency.
215 [% INCLUDE 'admin-menu.inc' %]
219 [% MACRO jsinclude BLOCK %]
220 <script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu_[% KOHA_VERSION %].js"></script>
221 [% INCLUDE 'datatables.inc' %]
222 [% INCLUDE 'columns_settings.inc' %]
223 <script type="text/javascript">
225 function check_currency(val) {
227 $("#active").prop('disabled', false);
230 $("#active").prop('checked', false);
231 $("#active").prop('disabled', true);
232 $("#hint").html(_("The active currency must have a rate of 1.0"));
236 $(document).ready(function() {
237 columns_settings = [% ColumnsSettings.GetColumns( 'admin', 'currency', 'currencies-table', 'json' ) %]
238 var issuest = KohaTable("#currencies-table", {
239 dom: 'B<"clearfix">t',
241 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
242 { "sType": "title-string", "aTargets" : [ "title-string" ] }
244 }, columns_settings );
246 // prevents users to check active with a currency != 1
247 $("#rate").keyup(function() {
248 check_currency( $(this).val() );
250 check_currency( $("#rate").val() );
251 $("#currency_code").on("blur",function(){
258 [% INCLUDE 'intranet-bottom.inc' %]