Commented out sendmail parts for testing. Added SentInvoice table that tracks when invoices were sent. Added InvoiceID and InvoiceSent columns to Invoice table. Now tracks which invoices haven't been sent and only sends those. Once hte invoice has been sent it marks it has having been sent in the database and adds the date to the SentInvoice table. Started adding parts to allow xlsx filent not to be hardcoded. Updated TableSetup using the PyCharm autogeneric SQL thing.

This commit is contained in:
Dan Dembinski
2021-04-01 15:52:47 -04:00
parent ae4d6c1a1f
commit 82ad72007c
4 changed files with 79 additions and 41 deletions

View File

@@ -1,32 +1,43 @@
create table Invoice(
OrderID TEXT NOT NULL,
InvoiceNumber TEXT NOT NULL,
DateCreated TEXT NOT NULL,
ProductionCharges REAL NOT NULL,
ShippingCharges REAL NOT NULL,
AdjustmentsBalance REAL NOT NULL,
DuePayment REAL NOT NULL,
ChargeCode TEXT,
UserLogon TEXT NOT NULL,
UserProfileFirstName TEXT NOT NULL,
UserProfileLastName TEXT NOT NULL,
InvoiceEmailAddress TEXT NOT NULL,
ShippingCompany TEXT,
ShippingFirstName TEXT NOT NULL,
ShippingLastName TEXT NOT NULL,
ShippingAddress1 TEXT NOT NULL,
ShippingAddress2 TEXT,
ShippingCity TEXT NOT NULL,
ShippingState TEXT NOT NULL,
ShippingPostalCode TEXT NOT NULL
create table Invoice
(
OrderID TEXT not null,
InvoiceNumber TEXT not null,
DateCreated TEXT not null,
ProductionCharges REAL not null,
ShippingCharges REAL not null,
AdjustmentsBalance REAL not null,
DuePayment REAL not null,
ChargeCode TEXT,
UserLogon TEXT not null,
UserProfileFirstName TEXT not null,
UserProfileLastName TEXT not null,
InvoiceEmailAddress TEXT not null,
ShippingCompany TEXT,
ShippingFirstName TEXT not null,
ShippingLastName TEXT not null,
ShippingAddress1 TEXT not null,
ShippingAddress2 TEXT,
ShippingCity TEXT not null,
ShippingState TEXT not null,
ShippingPostalCode TEXT not null,
InvoiceID INTEGER
constraint Invoice_pk
primary key autoincrement,
InvoiceSent boolean default false
);
create table ItemDetail(
OrderID TEXT NOT NULL,
DocumentID TEXT NOT NULL,
GLIJobNumber TEXT NOT NULL,
ProductName TEXT NOT NULL,
Quantity INT NOT NULL,
ItemPrice REAL NOT NULL
create table ItemDetail
(
OrderID TEXT not null,
DocumentID TEXT not null,
GLIJobNumber TEXT not null,
ProductName TEXT not null,
Quantity INT not null,
ItemPrice REAL not null
);
create table SentInvoices
(
InvoiceID INT not null,
SentDate DATE not null
);