I have classic grid that contains a list of payments made on account.  The 
grid is populated from the bizobj payments which is a child of the client.

I need the subtotal and the balance.  Total amt - subtotal = balance

The bizobj has
addField('amt_rec')
addField('fk_client')

I now have to sum(amt_rec) where fk_client = somePkOfClient.

VirtualFields = {"subtotal": self.getSubTotal}

def getSubTotal(self):
  tempCur=self.getTempCursor()
  tempCur.execute("Select sum(amt_rec) as totalrec from payments where 
fk_client = %s" % client_pkid)
  return tempCur.Record.totalrec

"subtotal" has the correct figure.

Can I use "subtotal" in the next virtual field?

def getBalance(self):
  return total - self.subtotal

   
What is the correct way to handle this?

-- 
John Fabiani
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/200905192216.57669.jfabi...@yolo.com

Reply via email to