From e3a04a0e36bab550be8a1fddadf5d0b3c06128a1 Mon Sep 17 00:00:00 2001 From: Juerd Waalboer Date: Sat, 11 Jun 2022 17:18:31 +0200 Subject: [PATCH] Keep track of cash First attempt at keeping track of where cash goes using the new hidden '-cash' account. --- plugins/withdraw | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/withdraw b/plugins/withdraw index 9a7ed15..f1bc9b3 100644 --- a/plugins/withdraw +++ b/plugins/withdraw @@ -18,8 +18,9 @@ sub amount($self, $cart, $arg, @) { my $amount = parse_amount($arg); defined $amount or return REJECT, "Invalid amount"; - $cart->add(-$amount, "Withdrawal", - { is_withdrawal => 1 }); + $cart + ->add(-$amount, "Withdrawal", { is_withdrawal => 1 }) + ->add_contra("-cash", +$amount, "Withdrawn by \$you"); return ACCEPT; }