mirror of
https://github.com/brmlab/brmbar.git
synced 2025-06-10 14:23:59 +02:00
#16: stored function for receipt reimbursement transaction
This commit is contained in:
parent
629b35655d
commit
1df7db93e7
2 changed files with 71 additions and 3 deletions
|
@ -135,9 +135,13 @@ class Shop:
|
|||
return cost
|
||||
|
||||
def receipt_to_credit(self, user, credit, description):
|
||||
transaction = self._transaction(responsible = user, description = "Receipt: " + description)
|
||||
self.profits.credit(transaction, credit, user.name)
|
||||
user.credit(transaction, credit, "Credit from receipt: " + description)
|
||||
#transaction = self._transaction(responsible = user, description = "Receipt: " + description)
|
||||
#self.profits.credit(transaction, credit, user.name)
|
||||
#user.credit(transaction, credit, "Credit from receipt: " + description)
|
||||
self.db.execute_and_fetch(
|
||||
"SELECT public.buy_for_cash(%s, %s, %s, %s, %s)",
|
||||
[self.profits.id, user.id, user.name, credit, description]
|
||||
)[0]
|
||||
self.db.commit()
|
||||
|
||||
def _transaction(self, responsible = None, description = None):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue