4 [% USE TablesSettings %]
6 [% PROCESS 'i18n.inc' %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>[% FILTER collapse %]
10 [% IF op == 'add_form' %]
12 [% tx("Modify currency '{currency_name}'", { currency_name = currency.currency }) | html %] ›
14 [% t("New currency") | html %] ›
17 [% IF op == 'delete_confirm' %]
18 [% tx("Confirm deletion of currency '{currency_name}'", { currency_name = currency.currency }) | html %] ›
20 [% t("Currencies and exchange rates") | html %] ›
21 [% t("Administration") | html %] ›
22 [% t("Koha") | html %]
24 [% INCLUDE 'doc-head-close.inc' %]
27 <body id="admin_currency" class="admin">
28 [% WRAPPER 'header.inc' %]
29 [% INCLUDE 'currencies-admin-search.inc' %]
32 [% WRAPPER 'sub-header.inc' %]
33 [% WRAPPER breadcrumbs %]
34 [% WRAPPER breadcrumb_item %]
35 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
37 [% IF op == 'add_form' || op == 'delete_confirm' %]
38 [% WRAPPER breadcrumb_item %]
39 <a href="/cgi-bin/koha/admin/currency.pl">Currencies and exchange rates</a>
41 [% ELSIF op == 'list' %]
42 [% WRAPPER breadcrumb_item bc_active= 1 %]
43 <span>Currencies and exchange rates</span>
47 [% IF op == 'add_form' %]
48 [% WRAPPER breadcrumb_item bc_active= 1 %]
50 [% tx("Modify currency '{currency_name}'", { currency_name = currency.currency }) | html %]
52 <span>New currency</span>
57 [% IF op == 'delete_confirm' %]
58 [% WRAPPER breadcrumb_item bc_active= 1 %]
59 [% tx("Confirm deletion of currency '{currency_name}'", { currency_name = currency.currency }) | html %]
64 [% END #/ WRAPPER breadcrumbs %]
65 [% END #/ WRAPPER sub-header.inc %]
67 <div class="main container-fluid">
69 <div class="col-sm-10 col-sm-push-2">
73 <div id="toolbar" class="btn-toolbar">
74 <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>
78 [% FOR m IN messages %]
79 <div class="dialog [% m.type | html %]">
81 [% CASE 'error_on_update' %]
82 <span>An error occurred when updating this currency. Perhaps it already exists.</span>
83 [% CASE 'error_on_insert' %]
84 <span>An error occurred when adding this currency. The currency code might already exist.</span>
85 [% CASE 'error_on_delete' %]
86 <span>An error occurred when deleting this currency. Check the logs for details.</span>
87 [% CASE 'success_on_update' %]
88 <span>Currency updated successfully.</span>
89 [% CASE 'success_on_insert' %]
90 <span>Currency added successfully.</span>
91 [% CASE 'success_on_delete' %]
92 <span>Currency deleted successfully.</span>
94 <span>[% m.code | html %]</span>
101 [% IF op == 'add_form' %]
105 [% tx("Modify currency '{currency_name}'", { currency_name = currency.currency }) | html %]
107 <span>New currency</span>
111 <form action="/cgi-bin/koha/admin/currency.pl" name="Aform" method="post" class="validated">
112 <input type="hidden" name="op" value="add_validate" />
113 <fieldset class="rows">
114 <legend class="sr-only">New currency entry form</legend>
118 <span class="label">Currency: </span>
119 <input type="hidden" name="is_a_modif" value="1" />
120 <input type="hidden" name="currency_code" id="currency" value="[% currency.currency | html %]" />[% currency.currency | html %]
122 <label for="currency_code" class="required">Currency: </label>
123 <input type="text" name="currency_code" id="currency_code" class="focus" size="50" maxlength="50" required="required" class="required" /> <span class="required">Required</span>
127 <label for="rate" class="required">Rate: </label>
128 <input type="text" name="rate" id="rate" size="10" maxlength="10" value="[% currency.rate | html %]" required="required" class="required" /> <span class="required">Required</span>
131 <label for="symbol" class="required">Symbol: </label>
132 <input type="text" name="symbol" id="symbol" size="5" maxlength="5" value="[% currency.symbol | html %]" required="required" class="required" /> <span class="required">Required</span>
135 <label for="isocode">ISO code: </label>
136 <input type="text" name="isocode" id="isocode" size="5" maxlength="5" value="[% currency.isocode | html %]" />
139 <span class="label">Last updated: </span>[% currency.timestamp | $KohaDates %]
142 <label for="p_sep_by_space">Space separation between symbol and value: </label>
143 [% IF currency.p_sep_by_space %]
144 <input type="checkbox" id="p_sep_by_space" name="p_sep_by_space" value="1" checked="checked" />
146 <input type="checkbox" id="p_sep_by_space" name="p_sep_by_space" value="1" />
150 <label for="active">Active: </label>
151 [% IF currency.active %]
152 <input type="checkbox" id="active" name="active" value="1" checked="checked" />
154 <input type="checkbox" id="active" name="active" value="1" />
156 <span id="hint" class="hint"></span>
161 <fieldset class="action">
162 <input type="submit" class="btn btn-primary" value="Submit" />
163 <a href="/cgi-bin/koha/admin/currency.pl" class="cancel">Cancel</a>
169 [% IF op =='delete_confirm' %]
170 [% IF nb_of_orders or nb_of_vendors %]
171 <div class="dialog alert">
172 <h1>Cannot delete currency [% currency.currency | $HtmlTags tag='span' attributes=>'class="ex"' %]</h1>
174 [% IF nb_of_orders %]
175 <span>This currency is used by [% nb_of_orders | html %] orders.</span>
176 [% ELSIF nb_of_vendors %]
177 <span>This currency is used by [% nb_of_vendors | html %] vendors.</span>
179 <span>Deletion not possible</span>
181 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
182 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
186 <div class="dialog alert">
187 <h1>[% tx("Confirm deletion of currency '{currency_name}'", { currency_name = currency.currency }) | html %]</h1>
189 <tr><th>Currency</th>
190 <td>[% currency.currency | html %]</td>
193 <td>[% currency.rate | html %]</td>
196 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
197 <input type="hidden" name="op" value="delete_confirmed" />
198 <input type="hidden" name="currency_code" value="[% currency.currency | html %]" />
199 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this currency</button>
201 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
202 <button type="submit" class="deny"><i class="fa fa-fw fa-times"></i> No, do not delete</button>
208 [% IF op == 'list' %]
210 <h1>Currencies and exchange rates</h1>
212 [% IF currencies and no_active_currency %]
213 <div class="dialog alert"><h3>No active currency is defined</h3><p>Please edit one currency and mark it as active.</p></div>
217 You searched for [% searchfield | html %]</span>
220 <div class="page-section">
221 <table id='currencies-table'>
228 <th>Last updated</th>
231 <th class="NoSort noExport">Actions</th>
235 [% FOREACH currency IN currencies %]
237 <td>[% currency.currency | html %]</td>
238 <td>[% currency.rate | html %]</td>
239 <td>[% currency.symbol | html %]</td>
240 <td>[% currency.isocode | html %]</td>
241 <td data-order="[% currency.timestamp | html %]">[% currency.timestamp | $KohaDates %]</td>
242 <td style="color:green;">[% IF currency.active %]✓[% END %]</td>
243 <td>[% IF currency.archived %]Yes[% END %]</td>
245 <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-solid fa-pencil" aria-hidden="true"></i> Edit</a>
246 <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-can"></i> Delete</a>
256 When importing MARC files via the staging tools, the tool will attempt to find and use the price of the currently active currency.
259 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)".
260 These examples assume USD is the active currency.
267 </div> <!-- /.col-sm-10.col-sm-push-2 -->
269 <div class="col-sm-2 col-sm-pull-10">
271 [% INCLUDE 'admin-menu.inc' %]
273 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
274 </div> <!-- /.row -->
276 [% MACRO jsinclude BLOCK %]
277 [% Asset.js("js/admin-menu.js") | $raw %]
278 [% INCLUDE 'datatables.inc' %]
279 [% INCLUDE 'columns_settings.inc' %]
282 function check_currency(val) {
284 $("#active").prop('disabled', false);
287 $("#active").prop('checked', false);
288 $("#active").prop('disabled', true);
289 $("#hint").html(_("The active currency must have a rate of 1.0"));
293 $(document).ready(function() {
294 columns_settings = [% TablesSettings.GetTableSettings( 'admin', 'currency', 'currencies-table', 'json' ) | $raw %]
295 var issuest = KohaTable("currencies-table", {
296 }, columns_settings );
298 // prevents users to check active with a currency != 1
299 $("#rate").keyup(function() {
300 check_currency( $(this).val() );
302 check_currency( $("#rate").val() );
303 $("#currency_code").on("blur",function(){
310 [% INCLUDE 'intranet-bottom.inc' %]