Bug 41823: (follow-up) Remove redundant table_settings variable

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Lucas Gass 2026-04-29 19:14:15 +00:00
parent 847fba0505
commit 482c323144
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 9 additions and 10 deletions

View File

@ -312,26 +312,25 @@
</script>
<script nonce="[% Koha.CSPNonce | $raw %]">
function check_currency(val) {
if ( val == 1.0 ) {
$("#active").prop('disabled', false);
if (val == 1.0) {
$("#active").prop("disabled", false);
$("#hint").html("");
} else {
$("#active").prop('checked', false);
$("#active").prop('disabled', true);
$("#active").prop("checked", false);
$("#active").prop("disabled", true);
$("#hint").html(_("The active currency must have a rate of 1.0"));
}
}
$(document).ready(function() {
let table_settings = [% TablesSettings.GetTableSettings( 'admin', 'currency', 'currencies-table', 'json' ) | $raw %]
$(document).ready(function () {
$("#currencies-table").kohaTable({}, table_settings);
// prevents users to check active with a currency != 1
$("#rate").keyup(function() {
check_currency( $(this).val() );
$("#rate").keyup(function () {
check_currency($(this).val());
});
check_currency( $("#rate").val() );
$("#currency_code").on("blur",function(){
check_currency($("#rate").val());
$("#currency_code").on("blur", function () {
toUC(this);
});
});