Refuse weird cash combos

Because withdraw/deposit make no sense without an account
This commit is contained in:
Juerd Waalboer 2022-06-12 04:14:50 +02:00
parent 8f43f326b1
commit bdb4b2ce34

View file

@ -13,6 +13,12 @@ sub command :Tab(cash) ($self, $cart, $command, @) {
return NEXT if $command ne 'cash';
if ($cart->size) {
return REJECT, "Can't use cash checkout on a deposit transaction."
if $cart->entries('is_deposit');
return REJECT, "Can't use cash checkout on a withdraw transaction."
if $cart->entries('is_withdrawal');
$cart->checkout('-cash');
} else {
call_hooks 'cash';