>
> sorry if i am off topic, i am abit stuck
>
i got the model
db.define_table('t_stck_issue',
Field('f_name', type='reference t_items',
label=T('Name')),
Field('f_stck_client', type='reference t_clients',
label=T('Client Assgn')),
Field('f_stck_quantity', type='integer',
label=T('Stock Quantity')),
Field('f_unit_price', type='double',
label=T('Unit Price')),
Field('f_sub_total',type='double', compute=lambda
r:r['f_unit_price']*r['f_stck_quantity'],
label=T('Sub Total')),
auth.signature,
format='%(f_name)s',
migrate=settings.migrate)
db.define_table('t_stck_issue_archive',db.t_stck_issue,Field('current_record','reference
t_stck_issue',readable=False,writable=False))
AND THE CONTROLLER
def stck_issue_manage():
#form = SQLFORM.smartgrid(db.t_stck_issue,onupdate=auth.archive)
form = SQLFORM.grid(db.t_stck_issue)
myrow=db().select(db.t_stck_issue.f_sub_total.sum())[0]
answer=myrow._extra['SUM(t_stck_issue.f_sub_total)']
return locals()
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.