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)))
def getAllowanceAmountForPrinting(self): return util.formatMoney(self.allowance_amount)
def getAmountForPrinting(self): return util.formatMoney(self.amount)
def getOpeningBalanceForPrinting(self): return util.formatMoney(self.opening_balance)