Example #1
0
 def accountings_list(self):
     try:
         accountingsList = Accountings.select().order_by(Accountings.id.desc())
         self.privData['ACCOUNTINGS_LIST'] = accountingsList
         return self.display('accountings-list')
     except Exception, e:
         print e
         return self.error(msg='获取对帐单列表失败!')
Example #2
0
 def accounting_details(self):
     inputParams = self.getInput()
     try:
         accounting = Accountings.get(Accountings.id == int(inputParams['id']))
         incommings = AccountIncommings.select().where(AccountIncommings.accounting==accounting).order_by(AccountIncommings.id.desc())
         outgoings = AccountOutgoings.select().where(AccountOutgoings.accounting==accounting).order_by(AccountOutgoings.id.desc())
         self.privData['ACCOUNTING'] = accounting
         self.privData['OUTGOINGS'] = outgoings
         self.privData['INCOMMINGS'] = incommings
         return self.display('accounting-details')
     except Exception, e:
         return self.error(msg='获取对帐单详情失败!')
Example #3
0
    def confirm_accountings(self):
        inputs = self.getInput()
        status = 2 # disagree
        if inputs.has_key('agree'):
            status = 1

        try:
            accounting = Accountings.get(Accountings.id == int(inputs['id']))
            accounting.remark=inputs['remark']
            accounting.status=status
            accounting.save()
            return self.accountings_list()
        except Exception, e:
            print e
            return self.error(msg='确认对帐单失败!')