From 5720ac4dbbee1727154e5ea7fb0f1664215e3d6c Mon Sep 17 00:00:00 2001 From: Dan Dembinski Date: Fri, 19 Mar 2021 02:28:08 -0400 Subject: [PATCH] Added some comments --- InvoiceDatabase.py | 4 ++++ sendEmail.py | 1 + 2 files changed, 5 insertions(+) diff --git a/InvoiceDatabase.py b/InvoiceDatabase.py index 770f43d..0527cde 100644 --- a/InvoiceDatabase.py +++ b/InvoiceDatabase.py @@ -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) diff --git a/sendEmail.py b/sendEmail.py index 2501d6d..e708ef9 100644 --- a/sendEmail.py +++ b/sendEmail.py @@ -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()