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 <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 %]
20 [% IF op == 'delete_confirm' %]Confirm deletion of currency [% currency.currency | $HtmlTags tag='span' attributes=>'class="ex"' %]
21 [% ELSIF op == 'list' %]Currencies
25 <div class="main container-fluid">
27 <div class="col-sm-10 col-sm-push-2">
31 <div id="toolbar" class="btn-toolbar">
32 <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>
36 [% FOR m IN messages %]
37 <div class="dialog [% m.type | html %]">
39 [% CASE 'error_on_update' %]
40 An error occurred when updating this currency. Perhaps it already exists.
41 [% CASE 'error_on_insert' %]
42 An error occurred when adding this currency. The currency code might already exist.
43 [% CASE 'error_on_delete' %]
44 An error occurred when deleting this currency. Check the logs.
45 [% CASE 'success_on_update' %]
46 Currency updated successfully.
47 [% CASE 'success_on_insert' %]
48 Currency added successfully.
49 [% CASE 'success_on_delete' %]
50 Currency deleted successfully.
59 [% IF op == 'add_form' %]
61 <form action="/cgi-bin/koha/admin/currency.pl" name="Aform" method="post" class="validated">
62 <input type="hidden" name="op" value="add_validate" />
63 <fieldset class="rows">
74 <span class="label">Currency: </span>
75 <input type="hidden" name="is_a_modif" value="1" />
76 <input type="hidden" name="currency_code" id="currency" value="[% currency.currency | html %]" />[% currency.currency | html %]
78 <label for="currency_code" class="required">Currency: </label>
79 <input type="text" name="currency_code" id="currency_code" size="50" maxlength="50" required="required" class="required" /> <span class="required">Required</span>
83 <label for="rate" class="required">Rate: </label>
84 <input type="text" name="rate" id="rate" size="10" maxlength="10" value="[% currency.rate | html %]" required="required" class="required" /> <span class="required">Required</span>
87 <label for="symbol" class="required">Symbol: </label>
88 <input type="text" name="symbol" id="symbol" size="5" maxlength="5" value="[% currency.symbol | html %]" required="required" class="required" /> <span class="required">Required</span>
91 <label for="isocode">ISO code: </label>
92 <input type="text" name="isocode" id="isocode" size="5" maxlength="5" value="[% currency.isocode | html %]" />
95 <span class="label">Last updated: </span>[% currency.timestamp | $KohaDates %]
98 <label for="p_sep_by_space">Space separation between symbol and value: </label>
99 [% IF currency.p_sep_by_space %]
100 <input type="checkbox" id="p_sep_by_space" name="p_sep_by_space" value="1" checked="checked" />
102 <input type="checkbox" id="p_sep_by_space" name="p_sep_by_space" value="1" />
106 <label for="active">Active: </label>
107 [% IF currency.active %]
108 <input type="checkbox" id="active" name="active" value="1" checked="checked" />
110 <input type="checkbox" id="active" name="active" value="1" />
112 <span id="hint" class="hint"></span>
117 <fieldset class="action">
118 <input type="submit" value="Submit" />
119 <a href="/cgi-bin/koha/admin/currency.pl" class="cancel">Cancel</a>
125 [% IF op =='delete_confirm' %]
126 [% IF nb_of_orders or nb_of_vendors %]
127 <div class="dialog alert">
128 <h3>Cannot delete currency [% currency.currency | $HtmlTags tag='span' attributes=>'class="ex"' %]</h3>
130 [% IF nb_of_orders %]
131 This currency is used by [% nb_of_orders | html %] orders.
132 [% ELSIF nb_of_vendors %]
133 This currency is used by [% nb_of_vendors | html %] vendors.
135 Deletion not possible
137 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
138 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
142 <div class="dialog alert">
143 <h3>Confirm deletion of currency [% currency.currency | $HtmlTags tag='span' attributes=>'class="ex"' %]</h3>
145 <tr><th>Currency</th>
146 <td>[% currency.currency | html %]</td>
149 <td>[% currency.rate | html %]</td>
152 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
153 <input type="hidden" name="op" value="delete_confirmed" />
154 <input type="hidden" name="currency_code" value="[% currency.currency | html %]" />
155 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this currency</button>
157 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
158 <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
164 [% IF op == 'list' %]
166 <h2>Currencies and exchange rates</h2>
168 [% IF currencies and no_active_currency %]
169 <div class="dialog alert"><h3>No active currency is defined</h3><p>Please edit one currency and mark it as active.</p></div>
173 You searched for [% searchfield | html %]</span>
176 <table id='currencies-table'>
183 <th class="title-string">Last updated</th>
186 <th class="NoSort">Actions</th>
190 [% FOREACH currency IN currencies %]
192 <td>[% currency.currency | html %]</td>
193 <td>[% currency.rate | html %]</td>
194 <td>[% currency.symbol | html %]</td>
195 <td>[% currency.isocode | html %]</td>
196 <td><span title="[% currency.timestamp | html %]">[% currency.timestamp | $KohaDates %]</span></td>
197 <td style="color:green;">[% IF currency.active %]✓[% END %]</td>
198 <td>[% IF currency.archived %]Yes[% END %]</td>
200 <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>
201 <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>
211 When importing MARC files via the staging tools, the tool will attempt to find and use the price of the currently active currency.
214 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)".
215 These examples assume USD is the active currency.
222 </div> <!-- /.col-sm-10.col-sm-push-2 -->
224 <div class="col-sm-2 col-sm-pull-10">
226 [% INCLUDE 'admin-menu.inc' %]
228 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
229 </div> <!-- /.row -->
231 [% MACRO jsinclude BLOCK %]
232 [% Asset.js("js/admin-menu.js") | $raw %]
233 [% INCLUDE 'datatables.inc' %]
234 [% INCLUDE 'columns_settings.inc' %]
237 function check_currency(val) {
239 $("#active").prop('disabled', false);
242 $("#active").prop('checked', false);
243 $("#active").prop('disabled', true);
244 $("#hint").html(_("The active currency must have a rate of 1.0"));
248 $(document).ready(function() {
249 columns_settings = [% TablesSettings.GetColumns( 'admin', 'currency', 'currencies-table', 'json' ) | $raw %]
250 var issuest = KohaTable("currencies-table", {
251 dom: 'B<"clearfix">t',
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' %]