deposit: print formatted amount in prompt

This commit is contained in:
Juerd Waalboer 2022-08-29 00:17:25 +02:00
parent ccaf5016ff
commit 9db2b208eb

View file

@ -11,7 +11,7 @@ sub command :Tab(deposit) ($self, $cart, $command, @) {
} }
sub amount :Tab(13.37,42) ($self, $cart, $amount, @) { sub amount :Tab(13.37,42) ($self, $cart, $amount, @) {
$self->{amount} = parse_amount($amount) $self->{amount} = $amount = parse_amount($amount)
or return REJECT, "Invalid amount"; or return REJECT, "Invalid amount";
call_hooks("deposit_methods", \my $message, $self->{deposit_methods} = {}); call_hooks("deposit_methods", \my $message, $self->{deposit_methods} = {});
@ -20,8 +20,8 @@ sub amount :Tab(13.37,42) ($self, $cart, $amount, @) {
if keys %{ $self->{deposit_methods} }; if keys %{ $self->{deposit_methods} };
$cart $cart
->add(+$self->{amount}, "Deposit", { is_deposit => 1 }) ->add(+$amount, "Deposit", { is_deposit => 1 })
->add_contra("-deposits/other", -$self->{amount}, "Deposited by \$you"); ->add_contra("-deposits/other", -$amount, "Deposited by \$you");
return ACCEPT; return ACCEPT;
} }