Added some comments
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user