labor cost

conv_bal
watcha.h 2014-12-09 11:35:20 +07:00
parent 4e9025a0fe
commit 28d405bf73
2 changed files with 9 additions and 4 deletions

View File

@ -68,12 +68,17 @@ class LaborCostEntry(Model):
lines=[]
timenow=time.strftime("%Y-%m-%d")
for staff_id, vals in staffs.items():
qty=vals['qty'] or 0
amt=vals['amt'] or 0.0
rate=0.0
if qty:
rate=amt/qty # average
lines.append(('create',{
'staff_id': staff_id,
'qty': vals['qty'] or 0,
'amount': vals['amt'] or 0.0,
'qty': qty,
'amount': amt,
'date': timenow,
'rate': vals['amt'],
'rate': rate,
}))
for line in obj.lines:

View File

@ -14,7 +14,7 @@ class LaborCostEntryLine(Model):
'date': fields.Date("Date"),
'staff_id': fields.Many2One("clinic.staff","Staff"),
'qty': fields.Integer("Qty"),
'rate': fields.Float("Rate"),
'rate': fields.Float("Rate Avg."),
'amount': fields.Float("Amount"),
'company_id': fields.Many2One("company","Company"),
}