From 95f3f61cb09de7f3be9e802f939ffdb2d65a4a44 Mon Sep 17 00:00:00 2001 From: Aaron Johnson Date: Thu, 1 Jul 2021 00:54:44 -0500 Subject: [PATCH] add balance report before withdrawal --- bank | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bank b/bank index 37d7333..7d743a1 100755 --- a/bank +++ b/bank @@ -191,7 +191,7 @@ make_deposit() { } make_withdrawal() { - eval "$dbconnect -c \"SELECT id,name FROM account WHERE enabled = true ORDER BY name;\"" + eval "$dbconnect -c \"SELECT account.id,account.name,gold FROM balance INNER JOIN account ON account.id = balance.id WHERE account.enabled = true ORDER BY name;\"" #Show balances first read -p "Enter Account ID: " ID read -p "Enter amount of gp to withdraw: " amount tstamp=$(date +%Y-%m-%d\ %H:%M:%S) @@ -215,7 +215,6 @@ make_withdrawal() { bank_transfer() { eval "$dbconnect -c \"SELECT account.id,account.name,gold FROM balance INNER JOIN account ON account.id = balance.id WHERE account.enabled = true ORDER BY name;\"" #Show balances first - read -p "Enter Account ID to transfer $(tput bold)FROM$(tput sgr0): " FROM read -p "Enter Account ID to transfer $(tput bold)TO$(tput sgr0): " TO read -p "Enter amount of gp to transfer: " amount