Tungsten Automation

Kofax AP Agility 2.5.0 Fix Pack 3 English

Release Date: May 03, 2024

© 2024 Tungsten Automation. All rights reserved.
Use is subject to license terms.

Introduction

You can install Kofax AP Agility 2.5.0.3 to resolve the issues below.

Issues Resolved in This Fix Pack

ID Issue Solution
2098926

Unable to select GL code - Invoice Coding.

Missing business rule added.

2098752

File Extension field size is not consistent with other fields in the ERP Connector Configuration screen.

The field size of the File Extension setting is consistent with other fields on the configuration page.

2098690

The value entered in File Extension field is not cleared after disabling XSLT in ERP connector configuration.

When XSLT is disabled, the file extension value is removed.

2098685

Typo observed in XSLT transformation error message which appears when an incompatible XSLT is used.

The typo has been corrected.

2098066

ClassifyExtract job gets suspended with dependency error.

The ClassifyExtract job is no longer suspended with a dependency error.

2097649

Create new analytics report to show Historical Trends (Daily, Weekly, Monthly) for STP rate by vendors.

A new report is available that displays historical trends for straight-through processing by vendors. You can filter the results by time frame and specific vendors.

2097648

Create new analytics report to show Extraction Accuracy by vendors.

A new report is available that displays the extraction accuracy by vendors. You can filter the results by time frame and specific vendors.

2097647

Create new analytics report to show Historical Trends(Daily, Weekly, Monthly) for STP rate by countries (with Volume).

A new report is available that displays the historical trends for straight-through processing by countries with volume. You can filter the results by time frame and country.

2097645

Create new analytics report to show Extraction Accuracy by Countries.

A new report is available that displays the extraction accuracy by country. You can filter the results by time frame and specific countries.

2097098

Incorrect table values after call of DeleteRow .

Table values are displayed as expected.

2095382

Currency field valid with incorrect currency if vendor country of PO vendor is different from extracted vendor.

The currency is re-evaluated so it is not incorrectly considered valid when it should be flagged for review in validation.

2094840

Email approval failing.

Email approval is no longer failing.

2094857

Improve handling of authentication token for S/4Hana Cloud ES.

The authentication token is discarded after a 30 minute timeout as well as whenever a 401 or 403 error are encountered.

2094835

Invoice currency is incorrectly determined.

Improved logic for selecting currently based on matches located beside the total or tax amount. A currency is no longer selected solely based on the vendor country currency as this is prone to false positives.

2094833

Distinguishing between dot and comma.

When validating a modified cell a comma in the 4th-last position is now always interpreted as a thousands separator.

Amount formatting logic for server-side validation has been improved so that ambiguous amounts are now parsed with no decimals when:

  • The invoice total has no decimal point.

  • The separator from the 4th-last position appears more than once in one of the line item totals.

2094832

ExtractionProcess.exe runs out of memory when processing large documents.

Improvements to extraction for large documents means that it is significantly less likely that the ExtractionProcess.exe runs out of memory.

2094831

PDFs exported by ERP connector have incorrect number of pages when PDFs have been merged in IP Validation.

Documents that are merged or deleted during Validation or reScan are detected as such and handled accordingly.

PDFs are now regenerated if documents have been merged rather than reusing the original PDF.

2094829

Validation of VendorID field does not trigger PONumber validation if invoice type is validated as PO but is not a PO.

PONumber validation from the VendorID validation is triggered if the invoice type is configured to be validated as a PO.

2094827

Jobs getting suspended at Approval activity with error "Failed to execute business rule."

Jobs are no longer suspended during the Approval activity unexpectedly.

2094826

Ability to export custom fields to PDAP.

It is now possible to map a non-predefined custom field to a PDAP field.

2094825

Over-invoicing check is not working for the scenario where individual PO lines are not being looked into.

Line level pairing is enforced for zero quantity purchase orders.

2094824

Line Pairing - Paired line having total of zero when pairing multiple PO lines to one invoice line.

Lines paired with the correct quantity and total value.

2094822

Using current time as posting date can throw an error when exporting to SAP.

The S4Hana Cloud ES connector now produces clean CSV entries for vendor master data, even if they contain quotes.

2094813

Import of vendor master data via S/4HANA connector fails if a field in the CSV data contains a quote or comma character.

A new configuration setting has been added to the settings form for the connector which enables you to configure a time zone for the SAP server.

2094807

Document sent to ParkLPRFailedDocuments: Value cannot be null. Parameter name: input.

This error is not encountered because the logger no longer logs null values.

2094804

APA Analytics - Invoice status update mismatch between document_status and invoice_header tables.

Issues related to Analytics reports now behave as expected for newly processed invoices.

To ensure that existing invoices are displayed correctly in Analytics, it is necessary to run some SQL queries.

2094801

DOCUMENT_STATUS remains on state 8 (IP Validation) after rejecting a document with scan quality issue on the validation form

Rejected documents that are sent for re-scan now show the correct 'New' status.

2094800

Able to validate $0 Invoice Amount invoices with the lines deleted.

Zero value invoices can no longer be validated successfully without selected the "Zero value invoice" invalid reason.

2094795

Increase precision for unit price to 10 decimal places.

The unit price now supports up to 10 decimal places.

2094761

AP Analytics Invoice Search - when the invoice goes into APA workflow --> comes back to IPA Validation and Rejected, the Invoice status does not reflect as Error.

The status of a document is now set to INVOICE_CANCELLED when it is deleted, or when it is rejected as Not an Invoice.

2094745

IPA allows for an Invoice Date in the future but APA does not.

The "Future Days" setting in the Settings > Invoice Processing > Capture Profiles > Field Settings is now used to validate dates in both IPA and APA.

2094743

Site ID not updated when changing PO.

The Site ID is successfully updated when changing the PO.

2094742

Disallow over-invoicing during Line Pairing.

A new setting is available when configuring your Agnostic ERP Connector. When you select Apply XSLT, a new setting called File Extension is available to enter the required file extension for the generated file.

If no value is provided for this new setting then the files will be generated without an extension.

2094741

"Line data does not correspond to PO lines" error after line pairing correction when setting line type for misc charges.

An error is no longer encountered after the Line Pairing Correction activity related to misc charges when there are no corresponding entries on a PO.

2094739

Add the ability to configure a file extension for an agnostic ERP connector when applying XSLT transformation.

A line is not paired if the invoiced quantity exceeds the ordered quantity, the invoiced unit price exceeds the unit price from the PO line, or the invoiced line total exceeds the PO line total.

2094737

Add support for writing well-formed XML documents after an XSLT transformation.

The XSLT processor is now configured to generate well-formed XML documents if the output method of the XSLT is XML.

2094731

Accounts Payable Agility (SaaS) - Using just Tenant Code in the IPA/APA dll's ultimately leading to error in ClassifyExtract/Validation/Line Pairing - 'Object reference not set to an instance of an object.'

The combination of tenant code and deployment type is now used to distinguish different environments from each other.

2094729

Log Entries written to wrong database in Azure environment.

Different tenants are no longer overwriting each others logger configuration. Tenant-specific logger names are now used by the APA.dll.

2094719

Analytics for APA - wrong counts related to Invoices with Exceptions report.

The correct counts are now provided in the Invoices with Exceptions report.

2094713 Administrator ability to view and reassign invoices in Approval.

Members of the AP Manager group are now approval managers and can see all invoices that are in approval, even if they are assigned to a different user.

To use a different resource group for approval manager, modify the AP Agility AP Custom Assign Approval Manager business rule in TotalAgility and set the ApprovalManagerId to the resource ID of the resource group that you want to use.

2094711

Document Export fails after successful validation in APA Azure (Random).

Improvements have been made to the ERP connector plugin management to avoid invalid states when loading a plugin instance.

2094709

Invoice export completes successfully although invoice has not been exported.

The ERP connector sets a valid status in its response.

2094706

Customizable business rule for GL code validation.

It is now possible to customize a business rule for GL code validation.

2094675

Error when opening organization based on Generic template.

An error is no longer generated when opening an organization that is based on the generic template.

2094671

Use new EnvironmentName property for tenant key with KTA 8.

When using TotalAgility 8.0, the EnvironmentName property is used for the tenant key.

2094377

Create new analytics report to show STP rate by vendors in selected country (with volume).

A new report is available that displays straight-through processing information for vendors in the selected countries with volume. You can filter the results by time frame, specific vendors, and specific countries.

Known Issues

1884839: [TotalAgility 7.11] Embedded page with target type dynamic raises 404 error when referring to an empty form variable.

A 404 error is displayed when opening Settings > Invoice Processing > Capture Profiles if there is no organization selected from the list.

Workaround: Create an empty form called "NoProfileSelected" and update the ProfileDetailPage variable on ProfileSettings and InvoiceExportConfiguration form, setting “NoProfileSelected” as default value.

Issues Resolved in Previous Fix Packs

Problems Resolved in Fix Pack 2

ID Issue Solution
1813279

Configurable priority for default currency - PO vs Vendors.

A new setting is available in Settings > Invoice Processing > Capture Profiles > Currency Settings.

The new Default Currency Priority setting enables you to specify if the currency value comes from the vendor record or the PO header when no value is extracted from the document.

This setting is available for selection only if both the Default PO Currency and Default Vendor Currency settings are selected.

1812149

Missing index on the PO_HEADER_ID field of the PO_LINES table which impacts the performance of master data cleanup.

A new database index was added to the PO_LINES table so that master data cleanup can occur without impacting performance.

1804192, 1783924

Support for PO Currency in AP Agility Cloud.

The PO currency is now returned as the CURRENCY_CODE rather than the business unit currency when there is no currency printed on the invoice, but the purchase order contains a currency.

1804185

Refine ABN extraction based on VendorIdentifier in the Vendor master data.

When multiple good alternatives are returned for the ABN, the alternative that corresponds to the VendorIdentifier value is preferred.

1803198

Display Supplier Site Number rather than internal site id in the SiteID field for MarkView.

The Supplier Site Number is imported as the ExternalSiteID into the BRWVendorMaster database table.

The SiteID field is now populated with the Supplier Site Number rather than an the Internal Site ID.

1796364

Vendor Number and Supplier Site Number to be visible in the Validation screen and Vendor Search.

1803007

Job suspends if first page is smaller than subsequent page.

The width from the page with the largest width is now used rather than the first page, for layout analysis during line items extraction.

1798836

APA_Global_Import_Settings.form authorization access.

This form is now restricted to members of the APA Administrators group.

1798833

APA_Email_Approval_Configuration.form authorization access.

This form is now restricted to members of the AP Approvers group.

1795843

G/L Account validation/automation for multi-segment coding requirements.

It is now possible to automatically fill Cost Center codes, GL codes, and WBS codes.

To do this, navigate to one or more of the following hierarchy settings, as needed:

  • Settings > Workflow > Cost Center Structures and select the Autofill Cost Center Hierarchy Lists setting.

  • When this setting is selected, the Cost Center hierarchies are filled automatically during the AP Workflow when a top-level segment is selected by a user and their successive child hierarchies have a single value only.

  • Settings > Workflow > GL Account Structures and select the Autofill GL Code Hierarchy Lists setting.

    This setting is available only when Use Hierarchical GL Data is also selected.

    When this setting is selected, the GL Code hierarchies are filled automatically during the AP Workflow when a top-level segment is selected by a user and their successive child hierarchies have a single value only.

  • Settings > Workflow > Work Breakdown Structures and select the Autofill WBS Hierarchy Lists setting.

    When this setting is selected, the Work Breakdown Structure hierarchies are filled automatically during the AP Workflow when a top-level segment is selected by a user and their successive child hierarchies have a single value only.

If a child in any of the cost center, GL code, or WBS hierarchies has multiple segment choices available, the user must select a value before the autofill to continue.

1795081

Document still flagged as utility bill after switching to non-utility vendor when list of utility vendor ids is configured.

Documents are now successfully flagged as non-utility vendors when a list of utility vendor IDs is configured.

1794815

Update MarkView Vendors fails after a few hours.

Only 50 duplicate records are now recorded during vendor import. The duplicate check is skipped when the log level is not set to DEBUG.

1794809

Error establishing a connection to SQL Server during export of Migration Package in Azure installation.

All database queries are no longer executed on the Integration Server. Instead, all queries are now executed in the cloud.

1794801

APA/MarkView Integration 0 Tax amount not being exported from APA to MarkView.

A zero tax amount is now successfully exported from APA to MarkView.

1794756

Bill-To name not found when using formats with more than 3 words or blanks.

The maximum number of words for alternatives returned by the Format Locator is now resolved dynamically, based on the configured formats.

1794727

IP_CFG_CUR DBTableName / DBColumnName columns wiped out after applying changes on the Currency Settings.

Values for hidden fields on a multi-tenant environment are no longer lost when applying changes to the Currency Settings form.

1784766

Split the extraction of Canadian QST and PST taxes into separate fields.

A new field called QuebecSalesTax is available. When selected, QST tax values are extracted into the field rather than the existing ProvincialSalesTax.

If this setting is not selected, QST values are still extracted into the ProvincialSalesTax field.

1779988

Support SSO/Federated Security.

It is now possible to configure AP Agility to use Single Sign On security/Federated security.

If there is more than on Federated Security/SSO configuration in Kofax TotalAgility, it is necessary to get the unique identifier of the configuration that you are using.

Locate your unique configuration identifier by opening the Kofax TotalAgility database.

View the AUTH_PROVIDER database table and then locate the database record that corresponds to the provider that is configured in TotalAgility.

The Provider ID is prefixed with the 0x prefix and must be provided as part of the URL if there are multiple providers configured in TotalAgility.

The URL should be similar to:

https://localhost/TotalAgility/FederatedLogin.aspx?Id=E4E533F29E43148D92D469E02B07DA24

To use this type of security, configure AP Agility as follows:

  1. Log on to the Kofax AP Agility Workspace as an Administrator.

  2. Navigate to Settings > Administration > Variables and select the APA Use Federated Security Authentication.

    The Edit Variable window is displayed.

  3. Set the Variable Value to True and click Save.

  4. Go to Settings > Administration > Variables and select the Email Notification URL Hostname variable.

    The Edit Variable window is displayed.

  5. Set the Variable Value to https://host/forms/apagility/APA_Workspace_Logon_FedSecurity.form where the host is the domain name of the Kofax TotalAgility host.

  6. Click Save.

  7. Use the following URL to log on to the AP Agility Workspace:

    https://host/TotalAgility/forms/apagility/APA_Workspace_Logon_FedSecurity.form

The service should work with TotalAgility by using Windows Authentication. By default, The AP Agility ERP Connector web service is already configured to use Windows authentication for TotalAgility. This type of authentication should remain enabled.

To ensure that Federated Security is used by default when AP Agility is opened, use the following steps:

  1. Log on to the Kofax TotalAgility Designer as an Administrator.

  2. Navigate to User Interface > Sites and set the category to APAgility.

    The settings for the AP Agility site are displayed.

  3. From the Default form setting in the Desktop settings group, set the category to AP Agility and then select the APA_Workspace_Logon_FedSecurity value.

  4. Optionally, repeat the previous step for Tablet Settings and Phone settings if needed.

  5. Click Save.

Problems Resolved in Fix Pack 1

1781124: Support for Read-only Connection User to the Database.

1779281: Create Database Upgrade process in Azure.

New Analytics for AP Agility Reports

The following new reports are available in Analytics for AP Agility:
Category Report Name Description
Extraction Accuracy Extraction Accuracy rate by countries (with volume)** This report is available using the Extraction Accuracy rate by fields and by countries report and the filter lists.
Extraction Accuracy rate by fields and by countries Displays the field accuracy rate by country. Use the filters to expand or narrow the results, or to filter by one or more countries.
Extraction Accuracy rate by fields and by vendors Displays the field extraction accuracy rate by vendors. Use the filters to expand or narrow the results, or to filter by one or more vendors.
Extraction Accuracy rate by vendors (with volume)** This report is available using the Extraction Accuracy rate by fields and by vendors report and the filter lists.
Straight-Through Processing STP rate by vendors is selected by country (with volume) Displays the vendor straight-through processing rate by countries, with volume. Use the filters to expand or narrow the results, or to filter by one or more countries.
STP rate by country (with volume)** This report is available using the STP rate by vendors is selected by country (with volume) report and the filter lists.
Historical Trends (Daily, Weekly, Monthly) for STP rate by countries (with volume) Displays the straight-through processing rate for countries, with volume. Use the filters to expand or narrow the results, or to filter by one or more countries.
Historical Trends (Daily, Weekly, Monthly) for STP rate by vendors Displays the straight-through processing rate for vendors. Use the filters to expand or narrow the results, or to filter by one or more vendors.

** Achieved from another report using filters.

Applies To

This fix pack applies to Kofax AP Agility 2.5.0

This fix pack is cumulative and includes the resolved issues released in previous Kofax AP Agility 2.5.0 fix packs.

Files Included

This fix pack includes the following files:

File name Version
KofaxAPAgility-2.5.0.3.msp 2.5.0.3
KofaxAPAgility-2.5.0.3-ExtractionGroup-DLLs.zip 2.5.0.3
KofaxAPAgility-2.5.0.3-ExtractionGroup-DLLs-MT.zip 2.5.0.3
KofaxAPAgility-2.5.0.3-KTA-Artifacts.zip 2.5.0.3
KofaxAPAgility-2.5.0.3-KTA-Artifacts-MT.zip 2.5.0.3
KofaxAPAgility-2.5.0.3-UserExit.zip 2.5.0.3
KofaxAPAgilityAnalytics-2.5.0.3.zip 2.5.0.3
KofaxAPAgilityERPConnector-2.5.0.3_For_SAPS4HANACloudES.zip 2.5.0.3
ReadMe-KofaxAPAgility-2.5.0.3.html N/A

Install This Fix Pack

Use the appropriate installation instructions from the following procedures to install the fix pack in your environment.

Deploy AP Agility Upgrade on Kofax TotalAgility On-Premise

Before installing this fix pack, note the following:

To install this fix on Kofax TotalAgility perform the following steps:

  1. Stop the following services:

    1. Kofax TotalAgility Core Worker

    2. Kofax Transformation Server

    3. World Wide Web Publishing Service

  2. Backup the following databases, adjusting the names according to your environment:

    1. Kofax TotalAgility databases:

      • TotalAgility

      • TotalAgility_Documents

      • TotalAgility_Reporting

      • TotalAgility_Reporting_Stating

      • TotalAgility_Simulator

    2. Kofax AP Agility database:

      • APAgility

  3. Restart the following services:

    • Kofax TotalAgility Core Worker

    • Kofax Transformation Server

    • World Wide Web Publishing Service

  4. Open the Command Prompt as an Administrator and follow these steps to update the assemblies in the GAC.

    1. Navigate to where the MSP is located.

    2. Run an installation command based on the following options.

      • Option 1: Run an installation command on a machine where the ERP connector is installed based on the following conditions:

        msiexec /p "KofaxAPAgility-2.5.0.3.msp" KTA_CONNECTION_TEST_RESULT=SUCCESS APA_IIS_APP_POOL_USERNAME=<username> APA_IIS_APP_POOL_USERDOMAIN=<User domain or dot> APA_IIS_APP_POOL_USERPASSWORD=<password>

        If your existing installation does not have a custom account for the ERP Connector, run the following command:

        msiexec /p "KofaxAPAgility-2.5.0.3.msp" KTA_CONNECTION_TEST_RESULT=SUCCESS

      • Option 2: Run an installation command on a machine where no ERP connector is installed based on the following conditions:

        msiexec /p "KofaxAPAgility-2.5.0.3.msp" KTA_CONNECTION_TEST_RESULT=SUCCESS REINSTALL=<features>

        Where <features> is a comma-separated list that includes FTR_Basic,FTR_Core, and one of the following, if installed:

        • FTR_Sap if support for SAP has been installed.

        • FTR_Oracle,FTR_Markview if support for MarkView has been installed.

        Examples:

        • Only core assemblies installed: FTR_Basic,FTR_Core

        • Core assemblies installed and SAP support: FTR_Basic,FTR_Core,FTR_Sap

        • Core assemblies installed: FTR_Basic,FTR_Core,FTR_Oracle,FTR_Markview

  5. In TotalAgility Designer, go to Import, and import the KofaxAPAgility-2.5.0.3-KTA-Artifacts.zip.

    Select the Overwrite non-versioned items setting.

  6. On a separate tab in your browser, open the AP Agility workflow.

    1. From the menu, select Jobs > Create.

    2. From the Category list, select AP Agility.

      The list of processes is updated for the AP Agility category.

    3. From the Processes list, select AP Database Upgrade.

    4. In the text field provide a database schema name for upgrade. This should usually be [dbo].

    5. Start the job by pressing Create.

    The AP Agility databases are updated.

  7. Locate the temporary folder path where the patch files are located.

    1. Open the Transformation Designer and then the InvoiceProcessingAgility project.
    2. In the Project Tree select the Project node and then click on the Project path that is listed in the Details pane.
    3. Navigate to the Custom\Comp folder in the path where the VendorASE.csv file is located.
  8. Extract the contents of the KofaxAPAgility-2.5.0.3-ExtractionGroup-DLLs.zip file.

    Three files are extracted.

  9. Copy the three extracted DLL files to the Custom\Comp from step 7.c.
  10. Release the InvoiceProcesingAgility project in the Transformation Designer.

  11. Optionally, if you are working with custom user exit assemblies, rebuild them using the ICAL assemblies from KofaxAPAgility-2.5.0.3-UserExit.zip.

    Update the installations in the GAC.

    Note  Several properties from the PO and line data have changed type from float to double. If your user exits are working with PO or line data it may be necessary to make adjustments to the code.

  12. Optionally, if you are working with the VendorSiteCode, ensure that you clear the BRWVendorMaster table and then run the following jobs:

    1. AP Agility AP Data Import job.

    2. InvoiceProcessingAgility DumpAddressFiles job.

*  Repeat steps 1, 3, and 4 on all machines where the AP Agility assemblies are installed. If the ERP connector web service is installed on a separate machine, repeat step 3 on this machine.

Deploy AP Agility Upgrade in a Kofax TotalAgility Azure environment or in a Kofax TotalAgility On-Premise Multi-tenancy environment

Before installing this fix pack, note the following:

To install this fix in a Kofax TotalAgility Azure environment or in a Kofax TotalAgility On-Premise Multi-tenancy environment perform these steps:

  1. On the TotalAgility Designer menu, select Import, and import the KofaxAPAgility-2.5.0.3.KTA-Artifacts-MT.zip.

    Select the Overwrite non-versioned items setting.

  2. On a separate tab in your browser, open the AP Agility workflow.

    1. From the menu, select Jobs > Create.

    2. From the Category list, select AP Agility.

      The list of processes is updated for the AP Agility category.

    3. From the Processes list, select AP Database Upgrade.

    4. In the text field provide a database schema name for upgrade. This should be [apa_live] or [apa_dev].

    5. Start the job by pressing Create.

    The AP Agility databases are updated.

  3. Locate the temporary folder path where the patch files are located.

    1. Open the Transformation Designer and then the InvoiceProcessingAgility project.
    2. In the Project Tree select the Project node and then click on the Project path that is listed in the Details pane.
    3. Navigate to the Custom\Comp folder in the path where the VendorASE.csv file is located.
  4. Extract the contents of the KofaxAPAgility-2.5.0.3-ExtractionGroup-DLLs-MT.zip file.

    Three files are extracted.

  5. Copy the three extracted DLL files to the Custom\Comp from step 3.c.
  6. Release the InvoiceProcesingAgility project in the Transformation Designer.

  7. Optionally, if you are working with the VendorSiteCode, ensure that you clear the BRWVendorMaster table and then run the following jobs:

    • AP Agility AP Data Import job.

    • InvoiceProcessingAgility DumpAddressFiles job.

  8. If you have installed an ERP connector web service on-premise, open the Command Prompt as an Administrator on this machine and follow these steps to update the ERP Connector web service:

    1. Navigate to where the MSP is located.

    2. Run an installation command based on the following conditions.

      If your existing installation has a custom account for the ERP Connector, run the following command:

      msiexec /p "KofaxAPAgility-2.5.0.3.msp" KTA_CONNECTION_TEST_RESULT=SUCCESS APA_IIS_APP_POOL_USERNAME=<username> APA_IIS_APP_POOL_USERDOMAIN=<User domain or dot> APA_IIS_APP_POOL_USERPASSWORD=<password>

      If your existing installation does not have a custom account for the ERP Connector, run the following command:

      msiexec /p "KofaxAPAgility-2.5.0.3.msp" KTA_CONNECTION_TEST_RESULT=SUCCESS

    3. Open the web.config file of ERP Connector web service in a text editor.

      go to the app setting section and locate the key SdkServicesLocation. it's value will be overwritten by upgrade.

      <add key="SdkServicesLocation" value="http://<machine name>:80/TotalAgility/services/sdk" />

      update the key value to point to the correct url.

Additional Steps for Upgrading from AP Agility 2.5.0.0 or 2.5.0.0.1

These steps must be performed if you already have AP Agility 2.5.0.0 or 2.5.0.1 installed. This is relevant for all installation environments, including on-premise, Azure, and OPMT.

These steps are not required if you are upgrading from AP Agility 2.5.0.2.

  1. Log on to the TotalAgility Designer.
  2. On the menu, select Capture > Extraction Groups.
  3. From the Category list, select InvoiceProcessingAgility and check if the installed version is less than 1199.

    If the installed version is less than 1199 no further actions are required.

    If the installed version is greater than 1199 the new extraction group was not imported during the upgrade. To resolve this, perform the following steps:

    1. Prepare a fresh but temporary TotalAgility environment on another server where AP Agility is not installed. This environment can be deleted when these steps are complete.
    2. In the temporary TotalAgilty installation, Open the Designer and select Import to import KofaxAPAgility-2.5.0.3-KTA-Artifacts.zip or KofaxAPAgility-2.5.0.3-KTA-Artifacts-MT.zip depending on your environment.
    3. On the menu select Capture > Extraction Groups.
    4. From the Category list select InvoiceProcessingAgility.
    5. Click to open the InvoiceProcessingAgility extraction group.
    6. Click the Release button in the upper-right corner to increase the version number.
    7. Repeat this until the version number is greater than the version on the environment you are upgrading, as observed in step 3.
    8. Once the version number is high enough, go to Packages and create a new package called "KofaxAPAgility-2.5.0.3-ExtractionGroup-Custom".
    9. Add the "InvoiceProcessingAgility" extraction group.
    10. Export your package.
    11. Log on to the TotalAgility Designer on the environment you are upgrading.
    12. Import the "KofaxAPAgility-2.4.0.3-ExtractionGroup-Custom.zip" file.
    13. Optionally, merge your changes in Transformation Designer.
    14. Optionally, remove your temporary TotalAgility environment.

Steps to install 2.5.0.3 of the Kofax AP Agility ERP Connector for S/4Hana Cloud ES

  1. Log on to the TotalAgility Designer, go to Import, and import the KofaxAPAgilityERPConnector-2.5.0.3_For_SAPS4HANACloudES.zip.

    Select the Overwrite non-versioned items setting and click Import.

    The KofaxAPAgilityERPConnector-2.5.0.3_For_SAPS4HANACloudES.zip package is imported.

  2. Navigate to System Data > Server Variables and select the AP Agility category.

    If it does not already exist create a server variable called ERPCONNECTORCACHERESET with the Date type and set it to the current time.

    If the variable does exist, update it to the current time.

Upgrade Analytics for Kofax AP Agility

Before you can upgrade Analytics for AP Agility, it is necessary to take a backup of your existing solution so that you can revert back to it if necessary.

Follow these steps to make a backup of your Analytics for AP Agility solution:

  1. Open Kofax Insight Data Loader.
  2. Set any scheduled execution plans to Manual.
  3. Open Kofax Insight Studio.
  4. In the Documents tree, ensure that the APA_ANALYTICS project is selected.

  5. Select the Tools tab and click Export.

    The Export of "APA_ANALYTICS" window is displayed.

  6. In the Export window, perform the following steps:

    1. Expand Records > Base Records and select the following:

      • Document Status
      • Document Status with Invoice Header
      • Invoice Header
      • Invoice Header with Document Status
    2. Collapse Base Records and then select the following:

      • All Invoices
    3. Expand Views and select the following:

      • Analytics Main
      • Analytics Main - Search
    4. Expand Execution Plans and select the following:

      • Load Metrics
      • Main Data Load
    5. In the settings at the bottom of the window, select Export to separate files and Export data
    6. Click Export.

      A zip file is saved with all the selected data. Copy this file to a safe location as it may be needed to revert this fix.

Follow these steps to upgrade Analytics:

  1. Open Kofax Insight Studio.
  2. In the Documents tree, select the APA_ANALYTICS project from the list at the top.

    If your Analytics for Kofax AP Agility has a different project name, select that from the list.

  3. In the Documents tree, select Data Sources > AP_Agility.

    Details about the selected database and its tables are displayed.

  4. Add a new field to the dbo.DOCUMENT_STATUS table in this database by following these steps:

    1. Right-click on dbo.DOCUMENT_STATUS and select Add Field.

      The New Field window is displayed

    2. Enter VENDOR_COUNTRY as the Field name.
    3. Set the Field type to String.
    4. Click OK and Save.

      The field is added to the dbo.DOCUMENT_STATUS table.

    5. In the dbo.DOCUMENT_STATUS table, select the newly added VENDOR_COUNTRY field.

      The field details are displayed in the Property panel.

    6. In the Property panel, set the Length to 150 and press Enter.

      The field length is updated.

  5. Repeat the previous step to add the VENDOR_COUNTRY field to the dbo.INVOICE_HEADER table.
  6. Click Save.
  7. Select the Tools tab.
  8. From the toolbar, click Import.

    The "Select file for import" window is displayed.

  9. In the import window, select where the KofaxAPAgilityAnalytics-2.5.0.3.zip file is located and click OK.

  10. In the Import "KofaxAPAgilityAnalytics-2.5.0.3.zip" window, set the following:

    1. Select Check with references.
    2. Select Check all.
    3. Select Overwrite.
    4. Click Import.

    The updated package is imported.

  11. Refresh Kofax Insight Studio.
  12. In the Documents tree, select Data Sources > AP_Agility.
  13. In the Actions pane, above the list of database tables, click + Add Table.

    The Add table window is displayed.

  14. In the Add Table window, add a table called dbo.COUNTRIES.
  15. Click Save.

  16. In the Documents tree, expand Translation Tables and select Countries.

    A window is displayed indicating that there is a new table. If it is not already mapped, select the dbo.COUNTRIES table. Click OK.

  17. Click Save.
  18. Open the Insight Admin Console and add rights to view the newly added reports by following these steps:

    1. In the Documents tree, select Roles > IPA Admin role.

      The main panel is updated with details about the selected role.

    2. Select the View rights button and select the APA_ANALYTICS project from the list of projects.
    3. In the central panel, select the following:

      • Expand Views > Invoice Lists > Historic Overview and select Invoice List - STP Statistics.

      • Expand Views > Invoice Lists > Performance and select Invoice List - Workload by Country & Vendor.

      • Expand Views > Metrics > Historic Overview and select the following:

        • STP Statistics by Country
        • STP Statistics by Historical Trends
        • STP Statistics by Vendor
      • Expand Views > Metrics > Performance and select the following:

        • Extraction Accuracy by Country
        • Extraction Accuracy by Vendor
      • Click Save.
    4. Repeat step 18 for the following roles:

      • APA Admin role
      • IPA role
      • APA role
    5. Note:   After the rights for all four roles are updated, Analytics for AP Agility users must log out and log back in before they can see these changes.

    6. Open the Insight Data Loader and perform following steps:

      Select Data Load Module, select Date range tab.

      • Select Execution Plans > Delete All Data. Set from date: Beginning of times(1/1/1900 12:00 AM) and to date:Current time.

      • Select Execution Plans > Main Data Load. Set from date: Beginning of times(1/1/1900 12:00 AM) to date: Current time.

        Check the option: Save "To date" as the date of last successful load. Run the plan and wait for it to successfully complete.

Analytics for Kofax AP Agility is now updated and several new reports are available.

Execution plans that are set to Manual before taking backup, can be scheduled again.

If you want to remove this fix, refer to the removal instructions.

Remove This Fix Pack

Use the appropriate removal instructions from the following procedures to remove the fix pack from your environment.

Revert the Fix for AP Agility on Kofax TotalAgility On-Premise

You can only revert the Fix for AP Agility on Kofax TotalAgility by manually performing the following steps:

Revert the Fix for AP Agility in a Kofax TotalAgility Azure environment

To remove this Fix, contact your Kofax TotalAgility Cloud Administrator or Service provider representative who should be able to roll back the changes made to the database and restore a previous version before the Fix was applied.

Revert the Fix for Kofax AP Agility ERP Connector for S/4Hana Cloud ES.

You can only revert the Fix for AP Agility on Kofax TotalAgility by manually performing the following steps:

  1. Log on to the TotalAgility Designer, and delete the APA_ERP_Connection_SAP_S4HANACloud.

  2. Import the ErpPluginPackage-SAPS4HanaCloud.zip TotalAgility package from the KofaxAPAgilityERPConnector-2.5.0_For_SAPS4HANACloudES.zip that was shipped with the 2.5.0.0 release.

    Select Overwrite non-versioned items.

  3. Update the ERPCONNECTORCACHERESET server variable and set it to the current time.

Revert the Fix for Analytics for AP Agility

To revert the fix for Analytics for AP Agility, follow these steps.

  1. Open Kofax Insight Studio.
  2. In the Documents tree, select the APA_ANALYTICS project from the list at the top.

    If your Analytics for Kofax AP Agility has a different project name, select that from the list.

  3. Select the Tools tab.
  4. From the toolbar, click Import.

    The "Select file for import" window is displayed.

  5. In the import window, select the backed up file that was made during installation and click OK.

  6. In the Import window, set the following:

    1. Select Check all.
    2. Select Overwrite.
    3. Click Import.

    The backup package is imported.

  7. Manually remove the following from the APA_ANALYTICS project.

    These must be deleted in the order provided:

    1. Expand Views and delete the following by right-clicking and selecting Delete. Click Yes to confirm your deletion.

      • Invoice Lists > Historic Overview > Invoice List - STP Statistics
      • Invoice Lists > Performance > Invoice List - Current Workload by Country & Vendor
      • Metrics > Historical Overview > STP Statistics by Country

      • Metrics > Historical Overview > STP Statistics by Vendor

      • Metrics > Historical Overview > STP Statistics by Historical Trends

      • Metrics > Performance > Extraction Accuracy by Country

      • Metrics > Performance > Extraction Accuracy by Vendor

    2. Expand Metrics and delete the following by right-clicking and selecting Delete. Click Yes to confirm your deletion.

      • Metrics > Performance > Volume Metric
      • Metrics > Performance > Extraction Accuracy > Extraction Monitor Percent Metric by Country
      • Metrics > Performance > Extraction Accuracy > Extraction Monitor Metric by Country
      • Metrics > Historical Overview > General Statistics > STP Statistics Metric
      • Metrics > Historical Overview > General Statistics > STP Statistics No Touch Ratio Metric
    3. Expand Records and delete the following by right-clicking and selecting Click Yes to confirm your deletion.

      • Documents - All Processed
      • Documents - STP Statistics Dimensions
    4. Expand Translation Tables and delete the following by right-clicking and selecting Click Yes to confirm your deletion.
      • Countries
      • STP Statistics Dimension Types
    5. Expand Data Sources and delete the following by right-clicking and selecting Click Yes to confirm your deletion.
      • Select AP_Agility database.
      • Delete the COUNTRIES table.
      • Select the Invoice Header table and delete the VENDOR_COUNTRY field.
      • Select the Document Status table and delete the VENDOR_COUNTRY field.
  8. Refresh Kofax Insight Studio.

    This fix has been removed.

SQL Queries for Analytics for AP Agility

On-Premise

For on-premise installations, run the following four SQL queries:

/**** Query 1 - correct status in DOCUMENT_STATUS table where document is sent for ReScan. Please change the DB Schema names as per the target environment [live] - This is KTA main DB [apa_live] - This is Ap Agility DB ****/ -- Move documents in RescanRejectedDocs to state 11 (new) -- Move documents in RescanRejectedDocs to state 11 (new) UPDATE [apa_live].[DOCUMENT_STATUS] SET STATE_ID = 11 WHERE id IN ( SELECT ds.id from [apa_live].[DOCUMENT_STATUS] ds JOIN [live].[DocumentData] d ON d.Id = ds.DOC_ID JOIN [live].[FolderData] f ON d.ParentId = f.InternalId WHERE ds.STATE_ID = 8 AND CONVERT(nvarchar(100), f.id) IN( select InstanceId from ( select Attributes.Attribute.query('.').value('.', 'varchar(max)') as InstanceId, a.OWNER_ID as JobId, 'A' as JobState from (select CAST(var_value as xml) as x, OWNER_ID from [live].[VARIABLE] where VAR_TYPE = 32759) a cross apply x.nodes('/FolderVariableValue/InstanceId') Attributes (Attribute) ) FolderInstance where FolderInstance.InstanceId in ( select CONVERT(nvarchar(100), f.id) as FolderId from [apa_live].[DOCUMENT_STATUS] ds JOIN [live].[DocumentData] d ON d.Id = ds.DOC_ID JOIN [live].[FolderData] f ON d.ParentId = f.InternalId WHERE ds.STATE_ID = 8 ) AND JobId IN (SELECT JOB_ID FROM [live].[JOB_HISTORY] WHERE PROCESS_NAME = 'RescanRejectedDocs') ) )

/**** Query 2 - correct status in INVOICE_HEADER table to match the state at IP side ****/ UPDATE h SET h.CURRENT_STATE_MSG_ID = d.STATE_ID FROM [apa_live].[INVOICE_HEADER] h INNER JOIN [apa_live].[DOCUMENT_STATUS] d ON (h.INVOICE_ID = d.AP_INVOICE_ID) WHERE h.CURRENT_STATE_CODE IN ('IP_VALIDATION', 'WAITING_FOR_REMATCH')

/***** Queries to correct the DOCUMENT_STATUS, INVOICE_HEADER table status when the jobs are Suspended/Terminated/On-hold/Evaluation Failed. Please change the DB Schema names as per the target environment [live] - This is KTA main DB [apa_live] - This is Ap Agility DB *****/ -- Add Canceled state to INVOICE_STATES table as it is not available at IP side. INSERT INTO [apa_live].INVOICE_STATES (ID, STATE_NAME) SELECT 145, 'Canceled' WHERE NOT EXISTS (SELECT ID FROM [apa_live].INVOICE_STATES WHERE ID = 145) -- Create TEMPORARY table to store the document ids whose corresponding jobs are Suspended/Terminated/On-hold/Evaluation Failed. IF OBJECT_ID(N'tempdb..#T6061BB02F8F94B9A9810461D8B83B77E') IS NOT NULL BEGIN DROP TABLE #T6061BB02F8F94B9A9810461D8B83B77E END CREATE TABLE #T6061BB02F8F94B9A9810461D8B83B77E(DOC_ID VARCHAR(50), JOB_STATUS int) /* Insert document id, Job status to the temp table */ INSERT INTO #T6061BB02F8F94B9A9810461D8B83B77E SELECT DD.Id, JS.JOB_STATUS from /* Query to get folder instance id from the folder variable xml */ (select Attributes.Attribute.query('.').value('.', 'varchar(max)') as InstanceId, a.OWNER_ID from ( SELECT CAST(var_value as xml) as x, OWNER_ID, VAR_ID, DISPLAY_NAME, VERSION, VAR_TYPE from ( select var_value, OWNER_ID, VAR_ID, DISPLAY_NAME, VERSION, VAR_TYPE from [live].[VARIABLE] UNION select var_value, OWNER_ID, VAR_ID, DISPLAY_NAME, VERSION, VAR_TYPE from [live].[FINISHED_JOB_VARIABLE]) V where V.VAR_TYPE = 32759) a cross apply x.nodes('/FolderVariableValue/InstanceId') Attributes (Attribute) ) as FV JOIN ( --Suspended, On-hold, Evaluation failed jobs stay in JOB table SELECT JOB_ID, JOB_STATUS FROM [live].JOB WHERE JOB_STATUS IN (3,7,12) UNION --Terminated jobs will be moved to FINISHED_JOB table SELECT JOB_ID, JOB_STATUS FROM [live].FINISHED_JOB WHERE JOB_STATUS = 2) JS ON JS.JOB_ID = FV.OWNER_ID JOIN [live].FolderData FD ON CONVERT(NVARCHAR(50), FD.Id) = FV.InstanceId JOIN [live].DocumentData DD ON FD.InternalId = DD.ParentId JOIN [apa_live].DOCUMENT_STATUS DS ON DS.DOC_ID = CONVERT(NVARCHAR(50),DD.Id) UNION SELECT DV.InstanceId, JS.JOB_STATUS FROM /* Query to get document instance id from the document variable xml */ (select Attributes.Attribute.query('.').value('.', 'varchar(max)') as InstanceId, a.OWNER_ID from ( SELECT CAST(var_value as xml) as x, OWNER_ID, VAR_ID, DISPLAY_NAME, VERSION, VAR_TYPE from ( select var_value, OWNER_ID, VAR_ID, DISPLAY_NAME, VERSION, VAR_TYPE from [live].[VARIABLE] UNION select var_value, OWNER_ID, VAR_ID, DISPLAY_NAME, VERSION, VAR_TYPE from [live].[FINISHED_JOB_VARIABLE]) V WHERE V.VAR_TYPE = 32760) a cross apply x.nodes('/DocumentVariableValue/InstanceId') Attributes (Attribute) ) as DV JOIN ( --Suspended, On-hold, Evaluation failed jobs stay in JOB table SELECT JOB_ID, JOB_STATUS FROM [live].JOB WHERE JOB_STATUS IN (3,7,12) UNION --Terminated jobs will be moved to FINISHED_JOB table SELECT JOB_ID, JOB_STATUS FROM [live].FINISHED_JOB WHERE JOB_STATUS = 2) JS ON JS.JOB_ID = DV.OWNER_ID JOIN [apa_live].DOCUMENT_STATUS DS ON DS.DOC_ID = DV.InstanceId -- Set status as canceled and FINISH_DATE for Terminated jobs. UPDATE [apa_live].DOCUMENT_STATUS SET STATE_ID = 145, FINISH_DATE = CURRENT_TIMESTAMP WHERE DOC_ID IN (SELECT DOC_ID FROM #T6061BB02F8F94B9A9810461D8B83B77E WHERE JOB_STATUS = 2) -- Set status as error for Suspended, On-hold and Evaluation Failed jobs. UPDATE [apa_live].DOCUMENT_STATUS SET STATE_ID = 4 WHERE DOC_ID IN (SELECT DOC_ID FROM #T6061BB02F8F94B9A9810461D8B83B77E WHERE JOB_STATUS IN (3,7,12)) -- Set status as canceled and FINISH_DATE for Terminated jobs. UPDATE [apa_live].INVOICE_HEADER SET INVOICE_STATUS = 'INVOICE_CANCELLED', CURRENT_STATE = 'Canceled', CURRENT_STATE_CODE = 'INVOICE_STATE_CODE', CURRENT_STATE_MSG_ID = 145 WHERE APA_DOCUMENT_ID IN (SELECT DOC_ID FROM #T6061BB02F8F94B9A9810461D8B83B77E WHERE JOB_STATUS = 2) -- Set status as error for Suspended, On-hold and Evaluation Failed jobs. UPDATE [apa_live].INVOICE_HEADER SET INVOICE_STATUS = 'INVOICE_CANCELLED', CURRENT_STATE = 'Canceled', CURRENT_STATE_CODE = 'INVOICE_STATE_CODE', CURRENT_STATE_MSG_ID = 4 WHERE APA_DOCUMENT_ID IN (SELECT DOC_ID FROM #T6061BB02F8F94B9A9810461D8B83B77E WHERE JOB_STATUS IN (3,7,12))

/***** This query repairs the DOCUMENT_STATUS and INVOICE_HEADER table entries where the status is set to NULL. Please change the DB Schema names as per the target environment [live] - This is KTA main DB [apa_live] - This is Ap Agility DB *****/ /* Create a temp table to hold the live job, its current activity and document id */ IF OBJECT_ID(N'tempdb..#T12345') IS NOT NULL BEGIN DROP TABLE #T12345 END CREATE TABLE #T12345 (JOB_ID BINARY(16), ACTIVITY_NAME VARCHAR(100), DOC_ID VARCHAR(50)) /* Capture live job, its current activity and document id. */ INSERT INTO #T12345 SELECT LA.JOB_ID, LA.NODE_NAME, ID [DOC_ID] FROM [live].LIVE_ACTIVITY LA LEFT JOIN ( SELECT DD.Id, OWNER_ID FROM ( (select Attributes.Attribute.query('.').value('.', 'varchar(max)') as InstanceId, B.OWNER_ID from ( SELECT CAST(var_value as xml) as x, OWNER_ID, VAR_ID, DISPLAY_NAME, VERSION, VAR_TYPE from ( select var_value, OWNER_ID, VAR_ID, DISPLAY_NAME, VERSION, VAR_TYPE from [live].[VARIABLE]) A where A.VAR_TYPE = 32759) B cross apply x.nodes('/FolderVariableValue/InstanceId') Attributes(Attribute)) AS FV JOIN [live].FolderData FD ON CONVERT(NVARCHAR(50), FD.Id) = InstanceId JOIN [live].DocumentData DD ON FD.InternalId = DD.ParentId ) UNION SELECT DD.Id, OWNER_ID FROM ( (select Attributes.Attribute.query('.').value('.', 'varchar(max)') as InstanceId, B.OWNER_ID from ( SELECT CAST(var_value as xml) as x, OWNER_ID, VAR_ID, DISPLAY_NAME, VERSION, VAR_TYPE from ( select var_value, OWNER_ID, VAR_ID, DISPLAY_NAME, VERSION, VAR_TYPE from [live].[VARIABLE]) A WHERE A.VAR_TYPE = 32760) B cross apply x.nodes('/DocumentVariableValue/InstanceId') Attributes (Attribute)) AS DV JOIN [live].DOCUMENTDATA DD ON DV.INSTANCEID = CONVERT(NVARCHAR(50),DD.Id) ) ) AS U ON LA.JOB_ID = U.OWNER_ID WHERE LA.NODE_NAME IN ('Validation (IPA)', 'Line Pairing Correction (IPA)', 'Line Pairing Exception', 'Exception', 'Invoice Coding', 'Approval') AND LA.ACTIVITY_STATUS = 0 /* Update the document status with the correct status where the status is set to NULL */ UPDATE [apa_live].DOCUMENT_STATUS SET STATE_ID = CASE T.ACTIVITY_NAME WHEN 'Line Pairing Correction (IPA)' THEN 10 WHEN 'Validation (IPA)' THEN 8 WHEN 'Line Pairing Exception' THEN 5 WHEN 'Exception' THEN 5 WHEN 'Invoice Coding' THEN 3 WHEN 'Approval' THEN 2 END FROM [apa_live].DOCUMENT_STATUS DS JOIN #T12345 T ON DS.DOC_ID = T.DOC_ID WHERE DS.STATE_ID IS NULL AND DS.DELETED = 0 AND DS.FINISH_DATE IS NULL /* Update the invoice header table with correct status where the status is set to NULL */ UPDATE [apa_live].INVOICE_HEADER SET CURRENT_STATE_MSG_ID = CASE T.ACTIVITY_NAME WHEN 'Line Pairing Correction (IPA)' THEN 10 WHEN 'Validation (IPA)' THEN 8 WHEN 'Line Pairing Exception' THEN 310 WHEN 'Exception' THEN 305 WHEN 'Invoice Coding' THEN 303 WHEN 'Approval' THEN 301 END FROM [apa_live].DOCUMENT_STATUS DS JOIN #T12345 T ON DS.DOC_ID = T.DOC_ID JOIN [apa_live].INVOICE_HEADER IH ON DS.AP_INVOICE_ID = IH.INVOICE_ID WHERE DS.STATE_ID IS NULL AND DS.DELETED = 0 AND DS.FINISH_DATE IS NULL

Azure or OPMT

For Azure or OPMT installations ask your Kofax TotalAgility Cloud Administrator or Service provider representative to run the following two queries:

Note: For the status to correctly reflect, perform a complete data deletion and then reload from the beginning. Also, it is best to perform this operation when no invoices are being processed.

/**** Query 1 - correct status in DOCUMENT_STATUS table where document is sent for ReScan ****/

-- Move documents in RescanRejectedDocs to state 11 (new) UPDATE [apa_live].[DOCUMENT_STATUS] SET STATE_ID = 11 WHERE id IN ( SELECT ds.id from [apa_live].[DOCUMENT_STATUS] ds JOIN [live].[DocumentData] d ON d.Id = ds.DOC_ID JOIN [live].[FolderData] f ON d.ParentId = f.InternalId WHERE ds.STATE_ID = 8 AND CONVERT(nvarchar(100), f.id) IN( select InstanceId from ( select Attributes.Attribute.query('.').value('.', 'varchar(max)') as InstanceId, a.OWNER_ID as JobId, 'A' as JobState from (select CAST(var_value as xml) as x, OWNER_ID from [live].[VARIABLE] where VAR_TYPE = 32759) a cross apply x.nodes('/FolderVariableValue/InstanceId') Attributes (Attribute) ) FolderInstance where FolderInstance.InstanceId in ( select CONVERT(nvarchar(100), f.id) as FolderId from [apa_live].[DOCUMENT_STATUS] ds JOIN [live].[DocumentData] d ON d.Id = ds.DOC_ID JOIN [live].[FolderData] f ON d.ParentId = f.InternalId WHERE ds.STATE_ID = 8 ) AND JobId IN (SELECT JOB_ID FROM [live].[JOB_HISTORY] WHERE PROCESS_NAME = 'RescanRejectedDocs') ) )

/**** Query 2 - correct status in INVOICE_HEADER table to match the state at IP side ****/

UPDATE h SET h.CURRENT_STATE_MSG_ID = d.STATE_ID FROM [apa_live].[INVOICE_HEADER] h INNER JOIN [apa_live].[DOCUMENT_STATUS] d ON (h.INVOICE_ID = d.AP_INVOICE_ID) WHERE h.CURRENT_STATE_CODE IN ('IP_VALIDATION', 'WAITING_FOR_REMATCH')