4 [% USE TablesSettings %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>[% IF op == 'add_form' %][% IF currency %]Modify currency '[% currency.currency | html %]'[% ELSE %]New currency[% END %][% END %]
9 [% IF op == 'delete_confirm' %]Confirm deletion of currency '[% currency.currency | html %]'[% END %]
10 [% IF op == 'list' %]Currencies[% END %] › Currencies and exchange rates › Administration › Koha
12 [% INCLUDE 'doc-head-close.inc' %]
15 <body id="admin_currency" class="admin">
16 [% WRAPPER 'header.inc' %]
17 [% INCLUDE 'currencies-admin-search.inc' %]
20 [% WRAPPER 'sub-header.inc' %]
21 [% WRAPPER breadcrumbs %]
22 [% WRAPPER breadcrumb_item %]
23 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
25 [% WRAPPER breadcrumb_item %]
26 <a href="/cgi-bin/koha/admin/currency.pl">Currencies and exchange rates</a>
29 [% IF op == 'add_form' %]
30 [% WRAPPER breadcrumb_item bc_active= 1 %]
32 <span>Modify currency '[% currency.currency | html %]'</span>
34 <span>New currency</span>
39 [% IF op == 'delete_confirm' %]
40 [% WRAPPER breadcrumb_item bc_active= 1 %]
41 <span>Confirm deletion of currency [% currency.currency | $HtmlTags tag='span' attributes=>'class="ex"' %]</span>
44 [% ELSIF op == 'list' %]
45 [% WRAPPER breadcrumb_item bc_active= 1 %]
46 <span>Currencies</span>
49 [% END #/ WRAPPER breadcrumbs %]
50 [% END #/ WRAPPER sub-header.inc %]
52 <div class="main container-fluid">
54 <div class="col-sm-10 col-sm-push-2">
58 <div id="toolbar" class="btn-toolbar">
59 <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>
63 [% FOR m IN messages %]
64 <div class="dialog [% m.type | html %]">
66 [% CASE 'error_on_update' %]
67 <span>An error occurred when updating this currency. Perhaps it already exists</span>
68 [% CASE 'error_on_insert' %]
69 <span>An error occurred when adding this currency. The currency code might already exist</span>
70 [% CASE 'error_on_delete' %]
71 <span>An error occurred when deleting this currency. Check the logs</span>
72 [% CASE 'success_on_update' %]
73 <span>Currency updated successfully</span>
74 [% CASE 'success_on_insert' %]
75 <span>Currency added successfully</span>
76 [% CASE 'success_on_delete' %]
77 <span>Currency deleted successfully</span>
79 <span>[% m.code | html %]</span>
86 [% IF op == 'add_form' %]
88 <form action="/cgi-bin/koha/admin/currency.pl" name="Aform" method="post" class="validated">
89 <input type="hidden" name="op" value="add_validate" />
90 <fieldset class="rows">
94 <span>Modify currency</span>
96 <span>New currency</span>
103 <span class="label">Currency: </span>
104 <input type="hidden" name="is_a_modif" value="1" />
105 <input type="hidden" name="currency_code" id="currency" value="[% currency.currency | html %]" />[% currency.currency | html %]
107 <label for="currency_code" class="required">Currency: </label>
108 <input type="text" name="currency_code" id="currency_code" class="focus" size="50" maxlength="50" required="required" class="required" /> <span class="required">Required</span>
112 <label for="rate" class="required">Rate: </label>
113 <input type="text" name="rate" id="rate" size="10" maxlength="10" value="[% currency.rate | html %]" required="required" class="required" /> <span class="required">Required</span>
116 <label for="symbol" class="required">Symbol: </label>
117 <input type="text" name="symbol" id="symbol" size="5" maxlength="5" value="[% currency.symbol | html %]" required="required" class="required" /> <span class="required">Required</span>
120 <label for="isocode">ISO code: </label>
121 <input type="text" name="isocode" id="isocode" size="5" maxlength="5" value="[% currency.isocode | html %]" />
124 <span class="label">Last updated: </span>[% currency.timestamp | $KohaDates %]
127 <label for="p_sep_by_space">Space separation between symbol and value: </label>
128 [% IF currency.p_sep_by_space %]
129 <input type="checkbox" id="p_sep_by_space" name="p_sep_by_space" value="1" checked="checked" />
131 <input type="checkbox" id="p_sep_by_space" name="p_sep_by_space" value="1" />
135 <label for="active">Active: </label>
136 [% IF currency.active %]
137 <input type="checkbox" id="active" name="active" value="1" checked="checked" />
139 <input type="checkbox" id="active" name="active" value="1" />
141 <span id="hint" class="hint"></span>
146 <fieldset class="action">
147 <input type="submit" class="btn btn-primary" value="Submit" />
148 <a href="/cgi-bin/koha/admin/currency.pl" class="cancel">Cancel</a>
154 [% IF op =='delete_confirm' %]
155 [% IF nb_of_orders or nb_of_vendors %]
156 <div class="dialog alert">
157 <h1>Cannot delete currency [% currency.currency | $HtmlTags tag='span' attributes=>'class="ex"' %]</h1>
159 [% IF nb_of_orders %]
160 <span>This currency is used by [% nb_of_orders | html %] orders.</span>
161 [% ELSIF nb_of_vendors %]
162 <span>This currency is used by [% nb_of_vendors | html %] vendors.</span>
164 <span>Deletion not possible</span>
166 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
167 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
171 <div class="dialog alert">
172 <h1>Confirm deletion of currency [% currency.currency | $HtmlTags tag='span' attributes=>'class="ex"' %]</h1>
174 <tr><th>Currency</th>
175 <td>[% currency.currency | html %]</td>
178 <td>[% currency.rate | html %]</td>
181 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
182 <input type="hidden" name="op" value="delete_confirmed" />
183 <input type="hidden" name="currency_code" value="[% currency.currency | html %]" />
184 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this currency</button>
186 <form action="/cgi-bin/koha/admin/currency.pl" method="post">
187 <button type="submit" class="deny"><i class="fa fa-fw fa-times"></i> No, do not delete</button>
193 [% IF op == 'list' %]
195 <h1>Currencies and exchange rates</h1>
197 [% IF currencies and no_active_currency %]
198 <div class="dialog alert"><h3>No active currency is defined</h3><p>Please edit one currency and mark it as active.</p></div>
202 You searched for [% searchfield | html %]</span>
205 <div class="page-section">
206 <table id='currencies-table'>
213 <th>Last updated</th>
216 <th class="NoSort noExport">Actions</th>
220 [% FOREACH currency IN currencies %]
222 <td>[% currency.currency | html %]</td>
223 <td>[% currency.rate | html %]</td>
224 <td>[% currency.symbol | html %]</td>
225 <td>[% currency.isocode | html %]</td>
226 <td data-order="[% currency.timestamp | html %]">[% currency.timestamp | $KohaDates %]</td>
227 <td style="color:green;">[% IF currency.active %]✓[% END %]</td>
228 <td>[% IF currency.archived %]Yes[% END %]</td>
230 <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>
231 <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>
241 When importing MARC files via the staging tools, the tool will attempt to find and use the price of the currently active currency.
244 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)".
245 These examples assume USD is the active currency.
252 </div> <!-- /.col-sm-10.col-sm-push-2 -->
254 <div class="col-sm-2 col-sm-pull-10">
256 [% INCLUDE 'admin-menu.inc' %]
258 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
259 </div> <!-- /.row -->
261 [% MACRO jsinclude BLOCK %]
262 [% Asset.js("js/admin-menu.js") | $raw %]
263 [% INCLUDE 'datatables.inc' %]
264 [% INCLUDE 'columns_settings.inc' %]
267 function check_currency(val) {
269 $("#active").prop('disabled', false);
272 $("#active").prop('checked', false);
273 $("#active").prop('disabled', true);
274 $("#hint").html(_("The active currency must have a rate of 1.0"));
278 $(document).ready(function() {
279 columns_settings = [% TablesSettings.GetTableSettings( 'admin', 'currency', 'currencies-table', 'json' ) | $raw %]
280 var issuest = KohaTable("currencies-table", {
281 dom: 'B<"clearfix">t',
282 }, columns_settings );
284 // prevents users to check active with a currency != 1
285 $("#rate").keyup(function() {
286 check_currency( $(this).val() );
288 check_currency( $("#rate").val() );
289 $("#currency_code").on("blur",function(){
296 [% INCLUDE 'intranet-bottom.inc' %]