mirror of
https://github.com/brmlab/brmbarSAP.git
synced 2025-06-07 19:24:02 +02:00
code import
This commit is contained in:
parent
5a102fcd5a
commit
fc36d54062
18 changed files with 1809 additions and 1 deletions
14
stats.sh
Executable file
14
stats.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/bash
|
||||
# Display various stats from brmbar
|
||||
|
||||
DB="./brmbar.db"
|
||||
|
||||
overflow=$(echo "SELECT sum(cash)*(-1) FROM users WHERE name like '%overflow';" | sqlite3 $DB)
|
||||
cash=$(echo "SELECT (SELECT sum(profit) FROM transactions)-($overflow);" | sqlite3 $DB)
|
||||
inv=$(echo "SELECT sum(quan*buyprice) FROM stock;" | sqlite3 $DB)
|
||||
mate=$(echo "SELECT sum(amount) FROM transhuman WHERE strftime('%Y-%m-%d',age)=date('now','localtime') AND (stuff like '%mate%' OR stuff like '%Mate%');" | sqlite3 $DB)
|
||||
|
||||
echo "Overflow: $overflow"
|
||||
echo "Cash: $cash"
|
||||
echo "Inventory: $inv"
|
||||
echo "Clubmate sold today: $mate bottles"
|
Loading…
Add table
Add a link
Reference in a new issue