# Invoices
Invoices are sent to Sherwin Williams as 810 documents.
# Schedule
Invoices are scheduled to send every night. This is done by running PL SW.DAILY.INVOICES inside of QQ OE0991.
# Criteria
It will send any invoice that:
- has a
BILL.CUSTcustomer number of 91000982. EDI.INVOICEDfield is blankCM.FLAGis not "Y"- is not a sample order
- the total quantity shipped is more than 0
- has a status "I"
- has an invoice date on or before the current date
# Sending
SW.EDI.INVOICES will loop through all of the selected invoices.
Each line item should have an Assigned ID that was given by Sherwin Williams when the purhcase order was placed. This was stored in the line message.
Note
Sherwin Williams (Corcentric) has said that if their system can not identify the correct line items because of missing Assigned ID's, that their system will just forward the invoice to the appropriate person to be manually processed. This is why it is ok to send all invoices via EDI even if they were not received via EDI.
Some of the fields that should be required by Sherwin Williams are actually taken care of by Infocon. An example of this is the total amount of the invoice. Infocon will total the line items along with shipping costs and taxes and automatically add the field to the payload.
After sending the invoice, the program will mark the order as being sent by puting the date into the EDI.INVOICED field. (OM<118>)
# Default Data
For some reason, Sherwin Williams requires all of the fields to be sent back on the invoice that were sent on their purchase order. This is according to Infocon. These fields which really shouldn't change are stored as "default values" in the SW.EDI.IN log record.
# Logging
This program makes 3 log files saved to SW.EDI.OUT.
The first is the result of the API transaction. These are things like a 200 - Success message or any sort of errors that might have occured when sending the data to Infocon. These are stored with a RESULT*.json suffix.
The next is the actual JSON string of the invoice that was sent. This is stored with an OUT*.json suffix.
The last is a multi-value log of the field names and values of the invoice created by LOG-JSON. This is stored with a suffix of OUT*.MV.
# Errors
Any errors that are encountered are stored in SW.ERR and are also sent via email to SW.SVC.ADMIN.