merge file
parent
5d1a7ba4f1
commit
a10b7017a5
|
@ -238,11 +238,10 @@ class PrintLaborCost(Model):
|
||||||
for line in obj.lines:
|
for line in obj.lines:
|
||||||
staff=line.staff_id
|
staff=line.staff_id
|
||||||
for report_line in report_lines:
|
for report_line in report_lines:
|
||||||
#name=staff.number or staff.name or staff.id
|
name='%s-%s'%(staff.first_name,staff.number)
|
||||||
name=staff.number+"-"+(staff.name or staff.id)
|
name=name.replace(" ","-")
|
||||||
fname='%s-%s.xlsx'%(name,report_line['report_file'])
|
fname='%s-%s.xlsx'%(name,report_line['report_file'])
|
||||||
print('fname ---> ', fname)
|
print('fname ---> ', fname)
|
||||||
#report_file=report_line['report_file']
|
|
||||||
report_model=report_line['model']
|
report_model=report_line['model']
|
||||||
report_template=report_model.replace(".","_").replace("clinic_","")
|
report_template=report_model.replace(".","_").replace("clinic_","")
|
||||||
report_id=report_line['report_id']
|
report_id=report_line['report_id']
|
||||||
|
@ -282,11 +281,18 @@ class PrintLaborCost(Model):
|
||||||
db.commit()
|
db.commit()
|
||||||
|
|
||||||
os.system("cp -rf %s ."%tmp_dir)
|
os.system("cp -rf %s ."%tmp_dir)
|
||||||
|
|
||||||
|
os.system("cp merge.py labor_cost/")
|
||||||
|
os.system("python labor_cost/merge.py labor_cost")
|
||||||
|
os.system("rm labor_cost/*.py")
|
||||||
|
os.system("rm labor_cost/*.xlsx")
|
||||||
|
|
||||||
os.system("mv labor_cost %s"%obj.name)
|
os.system("mv labor_cost %s"%obj.name)
|
||||||
os.system("zip %s.zip %s/*"%(obj.name,obj.name))
|
os.system("zip %s.zip %s/*"%(obj.name,obj.name))
|
||||||
os.system("mv %s.zip %s/"%(obj.name,fdir))
|
os.system("mv %s.zip %s/"%(obj.name,fdir))
|
||||||
os.system("rm -r %s*"%(obj.name))
|
os.system("rm -r %s*"%(obj.name))
|
||||||
os.system("rm %s/*"%tmp_dir)
|
os.system("rm %s/*"%tmp_dir)
|
||||||
|
|
||||||
obj.write({
|
obj.write({
|
||||||
'zip_file': '%s.zip'%obj.name,
|
'zip_file': '%s.zip'%obj.name,
|
||||||
'state': 'done',
|
'state': 'done',
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue