Column Format is now working for both summary and item details. Load function passes client name to the client_Specific_Tabs function in ClientSpecific.py. This will allow any client customization to be done outside of the main program (in theory. I haven't actually tested this yet).

This commit is contained in:
Dan Dembinski
2019-06-25 13:47:17 -04:00
parent b8e5ae6baa
commit 28fce7e10f
5 changed files with 93 additions and 2365 deletions

View File

@@ -1,31 +1,48 @@
def Write_Report(y, ws, columnFormat, SSheader):
def Write_Report(y, columnFormat, SSheader, sheet):
results = []
count = 0
for child in y.report:
for childs in child:
print(columnFormat[SSheader[count]])
count = count + 1
if '$' in childs.text:
convert = childs.text
apply = convert[1:]
results.append(float(apply.replace(',', '')))
if childs.text is not "":
asdf = Format_Check(columnFormat, SSheader, childs, count)
else:
results.append(childs.text)
ws.append(results)
results = []
asdf = childs.text
results.append(asdf)
count = count + 1
count = 0
sheet.append(results)
results = []
def Detail_Write_Report(y, ws):
# def Detail_Write_Report(y, sheet):
# results = []
#
# for child in y.report:
# for childs in child:
# if '$' in childs.text:
# convert = childs.text
# apply = convert[1:]
# results.append(float(apply.replace(',', '')))
# else:
# results.append(childs.text)
# sheet.append(results)
# results = []
def Format_Check(columnFormat, SSheader, childs, count):
check = columnFormat[SSheader[count]]
results = []
for child in y.report:
for childs in child:
if '$' in childs.text:
convert = childs.text
apply = convert[1:]
results.append(float(apply.replace(',', '')))
else:
results.append(childs.text)
ws.append(results)
results = []
if check == "None":
return childs.text
elif check == "Currency":
if '$' in childs.text:
convert = childs.text
apply = convert[1:]
results.append(float(apply.replace(',', '')))
return results[0]
else:
return float(childs.text)
elif check == "Integer":
return int(childs.text)
else:
return childs.text