Matt is gone. Changed email to Carla. Changed test emails. Added argument position to bat file. Updated main.py to take bat arguement as xlsx fileName. Can now drag and drop invoice spreadsheet onto the bat file to load it into the database.

This commit is contained in:
Dan Dembinski
2021-05-28 12:33:51 -04:00
parent 909b12ff6c
commit 64d913572c
3 changed files with 11 additions and 6 deletions

View File

@@ -1,2 +1,2 @@
@echo off
cmd /k "cd /d C:\Program Files (x86)\AKSESS\Storefront\CFFInvoice\Scripts & activate & cd /d C:\Program Files (x86)\AKSESS\Storefront\CFFInvoice & python main.py"
cmd /k "cd /d C:\Program Files (x86)\AKSESS\Storefront\CFFInvoice\Scripts & activate & cd /d C:\Program Files (x86)\AKSESS\Storefront\CFFInvoice & python main.py &1"

View File

@@ -1,8 +1,13 @@
import sendEmail
import InvoiceDatabase
import sys
running = True
fileName = '1.xlsx'
try:
fileName = sys.argv[1]
except:
fileName = ''
while running is True:
print('1. load new excel file\n2. Send Test emails\n3. Send Invoices\n4. Quit')

View File

@@ -21,7 +21,7 @@ def send_email(test, record):
InvoiceID = info[18]
OrderNumber = info[0]
OrderDate = datetime.strptime(info[1], '%Y-%m-%d %I:%M:%S')
OrderDate = datetime.strptime(info[1], '%Y-%m-%d %H:%M:%S')
UserLogon = info[2]
Name = info[3] + ' ' + info[4]
ChargeCode = info[5]
@@ -181,13 +181,13 @@ def send_email(test, record):
msg = MIMEMultipart()
msg['Subject'] = 'INVOICE ' + InvoiceNumber
if test is True:
msg['To'] = 'dan.dembinski@gmail.com'
msg['Cc'] = 'ddembinski@gll.com'
msg['To'] = 'ddembinski@gll.com'
# msg['Cc'] = 'ddembinski@gll.com'
else:
msg['To'] = InvoiceEmailAddress
msg['Cc'] = 'Carrie Higgins <chiggins@gll.com>'
msg['Bcc'] = 'ddembinski@gll.com'
msg['From'] = 'Matt MulQueeny <mmulqueeny@printingconcepts.com>'
msg['From'] = 'Carla Lane <carla@printingconcepts.com>'
msg.add_header('Content-Type', 'text/html')
msg.attach(bodyHTML)