The DB column is currency.currency not currency.currency_code.
Test plan:
Delete a currency
Without this patch, you will get a warning in the logs:
No method currency_code! at
/home/koha/src/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt
line 148.
And the currency won't be deleted.
With this patch, it will!
It also changes the value of the delete op.
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
currency => $currency,
nb_of_orders => $nb_of_orders,
);
-} elsif ( $op eq 'delete' ) {
+} elsif ( $op eq 'delete_confirmed' ) {
my $currency = Koha::Acquisition::Currencies->find($currency_code);
my $deleted = eval { $currency->delete; };
</table>
<form action="/cgi-bin/koha/admin/currency.pl" method="post">
<input type="hidden" name="op" value="delete_confirmed" />
- <input type="hidden" name="currency_code" value="[% currency.currency_code %]" />
+ <input type="hidden" name="currency_code" value="[% currency.currency %]" />
<button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete this currency</button>
</form>
<form action="/cgi-bin/koha/admin/currency.pl" method="post">