labor cost
parent
4e9025a0fe
commit
28d405bf73
|
@ -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:
|
||||
|
|
|
@ -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"),
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue