Invoice Processing

Objective

This tutorial shows how a sample invoice process can be configured.

At the end of this tutorial, you should be able to:

  • Create a new invoice process

  • Import Emails into the workflow

  • Scan or use Mobile Capture to start a workflow

  • Use Email to inform vendors about expectations in the invoice process

  • Perform Optical Character Recognition (OCR)

  • Extract Key Invoice Metadata, such as PO Number, Invoice Number

  • Perform a Database Lookup & Other business rules

  • Provide an email with a link to a document so vendors can update missing metadata directly in the process

  • Use Timer functions to reject invoices if the vendor doesn't respond in a given timeframe

  • Export Documents with Zapier to Google Drive

  • Create Business Rules for Web Validation

Process Overview

Prerequisites

This section details the Admin Panel Organisation setup necessary prior to setting up the workflow. If the Organisation is already setup you can skip this section.

Creating the Workflow

1. Creating a New Workflow

In this step, we create a new workflow:

  1. Log in to the CumulusPro Admin Panelarrow-up-right with your Credentials

  2. Open the Organisation where you want to create the workflow

  3. Click on 'Workflows'

  4. Click on the 'Create Workflow Configuration' tile

  5. Name the new 'Invoice Tutorial' and then click on the tile

Watch this video on how to create a workflow:

2. Adding Index Fields

In this step, we will add some index fields. The index fields created here are only available in the workflow and are separated from the index fields you may have created on your Document Types.

circle-info

If you want the index field values from your Document Types in the Scan or Mobile clients to be passed on to your Workflow, create an index field in the workflow with the same name as you created them in the Document Type.

  1. Click on the + next to the 'Index Fields'.

2. A new field 'NewField1' has been created. Click on it.

3. Change the field display name, Field name and Datatype according to the table below.

4. Repeat step 1 to 4 for the remaining fields.

Name

Display Name

Datatype

InvoiceNumber

Invoice Number

string

InvoiceDate

Invoice Date

date

PONumber

PO Number

string

TaxPoint

Tax Point

string

NetTotal

Net Total

amount

TaxTotal

Tax Total

amount

GrossTotal

Gross Total

amount

Currency

Currency

string

DocumentType

Document Type

string

SupplierCompanyName

Supplier Company Name

string

SupplierTaxID

Supplier Tax ID

string

RejectURL

Reject URL

string

EmailFrom

Email From

string

Start Event - Scan/Mobile/Email Import

In this section we create a start event that gets documents from one of our own apps, such as Scan+ProcessLite, Scan+Express, Mobile Capture or from any iConnector compatible application.

Creating the Flow - Start Event

Click on the Design Process Button.

This will open an empty Process Designer. On the left side, you find the steps that can be added to the process. We start by adding a Start Event.

circle-info

A Start Event is the beginning of a workflow. This is where documents from Scan+ProcessLite, Scan+Express and Mobile Capture enter the workflow. Additionally, email and FTP import can also be configured at a start event and third party integrations such as Zapier can use a start event to send documents to CumulusPro.

circle-info

A process flow can have multiple Start Event, one for each document type if necessary.

Click on the Start Event icon and drag it onto the design canvas.

Your screen should now look like this.

To edit the properties of the Start Event, click on the Settings icon as shown below.

This opens a pop up showing the settings for the Start Event.

Select the Document Type from the dropdown. In the screenshot above, the document type 'Invoices' has been selected. However, the names available depend on the names given in the section 'Prerequisites'.

Start Event for Email Import

  1. Create a second start event.

  2. Click on the Settings.

  3. Leave the document type empty.

  4. Open the '+ Mail Polling'.

  5. Complete the settings.

    1. The IMAP Server, Port and Username/Password depends on your server. If you do not have an email account, you can skip the email import part.

    2. Select 'Active' to ON, this will enable the email import.

    3. Map the email fields to the index fields, for example 'From' choose 'EmailFrom' from the dropdown list.

    4. In case of an error, the Mail Pooler Error Message will display what has gone wrong.

Create an OCR Task

In this section, we create a Task that performs Optical Character Recognition (OCR) from the two Start Events.

  1. Drag the 'Service Task' onto the canvas.

  2. Name the Task 'OCR'.

  3. Click on the OCR Task tile.

  4. Select Settings.

  5. Select 'ABBYY OCR Searchable PDF' from the 'Action' dropdown.

  6. Close the OCR dialog by pressing the 'x' on the top right.

  7. Now, connect the 'Start Event' to the OCR Task.

  8. Click on the top start event, then click on the arrows.

  9. Drag the arrow on top of the OCR Task tile.

  10. Repeat the above for the bottom start event. Your diagram should look like below. To make the diagram easier to read, we now adjust and label the arrows.

  11. In the diagram above, we would like to adjust the arrow from the top start event to enter the OCR box from the top. In oder to do this, click on the arrow. The arrow is shown in a red-dashed line and the corners are marked in yellow.

  12. Click on the connector and move it to until the arrows align. The result should look like this. Now that the lines are drawn, we label them to indicate the input.

  13. Double click on the line from the top start event.

  14. Enter the name 'Email Import'.

  15. Drag the Label near the start event.

  16. Repeat the above steps for the second arrow and label it 'Scan/Mobile'. Your process should look like below.

Metadata Extraction

The next step we add is to extract Metadata. While we could follow similar steps to adding the OCR Task, we explore an alternative here.

  1. Click on the OCR tile and select the Service Task.

  2. Place the service task onto the canvas next to the OCR.

  3. Name the service task 'Metadata Extraction'. Note: The arrow to the service task was automatically added.

  4. Click on Settings of the 'Metadata Extraction'.

  5. Select 'FocalPoint Invoice Extraction' from the 'Action' Dropdown List.

  6. Now, the country settings are visible. Settings for the different 'Actions' appear after the action is selected.

  7. From the 'Country' dropdown list select 'UK'.

  8. Close the service task settings by pressing the x on the top right.

circle-info

The list contains supported and preconfigured Invoice Processing settings.

The process should look like this:

Scripting Business Rules with JavaScript

The Script Task allows you to define JavaScripts that are executed on the server side. In this tutorial step, we will use the Script Task to do a DB Lookup where we retrieve the SupplierCompanyName from the TaxID we found on the invoice.

  1. Add a Script Task (either drag and drop the script task from the left menu or click on the Metadata Extraction step and add the script task.

  2. Name the Script Task 'DB Lookup & Business Rules'.

  3. Click on the Settings of the Script Task.

  4. This opens a JavaScript editor.

  5. Copy the following code into the script:

This script queries the database with the TaxID and from the returned records, it selects the first and populates the value into the SupplierCompanyName index fields. In case of an error, the error message is assigned to the _errorMessage variable and the document stays in this workflow step.

The process flow should now look like below.

User Task - Validation

Now that we have the metadata extracted and the business rules executed, we want a user to validate the invoice. The user should have the option to edit the Index Field and if the document is correct to complete the document. If the document has to be sent to the vendor, the user will reject the document for the vendor to update.

  1. Add a User Task to the workflow.

  2. Name the User Task 'Validation'.

  3. Draw an arrow from the 'DB Lookup & Business Rules' to the Validation.

  4. Click on the Settings of 'Validation'.

  5. In Application Configuration select 'Web Validation (MyHome)' from the drop down list.

  6. Under 'Validation' button enable the 'Complete' and the 'Reject' button.

  7. Close 'Validation Settings' by clicking the top right 'x' of the dialog.

circle-info

As Validation requires users to access documents, we will create users and roles. However, we will do that later when we created a few more steps that require user interaction.

The workflow should look like this:

Exclusive Gateway

In Validation, we have given the user the chance to either Complete the invoice (and move to the next step) or to Reject the invoice. Hence in this next step, we want to route the document to different steps in the workflow.

  1. If the document is completed, then it should move on to the Approval stage.

  2. If the document is rejected, we want to inform the vendor and give the vendor a chance to correct the invoice.

An Exclusive gateway is added in the same way as a process step.

  1. Drag and Drop the Exclusive gateway onto the canvas.

  2. Draw an arrow from Validation to the exclusive gateway.

circle-info

The routing definition from the exclusive gateway is defined in the outgoing arrow. We will cover this in the next step.

Script Task - Web Validation URL for Supplier

If we reject the document to the vendor, we want to inform the vendor by email that the invoice has been rejected. As part of the email, we want to include a link to the web validation module (and document) where the vendor can update the document.

  1. Drag and Drop a Script Task onto the canvas.

  2. Name the Script Task to 'Create Web Validation URL for Supplier'.

  3. Open the settings for the Script Task.

  4. Copy/Paste the following code into the script task:

The script creates a URL that points to the document with an access token. The URL is then assigned to the index field RejectURL.

circle-exclamation

Now that the Script Task has been created, we can draw the conditional routing to that script task.

  1. Click on the Exclusive gateway.

  2. Click on the arrow.

  3. Draw the line to the 'Create Web Validation URL for Supplier'.

  4. Click on the arrow.

  5. Click on the Settings icon.

  6. For the Condition Field select '_status' from the dropdown list.

  7. For the 'Equals' enter 'reject'. Note: The _status variable is assigned the value of the button clicked by the user in Web Validation. the button 'Reject' assigns the value 'reject'.

  8. Close the Arrow Dialog.

  9. Double Click the arrow.

  10. Enter a Label description 'Reject to Supplier' and position this next to the arrow.

The workflow should now look like this:

Email to Supplier

In the next step, we want to send the vendor an email with a link to the invoice. The vendor can then click on the link in the email to update the details to the invoice.

  1. Add a Service Task.

  2. Name the task 'Email to Supplier'.

  3. Draw an arrow from 'Create Web Validation URL for Supplier' to 'Email to Supplier'.

  4. Click on the Settings of the 'Email to Supplier' service task.

  5. From the Action, select 'SendGrid Send Email'.

  6. Enter the details of the email. Note: To Email address can be taken from the Index field or can be a fixed email address.

  7. For the body, you can either use a Text Body or HTML Body. For HTML, copy this sample HTML email:

circle-info

The {RejectURL} is the index field value we enter here.

circle-info

If you have your own SendGrid account, you can enter the API Key in the settings. Then we will use your account. Otherwise the CumulusPro account will be used and the outgoing email will be from CumulusPro.

Supplier Validation and Timer

Once the email has been sent to the supplier, the system will wait for the supplier to update the invoice. There are two potential outcomes:

  1. The supplier updates the invoice and completes the assigned task.

  2. Supplier does not take any action and hence after a certain waiting period, the invoice should be processed as an exception (Email to Supplier that the invoice has been rejected).

    1. Add a User Task and name it 'Supplier'.

    2. Draw an arrow from 'Email to Supplier' to 'Supplier'.

    3. Draw an arrow from 'Supplier' to 'Validation'.

    4. Click on the 'Supplier' User Task settings.

    5. For 'Application Configuration' select 'Web Validation (MyHome)'.

    6. For 'Validation Buttons' select 'Complete'.

    7. Close the 'Supplier Settings' by clicking on the top right 'x'.

Now, we add a Timer function (Boundary event).

  1. Drag and Drop the Boundary event onto the Supplier User Task on the bottom right.

  2. Click on the Boundary Event.

  3. Click on Settings.

  4. Enter '3' in the 'Days' section.

This means that a task will wait for 3 days until action is taken. If no action is taken, the task is routed to another step.

circle-info

Update the 'Create Web Validation URL for Supplier' with the correct ID of the 'Supplier' user task.

Email to Supplier - Invoice Reject

In the case where the Supplier does not take action on the invoice within 3 days, we want to send an email to the Supplier informing the supplier about the rejection of the invoice.

  1. Add a Service Task onto the canvas next to the Boundary Event.

  2. Name the Service Task 'Email to Supplier - Invoice Reject'.

  3. Draw an arrow from the Boundary Event to the new Service Task.

  4. Double Click on the Arrow and create a label 'No response within 3 days.

  5. Click 'Settings' on the 'Email to Supplier - Invoice Reject' and complete the email settings similar to the previous 'Email to Supplier' task.

  6. In 'Add Attachment' select 'Original Email (EML) as the first attachment.

  7. In the second 'Add Attachment' select 'Original Document'.

The workflow should now look like this:

End Event

To complete the workflow, we add an end event. This are where documents are completed and after a configured time are deleted from the Straatos Platform.

  1. Add an End Event to the process next to 'Email to Supplier - Invoice Reject'.

  2. Draw a line to the End Event.

The workflow should now look like below.

Approval

Having complete the exception handling where we need suppliers to update the invoice, we now need to complete the standard (default) process. For this tutorial, we would like to route the document to an Approver. The Approver will have the option to Complete the document.

  1. Add a User Task 'Approver'.

  2. Draw an arrow from the Exclusive Gateway to 'Approver'.

  3. For 'Approver' settings, enable the button 'Complete'.

  4. For 'Application Configuration' select 'Web Validation (My Home)'.

The workflow should now look like this:

Commenting

Comment fields are an easy way to add notes to the workflow so it makes it easier to understand. For this tutorial, we add a note to the Supplier step to give an example of why a document is sent to the Supplier.

  1. Click on Supplier.

  2. Click on the notes icon.

  3. Place the note box onto the canvas.

  4. Enter a description, such as 'Missing PO Number'.

Export to Google Drive via Zapier

In the last step, we want to export the documents and metadata to a backend system. For this tutorial we use Zapier to export the documents to Google Drive. Zapier (www.zapier.com) provides integrations into more than 500 applications. Hence the Google Drive example is just one of many.

  1. Add a Service Task next to the 'Approver'.

  2. Name the Service Task 'Export to Google Drive.

  3. Draw an arrow from 'Approver' to the 'Export to Google Drive'.

  4. Draw an arrow from 'Export to Google Drive' to the End Event.

  5. Click on settings on 'Export to Google Drive' and select 'Zapier Integration' from the 'Action' Dropdown.

The remaining configuration is done within Zapier. We first complete the user and role setup and route a document past the all the steps so Zapier can automatically pick up the values to link to Google Drive.

User and Roles Setup

We need to create a user for each Validation step as well as a user to work with Zapier.

  1. Select 'Invoice Processing Tutorial' from the menu navigation.

  2. Select Authentication.

  3. Select Roles.

  4. Each User Task workflow step has already a role. However, we need to create a role for 'My Home' and 'Zapier'.

  5. Click on 'Create Role'.

  6. Name the role 'Zapier'.

  7. Click on the tile 'Zapier'.

  8. Under Functions, select 'Zapier'.

  9. Click on 'Back' in the browser.

  10. Click on 'Create Role'.

  11. Name the Role 'My Home'.

  12. Under Functions, select 'My Home'.

  13. Lastly, set up a scan role.

  14. Click on 'Back' in the browser.

  15. Click on 'Create Role'.

  16. Name the Role 'Scan'.

Now we have created the roles, lets create the users:

  1. Go back up to 'Authentication'.

  2. Click on 'Accounts'.

  3. Click on 'Create Account'.

  4. Name the user '[email protected]'.

  5. Click on the tbile.

  6. Enter an easy to remember password.

  7. Select 'Supplier' from the 'Add Role'.

Repeat steps 3-7 for the following users/roles:

Now the roles have been setup.

Testing the Workflow

Publishing the Workflow

Before using the workflow, we need to publish it.

  1. Go to Workflow Configuration - Invoice Process Tutorial - Design Process.

  2. Click on 'Publish Workflow'.

Upload a Document

Use either the Mobile app or Scan+ProcessLite to scan and upload a document.

Monitor the Documents

  1. Go to Workflow Configuration - Invoice Process Tutorial - Monitor Process.

Processing Documents

Use one of the CumulusPro Clients to capture a number of invoices. In this example we use Scan+ProcessLite.

  1. Goto the Link tile.

  2. Open the Scan+ProcessLite link.

  3. If it is the first time you are using scan client on the machine, you will need to install Scan+. Otherwise, you will be prompted to log in.

  4. Login with the Scan Operator credentials (alternatively, if you have configured 'Anonymous login', you will skip this step.

  5. Scan documents and upload documents.

circle-info

We need to include an index field 'FromEmail' where we can enter the email address. This makes it possible to test the email notification.

Monitoring the Process

Now that the documents are uploaded, we want to monitor the progress in the Process Monitor.

  1. Open admin.cumuluspro.net.

  2. Log in.

  3. Go to the workflow.

  4. Next to the 'Design' Button there is a 'Monitor' button. Click on the button.

The Process Monitor opens and displays the same representation as the Design Process.

If the documents are successfully imported, they are displayed as a number below the workflow step they are currently in.

In the above screenshot, 1 document is visible.

If the documents are not all visible, this might be that the counters have not been refreshed. The counters refresh every minute automatically. If you want to refresh the counters manually, you can do this by pressing the 'Update Counters' link.

To see more details of the documents in a particular step, click on the step tile. A table opens showing the details of the documents as well as actions that can be taken for those documents.

If you would like to see a preview of the documents, click the document line (not the checkbox in front) and a preview screen opens on the right.

To hide the preview screen, click on the document line again.

Continue to process all the documents and check the outcome in each particular step until the 'Export to Google Drive' step. Next, we will setup Zapier.

Zapier Configuration for Google Drive Export

For this tutorial, we going to setup Zapier as an export for Google Drive.

  1. Goto www.zapier.com.

  2. If you don't have already a login, create a new login.

  3. One setup, go to 'My Zaps' and click on 'Make a New Zap'.

  4. Your screen should look like this:

5. In 'Choose a Trigger App' enter CumulusPro.

6. Select CumulusPro.

7. Then for 'Choose Trigger' click on 'Save+Continue'.

8. Select (or create) and account.

circle-info

If you haven't used Zapier with this workflow yet, create a new account and log in with your organisation level account that has rights to zapier.

9. Click on Test Account and once 'Account is working' is displayed, click on 'Save+Continue'.

10. On the Set Up Options, choose the workflow and the workflow step.

circle-info

Only workflow steps which are 'Service Tasks' and where the Action is 'Zapier Integration' are shown.

11. On 'Test this Step' click 'Fetch & Continue'. Important is that a document is currently in the 'Export to Google Drive' step.

12. If the test is successful, click on continue.

Now we setup the Action (Google Drive)

  1. Search and select 'Google Drive'.

  2. Choose 'Create File from Trigger' and click 'Save+Continue'.

  3. Select your Google account or add a new one, then click Save & Continue.

  4. Select the Folder (optional).

  5. In 'File', click on the list icon at the end and then select the document you want to export. In this case it is the 'ABBYY OCR searchable PDF'.

  6. Click Continue.

  7. Click 'Create & Continue' on the 'Test Google Drive'.

  8. When the 'Test Successful' appears, click on 'Finish'.

  9. Create a Name for your Zap and switch it on.

  10. Now the Zapier setup is complete.

Follow the step below to process the document in Admin Panel Process Monitor.

  1. Select the document.

  2. Click on Retry selected.

  3. The document now gets exported to Google Drive.

  4. Check Google Drive if the documents are there.

Business Rules in Web Validation

So far, we have setup business rules in Java Script as part of a process step. However, we may want to validate index information in the Validation screen. For this tutorial we add a check if the GrossTotal is equal to the NetTotal + Tax.

  1. Go to the Workflow setup.

  2. Click on the index field 'GrossTotal'.

  3. Scroll down to the 'Validation Expression Message'.

  4. Add the message 'Net Total + Tax Total is not equal to Gross Total'.

  5. In 'Validation Expression (boolean)' enter the JavaScript below.

Now, to test, open the fly-out on the right hand side.

This opens the Web Validation Simulator. The Web Validation Simulator displays all the fields and rules as the web validation module. Each change that is made in the rules will immediately reflect in the simulator. Also, the index field values can be entered and tested if they fit the rules.

Last updated