Prevent Duplicate Invoices in Maximo
If you are an organization that uses IBM Maximo for your supply chain needs, then you may be entering invoices, or vouchers, directly into Maximo. Invoices provide a way to perform a three-way match between approved purchase order, receipts, and invoices.
Wouldn’t it be nice to have a method of preventing duplicate invoices from being entered by your accounts payable staff? With a quick and easy automation script in Maximo, we can prevent users from entering the same invoice twice in Maximo.
The following automation script assumes the following:
- The VENDOR field on the invoice is populated and required
- The VENDORINVOICENUM field on the invoice is populated and required
With those two fields populated, we can run a check to see if there are any other Invoices in Maximo that have the same information. If so, then we have a duplicate invoice situation. The invoice can either be deleted or canceled, or the Vendor or Vendor Invoice # data can be changed.
Automation Script:
# --------
# INVOICE.SAVE
#
# This script fires upon the modification of the Vendor
# Invoice Number or Vendor fields. It also fires implicitly
# upon save of an invoice.
#
# The purpose is to throw an exception if there is
# another invoice in Maximo (not this one) that has the
# same Vendor and Vendor Invoice Number. This helps prevent
# duplicate entry and payment of invoices.
#
# @author support@a3jgroup.com
# --------
from psdi.mbo import SqlFormat
if not mbo.isNull("vendor") and not mbo.isNull("vendorinvoicenum"):
whereClause = "invoicenum<>:1 and siteid=:2 and vendor=:3 and vendorinvoicenum=:4 and status<>'CAN' "
sqlFormat = SqlFormat(mbo.getUserInfo(), whereClause)
sqlFormat.setObject(1, "INVOICE", "invoicenum", mbo.getString("invoicenum"))
sqlFormat.setObject(2, "INVOICE", "siteid", mbo.getString("siteid"))
sqlFormat.setObject(3, "INVOICE", "vendor", mbo.getString("vendor"))
sqlFormat.setObject(4, "INVOICE", "vendorinvoicenum", mbo.getString("vendorinvoicenum"))
invoiceSet = mbo.getMboSet("$vendorinvoicecheck", "INVOICE", sqlFormat.format())
invoiceMbo = invoiceSet.moveFirst()
if invoiceMbo:
params = [ mbo.getString("vendorinvoicenum"), mbo.getString("companies.name"), invoiceMbo.getString("invoicenum") ]
service.error("invoice", "VendorInvoiceAlreadyExists", params)
Launch Points:
By naming the script INVOICE.SAVE we are implicitly stating that the script will run upon save of every invoice. However, it might be nice to also fire the script when either the VENDOR or VENDORINVOICENUM fields are validated. You can create two additional Launch Points for:
- INVOICE-ATTR-VENDINV
- Name: INVOICE-ATTR-VENDINV
- Description: Vendor Invoice Attribute Launch Point
- Object: INVOICE
- Attribute: VENDORINVOICENUM
- Events: Validate
- Active: Yes
- INVOICE-ATTR-VENDOR
- Name: INVOICE-ATTR-VENDOR
- Description: Vendor Attribute Launch Point on Invoice
- Object: INVOICE
- Attribute: VENDOR
- Events: Validate
- Active: Yes
Messages:
We’d like to give a nice error message to the user when a duplicate invoice is entered. Let’s add a message in the Database Configuration application.
Details:
- Message Group: invoice
- Message Key: VendorInvoiceAlreadyExists
- Display Method: MSGBOX
- Message ID Prefix: BMXZZ
- Value: Invoice number {0} has already been entered for {1}. It can be found on Maximo invoice {2}. Please double-check the invoice number and vendor details.
A3J Group, LLC is a boutique consulting firm specializing in enterprise asset management systems. Our experts have over 20 years experience in the space. We focus on all aspects of your maintenance projects from Functional to Technical to Executive and more. We are a tech forward company with suites of in-house solutions developed to help maintenance systems deliver the most value possible. Want to learn more? Visit us at www.a3jgroup.com. We look forward to working with you and coupling our expertise with your goals.
About
A3J Group is a leading solutions and consulting firm based in Tampa, Florida, specializing in Enterprise Asset Management (EAM) with a focus on fully developed Computerized Maintenance Management System (CMMS) solutions like IBM Maximo.
In addition to our suite of proprietary products—including MxMobile, our powerful mobile solution for Maximo—we provide traditional consulting services that help organizations plan, implement, optimize, and support their EAM strategies. Whether clients need hands-on configuration, strategic guidance, or ongoing system support, our team delivers the expertise to drive long-term success.
With over 50 years of combined experience, our specialized team is dedicated to our core mission: to serve as excellent stewards of our clients’ trust and investments, while driving measurable results through tailored, high-impact solutions and intelligent consulting.
Visit us at www.a3jgroup.com. Or drop us a line at info@a3jgroup.com.


