Everything seems to be working. Selecting the client and hitting the submit button runs the report for the select client and downloads the report as *clientname*+*datetime+report.xlsx.
This commit is contained in:
29
main.py
29
main.py
@@ -26,7 +26,7 @@ def Obtain_Ticket(URL, HOST):
|
||||
temp1 = response.split('<ObtainUserTicketResult>')
|
||||
temp2 = temp1[1].split('</ObtainUserTicketResult>')
|
||||
ticket = temp2[0]
|
||||
print("got ticket: " + ticket)
|
||||
#print("got ticket: " + ticket)
|
||||
return ticket
|
||||
|
||||
def Release_Ticket(ticket, URL, HOST):
|
||||
@@ -40,7 +40,7 @@ def Release_Ticket(ticket, URL, HOST):
|
||||
</soap12:Envelope>"""
|
||||
headers = {'Host': HOST, 'Content-Type': 'application/soap+xml; charset=utf-8', 'Content-Length': 'length'}
|
||||
response = requests.post(url=URL, data=ReleaseTicket, headers=headers).text
|
||||
print("released ticket "+ticket)
|
||||
#("released ticket "+ticket)
|
||||
|
||||
|
||||
def Run_Report(ticket, URL, HOST, REPORT_FIELDS, wb, ws, ws2, DETAIL_REPORT_FIELDS, summary_columnFormat, summary_SSheader, detail_columnFormat, detail_SSheader):
|
||||
@@ -277,7 +277,7 @@ def loadClients():
|
||||
|
||||
def GetClientConfig(Client):
|
||||
|
||||
SF_URL = []
|
||||
SF_URL = ""
|
||||
CLIENT_SUMMARY_TAB = []
|
||||
client_headers = []
|
||||
SUMMARY_TAB = []
|
||||
@@ -307,12 +307,16 @@ def GetClientConfig(Client):
|
||||
for w in y.find_all('client'):
|
||||
for x in w.find_all('name'):
|
||||
if x.text == Client:
|
||||
SF_URL = x.find('storefrontapiurl')
|
||||
print("SF_URL" SF_URL)
|
||||
for z in w.find('storefrontapiurl'):
|
||||
print(SF_URL)
|
||||
SF_URL = z
|
||||
#SF_URL = "http://diabetes-storefront.gli.us.com/store/storefrontapi.asmx"
|
||||
temp1 = SF_URL.split('://')
|
||||
temp2 = temp1[1].split('/')
|
||||
SF_HOST = (temp2[0])
|
||||
|
||||
# Get Storefront Host URL
|
||||
temp1 = SF_URL.split('://')
|
||||
temp2 = temp1[1].split('/')
|
||||
SF_HOST = (temp2[0])
|
||||
|
||||
|
||||
# Get Monthly Report Summary Fields
|
||||
for w in y.find_all('client'):
|
||||
@@ -369,7 +373,8 @@ def GetClientConfig(Client):
|
||||
for z in g.find_all('columnformat'):
|
||||
CLIENT_COLUMN_FORMAT.append(z.text)
|
||||
|
||||
summary_columnformat = dict.fromkeys(headers)
|
||||
|
||||
summary_columnformat = dict.fromkeys(headers[0])
|
||||
# set Summary Column Types Header Dictionary
|
||||
count = 0
|
||||
for key in summary_columnformat:
|
||||
@@ -388,7 +393,7 @@ def GetClientConfig(Client):
|
||||
|
||||
|
||||
|
||||
detail_columnformat = dict.fromkeys(detail_headers)
|
||||
detail_columnformat = dict.fromkeys(detail_headers[0])
|
||||
# set Detail Column Types Header Dictionary
|
||||
count = 0
|
||||
for key in detail_columnformat:
|
||||
@@ -400,10 +405,10 @@ def GetClientConfig(Client):
|
||||
wb = workbook.Workbook()
|
||||
ws = wb.active
|
||||
ws.title = "Order Summary"
|
||||
ws.append(headers)
|
||||
ws.append(headers[0])
|
||||
|
||||
ws2 = wb.create_sheet("Item Detail")
|
||||
ws2.append(detail_headers)
|
||||
ws2.append(detail_headers[0])
|
||||
|
||||
ClientConfig = [SF_URL, SF_HOST, REPORT_FIELDS, DETAIL_REPORT_FIELDS, summary_columnformat, headers, detail_columnformat, detail_headers, wb, ws, ws2]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user