Added some comments

This commit is contained in:
Dan Dembinski
2021-03-19 02:28:08 -04:00
parent 12c4722fe9
commit 5720ac4dbb
2 changed files with 5 additions and 0 deletions

View File

@@ -71,12 +71,15 @@ def load_sheet(invoiceNumber):
count = count + 1
session.commit()
#loops through each row in the Item Detail sheet except for the first and last
#Writes each row to the datbase
for row in shtItemDetail.iter_rows(min_row=2, max_row=shtItemDetail.max_row-1):
session.add(ItemDetail(OrderID=row[0].value, DocumentID=row[1].value, GLIJobNumber=row[4].value, ProductName=row[5].value, Quantity=row[6].value, ItemPrice=row[7].value))
session.commit()
def just_work():
#array of orderIDs
orders = []
for order in session.query(Invoice).all():
orders.append(order.OrderID)
@@ -84,6 +87,7 @@ def just_work():
def record_lookup(record):
#looks up the requested OrderID and returns an array of the results
result = []
for lookup in session.query(Invoice).filter(Invoice.OrderID == record):
result.append(lookup.OrderID)

View File

@@ -102,6 +102,7 @@ def send_email(test, record):
bodyHTML = MIMEText(HTMLpart, "html")
#html output for testing
f = open("sample.html", 'w')
f.write(HTMLpart)
f.close()