Exemplo n.º 1
0
  def post(self):
    account = ndb.Key(urlsafe=self.request.get('account')).get()
    balance = account.calculateBalance() 

    transaction = ndb.Key(urlsafe=self.request.get('transaction')).get()
    logging.info('Details from triggering transaction is %s', transaction)

    mail.send_mail(sender='*****@*****.**',
                   to="%s <%s>" % (account.child_first_name, account.child_email),
                   cc="*****@*****.**",
                   subject="Something happened in your Allowance Bank",
                   body="""Oh hello, %s!

A new transaction was just recorded for your account.
Transaction Type: %s
Transaction Amount: $%s
Memo: %s

New Balance: $%s
""" % (
    account.child_first_name,
    transaction.transaction_type,
    util.formatMoney(transaction.amount),
    transaction.memo,
    util.formatMoney(balance)))
Exemplo n.º 2
0
 def getAllowanceAmountForPrinting(self):
     return util.formatMoney(self.allowance_amount)
Exemplo n.º 3
0
 def getAmountForPrinting(self):
     return util.formatMoney(self.amount)
Exemplo n.º 4
0
 def getOpeningBalanceForPrinting(self):
     return util.formatMoney(self.opening_balance)