Now that you see how simple it is to send an Invoice by email, here is a description of how to set up xTuple Connect to do this. The configuration process has three basic steps:
Review Customer Form Assignments
Create an EDI Profile describing what to send and how
Set up the Customer to receive the email
The example in this section is very simple and illustrates only one way to set up xTuple Connect to send EDI. See Chapter 5, Advanced EDI for more sophisticated examples, including xTuple recommendations.
The particular report definition that is used when an Invoice is printed or emailed can be determined by the Customer Form Assignment screen. To reach this screen, follow these steps:
Follow this path:
The following screen will appear:
As you can see in the screenshot, the Customer Form Assignments are based on Customer Type. This means that whenever Invoices are printed for or emailed to this Customer, the Form Assignment for the Customer's Customer Type will be used. In this example, no changes are required. However, there may be cases where you would want to associate different Invoice Forms with different Customer Types.
EDI Profiles are the master records which describe what mechanism to use to send data electronically and the basic structure of what will be sent. Our simple example will hold just enough information to send a PDF copy of an Invoice by email to the Accounting department at our Customer.
To create an EDI Profile, start from the System menu:
Follow this path:
Click the NEW button
Type "Tremendous Toys Incorporated-IN" in the "Name" field
In the "EDI Profile" window that appears, select "Email" from the list of EDI Types
Click the "Review Before Sending" box
In the "To" field, enter the email address to which you want to send the Invoice: accounting@ttoys.com
You may enter multiple email addresses by separating each address with a comma (",").
In the "Cc" or "Bcc" field, specify addresses you want to receive a copy of the email
If you want replies automatically sent to a particular address, put that in the "Reply To" field
In the "Subject" field, specify a subject: Prodiem </doctypefull> </docnumber>
In the "Message Body" section, enter a detailed message to the Customer to be used whenever Invoices are emailed to the Customer
Make certain the content of your message appears legitimate so that spam filters will not reject it.
Click the NEW button on the "Forms" tab
If you get a dialog asking if you want to save the EDI Profile to the database, click OK
In the window that appears, select "Invoice" from the "Document Type" list
Make sure the File Name field is set. This is the name that will be given to the email attachment. </doctype></docnumber>
is usually the best choice
Make sure the "Output Format" is set to "Report" and that the "Report" is set to "[ use Customer Form assignment ]"
Click OK
Click SAVE on the EDI Profile screen
The following fields on the EDI Profile screen deserve special mention:
The EDI Profile in our example is specific to sending Invoices to the Customer TTOYS. The name reflects this.
This setting controls whether or not the user will see the Review EDI Before Sending screen. If this field is checked then all users will see this screen and be able to accept or cancel sending the EDI. If it is not checked, the EDI will be sent automatically; the user will not have a chance to review the information, change it if necessary and allowed, and accept or cancel sending the message.
This EDI Profile sets the destination email address specifically to "accounting@ttoys.com" and mentions "Tremendous Toys" in the message body. This is part of what makes this EDI Profile specific to this particular Customer. However, also notice the use of </doctypefull>
and </docnumber>
in the Subject. These are examples of special tokens that get replaced with the actual Document Type and document number when the EDI message gets built. See Chapter 5, Advanced EDI for ways to create more generic EDI Profiles.
This EDI Profile only has one EDI Form: IN. That means this EDI Profile can only be used to send Invoices. This EDI Form is described in Section 3.2.2, “EDI Forms”.
Tokens are used in EDI Profiles as a means for automatically placing specific information in an email when the email is actually created. There are a few basic tokens available for all supported Document Types. For example, note the </docnumber>
in the File Name field of the EDI Form window in Section 3.2, “Create a Simple EDI Profile”—this will be replaced with the actual invoice number when an Invoice is about to be sent.
The following tokens are available to support EDI Profiles wherever they are used:
The document number (e.g., 60096
)
The Document Type (e.g., IN
)
The primary key id for the document—this is a number used internally by xTuple ERP and not normally shown to users (e.g., 157
)
A human-meaningful version of the Document Type (e.g., Invoice
)
The primary key id for the document, named for the primary key field of that document (e.g., </invchead_id>
)
You can also define your own tokens to build more interesting and general EDI Profiles. See Section 1.2.2, “Defining New EDI Tokens” in Chapter 5, Advanced EDI for more information on how to do this.
Each EDI Profile needs additional information to describe what information should be sent for different Document Types. These extra details are described using EDI Forms. There should be one EDI Form for each Document Type you want to send using an EDI Profile. For example, our sample EDI Profile is only used to send Invoices, so we created exactly one EDI Form for this EDI Profile.
Our sample EDI Form screen shows the basic information for sending an xTuple ERP report when sending Invoices electronically. This EDI Form definition has the following components:
This EDI Form describes what to do when sending Invoices. The same EDI Profile could have other EDI Forms for sending other Document Types.
Invoices for this EDI Profile will be sent as PDF files generated by running a report. In this case, that report will be whatever the Customer Form Assignment says to use. In this case that will be the report named "Invoice".
The file name is used by the xTuple Connect Batch Manager to create a temporary file and as the name of the email attachment. If not given here, the xTuple Connect Batch Manager will add an appropriate suffix. In this case, the file name will start with the abbreviated type of document, which will be followed by the document number. Since this is a report, the suffix .pdf
will be appended. The end result, as you can see in Section 2, “Receiving Invoice Emails with Attachments”, is IN60096.pdf
.
Now that we have an EDI Profile to send Invoice PDF files to the Customer TTOYS, we have to instruct xTuple Connect to use this EDI Profile:
Follow this path:
Open the TTOYS record for editing
Select the "Transmission" tab
Click the ATTACH button, which brings up the following screen
Select "Invoice" for the Document Type
Select "Tremendous Toys Incorporated-IN" from the list of EDI Profiles
Click the ATTACH button
You should now see the "Tremendous Toys Incorporated-IN" profile listed on the Transmission tab in the Customer window.