Script BSILIBMTC: Library for bank statement import matching

BSISRCDOC: Entry point to override the value of LSRCDOC

The BSISRCDOC entry point is used to override the value of LSRCDOC.

Context and operating mode

In the context of the entry point:

  • There is no current transaction.

  • A trace file is open.

Call context

The BSISRCDOC entry point is called when collecting open items for matching.

Transaction

There is no transaction in progress.

Log file

There is an open log file.

Available variables and masks

The following tables are available:

  • BSIIMP [BSIIMP]: Bank statement import

  • BSIIMPD [BSIIMPD]: Bank statement import detail

  • GACCDUDATE [DUD]: Open items

Miscellaneous remarks

The current open item is available in [F:DUD].

The [L]LSRCDOC local variable is available to be updated with the new source document number.

If LSRCDOC is updated properly, [L]LFOUND should be updated to 1.

Otherwise [L]LFOUND should be 0.

BSISRCDOC0: Entry point to override the value of LSRCDOC before the core

The BSISRCDOC0 entry point is used to override the value of LSRCDOC before LSRCDOC is populated by the core from the invoice. It gives additional flexibility for specifics to improve performance with large datasets.

Context and operating mode

In the context of the entry point:

  • There is no current transaction.

  • A trace file is open.

Call context

The BSISRCDOC0 entry point is called when collecting open items for matching.

Transaction

There is one transaction in progress.

Log file

There is an open log file.

Available variables and masks

The following tables are available:

  • BSIIMP [BSIIMP]: Bank statement import

  • BSIIMPD [BSIIMPD]: Bank statement import detail

  • GACCDUDATE [DUD]: Open items

Miscellaneous remarks

The current open item is available in [F:DUD].

The [L]LSRCDOC local variable is available to be updated with the new source document number.

If LSRCDOC is updated properly, [L]LFOUND should be updated to 1, otherwise [L]LFOUND should be 0 and a core process updates LSRCDOC.

BSIMTCDUDCRIT: Entry point to modify CRITERE, CRITERE2 and CRITERE3

The BSIMTCDUDCRIT entry point is used to modify filtering criteria for open items in the matching process. The criteria can be amended in the CRITERE (basic criteria), CRITERE2 (BP criteria), and CRITERE3 (invoice criteria) local variables.

Context and operating mode

In the context of the entry point:

  • There is no current transaction.

  • A trace file is open.

Call context

The BSIMTCDUDCRIT entry point is called when preparing filtering criteria for open items for matching.

Transaction

There is one transaction in progress.

Log file

There is an open log file.

Available variables and masks

The following table is available:

  • BSIIP [BSIIMPPAR]: Bank statement import settings

The following variables are available:

  • [L]CRITERE: Basic filtering criteria for open items

  • [L]CRITERE2: BP filtering criteria for open items

  • [L]CRITERE3: Invoice filtering criteria for open items

  • [L]IS_BPRTOT: Indicates that the BP total option is set and exactly one BP found

  • [L]BPY00: Array of BPs for payment

  • [L]INV00: Array of document numbers for payment

  • [L]S: Number of BPs found

  • [L]S1: Number of invoices found

Miscellaneous remarks

The [L]CRITERE, [L]CRITERE2 and [L]CRITERE3 local variables are available to be updated with the desired filtering criteria based on the following:

  1. Data provided in the [F:BSIIP] bank import settings.

  2. Local variables described above.

Later the criterias are used to filter GACCDUDATE [F:DUD] to finish the matching process and update the BSIIMP and BSIIMPD tables for which the transaction is in progress.

BSISRCDOCCRIT: Entry point to modify CRIT_SRCDOC_SPE filtering criteria

The BSISRCDOCCRIT entry point is used to modify filtering criteria for open items in the matching process with the original document. Additional criteria can be applied using the CRIT_SRCDOC_SPE local variable (specific criteria).

Context and operating mode

In the context of the entry point:

  • There is no current transaction.

  • A trace file is open.

Call context

The BSISRCDOCCRIT entry point is called before collecting open items for matching with source documents.

Transaction

There is one transaction in progress.

Log file

There is an open log file.

Available variables and masks

The following tables are available:

  • BSIIMP [BSIIMP]: Bank statement import

  • BSIIMPD [BSIIMPD]: Bank statement import detail

Miscellaneous remarks

The specific filter is applied to GACCDUDATE [F:DUD].

The [L]CRIT_SRCDOC_SPE local variable is available to be updated or overwritten with the new specific filtering criteria.

Initially [L]CRIT_SRCDOC_SPE = "1=1" and if updated properly, it is evaluated on the [F:DUD] filter for open items, if not it is transparent for filtering.

Here is a filter block example from core source code:

Filter [F:DUD] Where evalue([L]CRIT_SRCDOC) and evalue([L]CRIT_SRCDOC_SPE)