uncommitted changes from other people... again

This commit is contained in:
TMA 2025-03-30 20:55:00 +02:00
parent 6749b2c97a
commit e04d614e15
5 changed files with 32 additions and 5 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
.*.sw? .*.sw?
*~

8
brmbar3/USEFUL.txt Normal file
View file

@ -0,0 +1,8 @@
Accounts with multiple barcodes:
SELECT accounts.name,barcodes.account,barcodes.barcode
FROM "barcodes"
join accounts on accounts.id = barcodes.account
where barcodes.account in (select a from (select count(*) as c, account as a from barcodes group by account) as dt where c > 1)
ORDER BY "account" DESC

View file

@ -100,8 +100,17 @@ Item {
} }
function chargeCredit() { function chargeCredit() {
var balance = shop.chargeCredit(amount, userdbid) var balance=0
status_text.setStatus("Charged! "+username+"'s credit is "+balance+".", "#ffff7c") if (!isNaN(amount)) {
if(amount>=0) {
balance = shop.chargeCredit(amount, userdbid)
status_text.setStatus("Charged "+amount+"! "+username+"'s credit is "+balance+".", "#ffff7c")
} else {
balance = shop.withdrawCredit((amount*(-1)), userdbid)
status_text.setStatus("Withdrawn "+amount+"! "+username+"'s credit is "+balance+".", "#ffff7c")
}
}
loadPage("MainPage") loadPage("MainPage")
} }
} }

View file

@ -100,8 +100,17 @@ Item {
} }
function withdrawCredit() { function withdrawCredit() {
var balance = shop.withdrawCredit(amount, userdbid) var balance=0
status_text.setStatus("Withdrawn! "+username+"'s credit is "+balance+".", "#ffff7c") if (!isNaN(amount)) {
amount=(amount*1)
if(amount>=0) {
balance = shop.withdrawCredit(amount, userdbid)
status_text.setStatus("Withdrawn "+amount+"! "+username+"'s credit is "+balance+".", "#ffff7c")
} else {
balance = shop.chargeCredit((amount*(-1)),userdbid)
status_text.setStatus("Charged "+amount+"! "+username+"'s credit is "+balance+".", "#ffff7c")
}
}
loadPage("MainPage") loadPage("MainPage")
} }
} }

View file

@ -1,3 +1,3 @@
p1=`echo -n "brmbar - dluhy: "; echo "SELECT name, crbalance FROM account_balances WHERE acctype = 'debt' AND crbalance < -100 AND name NOT LIKE '%overflow%' AND name NOT LIKE 'sachyo' ORDER BY crbalance ASC" | psql brmbar | tail -n +3 | grep '|' | tr -s " " | sed -e "s/ |/:/g" -e "s/$/;/" | tr -d "\n"` p1=`echo -n "brmbar - dluhy: "; echo "SELECT name, crbalance FROM account_balances WHERE acctype = 'debt' AND crbalance < -100 AND name NOT LIKE '%overflow%' AND name NOT LIKE 'sachyo' ORDER BY crbalance ASC" | psql brmbar | tail -n +3 | grep '|' | tr -s " " | sed -e "s/ |/:/g" -e "s/$/;/" | tr -d "\n"`
p2=`echo "SELECT sum(crbalance) FROM account_balances WHERE acctype = 'debt' AND crbalance < 0 AND name NOT LIKE '%overflow%' AND name NOT LIKE 'sachyo'" | psql brmbar | tail -n +3 | head -n 1 | tr -s " "` p2=`echo "SELECT sum(crbalance) FROM account_balances WHERE acctype = 'debt' AND crbalance < 0 AND name NOT LIKE '%overflow%' AND name NOT LIKE 'sachyo'" | psql brmbar | tail -n +3 | head -n 1 | tr -s " "`
echo "$p1 total$p2 Kc" | ssh -p 110 -i /home/brmlab/.ssh/id_rsa jenda@coralmyn.hrach.eu echo "$p1 total$p2 Kc. https://www.elektro-obojky.cz/" | ssh -p 110 -i /home/brmlab/.ssh/id_rsa jenda@coralmyn.hrach.eu