Added Barcode for cash payment. Barcode is '_cash_'.

This commit is contained in:
Stevko 2014-05-11 02:38:53 +02:00 committed by Petr Baudis
parent 65741c31f0
commit 6ed53b92aa
3 changed files with 18 additions and 3 deletions

View file

@ -50,12 +50,18 @@ Item {
status_text.setStatus("Unknown barcode", "#ff4444")
return
}
if (acct.acctype !== "debt") {
if (acct.acctype !== "debt" && acct.acctype !== "cash") {
loadPageByAcct(acct)
return
}
var balance = shop.sellItem(dbid, acct.id)
status_text.setStatus("Sold! "+acct.name+"'s credit is "+balance+".", "#ffff7c")
if (acct.acctype == "cash") { //Copied from BarButton.onButtonClick
shop.sellItemCash(dbid)
status_text.setStatus("Sold! Put " + price + " Kč in the money box.", "#ffff7c")
} else {
var balance = shop.sellItem(dbid, acct.id)
status_text.setStatus("Sold! "+acct.name+"'s credit is "+balance+".", "#ffff7c")
}
loadPage("MainPage")
}
}