Your problem is in print_dtotal in menu.sh.
You had a reference to f4 which shoudl have been f3, and you were missing the bits which actually added the total up. Also the summary .txt you supplied was a bit confused - 2 of the entries were missing the date, and one had the date in a different format (lower-case letter on the month, and a 4-digit year, whereas the others had upper-case initial letter on the month and 2-digit year - either will do, but you must be consistent!).
a corrected print_dtotal is:
print_dtotal()
{
count=0
grep -i : $BOOK | cut -d: -f4 | sort -u | while read i
do
dtotal=0
n=`num_lines ":$i"`
grep -i ":${i}$" $BOOK | while read x
do
count=`expr $count + 1`
temp1=`echo $x | cut -d: -f2`
temp2=`echo $x | cut -d: -f3`
dtotal=`expr $dtotal + \( $temp1 \* $temp2 \)`
if [ "${n}" -eq "${count}" ]; then
echo $i" $"$dtotal
fi
done
done
I'm not sure what the following is doing in summary_item() either:
#print_gtotal
echo "---------------------------"
print_dtotal | sort -f4| while read z
do
echo $z | cut -f4 -d' '
return 0
print_gtotal isn't referred to elsewhere, and the "sort -f4" line doesn't make sense. Just delete these lines.