2 [% USE ColumnsSettings %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Administration › Currencies & Exchange rates ›
6 [% IF op == 'add_form' %][% IF currency %]Modify currency '[% currency.currency %]'[% ELSE %]New currency[% END %][% END %]
7 [% IF op == 'delete_confirm' %]Confirm deletion of currency '[% currency.currency %]'[% END %]
8 [% IF op == 'list' %]Currencies[% END %]</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
11 [% INCLUDE 'datatables.inc' %]
12 [% INCLUDE 'columns_settings.inc' %]
13 <script type="text/javascript">
16 function check_currency(val) {
18 $("#active").prop('disabled', false);
21 $("#active").prop('checked', false);
22 $("#active").prop('disabled', true);
23 $("#hint").html(_("The active currency must have a rate of 1.0"));
27 $(document).ready(function() {
28 columns_settings = [% ColumnsSettings.GetColumns( 'admin', 'currency', 'currencies-table', 'json' ) %]
29 var issuest = KohaTable("#currencies-table", {
30 dom: 'B<"clearfix">t',
32 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
33 { "sType": "title-string", "aTargets" : [ "title-string" ] }
35 }, columns_settings );
37 // prevents users to check active with a currency != 1
38 $("#rate").keyup(function() {
39 check_currency( $(this).val() );
41 check_currency( $("#rate").val() );
42 $("#currency_code").on("blur",function(){
49 <body id="admin_currency" class="admin">
50 [% INCLUDE 'header.inc' %]
51 [% INCLUDE 'currencies-admin-search.inc' %]
55 <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 %]
56 [% IF op == 'delete_confirm' %]Confirm deletion of currency [% currency.currency | $HtmlTags tag='span' attributes=>'class="ex"' %]
57 [% ELSIF op == 'list' %]Currencies
61 <div id="doc3" class="yui-t2">
67 <div id="toolbar" class="btn-toolbar">
68 <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>
72 [% FOR m IN messages %]
73 <div class="dialog [% m.type %]">
75 [% CASE 'error_on_update' %]
76 An error occurred when updating this currency. Perhaps it already exists.
77 [% CASE 'error_on_insert' %]
78 An error occurred when adding this currency. The currency code might already exist.
79 [% CASE 'error_on_delete' %]
80 An error occurred when deleting this currency. Check the logs.
81 [% CASE 'success_on_update' %]
82 Currency updated successfully.
83 [% CASE 'success_on_insert' %]
84 Currency added successfully.
85 [% CASE 'success_on_delete' %]
86 Currency deleted successfully.
95 [% IF op == 'add_form' %]
97 <form action="/cgi-bin/koha/admin/currency.pl" name="Aform" method="post" class="validated">
98 <input type="hidden" name="op" value="add_validate" />
99 <fieldset class="rows">
110 <span class="label">Currency: </span>
111 <input type="hidden" name="is_a_modif" value="1" />
112 <input type="hidden" name="currency_code" id="currency" value="[% currency.currency %]" />[% currency.currency %]
114 <label for="currency_code" class="required">Currency: </label>
115 <input type="text" name="currency_code" id="currency_code" size="50" maxlength="50" required="required" class="required" /> <span class="required">Required</span>
119 <label for="rate" class="required">Rate: </label>
120 <input type="text" name="rate" id="rate" size="10" maxlength="10" value="[% currency.rate %]" required="required" class="required" /> <span class="required">Required</span>
123 <label for="symbol" class="required">Symbol: </label>
124 <input type="text" name="symbol" id="symbol" size="5" maxlength="5" value="[% currency.symbol %]" required="required" class="required" /> <span class="required">Required</span>
127 <label for="isocode">ISO code: </label>
128 <input type="text" name="isocode" id="isocode" size="5" maxlength="5" value="[% currency.isocode %]" />
131 <span class="label">Last updated: </span>[% currency.timestamp | $KohaDates %]
134 <label for="active">Active: </label>
135 [% IF currency.active %]
136 <input type="checkbox" id="active" name="active" value="1" checked="checked" />
138 <input type="checkbox" id="active" name="active" value="1" />
140 <span id="hint" class="hint"></span>
145 <fieldset class="action">
146 <input type="submit" value="Submit" />
147 <a href="/cgi-bin/koha/admin/currency.pl" class="cancel">Cancel</a>
153 [% IF op =='delete_confirm' %]
154 [% IF nb_of_orders or nb_of_vendors %]
155 <div class="dialog alert">
156 <h3>Cannot delete currency [% currency.currency | $HtmlTags tag='span' attributes=>'class="ex"' %]</h3>
158 [% IF nb_of_orders %]
159 This currency is used by [% nb_of_orders %] orders.
160 [% ELSIF nb_of_vendors %]
161 This currency is used by [% nb_of_vendors %] vendors.
163 Deletion not possible
165 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
166 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
170 <div class="dialog alert">
171 <h3>Confirm deletion of currency [% currency.currency | $HtmlTags tag='span' attributes=>'class="ex"' %]</h3>
173 <tr><th>Currency</th>
174 <td>[% currency.currency %]</td>
177 <td>[% currency.rate %]</td>
180 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
181 <input type="hidden" name="op" value="delete_confirmed" />
182 <input type="hidden" name="currency_code" value="[% currency.currency %]" />
183 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this currency</button>
185 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
186 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
192 [% IF op == 'list' %]
194 <h2>Currencies and exchange rates</h2>
196 [% IF currencies and no_active_currency %]
197 <div class="dialog alert"><h3>No active currency is defined</h3><p>Please edit one currency and mark it as active.</p></div>
201 You searched for [% searchfield |html %]</span>
204 <table id='currencies-table'>
211 <th class="title-string">Last updated</th>
218 [% FOREACH currency IN currencies %]
220 <td>[% currency.currency %]</td>
221 <td>[% currency.rate %]</td>
222 <td>[% currency.symbol |html %]</td>
223 <td>[% currency.isocode |html %]</td>
224 <td><span title="[% currency.timestamp %]">[% currency.timestamp | $KohaDates %]</span></td>
225 <td style="color:green;">[% IF currency.active %]✓[% END %]</td>
226 <td>[% IF currency.archived %]Yes[% END %]</td>
228 <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>
229 <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>
239 When importing MARC files via the staging tools, the tool will attempt to find and use the price of the currently active currency.
242 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)".
243 These examples assume USD is the active currency.
252 [% INCLUDE 'admin-menu.inc' %]
255 [% INCLUDE 'intranet-bottom.inc' %]