Refuse weird cash combos
Because withdraw/deposit make no sense without an account
This commit is contained in:
parent
8f43f326b1
commit
bdb4b2ce34
1 changed files with 6 additions and 0 deletions
|
@ -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';
|
||||
|
|
Loading…
Add table
Reference in a new issue