mirror of
https://github.com/brmlab/brmbar.git
synced 2025-06-07 21:04:00 +02:00
brmbar v3: Show bilance overview in the Management view
This commit is contained in:
parent
79080d4c5d
commit
febcbfae8c
3 changed files with 124 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
/ Management view
|
+ Management view
|
||||||
+ Stock management link
|
+ Stock management link
|
||||||
+ User management link
|
+ User management link
|
||||||
- Bilance overview (Cash, Profit, Credit total)
|
+ Bilance overview (Cash, Profit, Credit total)
|
||||||
- Withdrawal of user credit
|
- Withdrawal of user credit
|
||||||
1. choose user
|
1. choose user
|
||||||
2. choose amount
|
2. choose amount
|
||||||
|
|
|
@ -61,6 +61,19 @@ class ShopAdapter(QtCore.QObject):
|
||||||
shop.add_credit(credit = credit, user = user)
|
shop.add_credit(credit = credit, user = user)
|
||||||
return user.negbalance_str()
|
return user.negbalance_str()
|
||||||
|
|
||||||
|
@QtCore.Slot(result='QVariant')
|
||||||
|
def balance_cash(self):
|
||||||
|
return shop.cash.balance_str()
|
||||||
|
@QtCore.Slot(result='QVariant')
|
||||||
|
def balance_profit(self):
|
||||||
|
return shop.profits.balance_str()
|
||||||
|
@QtCore.Slot(result='QVariant')
|
||||||
|
def balance_inventory(self):
|
||||||
|
return shop.inventory_negbalance_str()
|
||||||
|
@QtCore.Slot(result='QVariant')
|
||||||
|
def balance_credit(self):
|
||||||
|
return shop.credit_negbalance_str()
|
||||||
|
|
||||||
db = psycopg2.connect("dbname=brmbar")
|
db = psycopg2.connect("dbname=brmbar")
|
||||||
shop = brmbar.Shop.new_with_defaults(db)
|
shop = brmbar.Shop.new_with_defaults(db)
|
||||||
currency = shop.currency
|
currency = shop.currency
|
||||||
|
|
|
@ -6,6 +6,115 @@ Item {
|
||||||
id: page
|
id: page
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
|
property variant cash: shop.balance_cash()
|
||||||
|
property variant profit: shop.balance_profit()
|
||||||
|
property variant inv_money: shop.balance_inventory()
|
||||||
|
property variant credit_money: shop.balance_credit()
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: profit_name
|
||||||
|
x: 65
|
||||||
|
y: 156
|
||||||
|
width: 337
|
||||||
|
height: 160
|
||||||
|
color: "#ffffff"
|
||||||
|
text: "Profit:"
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
font.pointSize: 34
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: profit_amount
|
||||||
|
x: 215
|
||||||
|
y: 156
|
||||||
|
height: 160
|
||||||
|
width: 254
|
||||||
|
color: "#ffff7c"
|
||||||
|
text: parent.profit
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
|
font.pointSize: 34
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: cash_name
|
||||||
|
x: 65
|
||||||
|
y: 266
|
||||||
|
width: 337
|
||||||
|
height: 160
|
||||||
|
color: "#ffffff"
|
||||||
|
text: "Cash:"
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
font.pointSize: 34
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: cash_amount
|
||||||
|
x: 215
|
||||||
|
y: 266
|
||||||
|
height: 160
|
||||||
|
width: 254
|
||||||
|
color: "#ffff7c"
|
||||||
|
text: parent.cash
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
|
font.pointSize: 34
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: credit_name
|
||||||
|
x: 535
|
||||||
|
y: 156
|
||||||
|
width: 337
|
||||||
|
height: 160
|
||||||
|
color: "#ffffff"
|
||||||
|
text: "Credit:"
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
font.pointSize: 34
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: credit_amount
|
||||||
|
x: 705
|
||||||
|
y: 156
|
||||||
|
height: 160
|
||||||
|
width: 254
|
||||||
|
color: "#ffff7c"
|
||||||
|
text: parent.credit_money
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
|
font.pointSize: 34
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: inv_name
|
||||||
|
x: 535
|
||||||
|
y: 266
|
||||||
|
width: 337
|
||||||
|
height: 160
|
||||||
|
color: "#ffffff"
|
||||||
|
text: "Stock:"
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
font.pointSize: 34
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: inv_amount
|
||||||
|
x: 705
|
||||||
|
y: 266
|
||||||
|
height: 160
|
||||||
|
width: 254
|
||||||
|
color: "#ffff7c"
|
||||||
|
text: parent.inv_money
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
horizontalAlignment: Text.AlignRight
|
||||||
|
font.pointSize: 34
|
||||||
|
}
|
||||||
|
|
||||||
BarButton {
|
BarButton {
|
||||||
id: stock_manager
|
id: stock_manager
|
||||||
x: 65
|
x: 65
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue