labor cost
parent
4e9025a0fe
commit
28d405bf73
|
@ -68,12 +68,17 @@ class LaborCostEntry(Model):
|
||||||
lines=[]
|
lines=[]
|
||||||
timenow=time.strftime("%Y-%m-%d")
|
timenow=time.strftime("%Y-%m-%d")
|
||||||
for staff_id, vals in staffs.items():
|
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',{
|
lines.append(('create',{
|
||||||
'staff_id': staff_id,
|
'staff_id': staff_id,
|
||||||
'qty': vals['qty'] or 0,
|
'qty': qty,
|
||||||
'amount': vals['amt'] or 0.0,
|
'amount': amt,
|
||||||
'date': timenow,
|
'date': timenow,
|
||||||
'rate': vals['amt'],
|
'rate': rate,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
for line in obj.lines:
|
for line in obj.lines:
|
||||||
|
|
|
@ -14,7 +14,7 @@ class LaborCostEntryLine(Model):
|
||||||
'date': fields.Date("Date"),
|
'date': fields.Date("Date"),
|
||||||
'staff_id': fields.Many2One("clinic.staff","Staff"),
|
'staff_id': fields.Many2One("clinic.staff","Staff"),
|
||||||
'qty': fields.Integer("Qty"),
|
'qty': fields.Integer("Qty"),
|
||||||
'rate': fields.Float("Rate"),
|
'rate': fields.Float("Rate Avg."),
|
||||||
'amount': fields.Float("Amount"),
|
'amount': fields.Float("Amount"),
|
||||||
'company_id': fields.Many2One("company","Company"),
|
'company_id': fields.Many2One("company","Company"),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue