Skip to main content
Skip table of contents

Using Script To Remove Unposted Invoices from an AR Batch

Reference No: AHI-7

Version No: 06.01.03-00

Support for a script which will remove Invoices within an unposted AR Invoice batch.

  • System clears the values of UDF fields named 'Fulfillment Date' and 'Exchange Rate Date' of the Invoices removed from the batch except for Credit Memo/Debit Memo/Summary Credit Memo/Summary Debit Memo.

  • The UDFs ‘Fulfillment Date’ and 'Exchange Rate Date' must be defined with the exact alphabets as ‘Fulfillment Date’ and 'Exchange Rate Date’ (hardcoded).

Sample Workflow

  1. From latest release folder, copy the ‘InvoiceAndUdfRemoval' folder and paste in the local folder/drive.

 File Path: SQLS > ARRI > Updates > InvoiceAndUdfRemoval

AHI-07_01.png
  1. Edit the ‘Compile.bat’ file.

  2. Enter the relevant DB Schema Details. (Ex: R2/R2@R2Service). Run the batch file.

AHI-07_02.png
  1. Enter the Site ID in the text file. Multiple Site Ids are allowed to enter.

  2. Open the ‘InvoiceAndUdfRemovalScript’ text file.

AHI-07_03.png

Multiple Site ID’s can be mentioned by comma separator as shown below.  

AHI-07_04.png
  1. Open ‘InvoiceAndUdfRemoval’ batch file and enter the schema name.

AHI-07_05.png
  1. Create a task through Windows Task Scheduler.

Set the time and upload the batch file so that Windows task scheduler runs at the pre-set time.

  1. In Invoicing module, add Unposted Invoice to the Unposted AR Invoice batch.

  2. When the batch file runs at the pre-set time mentioned in the windows task scheduler, it looks for the unposted Invoices present within the un-posted AR Invoice batches. It searches for the site that matches with the Site IDS passed in the script. Then, removes them from the respective batches.

For example:

If the user has passed two Site IDs (Ex: Site ‘A’ and Site ‘B’) in the script and when the windows task scheduler runs, it searches for the unposted batches in both the sites. If Site ‘A’ has unposted batches and Site ‘B’ doesn’t contain unposted batches. Windows task scheduler removes only the batches in Site ‘A’.

  1. It creates a log whether it is pass/fail and reason for the same as shown below.

AHI-07_06.png

Once the Invoices present in the batch removed, system deletes the empty batch.

  1. The history of the batch deletion will not be available in the system.

  2. The log files shows ‘Batch is in Use’/’Invoice is in Use’ when the Invoice/Batch is being used by the user.

  3. The log file shows ‘No Rows selected; when the unposted batches are not available in the respective Site ID mentioned in the script.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.