when compute, it should get level directly from current staff level

production
watcha.h 2015-11-23 16:29:25 +07:00
parent 8e091e131b
commit d5c27ec6cc
1 changed files with 6 additions and 2 deletions

View File

@ -140,7 +140,8 @@ class LaborCost(Model):
for line in item.lines: for line in item.lines:
nurse=line.nurse_id nurse=line.nurse_id
level=line.level_id or nurse.level_id #level=line.level_id or nurse.level_id
level=nurse.level_id
if not level: if not level:
raise Exception("Please specify level %s for %s"%(nurse.name,item.name)) raise Exception("Please specify level %s for %s"%(nurse.name,item.name))
levels[level.id]['total']+=1 levels[level.id]['total']+=1
@ -281,7 +282,10 @@ class LaborCost(Model):
# cost's nurses # cost's nurses
for line in item.lines: for line in item.lines:
nurse=line.nurse_id nurse=line.nurse_id
level=line.level_id or nurse.level_id #level=line.level_id or nurse.level_id
level=nurse.level_id
if not level:
raise Exception("Please specify level for %s"%nurse.name)
vals=levels.get(level.id) vals=levels.get(level.id)
rate,amt,qty=0.0,0.0,0 rate,amt,qty=0.0,0.0,0
level_id=level.id level_id=level.id